cli

package
v0.12.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClientDependencyInjectionStrategy_name = map[int32]string{
		0: "InjectIntoContext",
		1: "InjectAsArgument",
	}
	ClientDependencyInjectionStrategy_value = map[string]int32{
		"InjectIntoContext": 0,
		"InjectAsArgument":  1,
	}
)

Enum value maps for ClientDependencyInjectionStrategy.

View Source
var (
	EditScope_name = map[int32]string{
		0: "EditFields",
		1: "EditMessage",
	}
	EditScope_value = map[string]int32{
		"EditFields":  0,
		"EditMessage": 1,
	}
)

Enum value maps for EditScope.

View Source
var (
	// optional cli.FlagOptions flag = 25601;
	E_Flag = &file_github_com_rancher_opni_internal_codegen_cli_cli_proto_extTypes[1]
	// optional cli.FlagSetOptions flag_set = 25602;
	E_FlagSet = &file_github_com_rancher_opni_internal_codegen_cli_cli_proto_extTypes[2]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional cli.CommandOptions command = 25600;
	E_Command = &file_github_com_rancher_opni_internal_codegen_cli_cli_proto_extTypes[4]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var (
	// optional cli.CommandGroupOptions command_group = 25600;
	E_CommandGroup = &file_github_com_rancher_opni_internal_codegen_cli_cli_proto_extTypes[3]
)

Extension fields to descriptorpb.ServiceOptions.

View Source
var (
	// optional cli.GeneratorOptions generator = 25600;
	E_Generator = &file_github_com_rancher_opni_internal_codegen_cli_cli_proto_extTypes[0]
)

Extension fields to descriptorpb.FileOptions.

View Source
var File_github_com_rancher_opni_internal_codegen_cli_cli_proto protoreflect.FileDescriptor

Functions

func AddOutputFlag

func AddOutputFlag(cmd *cobra.Command)

func RenderOutput

func RenderOutput(cmd *cobra.Command, response proto.Message)

Types

type ClientDependencyInjectionStrategy

type ClientDependencyInjectionStrategy int32
const (
	ClientDependencyInjectionStrategy_InjectIntoContext ClientDependencyInjectionStrategy = 0
	ClientDependencyInjectionStrategy_InjectAsArgument  ClientDependencyInjectionStrategy = 1
)

func (ClientDependencyInjectionStrategy) Descriptor

func (ClientDependencyInjectionStrategy) Enum

func (ClientDependencyInjectionStrategy) EnumDescriptor deprecated

func (ClientDependencyInjectionStrategy) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClientDependencyInjectionStrategy.Descriptor instead.

func (ClientDependencyInjectionStrategy) Number

func (ClientDependencyInjectionStrategy) String

func (ClientDependencyInjectionStrategy) Type

type CommandGroupOptions

type CommandGroupOptions struct {
	Use         string `protobuf:"bytes,25601,opt,name=use,proto3" json:"use,omitempty"`
	GroupId     string `protobuf:"bytes,25602,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	EnableHooks bool   `protobuf:"varint,25603,opt,name=enable_hooks,json=enableHooks,proto3" json:"enable_hooks,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandGroupOptions) Descriptor deprecated

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

Deprecated: Use CommandGroupOptions.ProtoReflect.Descriptor instead.

func (*CommandGroupOptions) GetEnableHooks added in v0.12.0

func (x *CommandGroupOptions) GetEnableHooks() bool

func (*CommandGroupOptions) GetGroupId

func (x *CommandGroupOptions) GetGroupId() string

func (*CommandGroupOptions) GetUse

func (x *CommandGroupOptions) GetUse() string

func (*CommandGroupOptions) ProtoMessage

func (*CommandGroupOptions) ProtoMessage()

func (*CommandGroupOptions) ProtoReflect

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

func (*CommandGroupOptions) Reset

func (x *CommandGroupOptions) Reset()

func (*CommandGroupOptions) String

func (x *CommandGroupOptions) String() string

type CommandOptions

type CommandOptions struct {
	Use           string    `protobuf:"bytes,25601,opt,name=use,proto3" json:"use,omitempty"`
	Aliases       []string  `protobuf:"bytes,25602,rep,name=aliases,proto3" json:"aliases,omitempty"`
	RequiredFlags []string  `protobuf:"bytes,25603,rep,name=required_flags,json=requiredFlags,proto3" json:"required_flags,omitempty"`
	Skip          bool      `protobuf:"varint,25604,opt,name=skip,proto3" json:"skip,omitempty"`
	EnableHooks   bool      `protobuf:"varint,25605,opt,name=enable_hooks,json=enableHooks,proto3" json:"enable_hooks,omitempty"`
	Granularity   EditScope `protobuf:"varint,25606,opt,name=granularity,proto3,enum=cli.EditScope" json:"granularity,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandOptions) Descriptor deprecated

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

Deprecated: Use CommandOptions.ProtoReflect.Descriptor instead.

func (*CommandOptions) GetAliases added in v0.12.0

func (x *CommandOptions) GetAliases() []string

func (*CommandOptions) GetEnableHooks added in v0.12.0

func (x *CommandOptions) GetEnableHooks() bool

func (*CommandOptions) GetGranularity added in v0.12.0

func (x *CommandOptions) GetGranularity() EditScope

func (*CommandOptions) GetRequiredFlags

func (x *CommandOptions) GetRequiredFlags() []string

func (*CommandOptions) GetSkip added in v0.12.0

func (x *CommandOptions) GetSkip() bool

func (*CommandOptions) GetUse

func (x *CommandOptions) GetUse() string

func (*CommandOptions) ProtoMessage

func (*CommandOptions) ProtoMessage()

func (*CommandOptions) ProtoReflect

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

func (*CommandOptions) Reset

func (x *CommandOptions) Reset()

func (*CommandOptions) String

func (x *CommandOptions) String() string

type EditScope added in v0.12.0

type EditScope int32
const (
	// Allows all individual fields of the message to be edited individually.
	// This option generates flags and uses them in the CLI.
	EditScope_EditFields EditScope = 0
	// The whole message is edited as a single unit. This option does not use
	// flags, but instead enables editing the message with an editor, or from
	// a file.
	EditScope_EditMessage EditScope = 1
)

func (EditScope) Descriptor added in v0.12.0

func (EditScope) Descriptor() protoreflect.EnumDescriptor

func (EditScope) Enum added in v0.12.0

func (x EditScope) Enum() *EditScope

func (EditScope) EnumDescriptor deprecated added in v0.12.0

func (EditScope) EnumDescriptor() ([]byte, []int)

Deprecated: Use EditScope.Descriptor instead.

func (EditScope) Number added in v0.12.0

func (x EditScope) Number() protoreflect.EnumNumber

func (EditScope) String added in v0.12.0

func (x EditScope) String() string

func (EditScope) Type added in v0.12.0

type FlagOptions

type FlagOptions struct {
	Default      *string `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"`
	Env          string  `protobuf:"bytes,2,opt,name=env,proto3" json:"env,omitempty"`
	Secret       bool    `protobuf:"varint,3,opt,name=secret,proto3" json:"secret,omitempty"`
	TypeOverride string  `protobuf:"bytes,4,opt,name=type_override,json=typeOverride,proto3" json:"type_override,omitempty"`
	Skip         bool    `protobuf:"varint,5,opt,name=skip,proto3" json:"skip,omitempty"`
	// contains filtered or unexported fields
}

func (*FlagOptions) Descriptor deprecated

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

Deprecated: Use FlagOptions.ProtoReflect.Descriptor instead.

func (*FlagOptions) GetDefault

func (x *FlagOptions) GetDefault() string

func (*FlagOptions) GetEnv

func (x *FlagOptions) GetEnv() string

func (*FlagOptions) GetSecret

func (x *FlagOptions) GetSecret() bool

func (*FlagOptions) GetSkip

func (x *FlagOptions) GetSkip() bool

func (*FlagOptions) GetTypeOverride

func (x *FlagOptions) GetTypeOverride() string

func (*FlagOptions) ProtoMessage

func (*FlagOptions) ProtoMessage()

func (*FlagOptions) ProtoReflect

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

func (*FlagOptions) Reset

func (x *FlagOptions) Reset()

func (*FlagOptions) String

func (x *FlagOptions) String() string

type FlagSetOptions

type FlagSetOptions struct {
	Default  *anypb.Any `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"`
	NoPrefix bool       `protobuf:"varint,2,opt,name=no_prefix,json=noPrefix,proto3" json:"no_prefix,omitempty"`
	// contains filtered or unexported fields
}

func (*FlagSetOptions) Descriptor deprecated

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

Deprecated: Use FlagSetOptions.ProtoReflect.Descriptor instead.

func (*FlagSetOptions) GetDefault

func (x *FlagSetOptions) GetDefault() *anypb.Any

func (*FlagSetOptions) GetNoPrefix added in v0.12.0

func (x *FlagSetOptions) GetNoPrefix() bool

func (*FlagSetOptions) ProtoMessage

func (*FlagSetOptions) ProtoMessage()

func (*FlagSetOptions) ProtoReflect

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

func (*FlagSetOptions) Reset

func (x *FlagSetOptions) Reset()

func (*FlagSetOptions) String

func (x *FlagSetOptions) String() string

type Generator

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

func NewGenerator

func NewGenerator() *Generator

func (*Generator) Generate

func (cg *Generator) Generate(gen *protogen.Plugin) error

func (Generator) Name

func (cg Generator) Name() string

type GeneratorOptions

type GeneratorOptions struct {
	Generate                    bool                              `protobuf:"varint,1,opt,name=generate,proto3" json:"generate,omitempty"`
	GenerateDeepcopy            bool                              `protobuf:"varint,2,opt,name=generate_deepcopy,json=generateDeepcopy,proto3" json:"generate_deepcopy,omitempty"`
	GenerateFlagsForAllMessages bool                              `` /* 149-byte string literal not displayed */
	ClientDependencyInjection   ClientDependencyInjectionStrategy `` /* 182-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GeneratorOptions) Descriptor deprecated

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

Deprecated: Use GeneratorOptions.ProtoReflect.Descriptor instead.

func (*GeneratorOptions) GetClientDependencyInjection

func (x *GeneratorOptions) GetClientDependencyInjection() ClientDependencyInjectionStrategy

func (*GeneratorOptions) GetGenerate

func (x *GeneratorOptions) GetGenerate() bool

func (*GeneratorOptions) GetGenerateDeepcopy

func (x *GeneratorOptions) GetGenerateDeepcopy() bool

func (*GeneratorOptions) GetGenerateFlagsForAllMessages added in v0.12.0

func (x *GeneratorOptions) GetGenerateFlagsForAllMessages() bool

func (*GeneratorOptions) ProtoMessage

func (*GeneratorOptions) ProtoMessage()

func (*GeneratorOptions) ProtoReflect

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

func (*GeneratorOptions) Reset

func (x *GeneratorOptions) Reset()

func (*GeneratorOptions) String

func (x *GeneratorOptions) String() string

type TextRenderer

type TextRenderer interface {
	// RenderText renders the message to the given writer in a human-readable
	// format.
	RenderText(out Writer)
}

An optional interface that can be implemented by an RPC response type to control how it is rendered to the user.

type Writer

type Writer interface {
	Print(i ...any)
	Println(i ...any)
	Printf(format string, i ...any)
	PrintErr(i ...any)
	PrintErrln(i ...any)
	PrintErrf(format string, i ...any)
}

Jump to

Keyboard shortcuts

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