Documentation ¶
Index ¶
- Constants
- Variables
- type Command
- type Error
- type HandlerFunc
- type Message
- type OutgoingMessage
- type Processor
- func (ipc *Processor) Loop()
- func (ipc *Processor) Request(ctx context.Context, cmd Command, reqData interface{}, respData interface{}) error
- func (ipc *Processor) RequestAsync(cmd Command, data interface{}) (<-chan *Message, int, error)
- func (ipc *Processor) Send(cmd Command, data interface{}) error
- func (ipc *Processor) SetHandler(command Command, handler HandlerFunc)
Constants ¶
View Source
const ( CommandResponse = "response" CommandError = "error" )
Variables ¶
View Source
var ( ErrIPCTimeout = errors.New("ipc request timeout") ErrUnknownCommand = Error{"unknown-command", "Unknown command"} ErrSizeLimitExceeded = Error{Code: "size_limit_exceeded"} ErrTimeoutError = Error{Code: "timeout"} ErrUnsupportedError = Error{Code: "unsupported"} ErrNotFound = Error{Code: "not_found"} )
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type HandlerFunc func(message json.RawMessage) interface{}
type Message ¶
type Message struct { Command Command `json:"command"` ID int `json:"id"` Data json.RawMessage `json:"data"` }
type OutgoingMessage ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewCustomProcessor ¶
func NewStdioProcessor ¶
func (*Processor) RequestAsync ¶
func (*Processor) SetHandler ¶
func (ipc *Processor) SetHandler(command Command, handler HandlerFunc)
Click to show internal directories.
Click to hide internal directories.