Documentation ¶
Index ¶
- func HandlerCreate(repository *Repository, updater LatestUpdater) gin.HandlerFunc
- func HandlerDeleteBadgeRatingForRelease(repository *Repository) gin.HandlerFunc
- func HandlerGetBadgeRatingsForAppVersion(repository *Repository) gin.HandlerFunc
- func HandlerPatch(repository *Repository) gin.HandlerFunc
- func HandlerRedirectLatest(appLatestRepo *RepositoryLatest) gin.HandlerFunc
- func HandlerSetBadgeRatingForRelease(appRepo *Repository, badgeRepo *badge.Repository) gin.HandlerFunc
- type FindOneByUniqueKey
- type LatestUpdater
- type Repository
- func (repo *Repository) FindBy(criteria map[string]interface{}) (interface{}, error)
- func (repo *Repository) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
- func (repo *Repository) FindOneByDomainName(domain, name string) (*v1.Release, error)
- func (repo *Repository) FindOneByDomainNameVersion(domain, name, version string) (*v1.Release, 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(app interface{}) error
- func (repo *Repository) Save(application hateoas.Entity) error
- func (repo *Repository) Truncate() error
- type RepositoryFactory
- type RepositoryLatest
- func (repo *RepositoryLatest) FindApplication(domain, name string) (*v1.Application, error)
- func (repo *RepositoryLatest) FindBy(criteria map[string]interface{}) (interface{}, error)
- func (repo *RepositoryLatest) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
- func (repo *RepositoryLatest) FindOneByDomainNameVersion(domain, name, version string) (*v1.Release, error)
- func (repo *RepositoryLatest) FindOneByUnscoped(criteria map[string]interface{}) (hateoas.SoftDeletableEntity, error)
- func (repo *RepositoryLatest) FindPageBy(pageable hateoas.Pageable, criteria map[string]interface{}) (hateoas.Page, error)
- func (repo *RepositoryLatest) Save(application hateoas.Entity) error
- type RepositoryLatestFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerCreate ¶
func HandlerCreate(repository *Repository, updater LatestUpdater) gin.HandlerFunc
HandlerCreate replace or create a resource
func HandlerDeleteBadgeRatingForRelease ¶
func HandlerDeleteBadgeRatingForRelease(repository *Repository) gin.HandlerFunc
HandlerDeleteBadgeRatingForRelease sets the badge values for a particular release
func HandlerGetBadgeRatingsForAppVersion ¶
func HandlerGetBadgeRatingsForAppVersion(repository *Repository) gin.HandlerFunc
HandlerGetBadgeRatingsForAppVersion retrieves all the badge values for a particular application version
func HandlerPatch ¶
func HandlerPatch(repository *Repository) gin.HandlerFunc
HandlerPatch patch release properties
func HandlerRedirectLatest ¶
func HandlerRedirectLatest(appLatestRepo *RepositoryLatest) gin.HandlerFunc
HandlerRedirectLatest reply back the latest version of this application
func HandlerSetBadgeRatingForRelease ¶
func HandlerSetBadgeRatingForRelease(appRepo *Repository, badgeRepo *badge.Repository) gin.HandlerFunc
HandlerSetBadgeRatingForRelease sets the badge values for a particular release
Types ¶
type FindOneByUniqueKey ¶
type FindOneByUniqueKey interface {
FindOneByDomainNameVersion(string, string, string) (*v1.Release, error)
}
FindOneByUniqueKey declare a method allowing to find an application by domain, name and version
type LatestUpdater ¶
type LatestUpdater func(*v1.Release, logrus.FieldLogger) error
LatestUpdater updates the application latest version to the given version
func NewLatestUpdater ¶
func NewLatestUpdater(tm db.TransactionManager, appRepoFactory RepositoryFactory, latestRepoFactory RepositoryLatestFactory) LatestUpdater
NewLatestUpdater instantiates a LatestUpdater
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) FindBy ¶
func (repo *Repository) FindBy(criteria map[string]interface{}) (interface{}, error)
FindBy fetch a collection of applications matching each criteria
func (*Repository) FindOneBy ¶
func (repo *Repository) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
FindOneBy find by criteria
func (*Repository) FindOneByDomainName ¶
func (repo *Repository) FindOneByDomainName(domain, name string) (*v1.Release, error)
FindOneByDomainName fetch the first application matching each criteria
func (*Repository) FindOneByDomainNameVersion ¶
func (repo *Repository) FindOneByDomainNameVersion(domain, name, version string) (*v1.Release, error)
FindOneByDomainNameVersion fetch the first application matching each criteria
func (*Repository) FindOneByUnscoped ¶
func (repo *Repository) FindOneByUnscoped(criteria map[string]interface{}) (hateoas.SoftDeletableEntity, error)
FindOneByUnscoped gives the details of a particular application, 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(app interface{}) error
Remove deletes the application whose GetID is given as a parameter
func (*Repository) Save ¶
func (repo *Repository) Save(application hateoas.Entity) error
Save persists an application to the database
func (*Repository) Truncate ¶
func (repo *Repository) Truncate() error
Truncate empties the applications table for testing purposes
type RepositoryFactory ¶
type RepositoryFactory func(*gorm.DB) *Repository
RepositoryFactory defines a repository constructor
type RepositoryLatest ¶
type RepositoryLatest struct { Repository // contains filtered or unexported fields }
RepositoryLatest is a repository manager for applications
func NewRepositoryLatest ¶
func NewRepositoryLatest(db *gorm.DB) *RepositoryLatest
NewRepositoryLatest creates an application repository
func (*RepositoryLatest) FindApplication ¶
func (repo *RepositoryLatest) FindApplication(domain, name string) (*v1.Application, error)
FindApplication finds a single application
func (*RepositoryLatest) FindBy ¶
func (repo *RepositoryLatest) FindBy(criteria map[string]interface{}) (interface{}, error)
FindBy fetch a collection of applications matching each criteria
func (*RepositoryLatest) FindOneBy ¶
func (repo *RepositoryLatest) FindOneBy(criteria map[string]interface{}) (hateoas.Entity, error)
FindOneBy find by criteria
func (*RepositoryLatest) FindOneByDomainNameVersion ¶
func (repo *RepositoryLatest) FindOneByDomainNameVersion(domain, name, version string) (*v1.Release, error)
FindOneByDomainNameVersion fetch the first application matching each criteria
func (*RepositoryLatest) FindOneByUnscoped ¶
func (repo *RepositoryLatest) FindOneByUnscoped(criteria map[string]interface{}) (hateoas.SoftDeletableEntity, error)
FindOneByUnscoped gives the details of a particular application, even if soft deleted
func (*RepositoryLatest) FindPageBy ¶
func (repo *RepositoryLatest) FindPageBy(pageable hateoas.Pageable, criteria map[string]interface{}) (hateoas.Page, error)
FindPageBy returns a page of matching entities
type RepositoryLatestFactory ¶
type RepositoryLatestFactory func(*gorm.DB) *RepositoryLatest
RepositoryLatestFactory defines a repository constructor