configPkg

package
v0.0.0-...-3f8eaf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

README

chifra config

The chifra config program allows you to manage the various TrueBlocks caches. You may list all of the caches, some of the cache, or even individual caches either in terse or full detail. The cache of interest is specified with the modes option.

TrueBlocks maintains caches for the index of address appearances, named addresses, abi files, as well as other data including blockchain data, and address monitors.

Purpose:
  Report on and edit the configuration of the TrueBlocks system.

Usage:
  chifra config <mode> [flags]

Arguments:
  mode - either show or edit the configuration
	One of [ show | edit ]

Flags:
  -a, --paths        show the configuration paths for the system
  -x, --fmt string   export format, one of [none|json*|txt|csv]
  -v, --verbose      enable verbose output
  -h, --help         display this help screen

Data models produced by this tool:

Other Options

All tools accept the following additional flags, although in some cases, they have no meaning.

  -v, --version         display the current version of the tool
      --output string   write the results to file 'fn' and return the filename
      --append          for --output command only append to instead of replace contents of file
      --file string     specify multiple sets of command line options in a file

Note: For the --file string option, you may place a series of valid command lines in a file using any valid flags. In some cases, this may significantly improve performance. A semi-colon at the start of any line makes it a comment.

Note: If you use --output --append option and at the same time the --file option, you may not switch export formats in the command file. For example, a command file with two different commands, one with --fmt csv and the other with --fmt json will produce both invalid CSV and invalid JSON.

Documentation

Overview

Package configPkg handles the chifra config command. It The program allows you to manage the various TrueBlocks caches. You may list all of the caches, some of the cache, or even individual caches either in terse or full detail. The cache of interest is specified with the modes option. TrueBlocks maintains caches for the index of address appearances, named addresses, abi files, as well as other data including blockchain data, and address monitors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetOptions

func ResetOptions(testMode bool)

func RunConfig

func RunConfig(cmd *cobra.Command, args []string) error

RunConfig handles the config command for the command line. Returns error only as per cobra.

func ServeConfig

func ServeConfig(w http.ResponseWriter, r *http.Request) error

ServeConfig handles the config command for the API. Returns an error.

Types

type ConfigOptions

type ConfigOptions struct {
	Mode    string                `json:"mode,omitempty"`    // Either show or edit the configuration
	Paths   bool                  `json:"paths,omitempty"`   // Show the configuration paths for the system
	Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options
	Conn    *rpc.Connection       `json:"conn,omitempty"`    // The connection to the RPC server
	BadFlag error                 `json:"badFlag,omitempty"` // An error flag if needed

}

ConfigOptions provides all command options for the chifra config command.

func GetConfigOptions

func GetConfigOptions(args []string, g *globals.GlobalOptions) *ConfigOptions

GetConfigOptions returns the options for this tool so other tools may use it.

func GetOptions

func GetOptions() *ConfigOptions

func (*ConfigOptions) ConfigInternal

func (opts *ConfigOptions) ConfigInternal() error

ConfigInternal handles the internal workings of the config command. Returns an error.

func (*ConfigOptions) HandleEdit

func (opts *ConfigOptions) HandleEdit() error

func (*ConfigOptions) HandlePaths

func (opts *ConfigOptions) HandlePaths() error

HandlePaths handles the paths command for the command line. Returns error only as per cobra.

func (*ConfigOptions) HandleShow

func (opts *ConfigOptions) HandleShow() error

func (*ConfigOptions) String

func (opts *ConfigOptions) String() string

String implements the Stringer interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL