store

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueueUpdateGroup

func QueueUpdateGroup(conn *gorm.DB, group *QueueGroup) (dbqueuetypes.QueueGroupRecord, error)

Types

type DbQueueNotification

type DbQueueNotification struct {
	listener.GenericNotification
}

func NewDbQueueNotify

func NewDbQueueNotify() *DbQueueNotification

type Queue

type Queue struct {
	gorm.Model
	Priority uint64 `gorm:"column:priority"`
	Permit   uint64 `gorm:"column:permit"`
	Item     []byte `gorm:"column:item"`
	Name     string `gorm:"column:name"`
	GroupID  *int64 `gorm:"column:group_id"`
	Group    *QueueGroup
	Type     uint64         `gorm:"column:type"`
	Address  sql.NullString `gorm:"column:address;unique"`
	Carrier  []byte         `gorm:"column:carrier"`
}

func (Queue) TableName

func (Queue) TableName() string

type QueueAddressFailure

type QueueAddressFailure struct {
	Message string `json:"error"`
}

func (*QueueAddressFailure) Error

func (err *QueueAddressFailure) Error() string

type QueueFailure

type QueueFailure struct {
	Address string `gorm:"column:address"`
	Error   string `gorm:"column:error"`
}

type QueueGroup

type QueueGroup struct {
	gorm.Model
	Name      string `gorm:"column:name;unique"`
	Cancelled bool   `gorm:"column:cancelled"`
	Started   bool   `gorm:"column:started"`
}

QueueGroup represents a queue group

func (*QueueGroup) GroupId

func (r *QueueGroup) GroupId() int64

func (QueueGroup) TableName

func (QueueGroup) TableName() string

type QueuePermit

type QueuePermit struct {
	gorm.Model
}

func (*QueuePermit) PermitCreated

func (p *QueuePermit) PermitCreated() time.Time

func (*QueuePermit) PermitId

func (p *QueuePermit) PermitId() permit.Permit

type Store

type Store interface {
	// QueueStore Use composition to include the database queue store interface
	dbqueuetypes.QueueStore
	dbqueuetypes.QueueGroupStore

	Notify(channelName string, n interface{}) error

	// QueueNewGroup creates a new queue group in the database
	QueueNewGroup(name string) (dbqueuetypes.QueueGroupRecord, error)
}

func Open

func Open(path string, llf *local.ListenerProvider) Store

Jump to

Keyboard shortcuts

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