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

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.

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

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

List return a list of deployment run with filter

func (MongoDeploymentRunStorage) Update

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

Get fetches a Deployment by its ID

func (*MongoDeploymentStorage) Init

func (m *MongoDeploymentStorage) Init() error

Init establish connection to mongo

func (MongoDeploymentStorage) List

List returns a list of deployments with pagination (offet&limit), sort and filters

func (MongoDeploymentStorage) Update

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 NewNATSAdapter

func NewNATSAdapter() *NATSAdapter

NewNATSAdapter creates a new NATSAdapter

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

func (*NATSAdapter) Start

func (adapter *NATSAdapter) Start(ctx context.Context) error

Start starts the subscription to receive queries

type NatsMock

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

NatsMock is mock for NATS

func NewNatsMock

func NewNatsMock() *NatsMock

NewNatsMock ...

func (*NatsMock) GetReply

func (n *NatsMock) GetReply(subject string) *cloudevents.Event

GetReply will fetch a reply with the specified reply subject.

func (*NatsMock) Init

Init ...

func (*NatsMock) InitChannel

func (n *NatsMock) InitChannel(channel chan<- types.Query)

InitChannel ...

func (*NatsMock) PushMsg

func (n *NatsMock) PushMsg(ce cloudevents.Event)

PushMsg push msg to incoming, which will be pushed to channel in Start()

func (*NatsMock) Reply

func (n *NatsMock) Reply(subject string, reply cloudevents.Event) error

Reply ...

func (*NatsMock) Start

func (n *NatsMock) Start() error

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

Get fetch a provider by ID

func (ProviderMicroservice) List

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

func (q Query) CloudEvent() cloudevents.Event

CloudEvent ...

func (Query) QueryType

func (q Query) QueryType() common.QueryOp

QueryType returns the query operation

func (Query) ReplySubject

func (q Query) ReplySubject() string

ReplySubject returns the reply subject of the query

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

Init initialize the STAN connection.

func (*StanAdapter) SetHandlers

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

SetHandlers ...

func (*StanAdapter) Start

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

Start starts the event subscriber. Incoming events will be deposited into the channel.

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

Get fetches a template by ID

func (TemplateMicroservice) GetTemplateType

func (t TemplateMicroservice) GetTemplateType(actor types.Actor, templateTypeName service.TemplateTypeName) (service.TemplateType, error)

GetTemplateType fetches a template type by name

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