meta

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DELETE method = "DELETE"
	GET    method = "GET"
	POST   method = "POST"
	PATCH  method = "PATCH"
	PUT    method = "PUT"

	InputText   inputType = "text"
	InputPass   inputType = "password"
	InputBool   inputType = "bool"
	InputNumber inputType = "number"
	InputSelect inputType = "select"

	IdString idType = "string"
	IdInt    idType = "int"
)

Variables

This section is empty.

Functions

func APIURL

func APIURL(path string) string

APIURL full api url for the path

Types

type ActionHolder

type ActionHolder []*JsonAPIAction

func (*ActionHolder) AddAction

func (ah *ActionHolder) AddAction(m method, name, urlHelper string, params ...interface{}) *JsonAPIAction

AddAction ...

type Extendable

type Extendable interface {
	Extend() error
}

type FieldOption

type FieldOption struct {
	Label string                 `json:"label,omitempty"`
	Value interface{}            `json:"value"`
	Meta  map[string]interface{} `json:"meta,omitempty"`
}

func FieldOptionsFromValues

func FieldOptionsFromValues(values ...string) []FieldOption

type JsonAPIAction

type JsonAPIAction struct {
	Method       string         `json:"method"`
	Name         string         `json:"name"`
	URL          string         `json:"url"`
	Multi        bool           `json:"multi"`
	Relationship bool           `json:"relationship"`
	Fields       []JsonAPIField `json:"fields"`
}

func (*JsonAPIAction) Field

func (a *JsonAPIAction) Field(name string, inputType inputType, value interface{}, requred bool) *JsonAPIAction

Field ...

func (*JsonAPIAction) FieldWithOpts

func (a *JsonAPIAction) FieldWithOpts(name string, inputType inputType, value interface{}, requred bool, options []FieldOption) *JsonAPIAction

FieldWithOpts add field with options to action

func (*JsonAPIAction) Pagination

func (a *JsonAPIAction) Pagination(data *pagination.Pagination) *JsonAPIAction

Pagination add pagination meta to action

func (*JsonAPIAction) RelFields

func (a *JsonAPIAction) RelFields(typeName string) *JsonAPIAction

RelFields ...

type JsonAPIField

type JsonAPIField struct {
	Name      string                 `json:"name"`
	InputType string                 `json:"type"`
	Value     interface{}            `json:"value,omitempty"`
	Required  bool                   `json:"required"`
	Options   []FieldOption          `json:"options,omitempty"`
	Data      *pagination.Pagination `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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