go.bigb.es/curator
Index
- type Ops
- func NewOps(host string, resolver store.ModuleResolver, gitc *git.Cache, db store.SumdbStore, signer string) *Ops
- func (*Ops) Lookup(ctx context.Context, m module.Version) (int64, error)
- func (*Ops) ReadRecords(ctx context.Context, id, n int64) ([][]byte, error)
- func (*Ops) ReadTileData(ctx context.Context, t tlog.Tile) ([]byte, error)
- func (*Ops) RecordCount() int64
- func (*Ops) Signed(ctx context.Context) ([]byte, error)
Types
type Ops struct { // contains filtered or unexported fields }
func NewOps(host string, resolver store.ModuleResolver, gitc *git.Cache, db store.SumdbStore, signer string) *Ops
func (s *Ops) Lookup(ctx context.Context, m module.Version) (int64, error)
Lookup looks up a record for the given module, creating it if needed.
func (s *Ops) ReadRecords(ctx context.Context, id, n int64) ([][]byte, error)
ReadRecords returns the content for records id through id+n-1.
func (s *Ops) ReadTileData(ctx context.Context, t tlog.Tile) ([]byte, error)
ReadTileData reads the content of tile t.
func (s *Ops) RecordCount() int64
RecordCount returns the current number of records (for metrics).
func (s *Ops) Signed(ctx context.Context) ([]byte, error)
Signed returns the signed hash of the latest tree.
Ops implements sumdb.ServerOps backed by database persistence. Records and hashes are read from the database on demand. A mutex serializes writes to ensure tlog consistency.