Documentation ¶
Overview ¶
Package storage defines shared types and interfaces for storage.
Index ¶
- Variables
- type DeclarationAPIRetriever
- type DeclarationAPIStorage
- type DeclarationDeleter
- type DeclarationRetriever
- type DeclarationSetRetriever
- type DeclarationStorer
- type DeclarationsRetriever
- type EnrollmentDeclarationStorage
- type EnrollmentIDRetriever
- type EnrollmentSetRemover
- type EnrollmentSetStorage
- type EnrollmentSetStorer
- type EnrollmentSetsRetriever
- type SetDeclarationRemover
- type SetDeclarationStorage
- type SetDeclarationStorer
- type SetDeclarationsRetriever
- type SetRetreiver
- type StatusAPIStorage
- type StatusDeclarationsRetriever
- type StatusError
- type StatusErrorsRetriever
- type StatusReportQuery
- type StatusReportRetriever
- type StatusStorer
- type StatusValue
- type StatusValuesRetriever
- type StoredStatusReport
- type TokensDeclarationItemsRetriever
- type TokensJSONRetriever
- type Toucher
Constants ¶
This section is empty.
Variables ¶
var ( ErrStatusReportNotFound = errors.New("status report not found") ErrDeclarationNotFound = errors.New("declaration not found") )
Functions ¶
This section is empty.
Types ¶
type DeclarationAPIRetriever ¶ added in v0.4.0
type DeclarationAPIRetriever interface { // RetrieveDeclaration retrieves a declaration from storage. RetrieveDeclaration(ctx context.Context, declarationID string) (*ddm.Declaration, error) // RetrieveDeclarationModTime retrieves the last modification time of the declaration. RetrieveDeclarationModTime(ctx context.Context, declarationID string) (time.Time, error) }
type DeclarationAPIStorage ¶ added in v0.4.0
type DeclarationAPIStorage interface { Toucher DeclarationStorer DeclarationDeleter DeclarationAPIRetriever DeclarationsRetriever }
DeclarationAPIStorage are storage interfaces relating to declarations.
type DeclarationDeleter ¶ added in v0.4.0
type DeclarationDeleter interface { // DeleteDeclaration deletes a declaration. // If the declaration was deleted true should be returned. // // Implementations should return an error if there are declarations // that depend on it or if the declaration is associated with a set. DeleteDeclaration(ctx context.Context, declarationID string) (bool, error) }
type DeclarationRetriever ¶ added in v0.4.0
type DeclarationRetriever interface { // RetrieveEnrollmentDeclarationJSON fetches the JSON for a declaration for an enrollment ID. // This is part of the core DDM protocol for handling declarations for enrollments. RetrieveEnrollmentDeclarationJSON(ctx context.Context, declarationID, declarationType, enrollmentID string) ([]byte, error) }
type DeclarationSetRetriever ¶ added in v0.4.0
type DeclarationStorer ¶ added in v0.4.0
type DeclarationStorer interface { // StoreDeclaration stores a declaration. // If the declaration is new or has changed true should be returned. // // Note that a storage backend may try to create relations // based on the the ddm.IdentifierRefs field. StoreDeclaration(ctx context.Context, d *ddm.Declaration) (bool, error) }
type DeclarationsRetriever ¶ added in v0.4.0
type EnrollmentDeclarationStorage ¶ added in v0.4.0
type EnrollmentDeclarationStorage interface { TokensDeclarationItemsRetriever DeclarationRetriever }
EnrollmentDeclarationStorage is the storage required to support declarations in the DDM protocol. This is part of the core DDM protocol for handling declarations for enrollments.
type EnrollmentIDRetriever ¶ added in v0.4.0
type EnrollmentIDRetriever interface { // RetrieveEnrollmentIDs retrieves MDM enrollment IDs from storage. // In the case of sets and declarations the transitive associations // are traversed to try and collect the IDs. When multiple slices // are given they should be treated like a logical or (i.e. finding // all enrollment IDs for any of the given slices). // Warning: the results may be very large for e.g. sets (or, transitively, // declarations) that are assigned to many enrollment IDs. RetrieveEnrollmentIDs(ctx context.Context, declarations []string, sets []string, ids []string) ([]string, error) }
type EnrollmentSetRemover ¶ added in v0.4.0
type EnrollmentSetStorage ¶ added in v0.4.0
type EnrollmentSetStorage interface { EnrollmentSetsRetriever EnrollmentSetStorer EnrollmentSetRemover }
EnrollmentSetStorage are storage interfaces related to MDM enrollment IDs.
type EnrollmentSetStorer ¶ added in v0.4.0
type EnrollmentSetsRetriever ¶ added in v0.4.0
type SetDeclarationRemover ¶ added in v0.4.0
type SetDeclarationRemover interface { // StoreSetDeclaration dissociates setName and declarationID. // If the association is removed true should be returned. // It should not be an error if the association does not exist. RemoveSetDeclaration(ctx context.Context, setName, declarationID string) (bool, error) }
type SetDeclarationStorage ¶ added in v0.4.0
type SetDeclarationStorage interface { DeclarationSetRetriever SetDeclarationsRetriever SetDeclarationStorer SetDeclarationRemover }
SetStorage are storage interfaces related to sets.
type SetDeclarationStorer ¶ added in v0.4.0
type SetDeclarationStorer interface { // StoreSetDeclaration associates setName and declarationID. // If the association is created true should be returned. // It should not be an error if the association does not exist. StoreSetDeclaration(ctx context.Context, setName, declarationID string) (bool, error) }
type SetDeclarationsRetriever ¶ added in v0.4.0
type SetRetreiver ¶ added in v0.4.0
type StatusAPIStorage ¶ added in v0.4.0
type StatusAPIStorage interface { StatusDeclarationsRetriever StatusErrorsRetriever StatusValuesRetriever StatusReportRetriever }
StatusAPIStorage are storage interfaces related to retrieving status channel data.
type StatusDeclarationsRetriever ¶ added in v0.4.0
type StatusError ¶
type StatusErrorsRetriever ¶ added in v0.4.0
type StatusReportQuery ¶ added in v0.4.0
StatusReportQuery specifies search criteria for finding specific status reports for enrollments.
func (StatusReportQuery) Valid ¶ added in v0.4.0
func (q StatusReportQuery) Valid() error
Valid performs basic sanity checks for querying for status reports.
type StatusReportRetriever ¶ added in v0.4.0
type StatusReportRetriever interface {
RetrieveStatusReport(ctx context.Context, q StatusReportQuery) (*StoredStatusReport, error)
}
type StatusStorer ¶ added in v0.4.0
type StatusValue ¶
type StatusValuesRetriever ¶ added in v0.4.0
type StoredStatusReport ¶ added in v0.4.0
type StoredStatusReport struct { Raw []byte // the raw JSON bytes of the status report Timestamp time.Time // the date the status report was saved StatusID string // optional unique identifier of report. defined when report was saved. Index int // optional "index" for this enrollment's status reports. }
StoredStatusReport represents a stored status report by StoreDeclarationStatus.
type TokensDeclarationItemsRetriever ¶ added in v0.4.0
type TokensDeclarationItemsRetriever interface { // RetrieveDeclarationItemsJSON returns the declaration items JSON for enrollmentID. // This is part of the core DDM protocol for handling declarations for enrollments. RetrieveDeclarationItemsJSON(ctx context.Context, enrollmentID string) ([]byte, error) TokensJSONRetriever }