core

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterMessage

type FilterMessage struct {
	TopicId       []uuid.UUID
	Status        []MessageStatus
	SortBy        string
	SortDirection string
	Offset        int
	Limit         int
}

func (FilterMessage) Filter

func (f FilterMessage) Filter(operator string) (string, map[string]interface{})

func (FilterMessage) Page

func (f FilterMessage) Page() string

func (FilterMessage) Sort

func (f FilterMessage) Sort() string

type FilterSubscriber

type FilterSubscriber struct {
	TopicId     []uuid.UUID
	Name        []string
	WithDeleted bool
}

func (FilterSubscriber) Filter

func (f FilterSubscriber) Filter(operator string) (string, map[string]interface{})

type FilterTopic

type FilterTopic struct {
	Name        []string
	WithDeleted bool
}

func (FilterTopic) Filter

func (f FilterTopic) Filter(operator string) (string, map[string]interface{})

type Message

type Message struct {
	Id        uuid.UUID     `db:"id"`
	TopicId   uuid.UUID     `db:"topic_id"`
	Message   string        `db:"message"`
	Status    MessageStatus `db:"status"`
	CreatedAt string        `db:"created_at"`
}

type MessageStatus

type MessageStatus string
const (
	MessageStatusWaiting   MessageStatus = "waiting"
	MessageStatusDelivered MessageStatus = "delivered"
)

type Messages

type Messages []Message

func (Messages) Ids

func (messages Messages) Ids() []uuid.UUID

type Subscriber

type Subscriber struct {
	Id        uuid.UUID       `db:"id"`
	TopicId   uuid.UUID       `db:"topic_id"`
	TopicName string          `db:"topic_name"`
	Name      string          `db:"name"`
	Option    json.RawMessage `db:"option"`
	CreatedAt string          `db:"created_at"`
	DeletedAt null.String     `db:"deleted_at"`
}

func (Subscriber) Bucket

func (s Subscriber) Bucket() string

type SubscriberOpt

type SubscriberOpt struct {
	MaxAttempts        int    `json:"max_attempts"`
	VisibilityDuration string `json:"visibility_duration"`
}

type Subscribers

type Subscribers []Subscriber

func (Subscribers) MapByTopic

func (subscribers Subscribers) MapByTopic() map[uuid.UUID]Subscribers

type Topic

type Topic struct {
	Id        uuid.UUID   `db:"id"`
	Name      string      `db:"name"`
	CreatedAt string      `db:"created_at"`
	DeletedAt null.String `db:"deleted_at"`
}

func (Topic) Empty

func (t Topic) Empty() bool

type Topics

type Topics []Topic

func (Topics) Ids

func (topics Topics) Ids() []uuid.UUID

Jump to

Keyboard shortcuts

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