git

package
v1.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAuth

WithAuth returns an option which configures the auth method used by the provided source.

func WithPollInterval

func WithPollInterval(tick time.Duration) containers.Option[Source]

WithPollInterval configures the interval in which origin is polled to discover any updates to the target reference.

func WithRef

func WithRef(ref string) containers.Option[Source]

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.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is an implementation of storage/fs.FSSource 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 NewSource

func NewSource(logger *zap.Logger, url string, opts ...containers.Option[Source]) (_ *Source, err error)

NewSource constructs and configures a Source. The source uses the connection and credential details provided to build fs.FS implementations around a target git repository.

func (*Source) Get

func (s *Source) Get() (fs.FS, error)

Get builds a new fs.FS based on the configure Git remote and reference.

func (*Source) String

func (*Source) String() string

String returns an identifier string for the store type.

func (*Source) Subscribe

func (s *Source) Subscribe(ctx context.Context, ch chan<- fs.FS)

Subscribe feeds gitfs implementations of fs.FS onto the provided channel. It blocks until the provided context is cancelled (it will be called in a goroutine). It closes the provided channel before it returns.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL