event

package
v0.0.151 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action added in v0.0.56

func Action(action string, data map[string]interface{})

func Close

func Close()

func Done added in v0.0.56

func Done(work_id, event string)

func Event added in v0.0.56

func Event(event string, data interface{})

func Publish

func Publish(clientId, channel string, data map[string]interface{}) error

func Rejected added in v0.0.66

func Rejected(work_id, event string)

func Stack

func Stack(channel string, f func(CreatedEvenMessage)) (err error)

func Subscribe

func Subscribe(channel string, f func(CreatedEvenMessage)) (err error)

func Work added in v0.0.56

func Work(work, work_id string, data interface{})

func Working added in v0.0.56

func Working(worker, work_id string)

func WsBroadcast added in v0.0.120

func WsBroadcast(message interface{}, ignoreId string)

func WsPublish added in v0.0.120

func WsPublish(channel string, message interface{}, ignoreId string)

func WsSendMessage added in v0.0.120

func WsSendMessage(clientId, channel string, message interface{})

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func Load

func Load() (*Conn, error)

func (*Conn) Lock added in v0.0.147

func (c *Conn) Lock(key string) bool

type CreatedEvenMessage

type CreatedEvenMessage struct {
	Created_at time.Time              `json:"created_at"`
	Id         string                 `json:"id"`
	ClientId   string                 `json:"client_id"`
	Channel    string                 `json:"channel"`
	Data       map[string]interface{} `json:"data"`
}

func (CreatedEvenMessage) ToString

func (m CreatedEvenMessage) ToString() string

func (CreatedEvenMessage) Type

func (m CreatedEvenMessage) Type() string

type Message

type Message interface {
	Type() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL