controller

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 Default

func Default() *Controller

Default returns the default controller

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 NewDefault

func NewDefault() *Controller

NewDefault returns new default controller

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

Jump to

Keyboard shortcuts

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