field

package
v0.0.0-...-704dcf6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2018 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(meta *Base, options ...Option)

Configure meta object by sequental call option cofigure functions

Types

type Base

type Base struct {
	// primary key flag
	Primary bool

	// Name of the field
	Name string

	// tags for this field in record struct
	Tags string

	// reference field (this value as usual should be set to ID field of other table)
	Reference Mapper
}

Base struct with common field properties

func (*Base) GetField

func (b *Base) GetField() Base

GetField interface realisation with copy limitation

type CharField

type CharField struct {
	Base
}

CharField database type

func (*CharField) GetField

func (i *CharField) GetField() Base

GetField data

type Getter

type Getter interface {
	GetField() Mapper
}

Getter field meta object

type IntField

type IntField struct {
	Base
}

IntField database type

func (*IntField) GetField

func (i *IntField) GetField() Base

GetField data

type Mapper

type Mapper interface {
	// GetField returns field meta data
	GetField() Base
}

Mapper of field

func Char

func Char(name string, options ...Option) Mapper

Char field constructor

func Int

func Int(name string, options ...Option) Mapper

Int field constructor

type Option

type Option func(*Base)

Option setup function for field

func OptPrimary

func OptPrimary() Option

OptPrimary set this field primary key flag enabled

func OptReference

func OptReference(field Getter) Option

OptReference set this field referenced to any other field

func OptTags

func OptTags(tags string) Option

OptTags set this field primary key flag enabled

Jump to

Keyboard shortcuts

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