Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataStore ¶
type DataStore interface { // Name returns the name of the datastore type. Name() string // Reset clears the entire data store, both the schema and claims. // RH: ATTN: This method is useful for testing, but probably should not make it into production :) Reset() error // Schema returns the immutable data schema. Schema() model.Schema // AddLabelType creates a new label type definition in the data store. AddLabelType(labelType model.LabelType) error // AddClaimType create a new claim type definition in the data store. AddClaimType(model.ClaimType) error // AddClaim creates a new claim in the data store. AddClaim(claim model.Claim) error // GetClaim returns a single claim by id. // If the storage backend call is successful, but the claim doesn't exist, (nil, nil) is returned (so no error) GetClaim(id model.ClaimID) (model.Claim, error) // GetClaims returns an iterator over all claims in the data store, optionally filtered. // It returns a single-use iterator. GetClaims(filter *model.ClaimFilter) (iter.Seq[model.Claim], error) // SetLatestMigration sets the latest claim schema migration number applied SetLatestMigration(int, string) error // GetLatestMigration returns the latest claim schema migration number applied GetLatestMigration() (int, error) }
DataStore is the interface to persist (or not) claim schema and data.
Click to show internal directories.
Click to hide internal directories.