Documentation ¶
Index ¶
- Constants
- Variables
- func IfNoMatch(digest digest.Digest) containers.Option[FetchOptions]
- func WithCredentials(user, pass string) containers.Option[StoreOptions]
- func WithManifestVersion(version oras.PackManifestVersion) containers.Option[StoreOptions]
- type Bundle
- type FetchOptions
- type FetchResponse
- type File
- type FileInfo
- type Reference
- type Store
- func (s *Store) Build(ctx context.Context, src fs.FS, ref Reference) (Bundle, error)
- func (s *Store) Copy(ctx context.Context, src, dst Reference) (Bundle, error)
- func (s *Store) Fetch(ctx context.Context, ref Reference, opts ...containers.Option[FetchOptions]) (*FetchResponse, error)
- func (s *Store) List(ctx context.Context) (bundles []Bundle, _ error)
- type StoreOptions
Constants ¶
const ( SchemeHTTP = "http" SchemeHTTPS = "https" SchemeFlipt = "flipt" )
const ( // MediaTypeFliptFeatures is the OCI media type for a flipt features artifact MediaTypeFliptFeatures = "application/vnd.io.flipt.features.v1" // MediaTypeFliptNamespace is the OCI media type for a flipt features namespace artifact MediaTypeFliptNamespace = "application/vnd.io.flipt.features.namespace.v1" // AnnotationFliptNamespace is an OCI annotation key which identifies the namespace key // of the annotated flipt namespace artifact AnnotationFliptNamespace = "io.flipt.features.namespace" )
Variables ¶
var ( // ErrMissingMediaType is returned when a descriptor is presented // without a media type ErrMissingMediaType = errors.New("missing media type") // ErrUnexpectedMediaType is returned when an unexpected media type // is found on a target manifest or descriptor ErrUnexpectedMediaType = errors.New("unexpected media type") // ErrReferenceRequired is returned when a referenced is required for // a particular operation ErrReferenceRequired = errors.New("reference required") )
Functions ¶
func IfNoMatch ¶
func IfNoMatch(digest digest.Digest) containers.Option[FetchOptions]
IfNoMatch configures the call to Fetch to return early if the supplied digest matches the target manifest pointed at by the underlying reference This is a cache optimization to skip re-fetching resources if the contents has already been seen by the caller
func WithCredentials ¶
func WithCredentials(user, pass string) containers.Option[StoreOptions]
WithCredentials configures username and password credentials used for authenticating with remote registries
func WithManifestVersion ¶ added in v1.39.1
func WithManifestVersion(version oras.PackManifestVersion) containers.Option[StoreOptions]
WithManifestVersion configures what OCI Manifest version to build the bundle.
Types ¶
type FetchOptions ¶
type FetchOptions struct {
IfNoMatch digest.Digest
}
FetchOptions configures a call to Fetch
type FetchResponse ¶
FetchResponse contains any fetched files for the given tracked reference If Matched == true, then the supplied IfNoMatch digest matched and Files should be nil
type File ¶
type File struct { io.ReadCloser // contains filtered or unexported fields }
File is a wrapper around a flipt feature state files contents.
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
FileInfo describes a flipt features state file instance.
type Reference ¶
func ParseReference ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a type which can retrieve Flipt feature files from a target repository and reference Repositories can be local (OCI layout directories on the filesystem) or a remote registry
func NewStore ¶
func NewStore(logger *zap.Logger, dir string, opts ...containers.Option[StoreOptions]) (*Store, error)
NewStore constructs and configures an instance of *Store for the provided config
func (*Store) Build ¶
Build bundles the target directory Flipt feature state into the target configured on the Store It returns a Bundle which contains metadata regarding the resulting bundle details
func (*Store) Fetch ¶
func (s *Store) Fetch(ctx context.Context, ref Reference, opts ...containers.Option[FetchOptions]) (*FetchResponse, error)
Fetch retrieves the associated files for the tracked repository and reference It can optionally be configured to skip fetching given the caller has a digest that matches the current reference target
type StoreOptions ¶
type StoreOptions struct {
// contains filtered or unexported fields
}
StoreOptions are used to configure call to NewStore This shouldn't be handled directory, instead use one of the function options e.g. WithBundleDir or WithCredentials