Documentation ¶
Index ¶
- func ConvertFromGRPCWorkflow(w map[string]*pb.Workflow) map[string]Workflow
- func ConvertToGRPCWorkflow(w map[string]Workflow) map[string]*pb.Workflow
- type MongoDBConnector
- func (m *MongoDBConnector) Connect() error
- func (m *MongoDBConnector) DeleteConfig(id string, idType pb.IdType) error
- func (m *MongoDBConnector) Disconnect()
- func (m *MongoDBConnector) GetAllConfigs() ([]*pb.Config, error)
- func (m *MongoDBConnector) GetConfig(id string, idType pb.IdType) (*pb.Config, error)
- func (m *MongoDBConnector) Init() error
- func (m *MongoDBConnector) SaveConfig(config *pb.Config) error
- func (c *MongoDBConnector) UpdateAllStates(configName string, states map[string]*pb.Workflow) error
- func (m *MongoDBConnector) UpdateBuilderTTL(name string, newTTL int32) error
- func (m *MongoDBConnector) UpdateCs(config *pb.Config) error
- func (m *MongoDBConnector) UpdateDs(config *pb.Config) error
- func (c *MongoDBConnector) UpdateMsToNull(id string, idType pb.IdType) error
- func (m *MongoDBConnector) UpdateSchedulerTTL(name string, newTTL int32) error
- func (m *MongoDBConnector) UpdateWorkflowState(configName, clusterName string, workflow *pb.Workflow) error
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFromGRPCWorkflow ¶
ConvertFromGRPCWorkflow converts the workflow state data from GRPC to the database representation.
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 ¶
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 ¶
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