context

package
v2.10.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKey contextKey

ContextKey is a key used to store and retrieve Context from a Go context.Context.

Functions

func SetInContext

func SetInContext(goCtx gocontext.Context, cliCtx Context) gocontext.Context

SetInContext stores the provided autocli.Context in the given Go context.Context. It returns a new context.Context containing the autocli.Context value.

Types

type Context

type Context struct {
	Flags *pflag.FlagSet

	AddressCodec          address.Codec
	ValidatorAddressCodec address.ValidatorAddressCodec
	ConsensusAddressCodec address.ConsensusAddressCodec

	Cdc codec.Codec

	Keyring keyring.Keyring

	EnabledSignModes []apisigning.SignMode
}

Context represents the client context used in autocli commands. It contains various components needed for command execution.

func ClientContextFromGoContext

func ClientContextFromGoContext(ctx gocontext.Context) (*Context, error)

ClientContextFromGoContext returns the autocli.Context from a given Go context. It checks if the context contains a valid autocli.Context and returns it.

Jump to

Keyboard shortcuts

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