Documentation ¶
Index ¶
- func HandlerDepend(depRepo *Repository, depend Depend) gin.HandlerFunc
- func HandlerDeploy(appRepo application.FindOneByUniqueKey, envRepo *environment.Repository, ...) gin.HandlerFunc
- func HandlerFindDeployment(appRepo application.FindOneByUniqueKey, envRepo *environment.Repository, ...) gin.HandlerFunc
- func HandlerListApplicationActiveDeployments(depRepo *Repository) gin.HandlerFunc
- func HandlerListReleaseActiveDeployments(depRepo *Repository) gin.HandlerFunc
- type Depend
- type Deployer
- type Repository
- func (repo *Repository) FindActivesBy(domain string, name string, criteria map[string]interface{}) ([]*v1.Deployment, error)
- func (repo *Repository) FindActivesByRelease(domain string, name string, version string, criteria map[string]interface{}) ([]*v1.Deployment, error)
- func (repo *Repository) FindBy(criteria map[string]interface{}) (interface{}, error)
- func (repo *Repository) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
- func (repo *Repository) FindOneByUnscoped(criteria map[string]interface{}) (hateoas.SoftDeletableEntity, error)
- func (repo *Repository) FindPageBy(pageable hateoas.Pageable, criteria map[string]interface{}) (hateoas.Page, error)
- func (repo *Repository) GetType() reflect.Type
- func (repo *Repository) Remove(dep interface{}) error
- func (repo *Repository) Save(deployment hateoas.Entity) error
- func (repo *Repository) Truncate() error
- func (repo *Repository) UndeployByApplicationEnv(domain, name string, envID uint) error
- type RepositoryFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerDepend ¶
func HandlerDepend(depRepo *Repository, depend Depend) gin.HandlerFunc
HandlerDepend add an observable depdendency with its
func HandlerDeploy ¶
func HandlerDeploy(appRepo application.FindOneByUniqueKey, envRepo *environment.Repository, deployer Deployer) gin.HandlerFunc
HandlerDeploy deploy this application version to the given environment and removes old deployments
func HandlerFindDeployment ¶
func HandlerFindDeployment(appRepo application.FindOneByUniqueKey, envRepo *environment.Repository, depRepo *Repository) gin.HandlerFunc
HandlerFindDeployment finds deployment for a given application and environment
func HandlerListApplicationActiveDeployments ¶
func HandlerListApplicationActiveDeployments(depRepo *Repository) gin.HandlerFunc
HandlerListApplicationActiveDeployments list active deployments for a given application
func HandlerListReleaseActiveDeployments ¶
func HandlerListReleaseActiveDeployments(depRepo *Repository) gin.HandlerFunc
HandlerListReleaseActiveDeployments list active deployments for a given release (with version)
Types ¶
type Depend ¶
type Depend func(src *v1.Deployment, target *v1.Deployment, t string) error
Depend deploys an application version to the given environment and removes old deployments
func Dependency ¶
func Dependency(depRepo *Repository) Depend
Dependency declare an observable dependency on one application
type Deployer ¶
type Deployer func(application v1.Release, environment v1.Environment, deployment *v1.Deployment, log logrus.FieldLogger) (*v1.Deployment, bool, error)
Deployer deploys an application version to the given environment and removes old deployments
func ApplicationDeployer ¶
func ApplicationDeployer(tm db.TransactionManager, depFactory RepositoryFactory) Deployer
ApplicationDeployer deploys an application version to the given environment and removes old deployments
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is a repository manager for applications
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
NewRepository creates an application repository
func (*Repository) FindActivesBy ¶
func (repo *Repository) FindActivesBy(domain string, name string, criteria map[string]interface{}) ([]*v1.Deployment, error)
FindActivesBy fetch a collection of deployments matching each criteria on a given domain and name apps
func (*Repository) FindActivesByRelease ¶
func (repo *Repository) FindActivesByRelease(domain string, name string, version string, criteria map[string]interface{}) ([]*v1.Deployment, error)
FindActivesByRelease fetch a collection of deployments matching each criteria on a given domain, name and version
func (*Repository) FindBy ¶
func (repo *Repository) FindBy(criteria map[string]interface{}) (interface{}, error)
FindBy fetch a collection of deployments matching each criteria
func (*Repository) FindOneBy ¶
func (repo *Repository) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
FindOneBy fetch the first deployment matching each criteria
func (*Repository) FindOneByUnscoped ¶
func (repo *Repository) FindOneByUnscoped(criteria map[string]interface{}) (hateoas.SoftDeletableEntity, error)
FindOneByUnscoped gives the details of a particular deployment, even if soft deleted
func (*Repository) FindPageBy ¶
func (repo *Repository) FindPageBy(pageable hateoas.Pageable, criteria map[string]interface{}) (hateoas.Page, error)
FindPageBy returns a page of matching entities
func (*Repository) GetType ¶
func (repo *Repository) GetType() reflect.Type
GetType returns the entity type managed by this repository
func (*Repository) Remove ¶
func (repo *Repository) Remove(dep interface{}) error
Remove deletes the deployment whose GetID is given as a parameter
func (*Repository) Save ¶
func (repo *Repository) Save(deployment hateoas.Entity) error
Save persists an deployment to the database
func (*Repository) Truncate ¶
func (repo *Repository) Truncate() error
Truncate empties the deployments table for testing purposes
func (*Repository) UndeployByApplicationEnv ¶
func (repo *Repository) UndeployByApplicationEnv(domain, name string, envID uint) error
UndeployByApplicationEnv updates all deployments attached to a given application regardless version with an undeploy date to now
type RepositoryFactory ¶
type RepositoryFactory func(*gorm.DB) *Repository
RepositoryFactory defines a repository constructor