event

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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"
)

Variables

This section is empty.

Functions

func Close

func Close()

func Data added in v1.0.8

func Data(channel string, data et.Json) error

* * Data * @param string channel * @param func(Message) reciveFn * @return error *

func Log added in v0.0.159

func Log(event string, data et.Json)

* * Log * @param event string * @param data et.Json *

func Overflow added in v1.0.8

func Overflow(data et.Json)

* * Overflow * @param data et.Json *

func Publish

func Publish(channel string, data et.Json) error

* * Publish * @param channel string * @param data et.Json * @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 Telemetry added in v1.0.8

func Telemetry(data et.Json)

* * Telemetry * @param data et.Json *

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

func TokenLastUse(data et.Json)

* * TokenLastUse * @param data et.Json *

func Work added in v0.0.56

func Work(event string, data et.Json) et.Json

* * Work * @param event string * @param data et.Json *

func WorkState added in v1.0.8

func WorkState(work_id string, status WorkStatus, data et.Json)

* * WorkState * @param work_id string * @param status WorkStatus * @param data et.Json *

Types

type Conn

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

func Load

func Load() (*Conn, error)

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 Message

type Message interface {
	Type() 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 *

Jump to

Keyboard shortcuts

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