helper

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT, Apache-2.0, MIT Imports: 23 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 GetAPI

func GetAPI(ctx *cli.Context) (common.ICommon, jsonrpc.ClientCloser, error)

func GetAPIInfo

func GetAPIInfo(ctx *cli.Context) (httpparse.APIInfo, error)

func GetFullAPI

func GetFullAPI(ctx *cli.Context) (api.IFullAPI, jsonrpc.ClientCloser, error)

func GetFullAPIWithPWD

func GetFullAPIWithPWD(ctx *cli.Context) (api.IFullAPI, jsonrpc.ClientCloser, error)

func GetRawAPI

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

func NewTabWriter added in v1.11.0

func NewTabWriter(w io.Writer) *tabwriter.Writer

func PrintJSON added in v1.11.0

func PrintJSON(v interface{}) 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 ShowHelp

func ShowHelp(cctx *cli.Context, err error) error

Types

type ErrCmdFailed

type ErrCmdFailed struct {
	// contains filtered or unexported fields
}

func (*ErrCmdFailed) Error

func (e *ErrCmdFailed) Error() string

type PrintHelpErr

type PrintHelpErr struct {
	Err error
	Ctx *cli.Context
}

func (*PrintHelpErr) Error

func (e *PrintHelpErr) Error() string

func (*PrintHelpErr) Is

func (e *PrintHelpErr) Is(o error) bool

func (*PrintHelpErr) Unwrap

func (e *PrintHelpErr) Unwrap() error

Jump to

Keyboard shortcuts

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