Documentation ¶
Index ¶
- Constants
- type Column
- type Invokable
- type InvokeFn
- type Lister
- type Mapper
- type Message
- type MethodType
- type MsgErr
- type Node
- type NodeConfig
- type OnSetValue
- type ParamVal
- type Params
- type PermType
- type Request
- type Requester
- type Responder
- type Response
- type Settable
- type StreamState
- type SubPath
- type ValueType
- type ValueUpdate
- type Valued
Constants ¶
View Source
const ( ResultValues = "values" ResultTable = "table" ResultStream = "stream" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Msg int32 `json:"msg" msgpack:"msg"` Ack int32 `json:"ack,omitempty" msgpack:"ack,omitempty"` Reqs []*Request `json:"requests,omitempty" msgpack:"requests,omitempty"` Resp []*Response `json:"responses,omitempty" msgpack:"responses,omitempty"` Salt string `json:"salt,omitempty" msgpack:"salt,omitempty"` }
type MethodType ¶
type MethodType string
const ( MethodList MethodType = "list" MethodSub MethodType = "subscribe" MethodUnsub MethodType = "unsubscribe" MethodClose MethodType = "close" MethodSet MethodType = "set" MethodRemove MethodType = "remove" MethodInvoke MethodType = "invoke" )
type MsgErr ¶
type MsgErr struct { Type string `json:"type" msgpack:"type"` Msg string `json:"msg" msgpack:"msg"` Phase string `json:"phase" msgpack:"phase"` Path string `json:"path" msgpack:"path"` Detail string `json:"detail" msgpack:"detail"` }
var ( ErrPermissionDenied *MsgErr = &MsgErr{Type: "permissionDenied"} ErrInvalidMethod *MsgErr = &MsgErr{Type: "invalidMethod"} ErrNotImplemented *MsgErr = &MsgErr{Type: "notImplemented"} ErrInvalidPath *MsgErr = &MsgErr{Type: "invalidPath"} ErrInvalidPaths *MsgErr = &MsgErr{Type: "invalidPaths"} ErrInvalidValue *MsgErr = &MsgErr{Type: "invalidValue"} ErrInvalidParam *MsgErr = &MsgErr{Type: "invalidParameter"} ErrDisconnected *MsgErr = &MsgErr{Type: "disconnected", Phase: "response"} ErrFailed *MsgErr = &MsgErr{Type: "failed"} )
type Node ¶
type Node interface { Name() string Attributes() map[string]interface{} GetAttribute(string) (interface{}, bool) SetAttribute(string, interface{}) Configs() map[NodeConfig]interface{} GetConfig(NodeConfig) (interface{}, bool) SetConfig(NodeConfig, interface{}) }
type NodeConfig ¶
type NodeConfig string
const ( ConfigBase NodeConfig = "$base" ConfigIs NodeConfig = "$is" ConfigInterface NodeConfig = "$interface" ConfigDisconnected NodeConfig = "$disconnectedTs" ConfigPermission NodeConfig = "$permission" ConfigPermissions NodeConfig = "$$permissions" ConfigName NodeConfig = "$name" ConfigType NodeConfig = "$type" ConfigWritable NodeConfig = "$writable" ConfigSetings NodeConfig = "$settings" ConfigParams NodeConfig = "$params" ConfigColumns NodeConfig = "$columns" ConfigResult NodeConfig = "$result" ConfigStreamMeta NodeConfig = "$streamMeta" ConfigInvokable NodeConfig = "$invokable" )
type OnSetValue ¶
type ParamVal ¶
type ParamVal string
const ( // ParamName is the name of the parameter. Used in Invoke actions. ParamName ParamVal = "name" // ParamType is the type of the parameter. Used in Invoke actions. ParamType ParamVal = "type" // ParamDef is the default value of the parameter. Used in Invoke actions. ParamDef ParamVal = "default" // ParamEditor is the editor for the type. Used in Invoke actions. ParamEditor ParamVal = "editor" // ParamHolder is the placeholder for the value. Used in Invoke actions. ParamHolder ParamVal = "placeholder" // ParamDesc is the parameter description. Used in Invoke actions. ParamDesc ParamVal = "description" )
type PermType ¶
type PermType string
PermType is the Permission type.
const ( // PermNone is permission none. PermNone PermType = "none" // PermRead is permission Read only PermRead PermType = "read" // PermWrite is permission write PermWrite PermType = "write" // PermConfig is permission config PermConfig PermType = "config" // PermNever is permission never PermNever PermType = "never" )
type Request ¶
type Request struct { Rid int32 `json:"rid" msgpack:"rid"` Method MethodType `json:"method" msgpack:"method"` Path string `json:"path,omitempty" msgpack:"path,omitempty"` Paths []*SubPath `json:"paths,omitempty" msgpack:"paths,omitempty"` Sids []int32 `json:"sids,omitempty" msgpack:"sids,omitempty"` Params map[string]interface{} `json:"params,omitempty" msgpack:"params,omitempty"` Permit string `json:"permit,omitempty" msgpack:"permit,omitempty"` Value interface{} `json:"value,omitempty" msgpack:"value,omitempty"` }
func NewReq ¶
func NewReq(rid int32, method MethodType) *Request
type Response ¶
type Response struct { Rid int32 `json:"rid" msgpack:"rid"` Stream StreamState `json:"stream" msgpack:"stream"` Updates []interface{} `json:"updates" msgpack:"updates"` Columns []map[string]interface{} `json:"columns,omitempty" msgpack:"columns,omitempty"` Error *MsgErr `json:"error,omitempty" msgpack:"error,omitempty"` }
type StreamState ¶
type StreamState string
const ( StreamInit StreamState = "initialize" StreamOpen StreamState = "open" StreamClosed StreamState = "closed" )
type SubPath ¶
type ValueType ¶
type ValueType string
ValueType represents the type of value stored by the Node
const ( // ValueBool indicates this value type is a boolean ValueBool ValueType = "bool" // ValueNum indicates this value type is a number (integer or double) ValueNum ValueType = "num" // ValueString indicates this value type is a String ValueString ValueType = "string" // ValueDynamic indicates this value type is of an undetermined type ValueDynamic ValueType = "dynamic" // ValueDynamic indicates this value type is a Map ValueMap ValueType = "map" // ValueDynamic indicates this value type is an Array ValueArray ValueType = "array" )
func GenerateEnumValue ¶
type ValueUpdate ¶
type ValueUpdate struct {
// contains filtered or unexported fields
}
func NewValueUpdate ¶
func NewValueUpdate(value interface{}) *ValueUpdate
func (*ValueUpdate) GetTs ¶
func (v *ValueUpdate) GetTs() time.Time
func (*ValueUpdate) Value ¶
func (v *ValueUpdate) Value() interface{}
Click to show internal directories.
Click to hide internal directories.