exec

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package exec defines the RPC interface for the sansshell Exec actions.

Index

Constants

View Source
const (
	Exec_Run_FullMethodName          = "/Exec.Exec/Run"
	Exec_StreamingRun_FullMethodName = "/Exec.Exec/StreamingRun"
)

Variables

View Source
var Exec_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Exec.Exec",
	HandlerType: (*ExecServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Run",
			Handler:    _Exec_Run_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamingRun",
			Handler:       _Exec_StreamingRun_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "exec.proto",
}

Exec_ServiceDesc is the grpc.ServiceDesc for Exec service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterExecServer

func RegisterExecServer(s grpc.ServiceRegistrar, srv ExecServer)

Types

type ExecClient

type ExecClient interface {
	// Run takes input, executes it and returns result of input execution
	Run(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error)
	// StreamingRun takes input, executes it and streams back execution information
	//
	// The return code can only be nonzero in the final response. Intermediate
	// responses may contain stdout and/or stderr.
	StreamingRun(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (Exec_StreamingRunClient, error)
}

ExecClient is the client API for Exec 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.

func NewExecClient

func NewExecClient(cc grpc.ClientConnInterface) ExecClient

type ExecClientProxy

type ExecClientProxy interface {
	ExecClient
	RunOneMany(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (<-chan *RunManyResponse, error)
	StreamingRunOneMany(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (Exec_StreamingRunClientProxy, error)
}

ExecClientProxy is the superset of ExecClient which additionally includes the OneMany proxy methods

func NewExecClientProxy

func NewExecClientProxy(cc *proxy.Conn) ExecClientProxy

NewExecClientProxy creates a ExecClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.

type ExecRequest

type ExecRequest struct {
	Command string   `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	Args    []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

ExecRequest describes what to execute

func (*ExecRequest) Descriptor deprecated

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

Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead.

func (*ExecRequest) GetArgs

func (x *ExecRequest) GetArgs() []string

func (*ExecRequest) GetCommand

func (x *ExecRequest) GetCommand() string

func (*ExecRequest) ProtoMessage

func (*ExecRequest) ProtoMessage()

func (*ExecRequest) ProtoReflect

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

func (*ExecRequest) Reset

func (x *ExecRequest) Reset()

func (*ExecRequest) String

func (x *ExecRequest) String() string

type ExecResponse

type ExecResponse struct {
	Stdout  []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
	Stderr  []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
	RetCode int32  `protobuf:"varint,3,opt,name=retCode,proto3" json:"retCode,omitempty"`
	// contains filtered or unexported fields
}

ExecResponse describes output of execution

func (*ExecResponse) Descriptor deprecated

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

Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead.

func (*ExecResponse) GetRetCode

func (x *ExecResponse) GetRetCode() int32

func (*ExecResponse) GetStderr

func (x *ExecResponse) GetStderr() []byte

func (*ExecResponse) GetStdout

func (x *ExecResponse) GetStdout() []byte

func (*ExecResponse) ProtoMessage

func (*ExecResponse) ProtoMessage()

func (*ExecResponse) ProtoReflect

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

func (*ExecResponse) Reset

func (x *ExecResponse) Reset()

func (*ExecResponse) String

func (x *ExecResponse) String() string

type ExecServer

type ExecServer interface {
	// Run takes input, executes it and returns result of input execution
	Run(context.Context, *ExecRequest) (*ExecResponse, error)
	// StreamingRun takes input, executes it and streams back execution information
	//
	// The return code can only be nonzero in the final response. Intermediate
	// responses may contain stdout and/or stderr.
	StreamingRun(*ExecRequest, Exec_StreamingRunServer) error
}

ExecServer is the server API for Exec service. All implementations should embed UnimplementedExecServer for forward compatibility

type Exec_StreamingRunClient added in v1.22.0

type Exec_StreamingRunClient interface {
	Recv() (*ExecResponse, error)
	grpc.ClientStream
}

type Exec_StreamingRunClientProxy added in v1.22.0

type Exec_StreamingRunClientProxy interface {
	Recv() ([]*StreamingRunManyResponse, error)
	grpc.ClientStream
}

type Exec_StreamingRunServer added in v1.22.0

type Exec_StreamingRunServer interface {
	Send(*ExecResponse) error
	grpc.ServerStream
}

type RunManyResponse

type RunManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *ExecResponse
	Error error
}

RunManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type StreamingRunManyResponse added in v1.22.0

type StreamingRunManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *ExecResponse
	Error error
}

StreamingRunManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type UnimplementedExecServer

type UnimplementedExecServer struct {
}

UnimplementedExecServer should be embedded to have forward compatible implementations.

func (UnimplementedExecServer) Run

func (UnimplementedExecServer) StreamingRun added in v1.22.0

type UnsafeExecServer

type UnsafeExecServer interface {
	// contains filtered or unexported methods
}

UnsafeExecServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExecServer will result in compilation errors.

Directories

Path Synopsis
Package client provides the client interface for 'exec'
Package client provides the client interface for 'exec'
Package server implements the sansshell 'Exec' service.
Package server implements the sansshell 'Exec' service.

Jump to

Keyboard shortcuts

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