zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/pkg/retention/types/types.go (about) 1 package types 2 3 import ( 4 "context" 5 "time" 6 7 ispec "github.com/opencontainers/image-spec/specs-go/v1" 8 9 mTypes "zotregistry.io/zot/pkg/meta/types" 10 ) 11 12 type Candidate struct { 13 DigestStr string 14 MediaType string 15 Tag string 16 PushTimestamp time.Time 17 PullTimestamp time.Time 18 RetainedBy string 19 } 20 21 type PolicyManager interface { 22 HasDeleteReferrer(repo string) bool 23 HasDeleteUntagged(repo string) bool 24 HasTagRetention(repo string) bool 25 GetRetainedTags(ctx context.Context, repoMeta mTypes.RepoMeta, index ispec.Index) []string 26 } 27 28 type Rule interface { 29 Name() string 30 Perform(candidates []*Candidate) []*Candidate 31 }