cli

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 62 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JS_PULLCONSUMER_NAME string = "natscli-benchpull"
)

Variables

View Source
var SkipContexts bool

SkipContexts used during tests

View Source
var (
	Version = "development"
)

Functions

func SetContext

func SetContext(c context.Context)

SetContext sets the context to use

func SetLogger

func SetLogger(l Logger)

SetLogger sets a custom logger to use

func SetVersion

func SetVersion(v string)

Types

type Logger

type Logger interface {
	Printf(format string, a ...interface{})
	Fatalf(format string, a ...interface{})
	Print(a ...interface{})
	Fatal(a ...interface{})
	Println(a ...interface{})
}

Logger provides a plugable logger implementation

type OptionalBoolValue

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

OptionalBoolValue is contains a *bool and implements kingpin.Value

func OptionalBoolean

func OptionalBoolean(s kingpin.Settings) *OptionalBoolValue

func (*OptionalBoolValue) IsBoolFlag

func (v *OptionalBoolValue) IsBoolFlag() bool

func (*OptionalBoolValue) IsSetByUser

func (v *OptionalBoolValue) IsSetByUser() bool

func (*OptionalBoolValue) Set

func (v *OptionalBoolValue) Set(s string) error

func (*OptionalBoolValue) SetBool

func (v *OptionalBoolValue) SetBool(val bool)

func (*OptionalBoolValue) String

func (v *OptionalBoolValue) String() string

func (*OptionalBoolValue) Value

func (v *OptionalBoolValue) Value() bool

type Options

type Options struct {
	// Config is a nats configuration context
	Config *natscontext.Context
	// Servers is the list of servers to connect to
	Servers string
	// Creds is nats credentials to authenticate with
	Creds string
	// TlsCert is the TLS Public Certificate
	TlsCert string
	// TlsKey is the TLS Private Key
	TlsKey string
	// TlsCA is the certificate authority to verify the connection with
	TlsCA string
	// Timeout is how long to wait for operations
	Timeout time.Duration
	// Username is the username or token to connect with
	Username string
	// Password is the password to connect with
	Password string
	// Nkey is the file holding a nkey to connect with
	Nkey string
	// JsApiPrefix is the JetStream API prefix
	JsApiPrefix string
	// JsEventPrefix is the JetStream events prefix
	JsEventPrefix string
	// JsDomain is the domain to connect to
	JsDomain string
	// CfgCtx is the context name to use
	CfgCtx string
	// Trace enables verbose debug logging
	Trace bool

	// Conn sets a prepared connect to connect with
	Conn *nats.Conn
	// Mgr sets a prepared jsm Manager to use for JetStream access
	Mgr *jsm.Manager
	// JSc is a prepared NATS JetStream context to use for KV and Object access
	JSc nats.JetStreamContext
}

Options configure the CLI

func ConfigureInApp

func ConfigureInApp(app *kingpin.Application, cliOpts *Options, prepare bool, disable ...string) (*Options, error)

ConfigureInApp attaches the cli commands to app, prepare will load the context on demand and should be true unless override nats, manager and js context is given in a custom PreAction in the caller. Disable is a list of command names to skip.

func ConfigureInCommand

func ConfigureInCommand(cmd *kingpin.CmdClause, cliOpts *Options, prepare bool, disable ...string) (*Options, error)

ConfigureInCommand attaches the cli commands to cmd, prepare will load the context on demand and should be true unless override nats, manager and js context is given in a custom PreAction in the caller. Disable is a list of command names to skip.

type SchemaValidator

type SchemaValidator struct{}

func (SchemaValidator) ValidateStruct

func (v SchemaValidator) ValidateStruct(data interface{}, schemaType string) (ok bool, errs []string)

type SrvCheckCmd

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

type SrvInfoCmd

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

type SrvLsCmd

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

type SrvPasswdCmd

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

type SrvPingCmd

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

type SrvRaftCmd

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

type SrvReportCmd

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

type SrvRequestCmd

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

type SrvRunCmd

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

type SrvRunConfig

type SrvRunConfig struct {
	Name                 string
	Port                 string
	UserPassword         string
	UserPasswordCrypt    string
	ServicePassword      string
	ServicePasswordCrypt string
	SystemPassword       string
	SystemPasswordCrypt  string
	ExtendDemoNetwork    bool
	ExtendWithContext    bool
	JetStream            bool
	Verbose              bool
	Debug                bool
	StoreDir             string
	Context              *natscontext.Context
}

Jump to

Keyboard shortcuts

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