Documentation ¶
Index ¶
- Constants
- Variables
- func OptBuiltAt(t time.Time) func(*Core) error
- func OptCompilerOverride(s string) func(*Core) error
- func OptGitCommit(gitCommit string) func(*Core) error
- func OptGitTreeState(gitTreeState string) func(*Core) error
- func OptGitVersion(gitVersion semver.Version) func(*Core) error
- func OptGoVersionOverride(s string) func(*Core) error
- func OptPlatformOverride(s string) func(*Core) error
- type AuthMetadata
- type BuildInfo
- type Core
- func (c *Core) CreateWorkflow(ctx context.Context, s WorkflowSpec) (Workflow, error)
- func (c *Core) DeleteWorkflow(ctx context.Context, id string) (Workflow, error)
- func (c *Core) GetBuildInfo(ctx context.Context) (BuildInfo, error)
- func (c *Core) GetWorkflow(ctx context.Context, id string) (Workflow, error)
- func (c *Core) Viewer(ctx context.Context) (User, error)
- type IOFetcher
- type Job
- type JobOutputFetcher
- type JobPersister
- type JobsPage
- type PageArgs
- type PageInfo
- type Persister
- type Scheduler
- type User
- type Volume
- type VolumePersister
- type VolumeRequirement
- type VolumeType
- type VolumesPage
- type Workflow
- type WorkflowPersister
- type WorkflowSpec
- type WorkflowsPage
Constants ¶
const ( TypeEphemeral = "EPHEMERAL" TypePersistent = "PERSISTENT" )
Variables ¶
var ( // ErrNotAuthenticated is returned when authentication is required but not supplied. ErrNotAuthenticated = errors.New("not authenticated") )
Functions ¶
func OptBuiltAt ¶
OptBuiltAt sets the time the core was built at to t.
func OptCompilerOverride ¶
OptCompilerOverride overrides the compiler. This is not normally required, but can be useful during testing to ensure predictable build info.
func OptGitCommit ¶
OptGitCommit sets the git commit to s.
func OptGitTreeState ¶
OptGitTreeState sets the git tree state to s.
func OptGitVersion ¶
OptGitVersion sets the core version to v.
func OptGoVersionOverride ¶
OptGoVersionOverride overrides the Go version. This is not normally required, but can be useful during testing to ensure predictable build info.
func OptPlatformOverride ¶
OptPlatformOverride overrides the platform. This is not normally required, but can be useful during testing to ensure predictable build info.
Types ¶
type AuthMetadata ¶
type AuthMetadata struct { Issuer string `json:"issuer"` AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` JWKSURI string `json:"jwks_uri"` RegistrationEndpoint string `json:"registration_endpoint"` ScopesSupported []string `json:"scopes_supported"` ResponseTypesSupported []string `json:"response_types_supported"` ResponseModesSupported []string `json:"response_modes_supported"` GrantTypesSupported []string `json:"grant_types_supported"` TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` RevocationEndpoint string `json:"revocation_endpoint"` RevocationEndpointAuthMethodsSupported []string `json:"revocation_endpoint_auth_methods_supported"` IntrospectionEndpoint string `json:"introspection_endpoint"` IntrospectionEndpointAuthMethodsSupported []string `json:"introspection_endpoint_auth_methods_supported"` CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"` }
AuthMetadata contains metadata as defined in the OAuth 2.0 Authorization Server Metadata proposed standard (RFC 8414).
type BuildInfo ¶
type BuildInfo struct { GitVersion *semver.Version GitCommit *string GitTreeState *string BuiltAt *time.Time GoVersion string Compiler string Platform string }
BuildInfo contains build information about the core.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core represents core business logic.
func (*Core) CreateWorkflow ¶
CreateWorkflow creates a new workflow. If an ID is provided in w, it is ignored and replaced with a unique identifier in the returned workflow.
func (*Core) DeleteWorkflow ¶
DeleteWorkflow deletes a workflow by ID. If the supplied ID is not valid, or there there is not a workflow with a matching ID in the database, an error is returned.
func (*Core) GetBuildInfo ¶
GetBuildInfo returns build information about the core.
func (*Core) GetWorkflow ¶
GetWorkflow retrieves a workflow by ID. If the supplied ID is not valid, or there there is not a workflow with a matching ID in the database, an error is returned.
type IOFetcher ¶
type IOFetcher interface { JobOutputFetcher }
IOFetcher is the interface where IO data is retrieved.
type Job ¶
type Job struct { ID string `bson:"_id,omitempty"` CreatedAt time.Time `bson:"createdAt"` StartedAt *time.Time `bson:"startedAt,omitempty"` FinishedAt *time.Time `bson:"finishedAt,omitempty"` WorkflowID string `bson:"workflowID"` Name string `bson:"name"` Image string `bson:"image"` Command []string `bson:"command"` Status string `bson:"status"` ExitCode *int `bson:"exitCode,omitempty"` Requires []string `bson:"requires"` Volumes []VolumeRequirement `bson:"volumes"` // contains filtered or unexported fields }
Job contains information about an indivisual job.
type JobOutputFetcher ¶
JobOutputFetcher is the interface to fetch job output.
type JobPersister ¶
type JobPersister interface { CreateJob(context.Context, Job) (Job, error) DeleteJobsByWorkflowID(context.Context, string) error GetJobs(context.Context, PageArgs) (JobsPage, error) GetJobsByWorkflowID(context.Context, PageArgs, string) (JobsPage, error) GetJobsByID(context.Context, PageArgs, string, []string) (JobsPage, error) }
JobPersister is the interface by which jobs are persisted.
type JobsPage ¶
type JobsPage struct { Jobs []Job // Slice of results. PageInfo PageInfo // Information to aid in pagination. TotalCount int // Identifies the total count of items in the connection. }
JobsPage represents a page of jobs resulting from a query, and associated metadata.
type PageArgs ¶
type PageArgs struct { After *string // Select elements in the list that come after the specified cursor. Before *string // Select elements in the list that come before the specified cursor. First *int // Select the first n elements from the list. Last *int // Select the last n elements from the list. }
PageArgs contains criteria to select a page of results.
type PageInfo ¶
type PageInfo struct { StartCursor *string // When paginating backwards, the cursor to continue. EndCursor *string // When paginating forwards, the cursor to continue. HasNextPage bool // When paginating forwards, are there more items? HasPreviousPage bool // When paginating backwards, are there more items? }
PageInfo contains information to aid in pagination.
type Persister ¶
type Persister interface { WorkflowPersister JobPersister VolumePersister }
Persister is the interface by which all data is persisted.
type User ¶
type User struct { ID string `bson:"_id,omitempty"` // Unique user ID. Login string `bson:"login"` // The username used to login. // contains filtered or unexported fields }
User represents a user.
func (User) VolumesPage ¶
VolumesPage retrieves a page of volumes created by user u.
func (User) WorkflowsPage ¶
WorkflowsPage retrieves a page of workflows created by user u.
type Volume ¶
type Volume struct { ID string `bson:"_id,omitempty"` CreatedAt time.Time `bson:"createdAt"` WorkflowID string `bson:"workflowID"` Name string `bson:"name"` Type VolumeType `bson:"type"` // contains filtered or unexported fields }
Volume describes a storage volume.
type VolumePersister ¶
type VolumePersister interface { CreateVolume(context.Context, Volume) (Volume, error) DeleteVolumesByWorkflowID(context.Context, string) error GetVolumes(context.Context, PageArgs) (VolumesPage, error) GetVolumesByWorkflowID(context.Context, PageArgs, string) (VolumesPage, error) }
VolumePersister is the interface by which workflows are persisted.
type VolumeRequirement ¶
type VolumeRequirement struct { VolumeID string `bson:"volumeID"` Name string `bson:"name"` Location string `bson:"location"` }
VolumeRequirement describes a required volume.
type VolumeType ¶
type VolumeType string
func (VolumeType) String ¶
func (v VolumeType) String() string
type VolumesPage ¶
type VolumesPage struct { Volumes []Volume // Slice of results. PageInfo PageInfo // Information to aid in pagination. TotalCount int // Identifies the total count of items in the connection. }
VolumesPage represents a page of Volumes resulting from a query, and associated metadata.
type Workflow ¶
type Workflow struct { ID string `bson:"_id,omitempty"` CreatedAt time.Time `bson:"createdAt"` StartedAt *time.Time `bson:"startedAt,omitempty"` FinishedAt *time.Time `bson:"finishedAt,omitempty"` Name string `bson:"name"` Status string `bson:"status"` // contains filtered or unexported fields }
Workflow represents a workflow.
func (Workflow) VolumesPage ¶
VolumesPage retrieves a page of volumes related to workflow w.
type WorkflowPersister ¶
type WorkflowPersister interface { CreateWorkflow(context.Context, Workflow) (Workflow, error) DeleteWorkflow(context.Context, string) (Workflow, error) GetWorkflow(context.Context, string) (Workflow, error) GetWorkflows(context.Context, PageArgs) (WorkflowsPage, error) }
WorkflowPersister is the interface by which workflows are persisted.
type WorkflowSpec ¶
type WorkflowSpec struct { Name string `bson:"name"` Jobs []jobSpec `bson:"jobs"` Volumes *[]volumeSpec `bson:"volumes"` }
WorkflowSpec represents a workflow specification.
type WorkflowsPage ¶
type WorkflowsPage struct { Workflows []Workflow // Slice of results. PageInfo PageInfo // Information to aid in pagination. TotalCount int // Identifies the total count of items in the connection. }
WorkflowsPage represents a page of workflows resulting from a query, and associated metadata.