Documentation ¶
Index ¶
- Constants
- func Close()
- func Overflow(message interface{})
- func Publish(channel string, message interface{}) error
- func Stack(channel string, reciveFn func(Message)) error
- func Subscribe(channel string, reciveFn func(Message)) error
- func Telemetry(message interface{})
- func TokeLastUse(message interface{})
- type Conn
- type Message
- type PubSub
- func (p *PubSub) Close()
- func (p *PubSub) Connect() (bool, error)
- func (p *PubSub) IsConnected() bool
- func (p *PubSub) Params(params js.Json) error
- func (p *PubSub) Ping()
- func (p *PubSub) Publish(channel string, message interface{})
- func (p *PubSub) SendMessage(clientId string, message interface{}) error
- func (p *PubSub) Stack(channel string, reciveFn func(m.Message))
- func (p *PubSub) Subscribe(channel string, reciveFn func(m.Message))
- func (p *PubSub) Type() string
- func (p *PubSub) Unsubscribe(channel string)
Constants ¶
View Source
const ( ERR_ENV_REQUIRED = "Variables de entorno requerida (%s)" ERR_NOT_CONNECT = "Not connect nats" ERR_PARAM_NOT_FOUND = "Param not found" ERR_CLIENT_ID_EMPTY = "Client id is empty" PARAMS_UPDATED = "Params updated" ERR_NOT_PUBSUB_SERVICE = "PubSub service not found" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { Created_at time.Time `json:"created_at"` Id string `json:"id"` From js.Json `json:"from"` Tp message.TpMessage `json:"tp"` Channel string `json:"channel"` Data interface{} `json:"data"` // contains filtered or unexported fields }
func DecodeMessage ¶
Decode return the message as struct
func NewMessage ¶
NewMessage create a new message
type PubSub ¶
func (*PubSub) SendMessage ¶
Send a message to the server
func (*PubSub) Unsubscribe ¶
Unsubscribe from a channel
Click to show internal directories.
Click to hide internal directories.