Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWrapper ¶
func NewWrapper(s Storer) *wrapper
Types ¶
type BackupDeleter ¶
type BackupGetter ¶
type BackupGetterDeleter ¶
type BackupGetterDeleter interface {
BackupGetter
BackupDeleter
}
type BackupGetterModelDeleter ¶
type BackupGetterModelDeleter interface {
BackupGetter
ModelDeleter
}
type BackupStorer ¶
type BackupStorer interface {
Storer
BackupWrapper
}
type BackupWrapper ¶
type BackupWrapper interface {
BackupGetterDeleter
GetBackups(
ctx context.Context,
filters ...FilterOption,
) ([]*backup.Backup, error)
}
type FilterOption ¶
type FilterOption func(*queryFilters)
func Service ¶
func Service(pst path.ServiceType) FilterOption
Service ensures the retrieved backups only match the specified service.
func Tags ¶
func Tags(m map[string]string) FilterOption
Tags ensures the retrieved backups carry every key/value pair in m, in addition to any other FilterOption supplied in the same call (all FilterOptions narrow the same underlying tag match; see populate). m is copied immediately, at call time, not read lazily when the returned FilterOption is later applied: the caller's map stays entirely theirs to mutate or discard afterwards with no effect on what this filter matches, and the FilterOption value itself is safe to keep and reuse.
This is the general-purpose counterpart to Service above: it accepts any caller-defined tag key, including the tenant/policy/object tags pkg/engine's callers use. Backups created through pkg/engine.Backup cannot have a tag here collide with the fork's own ServiceTag or BackupTypeTag - see BackupOperation.AdditionalTags - so combining Tags with Service in the same call is safe and meaningful.
type MetadataFile ¶
type MetadataFile struct {
Name string `json:"name"`
Path string `json:"path"`
Data any `json:"data"`
}
MetadataFile holds a standard representation of a metadata file. Primarily used for debugging purposes.
type ModelDeleter ¶
type Storer ¶
type Storer interface {
Delete(ctx context.Context, s model.Schema, id model.StableID) error
Get(ctx context.Context, s model.Schema, id model.StableID, data model.Model) error
GetIDsForType(ctx context.Context, s model.Schema, tags map[string]string) ([]*model.BaseModel, error)
GetWithModelStoreID(ctx context.Context, s model.Schema, id manifest.ID, data model.Model) error
Put(ctx context.Context, s model.Schema, m model.Model) error
Update(ctx context.Context, s model.Schema, m model.Model) error
ModelDeleter
}