Documentation ¶
Index ¶
- Constants
- type CredentialMicroservice
- type MongoDeploymentRunStorage
- func (m MongoDeploymentRunStorage) BatchGet(runIDs []common.ID) ([]types.DeploymentRun, error)
- func (m MongoDeploymentRunStorage) Create(run types.DeploymentRun) (runID common.ID, err error)
- func (m MongoDeploymentRunStorage) Delete(runID common.ID) error
- func (m MongoDeploymentRunStorage) DeleteAllRunByDeployment(deployment common.ID) error
- func (m MongoDeploymentRunStorage) DeletePlaceholder(id common.ID) (bool, error)
- func (m MongoDeploymentRunStorage) Get(runID common.ID) (types.DeploymentRun, error)
- func (m MongoDeploymentRunStorage) GetLatestRun(deploymentID common.ID) (*types.DeploymentRun, error)
- func (m *MongoDeploymentRunStorage) Init() error
- func (m MongoDeploymentRunStorage) List(filter types.DeploymentRunFilter, pagination service.RequestPagination) ([]types.DeploymentRun, error)
- func (m MongoDeploymentRunStorage) Update(id common.ID, run types.DeploymentRunUpdate, filter types.DeploymentRunFilter) (bool, error)
- type MongoDeploymentStorage
- func (m MongoDeploymentStorage) Create(deployment types.Deployment) error
- func (m MongoDeploymentStorage) Delete(id common.ID) error
- func (m MongoDeploymentStorage) Get(id common.ID) (types.Deployment, error)
- func (m *MongoDeploymentStorage) Init() error
- func (m MongoDeploymentStorage) List(filters types.DeploymentFilter, offset int64, limit int64, ...) ([]types.Deployment, error)
- func (m MongoDeploymentStorage) Update(id common.ID, deployment types.DeploymentUpdate, filter types.DeploymentFilter) (bool, error)
- type NATSAdapter
- type NatsMock
- func (n *NatsMock) GetReply(subject string) *cloudevents.Event
- func (n *NatsMock) Init(messaging2.NatsConfig) error
- func (n *NatsMock) InitChannel(channel chan<- types.Query)
- func (n *NatsMock) PushMsg(ce cloudevents.Event)
- func (n *NatsMock) Reply(subject string, reply cloudevents.Event) error
- func (n *NatsMock) Start() error
- type ProviderMicroservice
- type Query
- type RequestStructTypes
- type StanAdapter
- type StanAdapterOutput
- func (s StanAdapterOutput) DeploymentCreateFailed(result service.DeploymentCreationResult)
- func (s StanAdapterOutput) DeploymentCreated(result service.DeploymentCreationResult)
- func (s StanAdapterOutput) DeploymentDeleteFailed(result service.DeploymentDeletionResult)
- func (s StanAdapterOutput) DeploymentDeleted(result service.DeploymentDeletionResult)
- func (s StanAdapterOutput) DeploymentDeletionStarted(result service.DeploymentDeletionResult)
- func (s StanAdapterOutput) DeploymentRunCreateFailed(result service.DeploymentCreateRunResult)
- func (s StanAdapterOutput) DeploymentRunCreated(result service.DeploymentCreateRunResult)
- func (s StanAdapterOutput) DeploymentUpdateFailed(result service.DeploymentUpdateResult)
- func (s StanAdapterOutput) DeploymentUpdated(result service.DeploymentUpdateResult)
- func (s StanAdapterOutput) EventDeploymentRunStatusUpdated(updated deploymentevents.DeploymentRunStatusUpdated)
- func (s StanAdapterOutput) EventStartRunRequested(request deploymentevents.StartRunRequest)
- type TemplateMicroservice
- type UTCTimeSrc
- type WorkspaceMicroservice
Constants ¶
const DeploymentRunCollection string = "deploymentRun"
DeploymentRunCollection is the mongo collection for storing deployment runs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialMicroservice ¶
type CredentialMicroservice struct {
// contains filtered or unexported fields
}
CredentialMicroservice ...
func NewCredentialMicroservice ¶
func NewCredentialMicroservice(queryConn messaging2.QueryConnection) *CredentialMicroservice
NewCredentialMicroservice ...
func (CredentialMicroservice) Get ¶
func (c CredentialMicroservice) Get(actor types.Actor, owner, id string) (*service.CredentialModel, error)
Get a credential by ID from credential microservice. Note: the combination of username and cred ID is unique. The ID alone is Not.
func (CredentialMicroservice) List ¶
func (c CredentialMicroservice) List(actor types.Actor, owner string) ([]service.CredentialModel, error)
List returns a list of all credentials owned by a user.
type MongoDeploymentRunStorage ¶
type MongoDeploymentRunStorage struct {
// contains filtered or unexported fields
}
MongoDeploymentRunStorage is a mongo storage for deployment run
func NewMongoDeploymentRunStorage ¶
func NewMongoDeploymentRunStorage(config db.MongoDBConfig) *MongoDeploymentRunStorage
NewMongoDeploymentRunStorage creates a new MongoDeploymentRunStorage
func (MongoDeploymentRunStorage) BatchGet ¶
func (m MongoDeploymentRunStorage) BatchGet(runIDs []common.ID) ([]types.DeploymentRun, error)
BatchGet get a list of deployment runs in batch
func (MongoDeploymentRunStorage) Create ¶
func (m MongoDeploymentRunStorage) Create(run types.DeploymentRun) (runID common.ID, err error)
Create creates a deployment run
func (MongoDeploymentRunStorage) Delete ¶
func (m MongoDeploymentRunStorage) Delete(runID common.ID) error
Delete deletes a deployment run by ID
func (MongoDeploymentRunStorage) DeleteAllRunByDeployment ¶
func (m MongoDeploymentRunStorage) DeleteAllRunByDeployment(deployment common.ID) error
DeleteAllRunByDeployment deletes all deployment run within a deployment. Note: this permanently remove the runs from the storage.
func (MongoDeploymentRunStorage) DeletePlaceholder ¶
func (m MongoDeploymentRunStorage) DeletePlaceholder(id common.ID) (bool, error)
DeletePlaceholder deletes a placeholder record for a pending run creation request.
func (MongoDeploymentRunStorage) Get ¶
func (m MongoDeploymentRunStorage) Get(runID common.ID) (types.DeploymentRun, error)
Get returns the deployment run with the specific ID
func (MongoDeploymentRunStorage) GetLatestRun ¶
func (m MongoDeploymentRunStorage) GetLatestRun(deploymentID common.ID) (*types.DeploymentRun, error)
GetLatestRun returns the latest deployment run of a deployment if any
func (*MongoDeploymentRunStorage) Init ¶
func (m *MongoDeploymentRunStorage) Init() error
Init initialize the mongo storage
func (MongoDeploymentRunStorage) List ¶
func (m MongoDeploymentRunStorage) List(filter types.DeploymentRunFilter, pagination service.RequestPagination) ([]types.DeploymentRun, error)
List return a list of deployment run with filter
func (MongoDeploymentRunStorage) Update ¶
func (m MongoDeploymentRunStorage) Update(id common.ID, run types.DeploymentRunUpdate, filter types.DeploymentRunFilter) (bool, error)
Update a deployment run.
type MongoDeploymentStorage ¶
type MongoDeploymentStorage struct {
// contains filtered or unexported fields
}
MongoDeploymentStorage is mongo storage for deployment object
func NewMongoDeploymentStorage ¶
func NewMongoDeploymentStorage(conf db.MongoDBConfig) *MongoDeploymentStorage
NewMongoDeploymentStorage creates a new MongoDeploymentStorage
func (MongoDeploymentStorage) Create ¶
func (m MongoDeploymentStorage) Create(deployment types.Deployment) error
Create creates a Deployment object in mongo. Validation should be performed by caller.
func (MongoDeploymentStorage) Delete ¶
func (m MongoDeploymentStorage) Delete(id common.ID) error
Delete deletes a deployment by its ID
func (MongoDeploymentStorage) Get ¶
func (m MongoDeploymentStorage) Get(id common.ID) (types.Deployment, error)
Get fetches a Deployment by its ID
func (*MongoDeploymentStorage) Init ¶
func (m *MongoDeploymentStorage) Init() error
Init establish connection to mongo
func (MongoDeploymentStorage) List ¶
func (m MongoDeploymentStorage) List(filters types.DeploymentFilter, offset int64, limit int64, sort types.DeploymentSort) ([]types.Deployment, error)
List returns a list of deployments with pagination (offet&limit), sort and filters
func (MongoDeploymentStorage) Update ¶
func (m MongoDeploymentStorage) Update(id common.ID, deployment types.DeploymentUpdate, filter types.DeploymentFilter) (bool, error)
Update updates a deployment with specified ID. Validation should be performed by caller.
type NATSAdapter ¶
type NATSAdapter struct {
// contains filtered or unexported fields
}
NATSAdapter is an adapter for NATS, implements ports.ReplySink and ports.QuerySrc
func (*NATSAdapter) Init ¶
func (adapter *NATSAdapter) Init(conf messaging2.NatsConfig) error
Init ...
func (*NATSAdapter) InitChannel ¶
func (adapter *NATSAdapter) InitChannel(chann chan<- types.Query)
InitChannel sets the query channel (where to send received query to)
func (*NATSAdapter) Reply ¶
func (adapter *NATSAdapter) Reply(subject string, reply cloudevents.Event) error
Reply sends a reply to the specified subject
type NatsMock ¶
type NatsMock struct {
// contains filtered or unexported fields
}
NatsMock is mock for NATS
func (*NatsMock) GetReply ¶
func (n *NatsMock) GetReply(subject string) *cloudevents.Event
GetReply will fetch a reply with the specified reply subject.
func (*NatsMock) InitChannel ¶
InitChannel ...
func (*NatsMock) PushMsg ¶
func (n *NatsMock) PushMsg(ce cloudevents.Event)
PushMsg push msg to incoming, which will be pushed to channel in Start()
type ProviderMicroservice ¶
type ProviderMicroservice struct {
// contains filtered or unexported fields
}
ProviderMicroservice is a client to provider microservice
func NewProviderMicroservice ¶
func NewProviderMicroservice(queryConn messaging2.QueryConnection) *ProviderMicroservice
NewProviderMicroservice ...
func (ProviderMicroservice) Get ¶
func (p ProviderMicroservice) Get(actor types.Actor, id common.ID) (*service.ProviderModel, error)
Get fetch a provider by ID
func (ProviderMicroservice) List ¶
func (p ProviderMicroservice) List(actor types.Actor) ([]service.ProviderModel, error)
List fetches a list of provider
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query implements the types.Query interface
func NewQuery ¶
func NewQuery(replySubject string, ce cloudevents.Event) Query
NewQuery creates a new query object
func (Query) ReplySubject ¶
ReplySubject returns the reply subject of the query
type RequestStructTypes ¶
type RequestStructTypes interface { service.DeploymentCreationRequest | service.DeploymentCreateRunRequest | service.DeploymentDeletionRequest | deploymentevents.RunPreflightStarted | deploymentevents.RunPreflightStartFailed | deploymentevents.RunPreflightResult | deploymentevents.RunExecutionSucceeded | deploymentevents.RunExecutionFailed | service.DeploymentUpdateRequest | deploymentevents.DeploymentDeletionCleanupResult }
RequestStructTypes is a type set that includes the struct that represents the body of the event this service is accepting.
type StanAdapter ¶
type StanAdapter struct {
// contains filtered or unexported fields
}
StanAdapter is an adapter that implements both EventSrc and EventSink
func NewStanAdapter ¶
func NewStanAdapter(conn messaging2.EventConnection) *StanAdapter
NewStanAdapter ...
func (*StanAdapter) Init ¶
func (s *StanAdapter) Init(config messaging2.NatsStanMsgConfig) error
Init initialize the STAN connection.
func (*StanAdapter) SetHandlers ¶
func (s *StanAdapter) SetHandlers(handlers ports.EventHandlers)
SetHandlers ...
type StanAdapterOutput ¶
type StanAdapterOutput struct {
// contains filtered or unexported fields
}
StanAdapterOutput is an adapter for the outgoing events
func (StanAdapterOutput) DeploymentCreateFailed ¶
func (s StanAdapterOutput) DeploymentCreateFailed(result service.DeploymentCreationResult)
DeploymentCreateFailed ...
func (StanAdapterOutput) DeploymentCreated ¶
func (s StanAdapterOutput) DeploymentCreated(result service.DeploymentCreationResult)
DeploymentCreated ...
func (StanAdapterOutput) DeploymentDeleteFailed ¶
func (s StanAdapterOutput) DeploymentDeleteFailed(result service.DeploymentDeletionResult)
DeploymentDeleteFailed ...
func (StanAdapterOutput) DeploymentDeleted ¶
func (s StanAdapterOutput) DeploymentDeleted(result service.DeploymentDeletionResult)
DeploymentDeleted ...
func (StanAdapterOutput) DeploymentDeletionStarted ¶
func (s StanAdapterOutput) DeploymentDeletionStarted(result service.DeploymentDeletionResult)
DeploymentDeletionStarted ...
func (StanAdapterOutput) DeploymentRunCreateFailed ¶
func (s StanAdapterOutput) DeploymentRunCreateFailed(result service.DeploymentCreateRunResult)
DeploymentRunCreateFailed ...
func (StanAdapterOutput) DeploymentRunCreated ¶
func (s StanAdapterOutput) DeploymentRunCreated(result service.DeploymentCreateRunResult)
DeploymentRunCreated ...
func (StanAdapterOutput) DeploymentUpdateFailed ¶
func (s StanAdapterOutput) DeploymentUpdateFailed(result service.DeploymentUpdateResult)
DeploymentUpdateFailed ...
func (StanAdapterOutput) DeploymentUpdated ¶
func (s StanAdapterOutput) DeploymentUpdated(result service.DeploymentUpdateResult)
DeploymentUpdated ...
func (StanAdapterOutput) EventDeploymentRunStatusUpdated ¶
func (s StanAdapterOutput) EventDeploymentRunStatusUpdated(updated deploymentevents.DeploymentRunStatusUpdated)
EventDeploymentRunStatusUpdated ...
func (StanAdapterOutput) EventStartRunRequested ¶
func (s StanAdapterOutput) EventStartRunRequested(request deploymentevents.StartRunRequest)
EventStartRunRequested publishes deploymentevents.EventStartRunRequested event. This event is to be consumed by a deployment execution service.
type TemplateMicroservice ¶
type TemplateMicroservice struct {
// contains filtered or unexported fields
}
TemplateMicroservice is a client for template microservice
func NewTemplateMicroservice ¶
func NewTemplateMicroservice(queryConn messaging2.QueryConnection) *TemplateMicroservice
NewTemplateMicroservice ...
func (TemplateMicroservice) GetTemplateType ¶
func (t TemplateMicroservice) GetTemplateType(actor types.Actor, templateTypeName service.TemplateTypeName) (service.TemplateType, error)
GetTemplateType fetches a template type by name
type WorkspaceMicroservice ¶
type WorkspaceMicroservice struct {
// contains filtered or unexported fields
}
WorkspaceMicroservice is a client to interact with Workspace microservice
func NewWorkspaceMicroservice ¶
func NewWorkspaceMicroservice(queryConn messaging2.QueryConnection) *WorkspaceMicroservice
NewWorkspaceMicroservice ...
func (WorkspaceMicroservice) Get ¶
func (w WorkspaceMicroservice) Get(actor types.Actor, id common.ID) (*service.WorkspaceModel, error)
Get a workspace