build

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 18 Imported by: 8

Documentation

Overview

Package build holds build package and artifact managment for robot.

Index

Constants

View Source
const (
	UnknownType = Type_UnknownType
	BuildBot    = Type_BuildBot
	User        = Type_User
	Local       = Type_Local
)

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, grpcServer *grpc.Server, store Store) error

Serve wraps a store in a grpc server.

Types

type ArtifactHandler

type ArtifactHandler func(context.Context, *Artifact) error

ArtifactHandler is a function used to consume a stream of Artifacts.

type PackageHandler

type PackageHandler func(context.Context, *Package) error

PackageHandler is a function used to consume a stream of Packages.

type Store

type Store interface {
	// SearchArtifacts delivers matching build artifacts to the supplied handler.
	SearchArtifacts(ctx context.Context, query *search.Query, handler ArtifactHandler) error

	// SearchPackages delivers matching build packages to the supplied handler.
	SearchPackages(ctx context.Context, query *search.Query, handler PackageHandler) error

	// SearchTracks delivers matching build tracks to the supplied handler.
	SearchTracks(ctx context.Context, query *search.Query, handler TrackHandler) error

	// Add adds a new build artifact to the store.
	Add(ctx context.Context, id string, info *Information) (string, bool, error)

	// UpdateTrack updates track information.
	UpdateTrack(ctx context.Context, track *Track) (*Track, error)

	// UpdatePackage updates package information.
	UpdatePackage(ctx context.Context, pkg *Package) (*Package, error)
}

Store is the abstract interface to the storage of build artifacts.

func NewLocal

func NewLocal(ctx context.Context, store *stash.Client, library record.Library) (Store, error)

NewLocal builds a new build artifact manager that persists its data in the supplied library, and the artifacts in the supplied stash.

func NewRemote

func NewRemote(ctx context.Context, conn *grpc.ClientConn) Store

NewRemote returns a Store that talks to a remote grpc build service.

type TrackHandler

type TrackHandler func(context.Context, *Track) error

TrackHandler is a function used to consume a stream of Tracks.

Jump to

Keyboard shortcuts

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