cliutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonContext

func DaemonContext(cctx *cli.Context) context.Context

func EnvForRepo

func EnvForRepo(t repo.RepoType) string

func GetAPI

func GetAPI(ctx *cli.Context) (api.Common, jsonrpc.ClientCloser, error)

func GetFullNodeAPI

func GetFullNodeAPI(ctx *cli.Context) (api.FullNode, jsonrpc.ClientCloser, error)

func GetGatewayAPI

func GetGatewayAPI(ctx *cli.Context) (api.GatewayAPI, jsonrpc.ClientCloser, error)

func GetRawAPI

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

func GetStorageMinerAPI

func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.StorageMiner, jsonrpc.ClientCloser, error)

func GetWorkerAPI

func GetWorkerAPI(ctx *cli.Context) (api.WorkerAPI, jsonrpc.ClientCloser, error)

func ReqContext

func ReqContext(cctx *cli.Context) context.Context

ReqContext returns context for cli execution. Calling it for the first time installs SIGTERM handler that will close returned context. Not safe for concurrent execution.

func StorageMinerUseHttp

func StorageMinerUseHttp(opts *GetStorageMinerOptions)

Types

type APIInfo

type APIInfo struct {
	Addr  string
	Token []byte
}

func GetAPIInfo

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

func ParseApiInfo

func ParseApiInfo(s string) APIInfo

func (APIInfo) AuthHeader

func (a APIInfo) AuthHeader() http.Header

func (APIInfo) DialArgs

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

func (APIInfo) Host

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

type GetStorageMinerOption

type GetStorageMinerOption func(*GetStorageMinerOptions)

type GetStorageMinerOptions

type GetStorageMinerOptions struct {
	PreferHttp bool
}

Jump to

Keyboard shortcuts

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