base

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RFC3339NanoFixed  = "2006-01-02T15:04:05.000000000Z07:00"
	RFC3339MilliFixed = "2006-01-02T15:04:05.000Z07:00"
)

Variables

View Source
var Module = fx.Module(
	"rig-cli",
	clientModule,
	fx.Provide(func() (*cmdconfig.Config, error) {
		return cmdconfig.NewConfig("")
	}),
	fx.Provide(zap.NewDevelopment),
	fx.Provide(getContext),
	fx.Provide(func(c *cmdconfig.Context) *cmdconfig.Auth {
		return c.GetAuth()
	}),
	fx.Provide(func(c *cmdconfig.Context) *cmdconfig.Service {
		return c.GetService()
	}),
	fx.Provide(func() context.Context { return context.Background() }),
	fx.Provide(func() (*client.Client, error) {
		return client.NewClientWithOpts(
			client.WithHostFromEnv(),
			client.WithAPIVersionNegotiation(),
		)
	}),
	fx.Provide(func() *PromptInformation { return &PromptInformation{} }),
)

Functions

func InvokePreRunE added in v1.5.0

func InvokePreRunE(cmd *cobra.Command, args []string, invokes ...any) error

func MakeInvokePreRunE added in v1.5.0

func MakeInvokePreRunE(fs ...any) func(cmd *cobra.Command, args []string) error

func PersistentPreRunE added in v1.5.0

func PersistentPreRunE(cmd *cobra.Command, args []string) error

func Provide added in v1.6.0

func Provide(cmd *cobra.Command, args []string, invokes ...any) error

func SkipChecks added in v1.6.1

func SkipChecks(cmd *cobra.Command) bool

Types

type F added in v1.5.0

type F = func(cmd *cobra.Command, args []string) error

func CtxWrap added in v1.5.0

func CtxWrap(f FCtx) F

type FComplete added in v1.5.0

type FComplete = func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

func CtxWrapCompletion added in v1.5.0

func CtxWrapCompletion(f FCompleteCtx) FComplete

type FCompleteCtx added in v1.5.0

type FCompleteCtx = func(context.Context, *cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

type FCtx added in v1.5.0

type FCtx = func(ctx context.Context, cmd *cobra.Command, args []string) error

type Interactive added in v1.6.1

type Interactive bool

type PromptInformation added in v1.6.0

type PromptInformation struct {
	ContextCreation bool
}

Jump to

Keyboard shortcuts

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