controller

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthorizedID

func GetAuthorizedID(c Context) string

GetAuthorizedID

Types

type Attribute

type Attribute struct {
	*Controller
	// contains filtered or unexported fields
}

Attribute type

func NewAttribute

func NewAttribute(logger Logger) *Attribute

NewAttribute New

func (*Attribute) Create

func (controller *Attribute) Create(c Context)

Create Attribute

func (*Attribute) Delete

func (controller *Attribute) Delete(c Context)

Delete Attribute

func (*Attribute) FindAll

func (controller *Attribute) FindAll(c Context)

FindAll Attribute

func (*Attribute) FindAllByEntity

func (controller *Attribute) FindAllByEntity(c Context)

FindAllByAttribute

func (*Attribute) FindByID

func (controller *Attribute) FindByID(c Context)

FindByID AttributeID

func (*Attribute) Update

func (controller *Attribute) Update(c Context)

Update Attribute

type Context

type Context interface {
	Param(string) string
	MustGet(string) interface{}
	Bind(interface{}) error
	ShouldBindHeader(interface{}) error
	ShouldBindQuery(interface{}) error
	Status(int)
	JSON(int, interface{})
}

type Controller

type Controller struct {
	Logger Logger
}

Entity type

func New

func New(logger Logger) *Controller

NewEntity New

func (*Controller) RespondInvalidRequest

func (controller *Controller) RespondInvalidRequest(c Context, err error)

func (*Controller) RespondWithError

func (controller *Controller) RespondWithError(c Context, err error)

RespondWithError ...

type Entity

type Entity struct {
	*Controller
	// contains filtered or unexported fields
}

Entity type

func NewEntity

func NewEntity(logger Logger) *Entity

NewEntity New

func (*Entity) Create

func (controller *Entity) Create(c Context)

Create Entity

func (*Entity) FindAll

func (controller *Entity) FindAll(c Context)

FindAll Entity

func (*Entity) FindByID

func (controller *Entity) FindByID(c Context)

FindByID EntityID

func (*Entity) Update

func (controller *Entity) Update(c Context)

Update Entity

type H

type H map[string]interface{}

type Logger

type Logger interface {
	Errorf(format string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})

	Fatalf(format string, args ...interface{})
	Fatal(args ...interface{})
	Infof(format string, args ...interface{})
	Info(args ...interface{})
	Warnf(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Debug(args ...interface{})
}

Jump to

Keyboard shortcuts

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