Documentation ¶
Index ¶
- Variables
- func CaptureCommand(stdin io.Reader, pipePath string, cmd string, args ...string) (stdout string, stderr string, exitCode int, err error)
- func ExtendOffline(srv *server.HTTPServer, d time.Duration) error
- func GoOfflineFor(srv *server.HTTPServer, d time.Duration) error
- func GoOnline(srv *server.HTTPServer) error
- func InitCommand(pipePath string, handler ClientCommandHandlerFunc, cmd string, args ...string) (exitCode int, err error)
- func SendCommand(pipePath string, cmd string, args ...string) (exitCode int, err error)
- type ClientCommandHandlerFunc
- type ClientConn
- type CommandServer
- type Message
- type ServerCommandHandler
- type ServerConn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCommandRead = errors.New("failed reading command: no data received") ErrCommandInit = errors.New("invalid command") )
Functions ¶
func CaptureCommand ¶ added in v2.8.3
func ExtendOffline ¶
func GoOfflineFor ¶
func InitCommand ¶ added in v2.6.11
Types ¶
type ClientCommandHandlerFunc ¶ added in v2.7.0
type ClientCommandHandlerFunc func(cc *ClientConn) error
type ClientConn ¶ added in v2.7.0
func (*ClientConn) ListenMessage ¶ added in v2.7.0
func (cc *ClientConn) ListenMessage() (msg Message, err error)
func (*ClientConn) WriteMessage ¶ added in v2.7.0
func (cc *ClientConn) WriteMessage(message string) error
type CommandServer ¶ added in v2.7.0
type CommandServer struct {
// contains filtered or unexported fields
}
func NewCommandServer ¶ added in v2.7.0
func NewCommandServer(pipePath string, router *server.Router) (*CommandServer, error)
func (*CommandServer) Logger ¶ added in v2.7.0
func (cs *CommandServer) Logger() logger.Logger
func (*CommandServer) RegisterCommand ¶ added in v2.7.0
func (cs *CommandServer) RegisterCommand(cmd string, f ServerCommandHandler)
func (*CommandServer) Start ¶ added in v2.7.0
func (cs *CommandServer) Start()
func (*CommandServer) Stop ¶ added in v2.7.0
func (cs *CommandServer) Stop() error
type Message ¶ added in v2.7.0
type Message struct { Msg string // contains filtered or unexported fields }
type ServerCommandHandler ¶ added in v2.7.0
type ServerCommandHandler func(sc *ServerConn, args ...string) (exitCode int, err error)
type ServerConn ¶ added in v2.7.0
type ServerConn struct { Router *server.Router Logger logger.Logger // contains filtered or unexported fields }
func (*ServerConn) ReadMessage ¶ added in v2.7.0
func (sc *ServerConn) ReadMessage() (string, error)
func (*ServerConn) WriteError ¶ added in v2.7.0
func (sc *ServerConn) WriteError(msg string) error
func (*ServerConn) WriteOutput ¶ added in v2.7.0
func (sc *ServerConn) WriteOutput(msg string) error
Click to show internal directories.
Click to hide internal directories.