Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorTimeout = errors.New("cube: request timeout")
)
Functions ¶
This section is empty.
Types ¶
type Cube ¶
type Cube interface {
GetParam(param string) string
GetClass() string
GetInstanceId() string
PublishMessage(channel Channel, message Message) error
CallMethod(channel Channel, request Request, timeout time.Duration) (*Response, error)
Stop()
LogDebug(text string) error
LogError(text string) error
LogFatal(text string) error
LogInfo(text string) error
LogWarning(text string) error
LogTrace(text string) error
}
type HandlerInterface ¶
type InputChannel ¶
type InputChannel Channel
type Message ¶
type Message struct {
Id string `json:"id"`
Method string `json:"method"`
Params *json.RawMessage `json:"params"`
}
type Request ¶
type Request struct {
Method string `json:"method"`
Params *json.RawMessage `json:"params"`
}
type Response ¶
type Response struct {
Id string `json:"id"`
Result *json.RawMessage `json:"result"`
Error *Error `json:"error"`
}
func NewErrorResponse ¶
func NewResultResponse ¶
func NewResultResponse(requestId string, result *json.RawMessage) Response
Click to show internal directories.
Click to hide internal directories.