github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/chunks/handle_show.go (about)

     1  // Copyright 2021 The TrueBlocks Authors. All rights reserved.
     2  // Use of this source code is governed by a license that can
     3  // be found in the LICENSE file.
     4  
     5  package chunksPkg
     6  
     7  import (
     8  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
     9  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/logger"
    10  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output"
    11  )
    12  
    13  func (opts *ChunksOptions) HandleShow(rCtx *output.RenderCtx, blockNums []base.Blknum) error {
    14  	var err error
    15  	switch opts.Mode {
    16  	case "manifest":
    17  		err = opts.HandleManifest(rCtx, blockNums)
    18  
    19  	case "index":
    20  		err = opts.HandleIndex(rCtx, blockNums)
    21  
    22  	case "blooms":
    23  		err = opts.HandleBlooms(rCtx, blockNums)
    24  
    25  	case "addresses":
    26  		err = opts.HandleAddresses(rCtx, blockNums)
    27  
    28  	case "appearances":
    29  		err = opts.HandleAppearances(rCtx, blockNums)
    30  
    31  	case "stats":
    32  		err = opts.HandleStats(rCtx, blockNums)
    33  
    34  	default:
    35  		logger.Fatal("should not happen ==> in NamesInternal")
    36  	}
    37  	return err
    38  }