cliutil

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0, MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagVeryVerbose = &cli.BoolFlag{
	Name:        "vv",
	Usage:       "enables very verbose mode, useful for debugging the CLI",
	Destination: &IsVeryVerbose,
}

FlagVeryVerbose enables very verbose mode, which is useful when debugging the CLI itself. It should be included as a flag on the top-level command (e.g. boost -vv).

View Source
var IsVeryVerbose bool

IsVeryVerbose is a global var signalling if the CLI is running in very verbose mode or not (default: false).

Functions

func BoostUseHttp

func BoostUseHttp(opts *GetBoostOptions)

func EnvsForAPIInfos

func EnvsForAPIInfos(t lotus_repo.RepoType) (primary string, fallbacks []string, deprecated []string)

EnvsForAPIInfos returns the environment variables to use in order of precedence to determine the API endpoint of the specified node type.

It returns the current variables and deprecated ones separately, so that the user can log a warning when deprecated ones are found to be in use.

func GetBoostAPI

func GetBoostAPI(ctx *cli.Context, opts ...GetBoostOption) (api.Boost, jsonrpc.ClientCloser, error)

func GetRawAPI

func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http.Header, error)

Types

type APIInfo

type APIInfo struct {
	Addr  string
	Token []byte
}

func GetAPIInfo

func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error)

GetAPIInfo returns the API endpoint to use for the specified kind of repo.

The order of precedence is as follows:

  1. *-api-url command line flags.
  2. *_API_INFO environment variables
  3. deprecated *_API_INFO environment variables
  4. *-repo command line flags.

func ParseApiInfo

func ParseApiInfo(s string) APIInfo

func (APIInfo) AuthHeader

func (a APIInfo) AuthHeader() http.Header

func (APIInfo) DialArgs

func (a APIInfo) DialArgs(version string) (string, error)

func (APIInfo) Host

func (a APIInfo) Host() (string, error)

type GetBoostOption

type GetBoostOption func(*GetBoostOptions)

type GetBoostOptions

type GetBoostOptions struct {
	PreferHttp bool
}

Jump to

Keyboard shortcuts

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