notify

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clients

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

Clients notify clients

func NewClients

func NewClients(c *conf.Config, w *model.Watcher) *Clients

NewClients New NotifyClients

func (*Clients) Post

func (nc *Clients) Post(c context.Context, notifyURL *model.NotifyURL, msg string) (err error)

Post do callback with different client vary schemas

type LiveMsgHeader

type LiveMsgHeader struct {
	TraceId     string `json:"trace_id"`
	Caller      string `json:"caller"`
	SourceGroup string `json:"source_group"`
	Group       string `json:"group"`
}

LiveMsgHeader live databus message.value.caller_header

type LiveMsgValue

type LiveMsgValue struct {
	Topic        string         `json:"topic"`
	MsgID        interface{}    `json:"msg_id"`
	MsgKey       interface{}    `json:"msg_key"`
	MsgContent   interface{}    `json:"msg_content"`
	Timestamp    float64        `json:"timestamp"`
	CallerHeader *LiveMsgHeader `json:"caller_header"`
}

LiveMsgValue live databus message.value

type LiverpcClients

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

LiverpcClients liverpc clients

func (*LiverpcClients) Post

func (lrcs *LiverpcClients) Post(ctx context.Context, notifyURL *model.NotifyURL, msg string) (err error)

Post do callback with liverpc client

type Pub

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

Pub define producer.

func NewPub

func NewPub(w *model.Pub, c *conf.Config) (p *Pub, err error)

NewPub new kafka producer.

func (*Pub) Auth

func (p *Pub) Auth(secret string) bool

Auth check user pub permission.

func (*Pub) Send

func (p *Pub) Send(key, value []byte) (err error)

Send publish kafka message.

type Sub

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

Sub notify instance

func NewSub

func NewSub(w *model.Watcher, d *dao.Dao, c *conf.Config) (n *Sub, err error)

NewSub create notify instance and return it.

func (*Sub) AddRty

func (n *Sub) AddRty(nmsg string, id, cbi int64)

AddRty add retry msg to asyncretry chan by global service.

func (*Sub) Close

func (n *Sub) Close()

Close close sub.

func (*Sub) Closed

func (n *Sub) Closed() bool

Closed return if sub had been closed.

func (*Sub) IsUpdate

func (n *Sub) IsUpdate(w *model.Watcher) bool

IsUpdate check watch metadata if update.

Jump to

Keyboard shortcuts

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