adapters

package
v0.0.0-...-d3e8332 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const TFRunCollectionName = "deploymentRunTF"

TFRunCollectionName is mongodb collection name for Terraform Run

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgoWorkflowMediator

type ArgoWorkflowMediator struct {
	// contains filtered or unexported fields
}

ArgoWorkflowMediator is a client to interact with ArgoWorkflowMediator

func NewArgoWorkflowMediator

func NewArgoWorkflowMediator(conn *messaging2.StanConnection) ArgoWorkflowMediator

NewArgoWorkflowMediator creates a new ArgoWorkflowMediator

func (ArgoWorkflowMediator) Create

func (awm ArgoWorkflowMediator) Create(
	ctx context.Context,
	provider common.ID,
	username string,
	workflowFilename string,
	opts ...awmclient.AWMWorkflowCreateOpt) (awmProvider awmclient.AWMProvider, wfName string, err error)

Create perform sync workflow creation

func (ArgoWorkflowMediator) CreateAsync

func (awm ArgoWorkflowMediator) CreateAsync(
	provider common.ID,
	username string,
	workflowFilename string,
	opts ...awmclient.AWMWorkflowCreateOpt) error

CreateAsync perform async creation

type CredentialMicroservice

type CredentialMicroservice struct {
	// contains filtered or unexported fields
}

CredentialMicroservice ...

func NewCredentialMicroservice

func NewCredentialMicroservice(queryConn messaging2.QueryConnection) *CredentialMicroservice

NewCredentialMicroservice ...

func (CredentialMicroservice) Get

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

List returns a list of all credentials owned by a user.

func (CredentialMicroservice) ListPublicSSHKeys

func (c CredentialMicroservice) ListPublicSSHKeys(actor types.Actor, owner string) ([]service.CredentialModel, error)

ListPublicSSHKeys returns a list of all ssh credentials owned by a user.

type DeploymentMetadataService

type DeploymentMetadataService struct {
	// contains filtered or unexported fields
}

DeploymentMetadataService is a client to interact with deployment metadata service

func NewDeploymentMetadataService

func NewDeploymentMetadataService(conn messaging2.QueryConnection) DeploymentMetadataService

NewDeploymentMetadataService ...

func (DeploymentMetadataService) Get

Get fetches a deployment by ID

type DeploymentWorkflowStorage

type DeploymentWorkflowStorage struct {
	// contains filtered or unexported fields
}

DeploymentWorkflowStorage is a mongodb storage adapter for deployment workflow records

func NewDeploymentWorkflowStorage

func NewDeploymentWorkflowStorage(config db.MongoDBConfig) *DeploymentWorkflowStorage

NewDeploymentWorkflowStorage ...

func (DeploymentWorkflowStorage) CreateDeploymentDeletionWorkflow

func (storage DeploymentWorkflowStorage) CreateDeploymentDeletionWorkflow(deployment common.ID, templateType service.TemplateTypeName, awmProvider awmclient.AWMProvider, workflowName string) error

CreateDeploymentDeletionWorkflow inserts a workflow record for workflow that deletes deployment resource.

func (DeploymentWorkflowStorage) CreateDeploymentExecWorkflow

func (storage DeploymentWorkflowStorage) CreateDeploymentExecWorkflow(deployment common.ID, templateType service.TemplateTypeName, run common.ID, awmProvider awmclient.AWMProvider, workflowName string) error

CreateDeploymentExecWorkflow inserts a workflow record for workflow that executes the execution template.

func (DeploymentWorkflowStorage) CreateDeploymentPreflightWorkflow

func (storage DeploymentWorkflowStorage) CreateDeploymentPreflightWorkflow(deployment common.ID, templateType service.TemplateTypeName, run common.ID, awmProvider awmclient.AWMProvider, workflowName string) error

CreateDeploymentPreflightWorkflow inserts a workflow record for workflow that executes the prerequisite template.

func (DeploymentWorkflowStorage) CreatePrerequisiteDeletionWorkflow

func (storage DeploymentWorkflowStorage) CreatePrerequisiteDeletionWorkflow(deployment common.ID, templateType service.TemplateTypeName, awmProvider awmclient.AWMProvider, workflowName string) error

CreatePrerequisiteDeletionWorkflow inserts a workflow record for workflow that deletes prerequisite (resource provisioned for prerequisite template).

