Documentation
¶
Overview ¶
Package source fetches the code that becomes a deployment from wherever it lives. A deployment used to require compose content in hand; a Provider turns a Descriptor (a git URL, an upload token, a webhook delivery) into a directory on disk. Providers register behind one interface so a new source is an added registration, not a change to the deploy flow, and no single source (git today) is special.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Descriptor ¶
Descriptor names a source and how to reach it. Params carries provider-specific options (branch, subpath, ...). Auth is resolved by the caller from the credential manager, so a provider never sees a raw credential id and the package stays free of any credential-store dependency.
type GitProvider ¶
type GitProvider struct{}
GitProvider fetches a source by shallow-cloning a git repository. It shells out to the git binary rather than embedding a git implementation, matching how the agent already drives docker and nftables.
func (GitProvider) Fetch ¶
func (GitProvider) Fetch(ctx context.Context, d Descriptor, destDir string, log func(string)) (*Result, error)
Fetch shallow-clones d.Ref into destDir. A branch and a subpath within the repository are honoured through d.Params. Private repositories authenticate with d.Auth, injected into the clone URL. The .git directory is removed so the deployment stays a plain directory of files with no VCS metadata.
func (GitProvider) Type ¶
func (GitProvider) Type() string
type Provider ¶
type Provider interface {
Type() string
Fetch(ctx context.Context, d Descriptor, destDir string, log func(string)) (*Result, error)
}
Provider fetches a source into destDir. log, when non-nil, receives progress lines (a provider must not send secrets through it). destDir is the provider's to populate; the caller owns creating and cleaning up its parent.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry resolves a source type to its provider.
func NewRegistry ¶
NewRegistry indexes the providers by their Type(). A later registration for the same type wins, which keeps the call site a plain list.