usecases

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigInfo

type ConfigInfo struct {
	Name         string
	MsChecksum   []byte
	CsChecksum   []byte
	DsChecksum   []byte
	BuilderTTL   int32
	SchedulerTTL int32
	State        map[string]outboundAdapters.Workflow
}

ConfigInfo is a data structure which holds data that context-box needs in order to function properly. This data is required by EnqueueConfigs to decide which configs should be enqueued and which should not

func (*ConfigInfo) GetName

func (c *ConfigInfo) GetName() string

GetName function is required by the queue to evaluate equivalence

type Usecases

type Usecases struct {
	DB ports.DBPort
	// contains filtered or unexported fields
}

func (*Usecases) DeleteConfig

func (u *Usecases) DeleteConfig(request *pb.DeleteConfigRequest) (*pb.DeleteConfigResponse, error)

DeleteConfig sets the manifest to nil so that the iteration workflow for this config destroys the previous build infrastructure.

func (*Usecases) DeleteConfigFromDB

func (u *Usecases) DeleteConfigFromDB(request *pb.DeleteConfigRequest) (*pb.DeleteConfigResponse, error)

DeleteConfigFromDB removes the config from the request from the mongoDB c.usecases.MongoDB.

func (*Usecases) EnqueueConfigs

func (u *Usecases) EnqueueConfigs() error

EnqueueConfigs is a driver for enqueueConfigs function

func (*Usecases) GetAllConfigs

func (u *Usecases) GetAllConfigs(request *pb.GetAllConfigsRequest) (*pb.GetAllConfigsResponse, error)

GetAllConfigs is a gRPC service: function returns all configs from the DB

func (*Usecases) GetConfigBuilder

func (u *Usecases) GetConfigBuilder(request *pb.GetConfigRequest) (*pb.GetConfigResponse, error)

GetConfigBuilder is a gRPC service: function returns oldest config from the queueBuilder

func (*Usecases) GetConfigFromDB

func (u *Usecases) GetConfigFromDB(request *pb.GetConfigFromDBRequest) (*pb.GetConfigFromDBResponse, error)

GetConfigById is a gRPC service: function returns one config from the DB based on the requested index/name

func (*Usecases) GetConfigScheduler

func (u *Usecases) GetConfigScheduler(request *pb.GetConfigRequest) (*pb.GetConfigResponse, error)

GetConfigScheduler is a gRPC service: function returns oldest config from the queueScheduler

func (*Usecases) SaveConfigBuilder

func (u *Usecases) SaveConfigBuilder(request *pb.SaveConfigRequest) (*pb.SaveConfigResponse, error)

SaveConfigBuilder is a gRPC service: the function saves config to the DB after receiving it from Builder

func (*Usecases) SaveConfigOperator added in v0.4.1

func (u *Usecases) SaveConfigOperator(request *pb.SaveConfigRequest) (*pb.SaveConfigResponse, error)

SaveConfigOperator saves config to MongoDB after receiving it from the Operator microservice

func (*Usecases) SaveConfigScheduler

func (u *Usecases) SaveConfigScheduler(request *pb.SaveConfigRequest) (*pb.SaveConfigResponse, error)

SaveConfigScheduler is a gRPC servie: the function saves config to the DB after receiving it from Scheduler

func (*Usecases) SaveWorkflowState

func (u *Usecases) SaveWorkflowState(request *pb.SaveWorkflowStateRequest) (*pb.SaveWorkflowStateResponse, error)

SaveWorkflowState updates the workflow for a single cluster

func (*Usecases) UpdateNodepool

func (u *Usecases) UpdateNodepool(request *pb.UpdateNodepoolRequest) (*pb.UpdateNodepoolResponse, error)

UpdateNodepool updates the Nodepool struct in the database, which also initiates build. This function might return an error if the update is not allowed at this time (i.e.when config is being built).

Jump to

Keyboard shortcuts

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