func (*DeploymentWorkflowStorage) Init

func (storage *DeploymentWorkflowStorage) Init() error

Init initialize the mongo connection

func (DeploymentWorkflowStorage) ListDeploymentDeletionWorkflows

func (storage DeploymentWorkflowStorage) ListDeploymentDeletionWorkflows(deploymentID common.ID) ([]types.DeploymentWorkflow, error)

ListDeploymentDeletionWorkflows ...

func (DeploymentWorkflowStorage) ListDeploymentRunWorkflows

func (storage DeploymentWorkflowStorage) ListDeploymentRunWorkflows(deploymentID common.ID, runID common.ID) ([]types.DeploymentWorkflow, error)

ListDeploymentRunWorkflows ...

func (DeploymentWorkflowStorage) Search

func (storage DeploymentWorkflowStorage) Search(provider awmclient.AWMProvider, workflowName string) (types.DeploymentWorkflow, error)

Search searches for a workflow record.

func (DeploymentWorkflowStorage) WorkflowFailedAt

func (storage DeploymentWorkflowStorage) WorkflowFailedAt(provider awmclient.AWMProvider, workflowName string, endsAt time.Time) error

WorkflowFailedAt update the workflow record to failed

func (DeploymentWorkflowStorage) WorkflowSucceededAt

func (storage DeploymentWorkflowStorage) WorkflowSucceededAt(provider awmclient.AWMProvider, workflowName string, endsAt time.Time) error

WorkflowSucceededAt update the workflow record to succeeded

type EncryptionKeyEnvVar

type EncryptionKeyEnvVar struct {
	// contains filtered or unexported fields
}

EncryptionKeyEnvVar reads base64 encoded encryption key from env var.

func NewEncryptionKeyEnvVar

func NewEncryptionKeyEnvVar(envVar string) *EncryptionKeyEnvVar

NewEncryptionKeyEnvVar ...

func (EncryptionKeyEnvVar) GetKey

func (e EncryptionKeyEnvVar) GetKey() []byte

GetKey ...

type EncryptionKeyFile

type EncryptionKeyFile struct {
	// contains filtered or unexported fields
}

EncryptionKeyFile reads encryption key from file.

func NewEncryptionKeyFile

func NewEncryptionKeyFile(filename string) *EncryptionKeyFile

NewEncryptionKeyFile ...

func (EncryptionKeyFile) GetKey

func (e EncryptionKeyFile) GetKey() []byte

GetKey ...

type Event

type Event cloudevents.Event

Event implements types.IncomingEvent & types.OutgoingEvent

func (Event) CloudEvent

func (e Event) CloudEvent() cloudevents.Event

CloudEvent returns the event as a cloudevent

func (Event) EventType

func (e Event) EventType() common.EventType

EventType returns the event type

func (Event) ToCloudEvent

func (e Event) ToCloudEvent(source string) (cloudevents.Event, error)

ToCloudEvent returns the event as a cloudevent with the specified source

func (Event) Transaction

func (e Event) Transaction() common.TransactionID

Transaction returns the transaction ID

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

Get fetch a provider by ID

func (ProviderMicroservice) List

List fetches a list of provider

type QueryAdapter

type QueryAdapter struct {
	// contains filtered or unexported fields
}

QueryAdapter is an adapter for NATS, implements ports.ReplySink and ports.QuerySrc

func NewQueryAdapter

func NewQueryAdapter(qc messaging2.QueryConnection) *QueryAdapter

NewQueryAdapter ...

func (*QueryAdapter) Start

func (a *QueryAdapter) Start(ctx context.Context, wg *sync.WaitGroup, handlers ports.QueryHandlers) error

Start ...

type SSHKeySrc

type SSHKeySrc struct {
	SSHKey string
}

SSHKeySrc stores the master SSH key that will be injected into users' VMs to provide CACAO access to users' VMs.

func (SSHKeySrc) GetPublicSSHKey

func (s SSHKeySrc) GetPublicSSHKey() string

GetPublicSSHKey ...

type StanAdapter

type StanAdapter struct {
	// contains filtered or unexported fields
}

StanAdapter is an adapter for STAN that does both publishing and subscription

func NewStanAdapter

func NewStanAdapter(conn messaging2.EventConnection) *StanAdapter

NewStanAdapter ...

func (*StanAdapter) SetHandlers

