model

package
v0.0.0-...-cd1d72b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRepository

type CreateRepository interface {
	Create(Entity) error
}

RootRepository ...

type DeleteRepository

type DeleteRepository interface {
	Delete(Entity) error
}

RootRepository ...

type Entity

type Entity interface {
	Validate() error
	Primary() (interface{}, []interface{})
}

RootRepository ...

type ReadRepository

type ReadRepository interface {
	GetByPrimary(Entity) error
}

RootRepository ...

type RootRepository

type RootRepository struct {
	Ctx    *gin.Context
	DB     *gorm.DB
	Entity Entity
}

RootRepository ...

func NewRootRepository

func NewRootRepository(ctx *gin.Context, ent Entity) *RootRepository

NewRootRepository creates new RootRepository

func (*RootRepository) Create

func (r *RootRepository) Create(ent Entity) error

Create returns inserted entity if no error

func (*RootRepository) Delete

func (r *RootRepository) Delete(ent Entity) error

func (*RootRepository) GetByPrimary

func (r *RootRepository) GetByPrimary(ent Entity) error

GetByPrimary ...

func (*RootRepository) UpdateByPrimary

func (r *RootRepository) UpdateByPrimary(ent Entity) error

type UpdateRepository

type UpdateRepository interface {
	UpdateByPrimary(Entity) error
}

RootRepository ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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