cli

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 63 Imported by: 1

Documentation

Index

Constants

View Source
const OptionsEnd = "--"

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02

Variables

This section is empty.

Functions

func DefaultUsageFunc

func DefaultUsageFunc(sf *pflag.FlagSet, c *cobra.Command) string

TODO: Do we want to keep this or use cobra default one? Maybe banner + cobra default? Or something else? This is mostly copied from ffcli package

func GradientBanner added in v0.0.40

func GradientBanner(banner string) string

func InitLogging added in v0.0.40

func InitLogging()

func NewViper added in v0.0.40

func NewViper(prefix string) *viper.Viper

func PopulateFlagSet added in v0.0.21

func PopulateFlagSet(obj interface{}, flagSet *pflag.FlagSet, vpr *viper.Viper, opts ...FlagOption) *pflag.FlagSet

func StartAgent added in v0.0.38

func StartAgent(_ *config.Agent) error

func Unmarshal added in v0.0.39

func Unmarshal(vpr *viper.Viper, cfg interface{}) error

Types

type AppMetadataMigrator added in v0.34.0

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

func NewAppMetadataMigrator added in v0.34.0

func NewAppMetadataMigrator(logger *logrus.Logger, appNamesGetter AppNamesGetter, appMetadataSaver AppMetadataSaver) *AppMetadataMigrator

func (*AppMetadataMigrator) Migrate added in v0.34.0

func (m *AppMetadataMigrator) Migrate() (err error)

Migrate creates Applications given a list of app names

type AppMetadataSaver added in v0.34.0

type AppMetadataSaver interface {
	CreateOrUpdate(_ context.Context, _ appmetadata.ApplicationMetadata) error
	List(context.Context) ([]appmetadata.ApplicationMetadata, error)
}

type AppNamesGetter added in v0.34.0

type AppNamesGetter interface {
	GetAppNames(ctx context.Context) []string
}

type CmdRunFn added in v0.2.0

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

func CreateCmdRunFn added in v0.0.40

func CreateCmdRunFn(cfg interface{}, vpr *viper.Viper, fn CmdRunFn) CmdRunFn

type FlagOption added in v0.0.34

type FlagOption func(*options)

func WithReplacement added in v0.0.34

func WithReplacement(k, v string) FlagOption

func WithSkip added in v0.0.34

func WithSkip(n ...string) FlagOption

func WithSkipDeprecated added in v0.0.34

func WithSkipDeprecated(ok bool) FlagOption

WithSkipDeprecated specifies that fields marked as deprecated won't be parsed. By default PopulateFlagSet parses them but not shows in Usage; setting this option to true causes PopulateFlagSet to skip parsing.

type Server added in v0.3.0

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

func NewServer added in v0.3.0

func NewServer(c *config.Server) (*Server, error)

func (*Server) Start added in v0.3.0

func (s *Server) Start() error

func (*Server) Stop added in v0.3.0

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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