types

package
v0.0.0-...-2e5e463 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseInfo

type DatabaseInfo struct {
	Table      string
	Connection *rethink.Connection
	Meta       map[string]interface{}
	Schema     map[string]interface{}
}

DatabaseInfo keeps track of the information each handler requires

type Handler

type Handler interface {
	Update(*gin.Context)
	GetAll(*gin.Context)
	GetSingle(*gin.Context)
	Create(*gin.Context)
	Delete(*gin.Context)
	Routes() []RouteDetails
}

Handler is the collection of methods required for a type to be a handler

type Meta

type Meta map[string]interface{}

Meta is just a wrapper for map[string]interface{} to be used for JSONAPI meta

type RouteDetails

type RouteDetails struct {
	Enabled bool
	Handler gin.HandlerFunc
	Path    string
	Verb    string
}

RouteDetails gives us the info needed to automatically create handlers

type Schema

type Schema interface {
	DumpBody(data []byte) ([]byte, error)
}

Schema is an interface for schemas so we can pass all different schemas for our parsing and validation functions

Jump to

Keyboard shortcuts

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