attributes

package
v0.0.0-...-764bd47 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_LAYOUT = "2006-01-02"

Variables

This section is empty.

Functions

func DefaultBool

func DefaultBool(boolValue bool) func(interface{}) BoolValue

func DefaultText

func DefaultText(textValue string) func(interface{}) TextValue

Types

type AttributeStub

type AttributeStub struct{}

func (AttributeStub) AvailableFilters

func (stub AttributeStub) AvailableFilters() []interface{}

func (AttributeStub) DefaultFallback

func (stub AttributeStub) DefaultFallback(
	val interface{},
	instance interface{},
) (
	interface{},
	error,
)

func (AttributeStub) GetFilterWhere

func (stub AttributeStub) GetFilterWhere(int, map[string][]string) ([]string, []interface{})

func (AttributeStub) GetInsert

func (stub AttributeStub) GetInsert(val interface{}) ([]string, []interface{})

func (AttributeStub) GetOrderMap

func (stub AttributeStub) GetOrderMap() map[string]string

func (AttributeStub) Validate

func (stub AttributeStub) Validate(val interface{}) (interface{}, error)

func (AttributeStub) ValidateFilters

func (stub AttributeStub) ValidateFilters(map[string][]string) ([]schema.Filter, error)

func (AttributeStub) ValidateUpdate

func (stub AttributeStub) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type Bool

type Bool struct {
	AttributeStub
	Key        string
	ColumnName string
	Nullable   bool
	Default    func(interface{}) BoolValue
}

func (Bool) AvailableFilters

func (b Bool) AvailableFilters() []interface{}

func (*Bool) DefaultFallback

func (b *Bool) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Bool) GetInsert

func (b *Bool) GetInsert(val interface{}) ([]string, []interface{})

func (Bool) GetKey

func (b Bool) GetKey() string

func (Bool) GetOrderMap

func (b Bool) GetOrderMap() map[string]string

func (Bool) GetSelectDirect

func (b Bool) GetSelectDirect() ([]string, []interface{})

func (*Bool) Validate

func (b *Bool) Validate(val interface{}) (interface{}, error)

func (Bool) ValidateFilters

func (b Bool) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Bool) ValidateUpdate

func (b *Bool) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type BoolExactFilter

type BoolExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (BoolExactFilter) GetWhere

func (f BoolExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type BoolNullFilter

type BoolNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (BoolNullFilter) GetWhere

func (f BoolNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type BoolValue

type BoolValue struct {
	Value    *bool
	Provided bool
}

func AssertBool

func AssertBool(val interface{}) BoolValue

func (BoolValue) Equal

func (bv BoolValue) Equal(obv BoolValue) bool

func (*BoolValue) MarshalJSON

func (bv *BoolValue) MarshalJSON() ([]byte, error)

func (*BoolValue) UnmarshalJSON

func (bv *BoolValue) UnmarshalJSON(data []byte) error

type Date

type Date struct {
	AttributeStub
	Key        string
	ColumnName string
	Nullable   bool
	Default    func(interface{}) DateValue
}

func (Date) AvailableFilters

func (d Date) AvailableFilters() []interface{}

func (*Date) DefaultFallback

func (d *Date) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Date) GetInsert

func (d *Date) GetInsert(val interface{}) ([]string, []interface{})

func (Date) GetKey

func (d Date) GetKey() string

func (Date) GetOrderMap

func (d Date) GetOrderMap() map[string]string

func (Date) GetSelectDirect

func (d Date) GetSelectDirect() ([]string, []interface{})

func (*Date) Validate

func (d *Date) Validate(val interface{}) (interface{}, error)

func (Date) ValidateFilters

func (d Date) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Date) ValidateUpdate

func (d *Date) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type DateAfterFilter

type DateAfterFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DateAfterFilter) GetWhere

func (f DateAfterFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DateExactFilter

type DateExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DateExactFilter) GetWhere

func (f DateExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DateNullFilter

type DateNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DateNullFilter) GetWhere

