options

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagConfig = "config"
)

Defines flag for onexctl.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Config string

	WrapConfigFn      func() error
	UserOptions       *UserOptions   `json:"user" mapstructure:"user"`
	UserCenterOptions *ServerOptions `json:"usercenter" mapstructure:"usercenter"`
	GatewayOptions    *ServerOptions `json:"gateway" mapstructure:"gateway"`
}

Options composes the set of values necessary for obtaining onex service config.

func NewOptions

func NewOptions() *Options

NewOptions returns ConfigFlags with default values set.

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags binds client configuration flags to a given flagset.

func (*Options) Complete

func (o *Options) Complete()

func (*Options) Validate

func (o *Options) Validate() error

Validate validates ServerRunOptions.

type ServerOptions

type ServerOptions struct {
	Insecure      bool          `json:"insecure-skip-tls-verify" mapstructure:"insecure-skip-tls-verify"`
	CAFile        string        `json:"certificate-authority" mapstructure:"certificate-authority"`
	Addr          string        `json:"addr" mapstructure:"addr"`
	Timeout       time.Duration `json:"timeout" mapstructure:"timeout"`
	MaxRetries    int           `json:"max-retries" mapstructure:"max-retries"`
	RetryInterval time.Duration `json:"retry-interval" mapstructure:"retry-interval"`
}

ServerOptions defines options for server client.

func NewServerOptions

func NewServerOptions() *ServerOptions

NewServerOptions create a `zero` value instance.

func (*ServerOptions) AddFlags

func (o *ServerOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string)

AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet.

func (*ServerOptions) Validate

func (o *ServerOptions) Validate() []error

Validate verifies flags passed to ServerOptions.

type UserOptions

type UserOptions struct {
	BearerToken string `json:"token" mapstructure:"token"`
	Username    string `json:"username" mapstructure:"username"`
	Password    string `json:"password" mapstructure:"password"`
	SecretID    string `json:"secret-id" mapstructure:"secret-id"`
	SecretKey   string `json:"secret-key" mapstructure:"secret-key"`
	CertFile    string `json:"client-certificate" mapstructure:"client-certificate"`
	KeyFile     string `json:"client-key" mapstructure:"client-key"`
}

UserOptions defines options for user client.

func NewUserOptions

func NewUserOptions() *UserOptions

NewUserOptions create a `zero` value instance.

func (*UserOptions) AddFlags

func (o *UserOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet.

func (*UserOptions) Validate

func (o *UserOptions) Validate() []error

Validate verifies flags passed to UserOptions.

Jump to

Keyboard shortcuts

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