content

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerCreate

func HandlerCreate(repository *Repository) gin.HandlerFunc

HandlerCreate replace or create a resource

func HandlerGet

func HandlerGet(repository *Repository) gin.HandlerFunc

HandlerGet returns the first resource matching path params

Types

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.Content, error)

FindOneByDomainName fetch the first application matching each criteria

func (*Repository) FindOneByDomainNameVersion

func (repo *Repository) FindOneByDomainNameVersion(domain, name, version string) (*v1.Content, 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(content hateoas.Entity) error

Save persists an content to the database

func (*Repository) Truncate

func (repo *Repository) Truncate() error

Truncate empties the applications table for testing purposes

Jump to

Keyboard shortcuts

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