Documentation
¶
Overview ¶
Package store keeps the visor state in visor.db: documents (projects, workdirs, sessions, harness state, meta) and the event log.
Index ¶
- Constants
- Variables
- type EventRow
- type Store
- func (s *Store) AppendEvent(ctx context.Context, e EventRow) error
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, kind, id string) error
- func (s *Store) DeleteSessionEvents(ctx context.Context, session string) error
- func (s *Store) Events(ctx context.Context, after, until uint64, sessions []string, limit int) ([]EventRow, error)
- func (s *Store) Get(ctx context.Context, kind, id string) ([]byte, error)
- func (s *Store) LastSeq(ctx context.Context) (uint64, error)
- func (s *Store) LastSource(ctx context.Context, session string) (string, uint64, error)
- func (s *Store) List(ctx context.Context, kind string) ([][]byte, error)
- func (s *Store) Put(ctx context.Context, kind, id string, data []byte) error
Constants ¶
View Source
const ( KindMeta = "meta" KindProject = "project" KindWorkdir = "workdir" KindSession = "session" KindHarness = "harness" )
Document kinds.
Variables ¶
View Source
var ErrNotFound = errors.New("store: not found")
ErrNotFound reports a missing document.
Functions ¶
This section is empty.
Types ¶
type EventRow ¶
type EventRow struct {
Seq uint64
Session string
Data []byte
// Source and SourceSeq name the holder run and the holder sequence of
// an event that came from a holder.
Source string
SourceSeq uint64
}
EventRow is one stored event.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is one open visor.db.
func (*Store) AppendEvent ¶
AppendEvent writes one event with its sequence number.
func (*Store) DeleteSessionEvents ¶
DeleteSessionEvents removes the events of one session.
func (*Store) Events ¶
func (s *Store) Events(ctx context.Context, after, until uint64, sessions []string, limit int) ([]EventRow, error)
Events reads the events with after < seq <= until, in order, at most limit rows. An empty sessions list reads all sessions.
func (*Store) LastSource ¶
LastSource gives the holder run and the holder sequence of the last event of a session that came from a holder. An empty run means none.
Click to show internal directories.
Click to hide internal directories.