controller

package
v0.0.0-...-b4c102b Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersionController

func GetVersionController(event types.Event) (string, error)

GetVersionController is the controller for the VERSION operation. It gets the version information which are stored in the binary on compilation and returns them as JSON

Types

type ServiceBaseController

ServiceBaseController is a struct including the builder model interfaces, all controller functions are called on this struct and the included models

func NewServiceBaseController

func NewServiceBaseController(modelCloudWatchEvents model.CloudWatchEventsModelAPI, modelCodeBuild model.CodeBuildModelAPI, modelDynamoDB model.DynamoDBModelAPI) *ServiceBaseController

NewServiceBaseController takes the builder model interfaces as parameter and returns the pointer to an ServiceBaseController struct, on which all controller functions with their model calls can be called

func (*ServiceBaseController) CreateController

func (ServiceBaseController *ServiceBaseController) CreateController(event types.Event) (string, error)

CreateController is the controller for the CREATE action. First the status of the Environment gets checked, if the status is "pending" the CodBuild Job gets created and then triggered.

func (*ServiceBaseController) CreateResultController

func (ServiceBaseController *ServiceBaseController) CreateResultController(event types.Event) (string, error)

CreateResultController is the controller for the RESULT_CREATE action. The status of the Environment gets set according to the result of the CodeBuild Job.

func (*ServiceBaseController) DeleteCloudWatchEventController

func (ServiceBaseController *ServiceBaseController) DeleteCloudWatchEventController(event types.Event) (string, error)

DeleteCloudWatchEventController is the controller function for the DELETE_SCHEDULE action. It calls the function to delete all CloudWatchEvents rules for the Environment.

func (*ServiceBaseController) DeleteController

func (ServiceBaseController *ServiceBaseController) DeleteController(event types.Event) (string, error)

DeleteController is the controller function for the DELETE action. First the status of the Environment gets checked, if the status is "running", "stopped", "initiating failed", "destroyed failed" the CodBuild Job gets adapted to delete the Environment and then triggered.

func (*ServiceBaseController) DeleteResultController

func (ServiceBaseController *ServiceBaseController) DeleteResultController(event types.Event) (string, error)

DeleteResultController is the controller function for the RESULT_DESTROY action. The status of the Environment gets set according to the result of the CodeBuild Job and the CodeBuild Job and Environment get removed.

func (*ServiceBaseController) UpdateCloudWatchEventController

func (ServiceBaseController *ServiceBaseController) UpdateCloudWatchEventController(event types.Event) (string, error)

UpdateCloudWatchEventController is the controller for the UPDATE_SCHEDULE action. It calls the function to update all CloudWatchEvents rules for the Environment.

func (*ServiceBaseController) UpdateController

func (ServiceBaseController *ServiceBaseController) UpdateController(event types.Event) (string, error)

UpdateController is the controller for the UPDATE action. First the status of the Environment gets checked, if the status is "running" or "updating failed" the CodBuild Job gets adapted with the updated configuration and then triggered.

func (*ServiceBaseController) UpdateResultController

func (ServiceBaseController *ServiceBaseController) UpdateResultController(event types.Event) (string, error)

UpdateResultController is the controller for the RESULT_UPDATE action. The status of the Environment gets set according to the result of the CodeBuild Job.

type ServiceBaseControllerAPI

type ServiceBaseControllerAPI interface {
	CreateController(event types.Event) (string, error)
	CreateResultController(event types.Event) (string, error)
	DeleteController(event types.Event) (string, error)
	DeleteCloudWatchEventController(event types.Event) (string, error)
	DeleteResultController(event types.Event) (string, error)
	UpdateController(event types.Event) (string, error)
	UpdateResultController(event types.Event) (string, error)
	UpdateCloudWatchEventController(event types.Event) (string, error)
}

ServiceBaseControllerAPI is an interface including all controller functions

Jump to

Keyboard shortcuts

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