Documentation
¶
Index ¶
- Constants
- func Close()
- func Emiter(channel string, data et.Json)
- func Error(event string, err error) error
- func Events() []string
- func HealthCheck() bool
- func HttpEventPublish(w http.ResponseWriter, r *http.Request)
- func Id() string
- func Load() error
- func Log(event string, data et.Json)
- func On(channel string, handler Handler)
- func Overflow(data et.Json)
- func Publish(channel string, data et.Json) error
- func Queue(channel, queue string, f func(Message)) (err error)
- func Reset() error
- func Source(channel string, f func(Message)) error
- func Stack(channel string, f func(Message)) error
- func State(id string, status WorkStatus, data et.Json)
- func Subscribe(channel string, f func(Message)) (err error)
- func Unsubscribe(channel string) error
- func Work(event string, data et.Json) et.Json
- type Conn
- type EventEmiter
- type EventStatus
- type Handler
- type Message
- type WorkStatus
Constants ¶
View Source
const ( EventPublished EventStatus = "published" EventSubscribed EventStatus = "subscribed" EventUnsubscribed EventStatus = "unsubscribed" EventReceived EventStatus = "received" QUEUE_STACK = "stack" EVENT_STATUS = "event:status" EVENT_LOG = "event:log" EVENT_OVERFLOW = "event:overflow" EVENT_WORK = "event:work" EVENT_WORK_STATE = "event:work:state" )
View Source
const PackageName = "event"
Variables ¶
This section is empty.
Functions ¶
func HttpEventPublish ¶ added in v0.1.17
func HttpEventPublish(w http.ResponseWriter, r *http.Request)
* * HttpEventPublish * @param w http.ResponseWriter, r *http.Request *
func State ¶ added in v1.0.11
func State(id string, status WorkStatus, data et.Json)
* * State * @param id string, status WorkStatus *
func Unsubscribe ¶ added in v0.0.2
* * Unsubscribe * @param channel string * @return error *
Types ¶
type Conn ¶
func ConnectTo ¶
* * Connect to a host * @param host, user, password string * @return *Conn, error *
type EventEmiter ¶
type EventEmiter struct {
// contains filtered or unexported fields
}
type EventStatus ¶ added in v1.0.11
type EventStatus string
type Message ¶
type Message struct {
CreatedAt time.Time `json:"created_at"`
FromId string `json:"from_id"`
Id string `json:"id"`
Channel string `json:"channel"`
Data et.Json `json:"data"`
Myself bool `json:"myself"`
}
func DecodeMessage ¶
* * DecodeMessage * @param []byte data * @return Message, error *
func NewEvenMessage ¶
* * NewEvenMessage * @param string channel * @param et.Json data * @return Message *
type WorkStatus ¶
type WorkStatus string
const ( StatusPending WorkStatus = "pending" StatusProcessing WorkStatus = "processing" StatusCompleted WorkStatus = "completed" StatusFailed WorkStatus = "failed" )
Click to show internal directories.
Click to hide internal directories.