app

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteYamlFile

func WriteYamlFile(filename string, v interface{}) error

Types

type Ctx

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

func New

func New(setters ...OptSetter) *Ctx

func (*Ctx) AddCommand

func (c *Ctx) AddCommand(name string, fn func(...string), commands ...func(*cobra.Command))

func (*Ctx) Conf

func (c *Ctx) Conf(configs ...interface{})

Conf init all configs from yml file, and do initialization for each config. config dir include `config.yml.template` `config.yml` and `master.yml` config.yml.template shows config file template and preset config values config.yml contains all user configured values

func (*Ctx) Context

func (c *Ctx) Context() context.Context

func (*Ctx) Execute

func (c *Ctx) Execute(fn func(...string), commands ...func(*cobra.Command))

func (*Ctx) MarshalDefault

func (c *Ctx) MarshalDefault() error

func (*Ctx) Root

func (c *Ctx) Root() string

func (*Ctx) String

func (c *Ctx) String() string

type Marshaller

type Marshaller func(v interface{}) ([]byte, error)

type OptSetter

type OptSetter = func(conf *Ctx)

func WithDeployer

func WithDeployer(deployers ...deploy.Deployer) OptSetter

func WithFeat

func WithFeat(feat string) OptSetter

func WithLogger

func WithLogger(l logr.Logger) OptSetter

func WithName

func WithName(name string) OptSetter

func WithRoot

func WithRoot(root string) OptSetter

func WithVersion

func WithVersion(version string) OptSetter

Jump to

Keyboard shortcuts

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