Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer)
- type CommandProviderClient
- type CommandProviderServer
- type CommandSpec
- func (*CommandSpec) Descriptor() ([]byte, []int)deprecated
- func (x *CommandSpec) GetFlags() []*FlagSpec
- func (x *CommandSpec) GetLong() string
- func (x *CommandSpec) GetShort() string
- func (x *CommandSpec) GetSubcommands() []*CommandSpec
- func (x *CommandSpec) GetUse() string
- func (*CommandSpec) ProtoMessage()
- func (x *CommandSpec) ProtoReflect() protoreflect.Message
- func (x *CommandSpec) Reset()
- func (x *CommandSpec) String() string
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteRequest) GetArgs() []string
- func (x *ExecuteRequest) GetCommandPath() []string
- func (x *ExecuteRequest) GetFlags() map[string]string
- func (*ExecuteRequest) ProtoMessage()
- func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
- func (x *ExecuteRequest) Reset()
- func (x *ExecuteRequest) String() string
- type ExecuteResponse
- func (*ExecuteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteResponse) GetError() string
- func (x *ExecuteResponse) GetExitCode() int32
- func (*ExecuteResponse) ProtoMessage()
- func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteResponse) Reset()
- func (x *ExecuteResponse) String() string
- type FlagSpec
- func (*FlagSpec) Descriptor() ([]byte, []int)deprecated
- func (x *FlagSpec) GetDefault() string
- func (x *FlagSpec) GetName() string
- func (x *FlagSpec) GetShorthand() string
- func (x *FlagSpec) GetType() FlagType
- func (x *FlagSpec) GetUsage() string
- func (*FlagSpec) ProtoMessage()
- func (x *FlagSpec) ProtoReflect() protoreflect.Message
- func (x *FlagSpec) Reset()
- func (x *FlagSpec) String() string
- type FlagType
- type GetCommandsRequest
- type GetCommandsResponse
- func (*GetCommandsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommandsResponse) GetCommands() []*CommandSpec
- func (*GetCommandsResponse) ProtoMessage()
- func (x *GetCommandsResponse) ProtoReflect() protoreflect.Message
- func (x *GetCommandsResponse) Reset()
- func (x *GetCommandsResponse) String() string
- type UnimplementedCommandProviderServer
- type UnsafeCommandProviderServer
Constants ¶
const ( CommandProvider_GetCommands_FullMethodName = "/orca.plugin.v1.CommandProvider/GetCommands" CommandProvider_Execute_FullMethodName = "/orca.plugin.v1.CommandProvider/Execute" )
Variables ¶
var ( FlagType_name = map[int32]string{ 0: "FLAG_TYPE_STRING", 1: "FLAG_TYPE_BOOL", } FlagType_value = map[string]int32{ "FLAG_TYPE_STRING": 0, "FLAG_TYPE_BOOL": 1, } )
Enum value maps for FlagType.
var CommandProvider_ServiceDesc = grpc.ServiceDesc{ ServiceName: "orca.plugin.v1.CommandProvider", HandlerType: (*CommandProviderServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCommands", Handler: _CommandProvider_GetCommands_Handler, }, { MethodName: "Execute", Handler: _CommandProvider_Execute_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "orca/plugin/v1/plugin.proto", }
CommandProvider_ServiceDesc is the grpc.ServiceDesc for CommandProvider service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_orca_plugin_v1_plugin_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCommandProviderServer ¶
func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer)
Types ¶
type CommandProviderClient ¶
type CommandProviderClient interface {
// GetCommands returns the command tree the plugin wants registered.
GetCommands(ctx context.Context, in *GetCommandsRequest, opts ...grpc.CallOption) (*GetCommandsResponse, error)
// Execute runs a leaf command previously returned by GetCommands.
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
}
CommandProviderClient is the client API for CommandProvider service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
CommandProvider is implemented by plugins that contribute CLI commands to orca.
func NewCommandProviderClient ¶
func NewCommandProviderClient(cc grpc.ClientConnInterface) CommandProviderClient
type CommandProviderServer ¶
type CommandProviderServer interface {
// GetCommands returns the command tree the plugin wants registered.
GetCommands(context.Context, *GetCommandsRequest) (*GetCommandsResponse, error)
// Execute runs a leaf command previously returned by GetCommands.
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
// contains filtered or unexported methods
}
CommandProviderServer is the server API for CommandProvider service. All implementations must embed UnimplementedCommandProviderServer for forward compatibility.
CommandProvider is implemented by plugins that contribute CLI commands to orca.
type CommandSpec ¶
type CommandSpec struct {
Use string `protobuf:"bytes,1,opt,name=use,proto3" json:"use,omitempty"`
Short string `protobuf:"bytes,2,opt,name=short,proto3" json:"short,omitempty"`
Long string `protobuf:"bytes,3,opt,name=long,proto3" json:"long,omitempty"`
Flags []*FlagSpec `protobuf:"bytes,4,rep,name=flags,proto3" json:"flags,omitempty"`
Subcommands []*CommandSpec `protobuf:"bytes,5,rep,name=subcommands,proto3" json:"subcommands,omitempty"`
// contains filtered or unexported fields
}
func (*CommandSpec) Descriptor
deprecated
func (*CommandSpec) Descriptor() ([]byte, []int)
Deprecated: Use CommandSpec.ProtoReflect.Descriptor instead.
func (*CommandSpec) GetFlags ¶
func (x *CommandSpec) GetFlags() []*FlagSpec
func (*CommandSpec) GetLong ¶
func (x *CommandSpec) GetLong() string
func (*CommandSpec) GetShort ¶
func (x *CommandSpec) GetShort() string
func (*CommandSpec) GetSubcommands ¶
func (x *CommandSpec) GetSubcommands() []*CommandSpec
func (*CommandSpec) GetUse ¶
func (x *CommandSpec) GetUse() string
func (*CommandSpec) ProtoMessage ¶
func (*CommandSpec) ProtoMessage()
func (*CommandSpec) ProtoReflect ¶
func (x *CommandSpec) ProtoReflect() protoreflect.Message
func (*CommandSpec) Reset ¶
func (x *CommandSpec) Reset()
func (*CommandSpec) String ¶
func (x *CommandSpec) String() string
type ExecuteRequest ¶
type ExecuteRequest struct {
// Names of the commands from the plugin's top-level command down to the leaf
// being executed, e.g. ["k8s", "ctx"].
CommandPath []string `protobuf:"bytes,1,rep,name=command_path,json=commandPath,proto3" json:"command_path,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
// Flag values keyed by flag name, encoded as strings.
Flags map[string]string `` /* 137-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*ExecuteRequest) Descriptor
deprecated
func (*ExecuteRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.
func (*ExecuteRequest) GetArgs ¶
func (x *ExecuteRequest) GetArgs() []string
func (*ExecuteRequest) GetCommandPath ¶
func (x *ExecuteRequest) GetCommandPath() []string
func (*ExecuteRequest) GetFlags ¶
func (x *ExecuteRequest) GetFlags() map[string]string
func (*ExecuteRequest) ProtoMessage ¶
func (*ExecuteRequest) ProtoMessage()
func (*ExecuteRequest) ProtoReflect ¶
func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
func (*ExecuteRequest) Reset ¶
func (x *ExecuteRequest) Reset()
func (*ExecuteRequest) String ¶
func (x *ExecuteRequest) String() string
type ExecuteResponse ¶
type ExecuteResponse struct {
ExitCode int32 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*ExecuteResponse) Descriptor
deprecated
func (*ExecuteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.
func (*ExecuteResponse) GetError ¶
func (x *ExecuteResponse) GetError() string
func (*ExecuteResponse) GetExitCode ¶
func (x *ExecuteResponse) GetExitCode() int32
func (*ExecuteResponse) ProtoMessage ¶
func (*ExecuteResponse) ProtoMessage()
func (*ExecuteResponse) ProtoReflect ¶
func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
func (*ExecuteResponse) Reset ¶
func (x *ExecuteResponse) Reset()
func (*ExecuteResponse) String ¶
func (x *ExecuteResponse) String() string
type FlagSpec ¶
type FlagSpec struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Shorthand string `protobuf:"bytes,2,opt,name=shorthand,proto3" json:"shorthand,omitempty"`
Usage string `protobuf:"bytes,3,opt,name=usage,proto3" json:"usage,omitempty"`
Type FlagType `protobuf:"varint,4,opt,name=type,proto3,enum=orca.plugin.v1.FlagType" json:"type,omitempty"`
// Default value, encoded as a string regardless of type.
Default string `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
// contains filtered or unexported fields
}
func (*FlagSpec) Descriptor
deprecated
func (*FlagSpec) GetDefault ¶
func (*FlagSpec) GetShorthand ¶
func (*FlagSpec) ProtoMessage ¶
func (*FlagSpec) ProtoMessage()
func (*FlagSpec) ProtoReflect ¶
func (x *FlagSpec) ProtoReflect() protoreflect.Message
type FlagType ¶
type FlagType int32
func (FlagType) Descriptor ¶
func (FlagType) Descriptor() protoreflect.EnumDescriptor
func (FlagType) EnumDescriptor
deprecated
func (FlagType) Number ¶
func (x FlagType) Number() protoreflect.EnumNumber
func (FlagType) Type ¶
func (FlagType) Type() protoreflect.EnumType
type GetCommandsRequest ¶
type GetCommandsRequest struct {
// contains filtered or unexported fields
}
func (*GetCommandsRequest) Descriptor
deprecated
func (*GetCommandsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCommandsRequest.ProtoReflect.Descriptor instead.
func (*GetCommandsRequest) ProtoMessage ¶
func (*GetCommandsRequest) ProtoMessage()
func (*GetCommandsRequest) ProtoReflect ¶
func (x *GetCommandsRequest) ProtoReflect() protoreflect.Message
func (*GetCommandsRequest) Reset ¶
func (x *GetCommandsRequest) Reset()
func (*GetCommandsRequest) String ¶
func (x *GetCommandsRequest) String() string
type GetCommandsResponse ¶
type GetCommandsResponse struct {
Commands []*CommandSpec `protobuf:"bytes,1,rep,name=commands,proto3" json:"commands,omitempty"`
// contains filtered or unexported fields
}
func (*GetCommandsResponse) Descriptor
deprecated
func (*GetCommandsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCommandsResponse.ProtoReflect.Descriptor instead.
func (*GetCommandsResponse) GetCommands ¶
func (x *GetCommandsResponse) GetCommands() []*CommandSpec
func (*GetCommandsResponse) ProtoMessage ¶
func (*GetCommandsResponse) ProtoMessage()
func (*GetCommandsResponse) ProtoReflect ¶
func (x *GetCommandsResponse) ProtoReflect() protoreflect.Message
func (*GetCommandsResponse) Reset ¶
func (x *GetCommandsResponse) Reset()
func (*GetCommandsResponse) String ¶
func (x *GetCommandsResponse) String() string
type UnimplementedCommandProviderServer ¶
type UnimplementedCommandProviderServer struct{}
UnimplementedCommandProviderServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedCommandProviderServer) Execute ¶
func (UnimplementedCommandProviderServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
func (UnimplementedCommandProviderServer) GetCommands ¶
func (UnimplementedCommandProviderServer) GetCommands(context.Context, *GetCommandsRequest) (*GetCommandsResponse, error)
type UnsafeCommandProviderServer ¶
type UnsafeCommandProviderServer interface {
// contains filtered or unexported methods
}
UnsafeCommandProviderServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CommandProviderServer will result in compilation errors.