tags

package
v0.0.0-...-8984e3b Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeysTagField

func GetKeysTagField(model interface{}, fieldName string) []string

func GetMapTagField

func GetMapTagField(model interface{}, fieldName string) map[string]*structtag.Tag

func RuleDefault

func RuleDefault(f FieldParam)

Regla Default Tag Con esta regla se pueden setear valores por defecto en los campos que se le especifique dicha tag Uso:

NameField string `default:"valor por defecto"`

func RuleOnCreate

func RuleOnCreate(f FieldParam)

Rule que se ejecutan al momento de guardar el registro por primera vez en al db

Types

type FieldParam

type FieldParam interface {
	FieldName() string
	GetParams() []string
	GetAction() string
	GetField() *structs.Field
}

type FieldParamStruct

type FieldParamStruct struct {
	// contains filtered or unexported fields
}

func (FieldParamStruct) FieldName

func (this FieldParamStruct) FieldName() string

func (FieldParamStruct) GetAction

func (this FieldParamStruct) GetAction() string

func (FieldParamStruct) GetField

func (this FieldParamStruct) GetField() *structs.Field

func (FieldParamStruct) GetParams

func (this FieldParamStruct) GetParams() []string

type HandleFuncTag

type HandleFuncTag func(i FieldParam)

type StructProcessorTag

type StructProcessorTag struct {
	// contains filtered or unexported fields
}

func New

func New() *StructProcessorTag

Funcion para crear un nuevo procesor tag registra todas las rules dentro de la estructura de datos

func (StructProcessorTag) GetHandleRule

func (this StructProcessorTag) GetHandleRule(tag string) HandleFuncTag

Funcion que obtiene el manejador de la regla, osea la funcion que procesa la regla

func (StructProcessorTag) ProcessTags

func (this StructProcessorTag) ProcessTags(model interface{})

func (*StructProcessorTag) RegisterHandleRule

func (this *StructProcessorTag) RegisterHandleRule(tag string, fn HandleFuncTag) error

Funcion para registrar las reglas en el processor tag

Jump to

Keyboard shortcuts

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