Documentation ¶
Index ¶
- func BuildJob(reqBytes []byte, natsInfo map[string]string)
- func BuildStart(reqBytes []byte, natsInfo map[string]string)
- func GetBuild(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func GetBuildsForUser(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func GetResources(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func GetRunner(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func GetRunnersForUser(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func InitMongoDB(name, address string) error
- func PleoDelete(reqBytes []byte, natsInfo map[string]string)
- func PleoRun(reqBytes []byte, natsInfo map[string]string)
- func UpdateRunner(reqBytes []byte, natsInfo map[string]string)
- func WorkflowDefinitionCreate(msg *stan.Msg)
- type Build
- type BuildConditionType
- type DB
- func (d DB) Delete(document common.CacaoBase) error
- func (d DB) GetBuild(ID, owner string) (*Build, error)
- func (d DB) GetBuildsForUser(owner string) (builds []Build, err error)
- func (d DB) GetRunner(ID, owner string) (*Runner, error)
- func (d DB) GetRunnersForUser(owner string) (runners []Runner, err error)
- func (d DB) Save(document common.CacaoBase) error
- type MonitoredResource
- type Request
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStart ¶
BuildStart persists a WorkflowDefinition Build in the database
func GetBuild ¶
GetBuild will return the Build from MongoDB with the information tying it to a WorkflowDefinition
func GetBuildsForUser ¶
GetBuildsForUser will return all Builds from MongoDB with information tying them to WorkflowDefinitions
func GetResources ¶
GetResources ...
func GetRunner ¶
GetRunner will return the Runner from MongoDB with the information tying it to a WorkflowDefinition
func GetRunnersForUser ¶
GetRunnersForUser will return all Runners from MongoDB with information tying them to WorkflowDefinitions
func InitMongoDB ¶
InitMongoDB will initialize the connection to the database
func UpdateRunner ¶
UpdateRunner is used to add the TCPPort NodePort to the Runner after it is created
func WorkflowDefinitionCreate ¶
func WorkflowDefinitionCreate(msg *stan.Msg)
WorkflowDefinitionCreate logs when a WorkflowDefinition is created
Types ¶
type Build ¶
type Build struct { Condition BuildConditionType `bson:"condition" json:"condition"` MonitoredResource `bson:",inline"` RunAfterBuild bool `json:"run"` // RunID should only be populated if RunAfterBuild is true RunID string `bson:"runid" json:"runid"` }
Build represents a request to build the necessary Docker image(s) for a WorkflowDefinition
func NewBuild ¶
NewBuild accepts a Request and uses it to populate a Build. The Condition field is set to BuildPending.
func (Build) GetCollection ¶
GetCollection returns the MongoDB collection in which Builds should be stored.
type BuildConditionType ¶
type BuildConditionType string
BuildConditionType is a string that represents the state of a Build.
const ( // BuildComplete means the build has completed successfully. BuildComplete BuildConditionType = "Complete" // BuildFailed means the build has failed. BuildFailed BuildConditionType = "Failed" // BuildPending means the build is still in progress. BuildPending BuildConditionType = "Pending" )
These are valid conditions of a build.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB struct is a wrapper around the CRUD adapter for Phylax related types.
func (DB) GetBuildsForUser ¶
GetBuildsForUser ...
func (DB) GetRunnersForUser ¶
GetRunnersForUser ...
type MonitoredResource ¶
type MonitoredResource struct { ID string `bson:"_id" json:"id"` Owner string `bson:"owner" json:"owner"` StartDate time.Time `bson:"startdate" json:"startdate"` EndDate time.Time `bson:"enddate" json:"enddate"` WorkflowDefinitionID string `bson:"workflowdefinitionid" json:"workflowdefinitionid"` ResourceName string `bson:"resourcename" json:"resourcename"` Cluster common.Cluster `json:"cluster"` Namespace string `bson:"namespace" json:"namespace"` }
MonitoredResource comprises the fields that are common among resources that Phylax monitors (e.g. Runners, Builds)
func (*MonitoredResource) Populate ¶
func (m *MonitoredResource) Populate(request Request) error
Populate accepts a phylax.Request and uses it to populate the fields of a MonitoredResource
type Request ¶
type Request struct { common.BasicRequest RunAfterBuild bool `json:"run"` TCPPorts []core.ServicePort `json:"tcp_ports,omitempty"` HTTPPorts []core.ServicePort `json:"http_ports,omitempty"` Namespace string `json:"namespace,omitempty"` AuthDisabled bool `json:"auth_disabled,omitempty"` WorkflowDefinition struct { Name string `json:"name,omitempty"` Type string `bson:"type" json:"type,omitempty" yaml:"type"` TCPPorts []core.ServicePort `json:"tcp_ports,omitempty"` Repository common.Repository `json:"repository"` } `json:"data,omitempty"` }
Request is a struct containing the necessary fields for all Phylax operations coming from the API
type Runner ¶
type Runner struct { MonitoredResource `bson:",inline"` TCPPorts []core.ServicePort `bson:"tcp_ports" json:"tcp_ports"` HTTPPorts []core.ServicePort `bson:"http_ports" json:"http_ports"` AuthDisabled bool `bson:"auth_disabled" json:"auth_disabled"` }
Runner contains the necessary information to link objects in K8s to the WorkflowDefinition they originate from
func NewRunner ¶
NewRunner populates a Runner from a phylax.Request and returns a pointer to it and an error if anything goes wrong
func (Runner) GetCollection ¶
GetCollection returns the MongoDB collection in which Runners should be stored.
func (*Runner) GetRedacted ¶
GetRedacted will return a new Runner with the cluster config removed