application

package
v0.0.0-...-6899a91 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

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

func (*RepositoryLatest) Save

func (repo *RepositoryLatest) Save(application hateoas.Entity) error

Save persists an application to the database

type RepositoryLatestFactory

type RepositoryLatestFactory func(*gorm.DB) *RepositoryLatest

RepositoryLatestFactory defines a repository constructor

Jump to

Keyboard shortcuts

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