ports

package
v0.0.0-...-e28bd7b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialMicroservice

type CredentialMicroservice interface {
	Get(actor service.Actor, owner, id string) (*service.CredentialModel, error)
	// List return a list of credential ID
	List(actor service.Actor, owner string) ([]service.CredentialModel, error)
}

CredentialMicroservice is an interface to interact with Credential service

type DeploymentMetadataService

type DeploymentMetadataService interface {
	Get(actor service.Actor, id common.ID) (service.Deployment, error)
}

DeploymentMetadataService ...

type EventSrc

type EventSrc interface {
	Init(config types.Config) error
	Start(ctx context.Context, wg *sync.WaitGroup, handlers IncomingEventHandlers) error
}

EventSrc is a sink to publish events into

type Git

type Git interface {
	// Clone clones the template from git, if template is private, gitCredential is required to clone the repo
	Clone(templateSrc service.TemplateSource, gitCredential *service.CredentialModel) (files []types.TemplateFile, commitHash string, err error)
}

Git ...

type IncomingEventHandlers

type IncomingEventHandlers interface {
	EventStartRunRequested(request deploymentevents.StartRunRequest, sink OutgoingEvents)    // deploymentevents.EventStartRunRequested
	DeploymentDeletionStarted(request service.DeploymentDeletionResult, sink OutgoingEvents) // service.DeploymentDeletionStarted
}

IncomingEventHandlers represents the handlers for all events that this service handles.

type K8S

type K8S interface {
	Ping(ctx context.Context, cfg *rest.Config) error
	Apply(ctx context.Context, cfg *rest.Config, templateFiles []types.TemplateFile) error
	Delete(ctx context.Context, cfg *rest.Config, templateFiles []types.TemplateFile) error
}

K8S ...

type K8SConnector

type K8SConnector interface {
	BuildConnection(config types.K8SConnectionConfig) (*rest.Config, io.Closer, error)
}

K8SConnector ...

type K8SRunStorage

type K8SRunStorage interface {
	Init() error
	Get(runID common.ID) (types.DeploymentRun, error)
	Create(run types.DeploymentRun) error
}

K8SRunStorage is storage for Terraform Run

type OutgoingEvents

type OutgoingEvents interface {
	EventRunPreflightStarted(deploymentevents.RunPreflightStarted)         // deploymentevents.EventRunPreflightStarted
	EventRunPreflightStartFailed(deploymentevents.RunPreflightStartFailed) // deploymentevents.EventRunPreflightStartFailed
	EventRunExecutionSucceeded(deploymentevents.RunExecutionSucceeded)     // deploymentevents.EventRunExecutionSucceeded
	EventRunExecutionFailed(deploymentevents.RunExecutionFailed)           // deploymentevents.EventRunExecutionFailed

	EventDeploymentDeletionCleanupSucceeded(deploymentevents.DeploymentDeletionCleanupResult) // deploymentevents.EventDeploymentDeletionCleanupSucceeded
	EventDeploymentDeletionCleanupFailed(deploymentevents.DeploymentDeletionCleanupResult)    // deploymentevents.EventDeploymentDeletionCleanupFailed
	EventDeploymentDeletionCleanupStarted(deploymentevents.DeploymentDeletionCleanupStarted)  // deploymentevents.EventDeploymentDeletionCleanupStarted
}

OutgoingEvents represents all outgoing events this service will publish

type Ports

type Ports struct {
	K8SRunStorage K8SRunStorage
	TimeSrc       TimeSrc
	SSHKeySrc     SSHKeySrc

	MetadataSvc  DeploymentMetadataService
	TemplateMS   TemplateMicroservice
	WorkspaceMS  WorkspaceMicroservice
	CredentialMS CredentialMicroservice
	ProviderMS   ProviderMicroservice
}

Ports contains a ref to most ports, this struct exist to ease passing dependency as parameter.

type ProviderMicroservice

type ProviderMicroservice interface {
	Get(actor service.Actor, id common.ID) (*service.ProviderModel, error)
	List(actor service.Actor) ([]service.ProviderModel, error)
}

ProviderMicroservice is an interface to interact with Provider service

type SSHKeySrc

type SSHKeySrc interface {
	GetPrivateSSHKey() string
}

SSHKeySrc is a way to get CACAO's private ssh key to ssh into a jump host that has access to user's k8s cluster.

type TemplateMicroservice

type TemplateMicroservice interface {
	Get(actor service.Actor, id common.ID) (service.Template, error)
}

TemplateMicroservice is an interface to interact with Template service

type TimeSrc

type TimeSrc interface {
	Now() time.Time
}

TimeSrc is a source of current time

type WorkspaceMicroservice

type WorkspaceMicroservice interface {
	Get(actor service.Actor, id common.ID) (*service.WorkspaceModel, error)
}

WorkspaceMicroservice is an interface to interact with Workspace service

Jump to

Keyboard shortcuts

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