Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RPCTimestampFromTime ¶
RPCTimestampFromTime takes a time.Time and returns an RPC timestamp
Types ¶
type APIKey ¶
type APIKey struct { ID uuid.UUID Created time.Time GitHubUser, Name, Description string ReadOnly bool }
APIKey models a user-created API key
type Build ¶
type Build struct { ID uuid.UUID Created, Updated, Completed time.Time GitHubRepo, GitHubRef string EncryptedGitHubCredential []byte ImageRepos []string Tags []string CommitSHATag bool BuildOptions *BuildOpts Request *furanrpc.BuildRequest Status BuildStatus Events []string }
func (*Build) CanAddEvent ¶
CanAddEvent indicates whether b is in a state where events can be added
func (*Build) EncryptAndSetGitHubCredential ¶
EncryptAndSetGitHubCredential takes a GitHub credential, encrypts it and sets EncryptedGitHubCredential accordingly
func (*Build) EventListenable ¶
EventListenable indicates where b is in a state where events can be listened for
func (*Build) GetGitHubCredential ¶
GetGitHubCredential returns the decrypted user token using key or error
type BuildManager ¶
type BuildManager interface { Start(ctx context.Context, opts *BuildOpts) error Run(ctx context.Context, id uuid.UUID) error }
BuildManager describes an object that manages builds
type BuildOpts ¶
type BuildOpts struct { BuildID uuid.UUID `json:"-"` ContextPath, CommitSHA string `json:"-"` // set by Builder RelativeDockerfilePath string `json:"relative_dockerfile_path"` DockerfileName string `json:"filename"` BuildArgs map[string]string `json:"build_args"` Cache *furanrpc.BuildCacheOpts `json:"cache_opts"` Resources *furanrpc.BuildResources `json:"resources"` }
BuildOpts models all options required to perform a build
type BuildStatus ¶
type BuildStatus int
const ( // BuildStatusUnknown Invalid or unknown status BuildStatusUnknown BuildStatus = iota // BuildStatusNotStarted Build has been requested but not started yet BuildStatusNotStarted // BuildStatusSkipped Build was requested but determined to be unnecessary BuildStatusSkipped // BuildStatusRunning Build is currently running in a k8s job BuildStatusRunning // BuildStatusFailure Build failed or internal error BuildStatusFailure // BuildStatusSuccess Build successfully completed & pushed BuildStatusSuccess // BuildStatusCancelRequested Build cancellation was requested but build has not yet aborted BuildStatusCancelRequested // BuildStatusCancelled Build was aborted due to cancellation request BuildStatusCancelled )
func BuildStatusFromState ¶
func BuildStatusFromState(s furanrpc.BuildState) BuildStatus
func (BuildStatus) State ¶
func (bs BuildStatus) State() furanrpc.BuildState
func (BuildStatus) String ¶
func (i BuildStatus) String() string
func (BuildStatus) TerminalState ¶
func (bs BuildStatus) TerminalState() bool
TerminalState returns whether the status is in a final (terminal) state that will not change
type CacheFetcher ¶
type CacheFetcher interface { // Fetch fetches the build cache for a build and returns a local filesystem // path where it was written. Caller is responsible for cleaning up the path when finished. Fetch(ctx context.Context, b *Build) (string, error) // Save persists the build cache for a build located at path. // Caller is responsible for cleaning up the path afterward. Save(ctx context.Context, b *Build, path string) error }
CacheFetcher describes an object that fetches and saves build cache
type CodeFetcher ¶
type CodeFetcher interface { GetCommitSHA(ctx context.Context, repo, ref string) (string, error) Fetch(ctx context.Context, repo, ref, destinationPath string) error }
CodeFetcher represents an object capable of fetching code
type Job ¶
type Job interface { // Error returns a channel that will contain any errors associated with this Job Error() chan error // Running returns a channel that signals that the build the Job is executing has been updated to status Running // This indicates that the Furan sidecar has started and is executing successfully and will take responsibility for // tracking the build status from this point forward Running() chan struct{} // Logs returns all pod logs associated with the Job Logs() (map[string]map[string][]byte, error) }
Job describes methods on a single abstract build job