models

package
v0.0.0-...-b9171e1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodGet    = "GET"
	MethodPost   = "POST"
	MethodPut    = "PUT"
	MethodDelete = "Delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SelfResource         bool     // GET PUT POST DELETE
	SelfResourceField    string   // GET PUT POST DELETE
	SelectFields         []string // GET PUT POST
	OmitFields           []string // GET PUT POST
	GetLimit             int
	GetSearchFields      []string
	GetMessage           string
	PostMessage          string
	PostDuplicateMessage string
	PostSkipOmit         bool // genetated fields cannot be omitted
	PostNewFields        []string
	PostGenerateValues   GenerateFields
	PostValidationFields ValidationFields
	PutMessage           string
	PutUpdatableFields   []string
	DeleteMessage        string
}

type GenerateFields

type GenerateFields map[string]GenerateFunction

type GenerateFunction

type GenerateFunction func(args ...interface{}) interface{}

type Route

type Route struct {
	Methods    []string
	DataEntity interface{}
	Config     Config
}

type Routes

type Routes []Route

type ValidationFields

type ValidationFields map[string]ValidationFunction

type ValidationFunction

type ValidationFunction func(value interface{}) bool

Jump to

Keyboard shortcuts

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