cliutil

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0, MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 lotus_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