Documentation
¶
Index ¶
- Constants
- type Checkpoint
- type CheckpointQuery
- type CheckpointRepository
- type ListCheckpointsResult
- type PostgresqlCheckpointRepository
- func (r *PostgresqlCheckpointRepository) EnforceMinimumCheckpointTime(minimum time.Time, excludeNames []string) error
- func (r *PostgresqlCheckpointRepository) GetCheckpoint(query *CheckpointQuery) (*Checkpoint, error)
- func (r *PostgresqlCheckpointRepository) Initialize(connection database.Connection) error
- func (r *PostgresqlCheckpointRepository) ListCheckpoints() ([]*Checkpoint, error)
- func (r *PostgresqlCheckpointRepository) QueryCheckpoints(query *CheckpointQuery) ([]*Checkpoint, error)
- func (r *PostgresqlCheckpointRepository) ResetAllCheckpoints(newCheckpointTime time.Time) error
- func (r *PostgresqlCheckpointRepository) ResetCheckpoints(request *ResetCheckpointsRequest) error
- func (r *PostgresqlCheckpointRepository) SetCheckpoint(checkpoint *Checkpoint) error
- type QueryCheckpointsRequest
- type QueryCheckpointsResult
- type ResetCheckpointsRequest
Constants ¶
View Source
const DefaultCheckpointName = "default"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type CheckpointQuery ¶
type CheckpointRepository ¶
type CheckpointRepository interface {
database.Repository
SetCheckpoint(checkpoint *Checkpoint) error
ListCheckpoints() ([]*Checkpoint, error)
QueryCheckpoints(query *CheckpointQuery) ([]*Checkpoint, error)
GetCheckpoint(query *CheckpointQuery) (*Checkpoint, error)
ResetAllCheckpoints(newCheckpointTime time.Time) error
ResetCheckpoints(request *ResetCheckpointsRequest) error
// EnforceMinimumCheckpointTime advances lingering checkpoints to the minimum, except the rows
// named in excludeNames — rows a caller manages itself, where a checkpoint sitting in the past
// is a deliberate instruction to re-meter rather than a leftover.
EnforceMinimumCheckpointTime(minimum time.Time, excludeNames []string) error
}
func NewPostgresqlCheckpointRepository ¶
func NewPostgresqlCheckpointRepository() CheckpointRepository
type ListCheckpointsResult ¶
type ListCheckpointsResult struct {
Checkpoints []*Checkpoint `json:"checkpoints"`
}
type PostgresqlCheckpointRepository ¶
type PostgresqlCheckpointRepository struct {
database.Repository
// contains filtered or unexported fields
}
func (*PostgresqlCheckpointRepository) EnforceMinimumCheckpointTime ¶
func (r *PostgresqlCheckpointRepository) EnforceMinimumCheckpointTime(minimum time.Time, excludeNames []string) error
EnforceMinimumCheckpointTime sets all non-default checkpoints to the given minimum time, except the rows named in excludeNames. Excluded rows are the ones the metering engine advances itself: force-advancing one of those would silently cancel a checkpoint reset — the hours between the reset and the minimum would never be metered, with nothing failing.
func (*PostgresqlCheckpointRepository) GetCheckpoint ¶
func (r *PostgresqlCheckpointRepository) GetCheckpoint(query *CheckpointQuery) (*Checkpoint, error)
func (*PostgresqlCheckpointRepository) Initialize ¶
func (r *PostgresqlCheckpointRepository) Initialize(connection database.Connection) error
func (*PostgresqlCheckpointRepository) ListCheckpoints ¶
func (r *PostgresqlCheckpointRepository) ListCheckpoints() ([]*Checkpoint, error)
func (*PostgresqlCheckpointRepository) QueryCheckpoints ¶
func (r *PostgresqlCheckpointRepository) QueryCheckpoints(query *CheckpointQuery) ([]*Checkpoint, error)
func (*PostgresqlCheckpointRepository) ResetAllCheckpoints ¶
func (r *PostgresqlCheckpointRepository) ResetAllCheckpoints(newCheckpointTime time.Time) error
func (*PostgresqlCheckpointRepository) ResetCheckpoints ¶
func (r *PostgresqlCheckpointRepository) ResetCheckpoints(request *ResetCheckpointsRequest) error
func (*PostgresqlCheckpointRepository) SetCheckpoint ¶
func (r *PostgresqlCheckpointRepository) SetCheckpoint(checkpoint *Checkpoint) error
type QueryCheckpointsRequest ¶
type QueryCheckpointsRequest struct {
CheckpointQuery
}
type QueryCheckpointsResult ¶
type QueryCheckpointsResult struct {
Checkpoints []*Checkpoint `json:"checkpoints"`
}
type ResetCheckpointsRequest ¶
type ResetCheckpointsRequest struct {
NewCheckpointTime time.Time `json:"newCheckpointTime"`
CheckpointQuery
}
Click to show internal directories.
Click to hide internal directories.