Documentation ¶
Index ¶
- Constants
- Variables
- func HostnameSimple() string
- func UUIDFromTime(time time.Time) string
- type Client
- func NewClient(topic, channel string) (clt *Client, err error)
- func NewClientAddingHost(topic, channel string) (clt *Client, err error)
- func NewClientGlobal(topic string) (clt *Client, err error)
- func NewClientUsingHost(topic string) (clt *Client, err error)
- func NewClientUsingHostTemp(topic string) (clt *Client, err error)
- type JsonWrapper
- func (jw *JsonWrapper) Call() (out string)
- func (jw *JsonWrapper) Check() error
- func (jw *JsonWrapper) From() (out string)
- func (jw *JsonWrapper) SetCall(call string)
- func (jw *JsonWrapper) SetFrom(from string)
- func (jw *JsonWrapper) SetTime()
- func (jw *JsonWrapper) SetTo(to string)
- func (jw *JsonWrapper) SetVS(key string, value string)
- func (jw *JsonWrapper) String() string
- func (jw *JsonWrapper) Time() time.Time
- func (jw *JsonWrapper) To() (out string)
Constants ¶
View Source
const ( FIELD_FROM = "_from" FIELD_TO = "_to" FIELD_CALL = "_call" FIELD_TIME = "_time" )
View Source
const ( TOPIC_GENERAL_EVENTS = "events" TOPIC_STORAGE = "storage" TOPIC_ALERTS = "alerts" TOPIC_RECEIVERS = "receivers" )
Variables ¶
View Source
var MANDATORY_FIELDS []string
Functions ¶
func HostnameSimple ¶
func HostnameSimple() string
func UUIDFromTime ¶
Types ¶
type Client ¶
type Client struct { Recv chan *JsonWrapper // contains filtered or unexported fields }
func NewClientAddingHost ¶
func NewClientGlobal ¶
func NewClientUsingHost ¶
func NewClientUsingHostTemp ¶
func (*Client) Publish ¶
func (c *Client) Publish(msg *JsonWrapper) error
func (*Client) StartLookup ¶
type JsonWrapper ¶
func NewJsonWrapper ¶
func NewJsonWrapper() *JsonWrapper
func NewJsonWrapperFromJson ¶
func NewJsonWrapperFromJson(json *simple.Json) *JsonWrapper
func NewMessage ¶
func NewMessage(to, call string) *JsonWrapper
func (*JsonWrapper) Call ¶
func (jw *JsonWrapper) Call() (out string)
func (*JsonWrapper) Check ¶
func (jw *JsonWrapper) Check() error
func (*JsonWrapper) From ¶
func (jw *JsonWrapper) From() (out string)
func (*JsonWrapper) SetCall ¶
func (jw *JsonWrapper) SetCall(call string)
func (*JsonWrapper) SetFrom ¶
func (jw *JsonWrapper) SetFrom(from string)
func (*JsonWrapper) SetTime ¶
func (jw *JsonWrapper) SetTime()
func (*JsonWrapper) SetTo ¶
func (jw *JsonWrapper) SetTo(to string)
The target of a message should be something like: * server ie: receivers * server:device ie: receivers:bc86fb50-ce5d-11e3-9c1a-0800200c9a66 * server:device:connection ie: receivers/xps:bc86fb50-ce5d-11e3-9c1a-0800200c9a66:100
The only actual rule through is that the first part is the NSQ topic or topic/channel (later).
func (*JsonWrapper) SetVS ¶
func (jw *JsonWrapper) SetVS(key string, value string)
func (*JsonWrapper) String ¶
func (jw *JsonWrapper) String() string
func (*JsonWrapper) Time ¶
func (jw *JsonWrapper) Time() time.Time
func (*JsonWrapper) To ¶
func (jw *JsonWrapper) To() (out string)
Click to show internal directories.
Click to hide internal directories.