fromctx

package
v0.6.5-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyKubeConfig         = Key(providerflags.FlagKubeConfig)
	CtxKeyKubeRESTClient     = Key("kube-restclient")
	CtxKeyKubeClientSet      = Key("kube-clientset")
	CtxKeyAkashClientSet     = Key("akash-clientset")
	CtxKeyPubSub             = Key("pubsub")
	CtxKeyLifecycle          = Key("lifecycle")
	CtxKeyErrGroup           = Key("errgroup")
	CtxKeyLogc               = Key("logc")
	CtxKeyStartupCh          = Key("startup-ch")
	CtxKeyInventoryUnderTest = Key("inventory-under-test")
)

Variables

View Source
var (
	ErrNotFound         = errors.New("fromctx: not found")
	ErrValueInvalidType = errors.New("fromctx: invalid type")
)

Functions

func AkashClientFromCtx

func AkashClientFromCtx(ctx context.Context) (akashclientset.Interface, error)

func ApplyToContext

func ApplyToContext(ctx context.Context, config map[interface{}]interface{}) context.Context

func CmdSetContextValue

func CmdSetContextValue(cmd *cobra.Command, key, val interface{})

func ErrGroupFromCtx

func ErrGroupFromCtx(ctx context.Context) (*errgroup.Group, error)

func IsInventoryUnderTestFromCtx

func IsInventoryUnderTestFromCtx(ctx context.Context) bool

func KubeClientFromCtx

func KubeClientFromCtx(ctx context.Context) (kubernetes.Interface, error)

func KubeConfigFromCtx

func KubeConfigFromCtx(ctx context.Context) (*rest.Config, error)

func KubeRESTClientFromCtx

func KubeRESTClientFromCtx(ctx context.Context) (*rest.RESTClient, error)

func LifecycleFromCtx

func LifecycleFromCtx(ctx context.Context) (lifecycle.Lifecycle, error)

func LogcFromCtx

func LogcFromCtx(ctx context.Context, opts ...LogcOption) cmblog.Logger

func LogrFromCtx

func LogrFromCtx(ctx context.Context) logr.Logger

func MustAkashClientFromCtx

func MustAkashClientFromCtx(ctx context.Context) akashclientset.Interface

func MustErrGroupFromCtx

func MustErrGroupFromCtx(ctx context.Context) *errgroup.Group

func MustKubeClientFromCtx

func MustKubeClientFromCtx(ctx context.Context) kubernetes.Interface

func MustKubeConfigFromCtx

func MustKubeConfigFromCtx(ctx context.Context) *rest.Config

func MustKubeRESTClientFromCtx

func MustKubeRESTClientFromCtx(ctx context.Context) *rest.RESTClient

func MustLifecycleFromCtx

func MustLifecycleFromCtx(ctx context.Context) lifecycle.Lifecycle

func MustPubSubFromCtx

func MustPubSubFromCtx(ctx context.Context) pubsub.PubSub

func MustStartupChFromCtx

func MustStartupChFromCtx(ctx context.Context) chan<- struct{}

func PubSubFromCtx

func PubSubFromCtx(ctx context.Context) (pubsub.PubSub, error)

func StartupChFromCtx

func StartupChFromCtx(ctx context.Context) (chan<- struct{}, error)

func WithLogc

func WithLogc(ctx context.Context, lg cmblog.Logger, opts ...LogcOption) context.Context

WithLogc add logger object to the context key defaults to the "log" use WithLogName("<custom name>") to set custom key

Types

type Key

type Key string

type LogcOption

type LogcOption func(*options) error

Jump to

Keyboard shortcuts

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