func (f DateNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DateValue

type DateValue struct {
	Value    *time.Time
	Provided bool
}

func AssertDate

func AssertDate(val interface{}) DateValue

func (DateValue) Equal

func (dv DateValue) Equal(odv DateValue) bool

func (DateValue) MarshalJSON

func (dv DateValue) MarshalJSON() ([]byte, error)

func (*DateValue) UnmarshalJSON

func (dv *DateValue) UnmarshalJSON(data []byte) error

type Datetime

type Datetime struct {
	AttributeStub
	Key        string
	ColumnName string
	Nullable   bool
	Default    func(interface{}) DatetimeValue
}

func (Datetime) AvailableFilters

func (dt Datetime) AvailableFilters() []interface{}

func (*Datetime) DefaultFallback

func (dt *Datetime) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Datetime) GetInsert

func (dt *Datetime) GetInsert(val interface{}) ([]string, []interface{})

func (Datetime) GetKey

func (dt Datetime) GetKey() string

func (Datetime) GetOrderMap

func (dt Datetime) GetOrderMap() map[string]string

func (Datetime) GetSelectDirect

func (dt Datetime) GetSelectDirect() ([]string, []interface{})

func (*Datetime) Validate

func (dt *Datetime) Validate(val interface{}) (interface{}, error)

func (Datetime) ValidateFilters

func (dt Datetime) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Datetime) ValidateUpdate

func (dt *Datetime) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type DatetimeAfterFilter

type DatetimeAfterFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DatetimeAfterFilter) GetWhere

func (f DatetimeAfterFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DatetimeExactFilter

type DatetimeExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DatetimeExactFilter) GetWhere

func (f DatetimeExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DatetimeNullFilter

type DatetimeNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DatetimeNullFilter) GetWhere

func (f DatetimeNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DatetimeValue

type DatetimeValue struct {
	Value    *time.Time
	Provided bool
}

func AssertDatetime

func AssertDatetime(val interface{}) DatetimeValue

func (DatetimeValue) Equal

func (dtv DatetimeValue) Equal(odtv DatetimeValue) bool

func (DatetimeValue) MarshalJSON

func (dtv DatetimeValue) MarshalJSON() ([]byte, error)

func (*DatetimeValue) UnmarshalJSON

func (dtv *DatetimeValue) UnmarshalJSON(data []byte) error

type Decimal

type Decimal struct {
	AttributeStub
	Key           string
	ColumnName    string
	DecimalPlaces int32
	Nullable      bool
	Default       func(interface{}) DecimalValue
}

func (Decimal) AvailableFilters

func (d Decimal) AvailableFilters() []interface{}

func (*Decimal) DefaultFallback

func (d *Decimal) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Decimal) GetInsert

func (d *Decimal) GetInsert(val interface{}) ([]string, []interface{})

func (Decimal) GetKey

func (d Decimal) GetKey() string

func (Decimal) GetOrderMap

func (d Decimal) GetOrderMap() map[string]string

func (Decimal) GetSelectDirect

func (d Decimal) GetSelectDirect() ([]string, []interface{})

func (*Decimal) Validate

func (d *Decimal) Validate(val interface{}) (interface{}, error)

func (Decimal) ValidateFilters

func (d Decimal) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Decimal) ValidateUpdate

func (d *Decimal) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type DecimalExactFilter

type DecimalExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DecimalExactFilter) GetWhere

func (f DecimalExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DecimalLesserFilter

type DecimalLesserFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DecimalLesserFilter) GetWhere

