cfgrpcapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LISTEN_PORT = 50081

Variables

This section is empty.

Functions

func PrintReply

func PrintReply(reply *ExecuteReply)

func RegisterRpcApiServer

func RegisterRpcApiServer(s *grpc.Server, srv RpcApiServer)

Types

type Command

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

func (*Command) Client

func (c *Command) Client() (RpcApiClient, *grpc.ClientConn, error)

func (*Command) Init

func (c *Command) Init()

func (*Command) SetFlags

func (c *Command) SetFlags(cmd *cobra.Command) *cobra.Command

type ExecuteReply

type ExecuteReply struct {
	Results              []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func NewExecuteReply

func NewExecuteReply(results ...*Result) *ExecuteReply

func (*ExecuteReply) Descriptor

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

func (*ExecuteReply) GetResults

func (m *ExecuteReply) GetResults() []*Result

func (*ExecuteReply) ProtoMessage

func (*ExecuteReply) ProtoMessage()

func (*ExecuteReply) Reset

func (m *ExecuteReply) Reset()

func (*ExecuteReply) String

func (m *ExecuteReply) String() string

func (*ExecuteReply) XXX_DiscardUnknown added in v0.3.0

func (m *ExecuteReply) XXX_DiscardUnknown()

func (*ExecuteReply) XXX_Marshal added in v0.3.0

func (m *ExecuteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecuteReply) XXX_Merge added in v0.3.0

func (m *ExecuteReply) XXX_Merge(src proto.Message)

func (*ExecuteReply) XXX_Size added in v0.3.0

func (m *ExecuteReply) XXX_Size() int

func (*ExecuteReply) XXX_Unmarshal added in v0.3.0

func (m *ExecuteReply) XXX_Unmarshal(b []byte) error

type ExecuteRequest

type ExecuteRequest struct {
	Shells               []*Shell `protobuf:"bytes,1,rep,name=shells,proto3" json:"shells,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewExecuteRequest

func NewExecuteRequest(shells ...*Shell) *ExecuteRequest

func (*ExecuteRequest) Descriptor

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

func (*ExecuteRequest) GetShells

func (m *ExecuteRequest) GetShells() []*Shell

func (*ExecuteRequest) ProtoMessage

func (*ExecuteRequest) ProtoMessage()

func (*ExecuteRequest) Reset

func (m *ExecuteRequest) Reset()

func (*ExecuteRequest) String

func (m *ExecuteRequest) String() string

func (*ExecuteRequest) XXX_DiscardUnknown added in v0.3.0

func (m *ExecuteRequest) XXX_DiscardUnknown()

func (*ExecuteRequest) XXX_Marshal added in v0.3.0

func (m *ExecuteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecuteRequest) XXX_Merge added in v0.3.0

func (m *ExecuteRequest) XXX_Merge(src proto.Message)

func (*ExecuteRequest) XXX_Size added in v0.3.0

func (m *ExecuteRequest) XXX_Size() int

func (*ExecuteRequest) XXX_Unmarshal added in v0.3.0

func (m *ExecuteRequest) XXX_Unmarshal(b []byte) error

type Result

type Result struct {
	Output               []byte   `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewResult

func NewResult(output []byte) *Result

func (*Result) Descriptor

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

func (*Result) GetOutput

func (m *Result) GetOutput() []byte

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) Strings

func (r *Result) Strings() []string

Result

func (*Result) XXX_DiscardUnknown added in v0.3.0

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal added in v0.3.0

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge added in v0.3.0

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size added in v0.3.0

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal added in v0.3.0

func (m *Result) XXX_Unmarshal(b []byte) error

type RpcApiClient

type RpcApiClient interface {
	Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteReply, error)
}

RpcApiClient is the client API for RpcApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewInsecureClient

func NewInsecureClient(host string, port uint, opts ...grpc.DialOption) (RpcApiClient, *grpc.ClientConn, error)

ApiClient

func NewRpcApiClient

func NewRpcApiClient(cc *grpc.ClientConn) RpcApiClient

type RpcApiServer

type RpcApiServer interface {
	Execute(context.Context, *ExecuteRequest) (*ExecuteReply, error)
}

RpcApiServer is the server API for RpcApi service.

type Shell

type Shell struct {
	Cmd                  string   `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"`
	Args                 []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	In                   []byte   `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewShell

func NewShell(cmd string, args ...string) *Shell

func NewShellIn

func NewShellIn(cmd string, in []byte, args ...string) *Shell

func (*Shell) Descriptor

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

func (*Shell) GetArgs

func (m *Shell) GetArgs() []string

func (*Shell) GetCmd

func (m *Shell) GetCmd() string

func (*Shell) GetIn

func (m *Shell) GetIn() []byte

func (*Shell) ProtoMessage

func (*Shell) ProtoMessage()

func (*Shell) Reset

func (m *Shell) Reset()

func (*Shell) String

func (m *Shell) String() string

func (*Shell) ToNative

func (s *Shell) ToNative() *nclib.Shell

func (*Shell) XXX_DiscardUnknown added in v0.3.0

func (m *Shell) XXX_DiscardUnknown()

func (*Shell) XXX_Marshal added in v0.3.0

func (m *Shell) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Shell) XXX_Merge added in v0.3.0

func (m *Shell) XXX_Merge(src proto.Message)

func (*Shell) XXX_Size added in v0.3.0

func (m *Shell) XXX_Size() int

func (*Shell) XXX_Unmarshal added in v0.3.0

func (m *Shell) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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