models

package
v0.0.0-...-116a51b Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 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 Event

type Event interface {
	OutboxRecord | SchemaResponse
	GetEvent() EventType
	GetID() string
	Verify() error
}

type EventType

type EventType int
const (
	SchemaEventType EventType = iota
	OutboxEventType
)

type OutboxRecord

type OutboxRecord struct {
	ID            uuid.UUID
	CreatedAt     *time.Time `db:"created_at"`
	PublishedAt   *time.Time `db:"published_at"`
	PublisherID   string     `db:"publisher_id"`
	SchemaID      string     `db:"schema_id"`
	Entity        string
	EntityID      string `db:"entity_id"`
	Action        string
	Payload       []byte
	ConsistencyID int    `db:"consistency_id"`
	Schema        string `json:"-"`
}

func (OutboxRecord) GetEvent

func (o OutboxRecord) GetEvent() EventType

func (OutboxRecord) GetID

func (o OutboxRecord) GetID() string

func (OutboxRecord) Verify

func (o OutboxRecord) Verify() error

type SchemaRequest

type SchemaRequest struct {
	ID string
}

type SchemaResponse

type SchemaResponse struct {
	ID          string
	CreatedAt   *time.Time `db:"created_at"`
	PublishedAt *time.Time `db:"published_at"`
	Schema      string
}

func (SchemaResponse) GetEvent

func (s SchemaResponse) GetEvent() EventType

func (SchemaResponse) GetID

func (s SchemaResponse) GetID() string

func (SchemaResponse) Verify

func (s SchemaResponse) Verify() error

Jump to

Keyboard shortcuts

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