event

package
v0.0.160 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Connect added in v0.0.156

func Connect(w http.ResponseWriter, r *http.Request)

http

func Done added in v0.0.56

func Done(work_id, event string)

Done work

func Log added in v0.0.159

func Log(event string, data et.Json)

func Publish

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

Basic function to publish a message to a channel

func Rejected added in v0.0.66

func Rejected(work_id, event string)

Rejected work

func Stack

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

Basic function to subscrite kind stack to a channel

func Subscribe

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

Basic function to subscribe to a channel

func Work added in v0.0.56

func Work(worker, work_id string, data et.Json)

Publish event asigned to a worker

func Worker added in v0.0.156

func Worker(event string, data et.Json)

Publish event

func Working added in v0.0.56

func Working(worker, work_id string)

Publish event begin work

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