Documentation ¶
Overview ¶
Package dydb implements a diviner.Database on top of dynamodb and the AWS cloudwatch logs storage. Database instances may be safely shared between multiple users.
Index ¶
- type DB
- func (d *DB) AppendRunMetrics(ctx context.Context, study string, seq uint64, metrics diviner.Metrics) error
- func (d *DB) CreateStudyIfNotExist(ctx context.Context, study diviner.Study) (created bool, err error)
- func (d *DB) CreateTable(ctx context.Context) error
- func (d *DB) InsertRun(ctx context.Context, run diviner.Run) (diviner.Run, error)
- func (d *DB) ListRuns(ctx context.Context, study string, states diviner.RunState, since time.Time) (runs []diviner.Run, err error)
- func (d *DB) ListStudies(ctx context.Context, prefix string, since time.Time) ([]diviner.Study, error)
- func (d *DB) Log(study string, seq uint64, since time.Time, follow bool) io.Reader
- func (d *DB) Logger(study string, seq uint64) io.WriteCloser
- func (d *DB) LookupRun(ctx context.Context, study string, seq uint64) (diviner.Run, error)
- func (d *DB) LookupStudy(ctx context.Context, name string) (study diviner.Study, err error)
- func (d *DB) NextSeq(ctx context.Context, study string) (uint64, error)
- func (d *DB) UpdateRun(ctx context.Context, study string, seq uint64, state diviner.RunState, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
A DB represents a session to a DynamoDB table; it implements diviner.Database.
func (*DB) AppendRunMetrics ¶
func (d *DB) AppendRunMetrics(ctx context.Context, study string, seq uint64, metrics diviner.Metrics) error
AppendRunMetrics reports new run metrics for the run named by the provided study and sequence number.
func (*DB) CreateStudyIfNotExist ¶
func (d *DB) CreateStudyIfNotExist(ctx context.Context, study diviner.Study) (created bool, err error)
CreateStudyIfNotExist creates a new study if it does not already exist. Existing studies are not updated.
func (*DB) CreateTable ¶
CreateTable creates the dynamoDB table named by this DB instance together with the required indices for operating in Diviner. The billing mode is set to PAY_PER_REQUEST.
func (*DB) InsertRun ¶
InsertRun inserts a new run into the provided study. The returned run is assigned a fresh sequence number and is returned with state Pending.
func (*DB) ListRuns ¶
func (d *DB) ListRuns(ctx context.Context, study string, states diviner.RunState, since time.Time) (runs []diviner.Run, err error)
ListRuns returns all runs in the provided study matching the query states that have also been active since the provided time.
func (*DB) ListStudies ¶
func (d *DB) ListStudies(ctx context.Context, prefix string, since time.Time) ([]diviner.Study, error)
ListStudies returns the set of studies in the database that have the provided prefix and have been active since the provided time.
func (*DB) Log ¶
Log returns an io.Reader that reads log messages from the AWS CloudWatch Logs service.
func (*DB) Logger ¶
func (d *DB) Logger(study string, seq uint64) io.WriteCloser
Logger returns a logger that writes log messages, line-for-line to the AWS CloudWatch Logs service.
func (*DB) LookupStudy ¶
LookupStudy returns the study with the provided name.
Directories ¶
Path | Synopsis |
---|---|
Package dynamoattr provides functions for marshaling and unmarshaling Go values to and from DynamoDB items (map[string]*dynamodb.AttributeValue).
|
Package dynamoattr provides functions for marshaling and unmarshaling Go values to and from DynamoDB items (map[string]*dynamodb.AttributeValue). |