func (src *StanAdapter) SetHandlers(handlers ports.EventHandlers)

SetHandlers ...

func (*StanAdapter) Start

func (src *StanAdapter) Start(ctx context.Context, wg *sync.WaitGroup) error

Start starts STAN subscription and start receiving events

type StanAdapterOutgoing

type StanAdapterOutgoing struct {
	// contains filtered or unexported fields
}

StanAdapterOutgoing ...

func (StanAdapterOutgoing) EventDeploymentDeletionCleanupFailed

func (s StanAdapterOutgoing) EventDeploymentDeletionCleanupFailed(result deploymentevents.DeploymentDeletionCleanupResult)

EventDeploymentDeletionCleanupFailed ...

func (StanAdapterOutgoing) EventDeploymentDeletionCleanupStarted

func (s StanAdapterOutgoing) EventDeploymentDeletionCleanupStarted(started deploymentevents.DeploymentDeletionCleanupStarted)

EventDeploymentDeletionCleanupStarted ...

func (StanAdapterOutgoing) EventDeploymentDeletionCleanupSucceeded

func (s StanAdapterOutgoing) EventDeploymentDeletionCleanupSucceeded(result deploymentevents.DeploymentDeletionCleanupResult)

EventDeploymentDeletionCleanupSucceeded ...

func (StanAdapterOutgoing) EventRunExecutionFailed

func (s StanAdapterOutgoing) EventRunExecutionFailed(failed deploymentevents.RunExecutionFailed)

EventRunExecutionFailed ...

func (StanAdapterOutgoing) EventRunExecutionStarted

func (s StanAdapterOutgoing) EventRunExecutionStarted(started deploymentevents.RunExecutionStarted)

EventRunExecutionStarted ...

func (StanAdapterOutgoing) EventRunExecutionSucceeded

func (s StanAdapterOutgoing) EventRunExecutionSucceeded(succeeded deploymentevents.RunExecutionSucceeded)

EventRunExecutionSucceeded ...

func (StanAdapterOutgoing) EventRunPreflightFailed

func (s StanAdapterOutgoing) EventRunPreflightFailed(result deploymentevents.RunPreflightResult)

EventRunPreflightFailed ...

func (StanAdapterOutgoing) EventRunPreflightStartFailed

func (s StanAdapterOutgoing) EventRunPreflightStartFailed(failed deploymentevents.RunPreflightStartFailed)

EventRunPreflightStartFailed ...

func (StanAdapterOutgoing) EventRunPreflightStarted

func (s StanAdapterOutgoing) EventRunPreflightStarted(started deploymentevents.RunPreflightStarted)

EventRunPreflightStarted ...

func (StanAdapterOutgoing) EventRunPreflightSucceeded

func (s StanAdapterOutgoing) EventRunPreflightSucceeded(result deploymentevents.RunPreflightResult)

EventRunPreflightSucceeded ...

type TFRunMongoStorage

type TFRunMongoStorage struct {
	// contains filtered or unexported fields
}

TFRunMongoStorage is mongodb storage for Terraform Run

func NewTFRunMongoStorage

func NewTFRunMongoStorage(conf db.MongoDBConfig) *TFRunMongoStorage

NewTFRunMongoStorage ...

func (*TFRunMongoStorage) Close

func (storage *TFRunMongoStorage) Close() error

Close ...

func (TFRunMongoStorage) Create

func (storage TFRunMongoStorage) Create(run types.DeploymentRun) error

Create inserts a run

func (TFRunMongoStorage) Get

func (storage TFRunMongoStorage) Get(runID common.ID) (types.DeploymentRun, error)

Get fetches a run based on ID

func (*TFRunMongoStorage) Init

func (storage *TFRunMongoStorage) Init() error

Init initialize the mongo connection

func (TFRunMongoStorage) Search

Search ...

func (TFRunMongoStorage) Update

func (storage TFRunMongoStorage) Update(runID common.ID, update types.DeploymentRunUpdate, filter types.DeploymentRunFilter) (updated bool, err error)

Update ...

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) Get

Get fetches a template by ID

type UTCTimeSrc

type UTCTimeSrc struct {
}

UTCTimeSrc is a source of UTC time

func (UTCTimeSrc) Now

func (t UTCTimeSrc) Now() time.Time

Now ...

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

Get a workspace

Jump to

Keyboard shortcuts

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