outboundAdapters

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromGRPCWorkflow

func ConvertFromGRPCWorkflow(w map[string]*pb.Workflow) map[string]Workflow

ConvertFromGRPCWorkflow converts the workflow state data from GRPC to the database representation.

func ConvertToGRPCWorkflow

func ConvertToGRPCWorkflow(w map[string]Workflow) map[string]*pb.Workflow

ConvertToGRPCWorkflow converts the database representation of the workflow state to GRPC.

Types

type MongoDBConnector

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

func NewMongoDBConnector

func NewMongoDBConnector(connectionUri string) *MongoDBConnector

NewMongoDBConnector creates a new instance of the MongoDBConnector struct retruns a pointer pointing to the new instance

func (*MongoDBConnector) Connect

func (m *MongoDBConnector) Connect() error

Connect tries to connect to MongoDB until maximum connection retries is reached If successful, returns mongo client, error otherwise

func (*MongoDBConnector) DeleteConfig

func (m *MongoDBConnector) DeleteConfig(id string, idType pb.IdType) error

Delete config deletes a config from database permanently returns error if not successful, nil otherwise

func (*MongoDBConnector) Disconnect

func (m *MongoDBConnector) Disconnect()

Disconnect closes the connection to MongoDB returns error if closing was not successful

func (*MongoDBConnector) GetAllConfigs

func (m *MongoDBConnector) GetAllConfigs() ([]*pb.Config, error)

GetAllConfig gets all configs from database returns slice of pb.Config if successful, error otherwise

func (*MongoDBConnector) GetConfig

func (m *MongoDBConnector) GetConfig(id string, idType pb.IdType) (*pb.Config, error)

GetConfig will get the config from the database, based on id and id type returns error if not successful, nil otherwise

func (*MongoDBConnector) Init

func (m *MongoDBConnector) Init() error

Init performs the initialization tasks after connection is established with MongoDB

func (*MongoDBConnector) SaveConfig

func (m *MongoDBConnector) SaveConfig(config *pb.Config) error

SaveConfig will save specified config in the database if config has been encountered before, based on id and name, it will update existing record return error if not successful, nil otherwise

func (*MongoDBConnector) UpdateAllStates

func (c *MongoDBConnector) UpdateAllStates(configName string, states map[string]*pb.Workflow) error

UpdateAllStates updates all states of the config specified.

func (*MongoDBConnector) UpdateBuilderTTL

func (m *MongoDBConnector) UpdateBuilderTTL(name string, newTTL int32) error

UpdateBuilderTTL will update a builderTTL based on the name of the config returns error if not successful, nil otherwise

func (*MongoDBConnector) UpdateCs

func (m *MongoDBConnector) UpdateCs(config *pb.Config) error

UpdateCs will update the current state related field in DB

func (*MongoDBConnector) UpdateDs

func (m *MongoDBConnector) UpdateDs(config *pb.Config) error

UpdateDs will update the desired state related field in DB

func (*MongoDBConnector) UpdateMsToNull

func (c *MongoDBConnector) UpdateMsToNull(id string, idType pb.IdType) error

UpdateMsToNull will update the msChecksum and manifest based on the id of the config returns error if not successful, nil otherwise

func (*MongoDBConnector) UpdateSchedulerTTL

func (m *MongoDBConnector) UpdateSchedulerTTL(name string, newTTL int32) error

UpdateSchedulerTTL will update a schedulerTTL based on the name of the config returns error if not successful, nil otherwise

func (*MongoDBConnector) UpdateWorkflowState

func (m *MongoDBConnector) UpdateWorkflowState(configName, clusterName string, workflow *pb.Workflow) error

UpdateWorkflowState updates the state of the config with the given workflow

type Workflow

type Workflow struct {
	Status      string `bson:"status"`
	Stage       string `bson:"stage"`
	Description string `bson:"description"`
	Timestamp   string `bson:"timestamp"`
}

Jump to

Keyboard shortcuts

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