Documentation ¶
Index ¶
- Constants
- func WithAuth(auth transport.AuthMethod) containers.Option[SnapshotStore]
- func WithCABundle(caCertBytes []byte) containers.Option[SnapshotStore]
- func WithDirectory(directory string) containers.Option[SnapshotStore]
- func WithFilesystemStorage(path string) containers.Option[SnapshotStore]
- func WithInsecureTLS(insecureSkipTLS bool) containers.Option[SnapshotStore]
- func WithPollOptions(opts ...containers.Option[storagefs.Poller]) containers.Option[SnapshotStore]
- func WithRef(ref string) containers.Option[SnapshotStore]
- func WithSemverResolver() containers.Option[SnapshotStore]
- type SnapshotStore
Constants ¶
const REFERENCE_CACHE_EXTRA_CAPACITY = 3
REFERENCE_CACHE_EXTRA_CAPACITY is the additionally capacity reserved in the cache for non-default references
Variables ¶
This section is empty.
Functions ¶
func WithAuth ¶
func WithAuth(auth transport.AuthMethod) containers.Option[SnapshotStore]
WithAuth returns an option which configures the auth method used by the provided source.
func WithCABundle ¶ added in v1.32.0
func WithCABundle(caCertBytes []byte) containers.Option[SnapshotStore]
WithCABundle returns an option which configures the CA Bundle used for validating the TLS connection to the provided source.
func WithDirectory ¶ added in v1.40.0
func WithDirectory(directory string) containers.Option[SnapshotStore]
WithDirectory sets a root directory which the store will walk from to discover feature flag state files.
func WithFilesystemStorage ¶ added in v1.43.0
func WithFilesystemStorage(path string) containers.Option[SnapshotStore]
WithFilesystemStorage configures the Git repository to clone into the local filesystem, instead of the default which is in-memory. The provided path is location for the dotgit folder.
func WithInsecureTLS ¶ added in v1.32.0
func WithInsecureTLS(insecureSkipTLS bool) containers.Option[SnapshotStore]
WithInsecureTLS returns an option which configures the insecure TLS setting for the provided source.
func WithPollOptions ¶ added in v1.34.0
func WithPollOptions(opts ...containers.Option[storagefs.Poller]) containers.Option[SnapshotStore]
WithPollOptions configures the poller used to trigger update procedures
func WithRef ¶
func WithRef(ref string) containers.Option[SnapshotStore]
WithRef configures the target reference to be used when fetching and building fs.FS implementations. If it is a valid hash, then the fixed SHA value is used. Otherwise, it is treated as a reference in the origin upstream.
func WithSemverResolver ¶ added in v1.42.1
func WithSemverResolver() containers.Option[SnapshotStore]
WithSemverResolver configures how the reference will be resolved for the repository.
Types ¶
type SnapshotStore ¶ added in v1.34.0
SnapshotStore is an implementation of storage.SnapshotStore This implementation is backed by a Git repository and it tracks an upstream reference. When subscribing to this source, the upstream reference is tracked by polling the upstream on a configurable interval.
func NewSnapshotStore ¶ added in v1.34.0
func NewSnapshotStore(ctx context.Context, logger *zap.Logger, url string, opts ...containers.Option[SnapshotStore]) (_ *SnapshotStore, err error)
NewSnapshotStore constructs and configures a Store. The store uses the connection and credential details provided to build fs.FS implementations around a target git repository.
func (*SnapshotStore) String ¶ added in v1.34.0
func (*SnapshotStore) String() string
String returns an identifier string for the store type.
func (*SnapshotStore) View ¶ added in v1.34.0
func (s *SnapshotStore) View(ctx context.Context, storeRef storage.Reference, fn func(storage.ReadOnlyStore) error) error
View accepts a function which takes a *StoreSnapshot. It supplies the provided function with a *Snapshot if one can be resolved for the requested revision reference. Providing an empty reference defaults View to using the stores base reference. The base reference will always be quickly accessible via minimal locking (single read-lock). Alternative references which have not yet been observed will be resolved and newly built into snapshots on demand.