kingpinv2

package
v0.0.0-...-665bf02 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// optional string placeholder = 6000;
	E_Placeholder = &file_protoconfig_go_kingpinv2_v1_extensions_proto_extTypes[0]
	// optional string envvar = 6001;
	E_Envvar = &file_protoconfig_go_kingpinv2_v1_extensions_proto_extTypes[1]
	// By default field represents a flag.
	//
	// optional bool argument = 6002;
	E_Argument = &file_protoconfig_go_kingpinv2_v1_extensions_proto_extTypes[2]
)

Extension fields to descriptor.FieldOptions.

View Source
var (
	// By default message represents just complex configuration type. If command_name is specified
	// such message becomes a kingpin.v2 command.
	// Name has to be unique within single protoconfig.Configuration type.
	//
	// optional protoconfig.go.kingpinv2.v1.Command command = 6002;
	E_Command = &file_protoconfig_go_kingpinv2_v1_extensions_proto_extTypes[3]
)

Extension fields to descriptor.MessageOptions.

View Source
var File_protoconfig_go_kingpinv2_v1_extensions_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AllClause

type AllClause interface {
	Required() AllClause
	HiddenPath() AllClause
	HiddenContent() AllClause
	DefaultPath(values string) PathOrContentClause
	DefaultContent(values string) PathOrContentClause
	PathOrContentClause
}

func Flag

func Flag(cmd FlagClause, flagName string, help string) AllClause

type Clause

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

Clause is a fluid interface used to build extended flags. This is useful for flags that are a bit of uncommon logic extension like fileOrContent.

func (*Clause) DefaultContent

func (f *Clause) DefaultContent(value string) PathOrContentClause

func (*Clause) DefaultPath

func (f *Clause) DefaultPath(value string) PathOrContentClause

func (*Clause) HiddenContent

func (f *Clause) HiddenContent() AllClause

HiddenContent hides a flag from usage but still allows it to be used.

func (*Clause) HiddenPath

func (f *Clause) HiddenPath() AllClause

HiddenPath hides a -file flag from usage but still allows it to be used.

func (*Clause) PathOrContent

func (f *Clause) PathOrContent() *PathOrContent

func (*Clause) Required

func (f *Clause) Required() AllClause

Required makes the flag required. You can not provide a Default() value to a Required() flag.

type Command

type Command struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Command) Descriptor deprecated

func (*Command) Descriptor() ([]byte, []int)

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetName

func (x *Command) GetName() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type Content

type Content struct {
	Content *any.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // any proto.Message
	// contains filtered or unexported fields
}

Content is byte steam created from PathOrContent flag, a custom extension built on top of kingpin.v2 flags type.

func (*Content) Descriptor deprecated

func (*Content) Descriptor() ([]byte, []int)

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetContent

func (x *Content) GetContent() *any.Any

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect

func (x *Content) ProtoReflect() protoreflect.Message

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

type ExistingFile

type ExistingFile struct {
	File *any.Any `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` // *os.File
	// contains filtered or unexported fields
}

ExistingFile represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.ExistingFile. repeated ExistingFile represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.ExistingFiles.

func (*ExistingFile) Descriptor deprecated

func (*ExistingFile) Descriptor() ([]byte, []int)

Deprecated: Use ExistingFile.ProtoReflect.Descriptor instead.

func (*ExistingFile) GetFile

func (x *ExistingFile) GetFile() *any.Any

func (*ExistingFile) ProtoMessage

func (*ExistingFile) ProtoMessage()

func (*ExistingFile) ProtoReflect

func (x *ExistingFile) ProtoReflect() protoreflect.Message

func (*ExistingFile) Reset

func (x *ExistingFile) Reset()

func (*ExistingFile) String

func (x *ExistingFile) String() string

type FlagClause

type FlagClause interface {
	Flag(name, help string) *kingpin.FlagClause
}

type IP

type IP struct {
	Ip *any.Any `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // *net.IP
	// contains filtered or unexported fields
}

IP represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.IP. repeated IP represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.IPList.

func (*IP) Descriptor deprecated

func (*IP) Descriptor() ([]byte, []int)

Deprecated: Use IP.ProtoReflect.Descriptor instead.

func (*IP) GetIp

func (x *IP) GetIp() *any.Any

func (*IP) ProtoMessage

func (*IP) ProtoMessage()

func (*IP) ProtoReflect

func (x *IP) ProtoReflect() protoreflect.Message

func (*IP) Reset

func (x *IP) Reset()

func (*IP) String

func (x *IP) String() string

type PathOrContent

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

PathOrContent is a flag type that defines two flags to fetch bytes. Either from file (*-file flag) or content (* flag).

func (*PathOrContent) Content

func (p *PathOrContent) Content() ([]byte, error)

Content returns content of the file. Flag that specifies path has priority. It returns error if the content is empty and required flag is set to true.

type PathOrContentClause

type PathOrContentClause interface {
	PathOrContent() *PathOrContent
}

type Regexp

type Regexp struct {
	Regexp *any.Any `protobuf:"bytes,1,opt,name=regexp,proto3" json:"regexp,omitempty"` // **regexp.Regexp
	// contains filtered or unexported fields
}

Regexp represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.Regexp. repeated Regexp represents https://pkg.go.dev/github.com/alecthomas/kingpin/v2#ArgClause.RegexpList.

func (*Regexp) Descriptor deprecated

func (*Regexp) Descriptor() ([]byte, []int)

Deprecated: Use Regexp.ProtoReflect.Descriptor instead.

func (*Regexp) GetRegexp

func (x *Regexp) GetRegexp() *any.Any

func (*Regexp) ProtoMessage

func (*Regexp) ProtoMessage()

func (*Regexp) ProtoReflect

func (x *Regexp) ProtoReflect() protoreflect.Message

func (*Regexp) Reset

func (x *Regexp) Reset()

func (*Regexp) String

func (x *Regexp) String() string

Jump to

Keyboard shortcuts

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