cliutil

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0, MIT Imports: 21 Imported by: 60

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonContext added in v1.5.1

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

func EnvForRepo added in v1.5.1

func EnvForRepo(t repo.RepoType) string

func GetAPI added in v1.5.1

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

func GetFullNodeAPI added in v1.5.1

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

func GetFullNodeAPIV1 added in v1.9.0

func GetFullNodeAPIV1(ctx *cli.Context) (v1api.FullNode, jsonrpc.ClientCloser, error)

func GetGatewayAPI added in v1.5.1

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

func GetGatewayAPIV0 added in v1.9.0

func GetGatewayAPIV0(ctx *cli.Context) (v0api.Gateway, jsonrpc.ClientCloser, error)

func GetRawAPI added in v1.5.1

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

func GetStorageMinerAPI added in v1.5.1

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

func GetWorkerAPI added in v1.5.1

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

func ReqContext added in v1.5.1

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 added in v1.5.1

func StorageMinerUseHttp(opts *GetStorageMinerOptions)

Types

type APIInfo

type APIInfo struct {
	Addr  string
	Token []byte
}

func GetAPIInfo added in v1.5.1

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(version string) (string, error)

func (APIInfo) Host

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

type GetStorageMinerOption added in v1.5.1

type GetStorageMinerOption func(*GetStorageMinerOptions)

type GetStorageMinerOptions added in v1.5.1

type GetStorageMinerOptions struct {
	PreferHttp bool
}

Jump to

Keyboard shortcuts

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