Documentation ¶
Index ¶
- Constants
- func Close()
- func Data(channel string, data et.Json) error
- func Log(event string, data et.Json)
- func Overflow(data et.Json)
- func Publish(channel string, data et.Json) error
- func Queue(channel, queue string, f func(EvenMessage)) (err error)
- func Source(channel string, f func(EvenMessage)) error
- func Stack(channel string, f func(EvenMessage)) error
- func Subscribe(channel string, f func(EvenMessage)) (err error)
- func Telemetry(data et.Json)
- func Test(w http.ResponseWriter, r *http.Request)
- func TokenLastUse(data et.Json)
- func Work(event string, data et.Json) et.Json
- func WorkState(work_id string, status WorkStatus, data et.Json)
- type Conn
- type EvenMessage
- type Message
- type WorkStatus
Constants ¶
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" )
Variables ¶
This section is empty.
Functions ¶
func Data ¶ added in v1.0.8
* * Data * @param string channel * @param func(Message) reciveFn * @return error *
func Queue ¶ added in v1.0.8
func Queue(channel, queue string, f func(EvenMessage)) (err error)
* * Queue * @param string channel * @param func(EvenMessage) f * @return error *
func Source ¶ added in v1.0.8
func Source(channel string, f func(EvenMessage)) error
* * Source * @param string channel * @param func(Message) reciveFn * @return error *
func Stack ¶
func Stack(channel string, f func(EvenMessage)) error
* * Stack * @param channel string * @param f func(EvenMessage) * @return error *
func Subscribe ¶
func Subscribe(channel string, f func(EvenMessage)) (err error)
* * Subscribe * @param channel string * @param f func(EvenMessage) * @return error *
func Test ¶ added in v0.0.165
func Test(w http.ResponseWriter, r *http.Request)
* * Test event, testing message broker * @param w http.ResponseWriter * @param r *http.Request *
func TokenLastUse ¶ added in v1.0.8
* * TokenLastUse * @param data et.Json *
Types ¶
type EvenMessage ¶ added in v0.0.177
type EvenMessage struct { Created_at time.Time `json:"created_at"` Id string `json:"id"` Channel string `json:"channel"` Data et.Json `json:"data"` }
func DecodeMessage ¶ added in v1.0.8
func DecodeMessage(data []byte) (EvenMessage, error)
* * DecodeMessage * @param []byte data * @return EvenMessage, error *
func NewEvenMessage ¶ added in v1.0.8
func NewEvenMessage(channel string, data et.Json) EvenMessage
* * NewEvenMessage * @param string channel * @param et.Json data * @return EvenMessage *
func (EvenMessage) Encode ¶ added in v1.0.8
func (m EvenMessage) Encode() ([]byte, error)
* * Encode * @return []byte, error *
func (EvenMessage) ToJson ¶ added in v1.0.8
func (m EvenMessage) ToJson() (et.Json, error)
* * ToJson * @return et.Json, error *
func (EvenMessage) ToString ¶ added in v0.0.177
func (m EvenMessage) ToString() string
* * ToString * @return string *
type WorkStatus ¶ added in v1.0.8
type WorkStatus int
const ( WorkStatusPending WorkStatus = iota WorkStatusAccepted WorkStatusProcessing WorkStatusCompleted WorkStatusFailed )
func ToWorkStatus ¶ added in v1.0.8
func ToWorkStatus(n int) WorkStatus
* * ToWorkStatus * @param int n * @return WorkStatus *
func (WorkStatus) String ¶ added in v1.0.8
func (s WorkStatus) String() string
* * String * @return string *