Documentation ¶
Index ¶
- func SetDefault(c *Controller)
- type Controller
- func (c *Controller) Close() error
- func (c *Controller) DBErrorMapper() *errors.ErrorMapper
- func (c *Controller) ModelStruct(model interface{}) (*mapping.ModelStruct, error)
- func (c *Controller) RegisterModels(models ...interface{}) error
- func (c *Controller) Schema(schemaName string) (*mapping.Schema, bool)
- func (c *Controller) Schemas() (schemas []*mapping.Schema)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(c *Controller)
SetDefault sets the default Controller to the provided
Types ¶
type Controller ¶
type Controller controller.Controller
Controller is the structure that controls whole jsonapi behavior. It contains repositories, model definitions, query builders and it's own config
var DefaultController *Controller
DefaultController is the Default controller used if no 'controller' is provided for operations
func MustGetNew ¶
func MustGetNew(cfg *config.Controller, logger ...unilogger.LeveledLogger) *Controller
MustGetNew gets the
func New ¶
func New(cfg *config.Controller, logger ...unilogger.LeveledLogger) (*Controller, error)
New creates new controller for given config
func (*Controller) Close ¶ added in v0.1.4
func (c *Controller) Close() error
Close closes all repositories
func (*Controller) DBErrorMapper ¶
func (c *Controller) DBErrorMapper() *errors.ErrorMapper
DBErrorMapper returns the database error manager
func (*Controller) ModelStruct ¶
func (c *Controller) ModelStruct(model interface{}) (*mapping.ModelStruct, error)
ModelStruct gets the model struct on the base of the provided model
func (*Controller) RegisterModels ¶
func (c *Controller) RegisterModels(models ...interface{}) error
RegisterModels registers provided models within the context of the provided Controller
func (*Controller) Schema ¶
func (c *Controller) Schema(schemaName string) (*mapping.Schema, bool)
Schema gets the schema by it's name
func (*Controller) Schemas ¶
func (c *Controller) Schemas() (schemas []*mapping.Schema)
Schemas gets the controller defined schemas