func (f DecimalLesserFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DecimalNullFilter

type DecimalNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (DecimalNullFilter) GetWhere

func (f DecimalNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type DecimalValue

type DecimalValue struct {
	Value         *decimal.Decimal
	DecimalPlaces int32
	Provided      bool
}

func AssertDecimal

func AssertDecimal(val interface{}, decimalPlaces int32) DecimalValue

func (DecimalValue) Equal

func (dv DecimalValue) Equal(odv DecimalValue) bool

func (*DecimalValue) MarshalJSON

func (dv *DecimalValue) MarshalJSON() ([]byte, error)

func (*DecimalValue) UnmarshalJSON

func (dv *DecimalValue) UnmarshalJSON(data []byte) error

type Integer

type Integer struct {
	AttributeStub
	Key        string
	ColumnName string
	Nullable   bool
	Default    func(interface{}) IntegerValue
}

func (Integer) AvailableFilters

func (i Integer) AvailableFilters() []interface{}

func (*Integer) DefaultFallback

func (i *Integer) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Integer) GetInsert

func (i *Integer) GetInsert(val interface{}) ([]string, []interface{})

func (Integer) GetKey

func (i Integer) GetKey() string

func (Integer) GetOrderMap

func (i Integer) GetOrderMap() map[string]string

func (Integer) GetSelectDirect

func (i Integer) GetSelectDirect() ([]string, []interface{})

func (*Integer) Validate

func (i *Integer) Validate(val interface{}) (interface{}, error)

func (Integer) ValidateFilters

func (i Integer) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Integer) ValidateUpdate

func (i *Integer) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type IntegerExactFilter

type IntegerExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (IntegerExactFilter) GetWhere

func (f IntegerExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type IntegerLesserFilter

type IntegerLesserFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (IntegerLesserFilter) GetWhere

func (f IntegerLesserFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type IntegerNullFilter

type IntegerNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (IntegerNullFilter) GetWhere

func (f IntegerNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type IntegerValue

type IntegerValue struct {
	Value    *int
	Provided bool
}

func AssertInteger

func AssertInteger(val interface{}) IntegerValue

func (IntegerValue) Equal

func (iv IntegerValue) Equal(oiv IntegerValue) bool

func (*IntegerValue) MarshalJSON

func (iv *IntegerValue) MarshalJSON() ([]byte, error)

func (*IntegerValue) UnmarshalJSON

func (iv *IntegerValue) UnmarshalJSON(data []byte) error

type Text

type Text struct {
	AttributeStub
	Key        string
	ColumnName string
	Nullable   bool
	MinLength  *int
	MaxLength  *int
	Default    func(interface{}) TextValue
}

func (Text) AvailableFilters

func (t Text) AvailableFilters() []interface{}

func (*Text) DefaultFallback

func (t *Text) DefaultFallback(val interface{}, instance interface{}) (interface{}, error)

func (*Text) GetInsert

func (t *Text) GetInsert(val interface{}) ([]string, []interface{})

func (Text) GetKey

func (t Text) GetKey() string

func (Text) GetOrderMap

func (t Text) GetOrderMap() map[string]string

func (Text) GetSelectDirect

func (t Text) GetSelectDirect() ([]string, []interface{})

func (*Text) Validate

func (t *Text) Validate(val interface{}) (interface{}, error)

func (Text) ValidateFilters

func (t Text) ValidateFilters(queries map[string][]string) ([]schema.Filter, error)

func (*Text) ValidateUpdate

func (t *Text) ValidateUpdate(newVal interface{}, oldVal interface{}) (interface{}, error)

type TextContainsFilter

type TextContainsFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextContainsFilter) GetWhere

func (f TextContainsFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextExactFilter

type TextExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextExactFilter) GetWhere

func (f TextExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextLengthExactFilter

type TextLengthExactFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextLengthExactFilter) GetWhere

func (f TextLengthExactFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextLengthGreaterFilter

type TextLengthGreaterFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextLengthGreaterFilter) GetWhere

func (f TextLengthGreaterFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextLengthLesserFilter

type TextLengthLesserFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextLengthLesserFilter) GetWhere

func (f TextLengthLesserFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextNullFilter

type TextNullFilter struct {
	*schema.BaseFilter
	// contains filtered or unexported fields
}

func (TextNullFilter) GetWhere

func (f TextNullFilter) GetWhere(
	c schema.Context,
	modelTable string,
	idColumn string,
	nextArg int,
) (
	[]string,
	[]interface{},
)

type TextValue

type TextValue struct {
	Value    *string
	Provided bool
}

func AssertText

func AssertText(val interface{}) TextValue

func (TextValue) Equal

func (tv TextValue) Equal(otv TextValue) bool

func (*TextValue) MarshalJSON

func (tv *TextValue) MarshalJSON() ([]byte, error)

func (*TextValue) UnmarshalJSON

func (tv *TextValue) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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