pgnotifier

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaitingState   = "waiting"
	ExecutingState = "executing"
	SucceededState = "succeeded"
	FailedState    = "failed"
	AbortedState   = "aborted"
)

Variables

This section is empty.

Functions

func GetCurrentSQLTimestamp

func GetCurrentSQLTimestamp() string

GetCurrentSQLTimestamp to get sql complaint current datetime string

func GetSQLTimestamp

func GetSQLTimestamp(t time.Time) string

GetSQLTimestamp to get sql complaint current datetime string from the given duration

Types

type ClaimResponseT

type ClaimResponseT struct {
	Payload json.RawMessage
	Err     error
}

type ClaimT

type ClaimT struct {
	ID                int64
	BatchID           string
	Status            string
	Payload           json.RawMessage
	ClaimResponseChan chan ClaimResponseT
}

type MessageT

type MessageT struct {
	Payload json.RawMessage
}

type NotificationT

type NotificationT struct {
	ID      int64
	BatchID string `json:"batch_id"`
	Status  string
}

type PgNotifierT

type PgNotifierT struct {
	URI string
	// contains filtered or unexported fields
}

func New

func New(connectionInfo string) (notifier PgNotifierT, err error)

func (PgNotifierT) AddTopic

func (notifier PgNotifierT) AddTopic(topic string) (err error)

func (*PgNotifierT) Claim

func (notifier *PgNotifierT) Claim(workerID string) (claim ClaimT, claimed bool)

func (*PgNotifierT) Publish

func (notifier *PgNotifierT) Publish(topic string, messages []MessageT) (ch chan []ResponseT, err error)

func (*PgNotifierT) Subscribe

func (notifier *PgNotifierT) Subscribe(topic string) (ch chan NotificationT, err error)

type ResponseT

type ResponseT struct {
	Status  string
	Payload json.RawMessage
}

Jump to

Keyboard shortcuts

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