child

package
v0.0.0-...-431bee0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShortRevNoMatch = errors.New("Revision ID does not match provided regular expression")

ErrShortRevNoMatch is returned by ShortRev when the revision ID does not match the regular expression.

Functions

func CIPDInstanceToRevision

func CIPDInstanceToRevision(name string, instance *cipd_api.InstanceDescription, revisionIdTag string, revisionIdTagStripKey bool) (*revision.Revision, error)

CIPDInstanceToRevision creates a revision.Revision based on the given InstanceInfo.

func NewSemVerGCS

func NewSemVerGCS(ctx context.Context, c *config.SemVerGCSChildConfig, reg *config_vars.Registry, client *http.Client) (*gcsChild, error)

NewSemVerGCS returns a Child which uses semantic versioning to compare object versions in GCS.

func ShortRev

func ShortRev(reTmpl string, id string) (string, error)

ShortRev shortens the revision ID using the given regular expression.

Types

type CIPDChild

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

CIPDChild is an implementation of Child which deals with a CIPD package.

func NewCIPD

func NewCIPD(ctx context.Context, c *config.CIPDChildConfig, reg *config_vars.Registry, client *http.Client, workdir string) (*CIPDChild, error)

NewCIPD returns an implementation of Child which deals with a CIPD package. If the caller calls CIPDChild.Download, the destination must be a descendant of the provided workdir.

func (*CIPDChild) GetRevision

func (c *CIPDChild) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision implements Child.

func (*CIPDChild) LogRevisions

func (c *CIPDChild) LogRevisions(ctx context.Context, from, to *revision.Revision) ([]*revision.Revision, error)

LogRevisions implements Child.

func (*CIPDChild) SetClientForTesting

func (c *CIPDChild) SetClientForTesting(client cipd.CIPDClient)

SetClientForTesting sets the CIPDClient used by the CIPDChild so that it can be overridden for testing.

func (*CIPDChild) Update

func (c *CIPDChild) Update(ctx context.Context, lastRollRev *revision.Revision) (*revision.Revision, []*revision.Revision, error)

Update implements Child. Note: that this just finds the newest version of the CIPD package.

func (*CIPDChild) VFS

func (c *CIPDChild) VFS(ctx context.Context, rev *revision.Revision) (vfs.FS, error)

VFS implements the Child interface.

type Child

type Child interface {
	// Update updates the local view of the Child and returns the tip-of-
	// tree Revision and the list of not-yet-rolled revisions, or any error
	// which occurred, given the last-rolled revision.
	Update(context.Context, *revision.Revision) (*revision.Revision, []*revision.Revision, error)

	// GetRevision returns a Revision instance associated with the given
	// revision ID.
	GetRevision(context.Context, string) (*revision.Revision, error)

	// LogRevisions returns a list of Revision instances between two revisions.
	LogRevisions(context.Context, *revision.Revision, *revision.Revision) ([]*revision.Revision, error)

	// VFS returns a vfs.FS instance which reads from this Child at the given
	// Revision.
	VFS(context.Context, *revision.Revision) (vfs.FS, error)
}

Child represents a Child (git repo or otherwise) which can be rolled into a Parent.

func NewGitiles

func NewGitiles(ctx context.Context, c *config.GitilesChildConfig, reg *config_vars.Registry, client *http.Client) (Child, error)

NewGitiles returns an implementation of Child which uses Gitiles rather than a local checkout.

type DockerChild

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

DockerChild is an implementation of Child which deals with Docker images.

func NewDocker

NewDocker returns an implementation of Child which deals with Docker images.

func (*DockerChild) GetRevision

func (c *DockerChild) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision implements Child.

func (*DockerChild) LogRevisions

func (c *DockerChild) LogRevisions(ctx context.Context, from, to *revision.Revision) ([]*revision.Revision, error)

LogRevisions implements Child.

func (*DockerChild) Update

func (c *DockerChild) Update(ctx context.Context, lastRollRev *revision.Revision) (*revision.Revision, []*revision.Revision, error)

Update implements Child.

func (*DockerChild) VFS

func (c *DockerChild) VFS(ctx context.Context, rev *revision.Revision) (vfs.FS, error)

VFS implements the Child interface.

type FuchsiaSDKChild

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

FuchsiaSDKChild is an implementation of Child which deals with the Fuchsia SDK.

func NewFuchsiaSDK

func NewFuchsiaSDK(ctx context.Context, c *config.FuchsiaSDKChildConfig, client *http.Client) (*FuchsiaSDKChild, error)

NewFuchsiaSDK returns a Child implementation which deals with the Fuchsia SDK.

func (*FuchsiaSDKChild) GetRevision

func (c *FuchsiaSDKChild) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision implements Child.

func (*FuchsiaSDKChild) LogRevisions

func (c *FuchsiaSDKChild) LogRevisions(ctx context.Context, from, to *revision.Revision) ([]*revision.Revision, error)

LogRevisions implements Child.

func (*FuchsiaSDKChild) Update

func (c *FuchsiaSDKChild) Update(ctx context.Context, lastRollRev *revision.Revision) (*revision.Revision, []*revision.Revision, error)

Update implements Child.

func (*FuchsiaSDKChild) VFS

func (c *FuchsiaSDKChild) VFS(ctx context.Context, rev *revision.Revision) (vfs.FS, error)

VFS implements the Child interface.

type GitCheckoutChild

type GitCheckoutChild struct {
	*git_common.Checkout
}

GitCheckoutChild is an implementation of Child which uses a local Git checkout.

func NewGitCheckout

NewGitCheckout returns an implementation of Child which uses a local Git checkout.

func (*GitCheckoutChild) Update

Update implements Child.

func (*GitCheckoutChild) VFS

VFS implements the Child interface.

type GitCheckoutGithubChild

type GitCheckoutGithubChild struct {
	*GitCheckoutChild
	// contains filtered or unexported fields
}

GitCheckoutGithubChild is an implementation of Child which uses a local Git checkout of a Github repo.

func NewGitCheckoutGithub

NewGitCheckoutGithub returns an implementation of Child which uses a local Git checkout of a Github repo.

func (*GitCheckoutGithubChild) GetRevision

func (c *GitCheckoutGithubChild) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision implements Child.

func (*GitCheckoutGithubChild) Update

Update implements Child.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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