eventsstoregorm

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 13 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 struct {
	ID          string    `gorm:"primaryKey;index:idx_ord"`
	SrcID       string    `gorm:"not null;index:idx_ord"`
	CreatedAt   time.Time `gorm:"not null;index:idx_ord"`
	Type        string    `gorm:"not null"`
	OriginalID  string    `gorm:"index"`
	Association string
	Data        datatypes.JSON
	Memo        datatypes.JSON
}

type EventState

type EventState struct {
	EventID string         `gorm:"index:idx_sord;not null"`
	T       time.Time      `gorm:"index:idx_sord;not null"`
	State   datatypes.JSON `gorm:"not null"`
}

type Store

type Store struct {
	DB *gorm.DB
}

func (*Store) Add

func (s *Store) Add(ctx context.Context, id apievent.EventID, srcid apieventsrc.EventSourceID, assoc, originalID, typ string, data map[string]*apivalues.Value, memo map[string]string) (apievent.EventID, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id apievent.EventID) (*apievent.Event, error)

func (*Store) GetProjectWaitingEvents

func (s *Store) GetProjectWaitingEvents(ctx context.Context, pid apiproject.ProjectID) ([]apievent.EventID, error)

func (*Store) GetState

func (s *Store) GetState(ctx context.Context, id apievent.EventID) ([]*apievent.EventStateRecord, error)

func (*Store) GetStateForProject

func (s *Store) GetStateForProject(ctx context.Context, eid apievent.EventID, pid apiproject.ProjectID) ([]*apievent.ProjectEventStateRecord, error)

func (*Store) List

func (s *Store) List(ctx context.Context, pid *apiproject.ProjectID, ofs, l uint32) ([]*eventsstore.ListRecord, error)

func (*Store) Setup

func (s *Store) Setup(ctx context.Context) error

func (*Store) Teardown

func (s *Store) Teardown(ctx context.Context) error

func (*Store) UpdateState

func (s *Store) UpdateState(ctx context.Context, id apievent.EventID, es *apievent.EventState) error

func (*Store) UpdateStateForProject

func (s *Store) UpdateStateForProject(ctx context.Context, eid apievent.EventID, pid apiproject.ProjectID, es *apievent.ProjectEventState) error

Jump to

Keyboard shortcuts

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