comms

package
v0.0.0-...-cb57a1e Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOF_AND_EXITED_SUCCESSFULLY = errors.New("EOF and Exited successfully")
)
View Source
var (
	Version = "0.0.5"
)

Functions

func IsEOFAndExitedSuccessfullyErr

func IsEOFAndExitedSuccessfullyErr(err error) bool

func NewExecutorSessions

func NewExecutorSessions() *executorSessions

Types

type Client

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

func NewConnectedClient

func NewConnectedClient(serverAddress string) (*Client, error)

func (*Client) Execute

func (c *Client) Execute(args *ExecutorExecuteArgs, reply *ExecutorExecuteReply) error

func (*Client) GetFeedback

func (c *Client) GetFeedback(args *GetFeedbackArgs, reply *GetFeedbackReply) error

func (*Client) RunWithFeedback

func (c *Client) RunWithFeedback(args *ExecutorExecuteArgs, pollForFeedbackInterval time.Duration, onFeedback func(lines []string)) error

func (*Client) Start

func (c *Client) Start(args *ExecutorExecuteArgs, reply *ExecutorStartReply) error

type Comms

type Comms interface {
	Execute(executeArgs *ExecutorExecuteArgs, reply *ExecutorExecuteReply) error
	Start(executeArgs *ExecutorExecuteArgs, reply *ExecutorStartReply) error
	GetFeedback(args *GetFeedbackArgs, reply *GetFeedbackReply) error
}

Comms is the shared interface between Client and Executor/server

type Executor

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

Executor is the RPC server/executor

func (*Executor) Execute

func (e *Executor) Execute(executeArgs *ExecutorExecuteArgs, reply *ExecutorExecuteReply) error

func (*Executor) GetFeedback

func (e *Executor) GetFeedback(args *GetFeedbackArgs, reply *GetFeedbackReply) error

func (*Executor) Start

func (e *Executor) Start(executeArgs *ExecutorExecuteArgs, reply *ExecutorStartReply) error

type ExecutorExecuteArgs

type ExecutorExecuteArgs struct {
	Exe  string
	Args []string
}

type ExecutorExecuteReply

type ExecutorExecuteReply struct {
	Out   []byte
	Error error
}

type ExecutorStartReply

type ExecutorStartReply struct {
	Pid       int
	SessionID string
	Error     error
}

type GetFeedbackArgs

type GetFeedbackArgs struct {
	SessionID   string
	OffsetLines int
}

type GetFeedbackReply

type GetFeedbackReply struct {
	Lines           []string
	NextOffsetLines int
	Error           error
}

Jump to

Keyboard shortcuts

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