bunstore

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigrationsFS added in v0.6.0

func GetMigrationsFS() (fs.FS, error)

func Migrations

func Migrations() *persistence.Migrations

Types

type DispatchModel

type DispatchModel struct {
	bun.BaseModel `bun:"table:search_job_dispatches,alias:sjd"`
	DispatchID    string         `bun:"dispatch_id,pk"`
	Revision      int64          `bun:"revision,notnull"`
	OperationKey  string         `bun:"operation_key,unique,notnull"`
	BatchID       string         `bun:"batch_id,nullzero"`
	BatchPosition int            `bun:"batch_position,notnull"`
	State         string         `bun:"state,notnull"`
	UpdatedAt     time.Time      `bun:"updated_at,notnull"`
	Snapshot      map[string]any `bun:"snapshot,type:jsonb,notnull"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(db *bun.DB) *Store

func (*Store) Get

func (s *Store) Get(ctx context.Context, dispatchID string) (jobs.DispatchSnapshot, bool, error)

func (*Store) GetByOperationKey

func (s *Store) GetByOperationKey(ctx context.Context, operationKey string) (jobs.DispatchSnapshot, bool, error)

func (*Store) ListBatch

func (s *Store) ListBatch(ctx context.Context, batchID string) ([]jobs.DispatchSnapshot, error)

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, snapshot jobs.DispatchSnapshot) error

Jump to

Keyboard shortcuts

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