types

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Write(ctx context.Context, p []byte) error
}

type ConsumerType

type ConsumerType string
const (
	ConsumerCorteza  ConsumerType = "corteza"
	ConsumerNoop     ConsumerType = "noop"
	ConsumerRedis    ConsumerType = "redis"
	ConsumerStore    ConsumerType = "store"
	ConsumerEventbus ConsumerType = "eventbus"
)

func ConsumerTypes

func ConsumerTypes() []ConsumerType

type Message

type Message struct {
	Q string
	P []byte
}

type Poller

type Poller interface {
	Poll(ctx context.Context) <-chan time.Time
}

type Producer

type Producer interface {
	Reader
	Subscriber
	Poller
}

type Queue

type Queue struct {
	Name     string
	Consumer Consumer
	Meta     QueueMeta
}

func (*Queue) CanDispatch

func (s *Queue) CanDispatch() bool

type QueueDb

type QueueDb struct {
	Queue    string
	Consumer string
	Meta     QueueMeta
}

type QueueEventBuilder

type QueueEventBuilder interface {
	CreateQueueEvent(string, []byte) eventbus.Event
}

type QueueFilter

type QueueFilter struct {
	Query   string
	Deleted filter.State

	filter.Sorting
	filter.Paging
}

type QueueMessage

type QueueMessage struct {
	Queue   string
	Payload []byte
}

type QueueMessageSet

type QueueMessageSet []QueueMessage

type QueueMeta

type QueueMeta struct {
	PollDelay      *time.Duration `json:"poll_delay"`
	DispatchEvents bool           `json:"dispatch_events"`
}

func (QueueMeta) MarshalJSON

func (m QueueMeta) MarshalJSON() ([]byte, error)

func (*QueueMeta) Scan

func (m *QueueMeta) Scan(src any) error

func (*QueueMeta) UnmarshalJSON

func (h *QueueMeta) UnmarshalJSON(s []byte) error

func (QueueMeta) Value

func (m QueueMeta) Value() (driver.Value, error)

type QueueServicer

type QueueServicer interface {
	QueueStorer
	QueueEventBuilder
}

type QueueSet

type QueueSet map[string]*Queue

type QueueStorer

type QueueStorer interface {
	SearchQueues(context.Context, QueueFilter) ([]QueueDb, QueueFilter, error)
	CreateQueueMessage(context.Context, QueueMessage) error
	ProcessQueueMessage(context.Context, uint64, QueueMessage) error
}

type Reader

type Reader interface {
	Read(ctx context.Context) ([]QueueMessage, error)
}

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context) <-chan interface{}
}

Jump to

Keyboard shortcuts

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