Documentation ¶
Index ¶
- Constants
- type Rater
- type RaterImpl
- func (r *RaterImpl) AddRevision(ctx context.Context, ds model.DataSet, effectiveBlockNumber int64) (bool, error)
- func (r *RaterImpl) AddRevocation(ctx context.Context, rid string) error
- func (r *RaterImpl) Head(ctx context.Context) string
- func (r *RaterImpl) HeadAt(ctx context.Context, blockID int64) string
- type Revision
- type RevisionStore
Constants ¶
View Source
const (
NoBlockNumber int64 = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rater ¶
type Rater interface { AddRevision(ctx context.Context, ds model.DataSet, effectiveBlockNumber int64) (bool, error) AddRevocation(ctx context.Context, rid string) error Head(ctx context.Context) string HeadAt(ctx context.Context, blockID int64) string }
Rater is an interface to PRV21 rating algorithm. It can be used by a custom index to algorithmically identify the "current" revision of the given variant, as well as its current revision at a given block height.
func NewRater ¶
func NewRater(variantID string, store RevisionStore) Rater
type RaterImpl ¶
type RaterImpl struct {
// contains filtered or unexported fields
}
func (*RaterImpl) AddRevision ¶
func (*RaterImpl) AddRevocation ¶
type RevisionStore ¶
type RevisionStore interface { Head(ctx context.Context, variantID string) (Revision, error) HeadAt(ctx context.Context, variantID string, blockNumber int64) (Revision, error) Revision(ctx context.Context, rid string) (Revision, error) CreateRevision(ctx context.Context, ds model.DataSet, effectiveBlockNumber int64, headFrom, headTo int64) error UpdateRevision(ctx context.Context, rid string, status model.RecordStatus, headFrom, headTo int64) error RevokeRevision(ctx context.Context, rid string) error SaveRevokedRevision(ctx context.Context, ds model.DataSet, effectiveBlockNumber int64) error DataSet(ctx context.Context, rid string) (model.DataSet, error) }
Click to show internal directories.
Click to hide internal directories.