fields

package
v0.0.0-...-eaebcad Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUOTE_CHAR byte = 34
	JSON_NULL       = "null"
)
View Source
const (
	JSON_TRUE  = "true"
	JSON_FALSE = "false"
)
View Source
const (
	FORMAT_DATE_TIME_TZ1 string = "2006-01-02T15:04:05.000-07"
	FORMAT_DATE_TIME_TZ2 string = "2006-01-02T15:04:05-07:00"
	FORMAT_DATE_TIME_TZ3 string = "2006-01-02T15:04:05Z07:00"
)
View Source
const (
	ER_VALID_AR_MAX_LEN = "Количество значений массива поля '%s' превышает максимальное"
	ER_VALID_AR_MIN_LEN = "Количество значений массива поля '%s' меньше минимального"
	ER_VALID_PRECISION  = "Количество знаков дробной части поля '%s' больше максимального"
	ER_VALID_MINVAL     = "Значение поля '%s' меньше минимального"
	ER_VALID_MAXVAL     = "Значение поля '%s' больше максимального"
	ER_VALID_ZEROVAL    = "Значение поля '%s' не может быть равно нулю"
	ER_VALID_LEN        = "Количество символов значения поля '%s' больше максимального"
	ER_VALID_AR_LEN     = "Количество значений массива поля '%s' больше максимального"
	ER_VALID_ENUM       = "Значение поля '%s' не найдено в перечислении"

	ER_UNMARSHAL_INT         = "Ошибка парсинга целого числа: "
	ER_UNMARSHAL_ARRAY       = "Ошибка парсинга массива: "
	ER_UNMARSHAL_ASSOC_ARRAY = "Ошибка парсинга ассоциативного массива: "
	ER_UNMARSHAL_FLOAT       = "Ошибка парсинга дробного числа: "
	ER_UNMARSHAL_STRING      = "Ошибка парсинга строки: "
	ER_UNMARSHAL_BOOL        = "Ошибка парсинга boolean значения: "
	ER_UNMARSHAL_TIME        = "Ошибка парсинга даты: "
	ER_UNMARSHAL_JSON        = "Ошибка парсинга json: "
	ER_UNMARSHAL_BYTEA       = "Ошибка парсинга bytea: "
)
View Source
const CONSTR_VALUE_SEP = ","
View Source
const FORMAT_DATE = "2006-01-02"
View Source
const FORMAT_DATE_TIME = "2006-01-02T15:04:05"
View Source
const FORMAT_TIME = "15:04:05"
View Source
const SINGLE_QUOTE_CHAR = 39

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(message []byte) (b []byte, err error)

func Base64Encode

func Base64Encode(message []byte) []byte

func ExtRemoveQuotes

func ExtRemoveQuotes(extVal []byte) string

func ExtValIsNull

func ExtValIsNull(extVal []byte) bool

func StrToBool

func StrToBool(vStr string) (bool, error)

func StrToFloat

func StrToFloat(vStr string) (float64, error)

func StrToInt

func StrToInt(vStr string) (int64, error)

func StrToTime

func StrToTime(vStr string, tmpl string) (time.Time, error)

func StrToUint

func StrToUint(vStr string) (uint64, error)

func ValidateArray

func ValidateArray(f FielderArray, val []interface{}) error

Array validaion

func ValidateAssocArray

func ValidateAssocArray(f FielderAssocArray, val []interface{}) error

Array validaion

func ValidateBytea

func ValidateBytea(f FielderBytea, val []byte) error

String validaion

func ValidateDate

func ValidateDate(f Fielder, val string) error

String validaion

func ValidateDateTime

func ValidateDateTime(f Fielder, val string) error

String validaion

func ValidateDateTimeTZ

func ValidateDateTimeTZ(f Fielder, val string) error

String validaion

func ValidateEnum

func ValidateEnum(f FielderEnum, val string) error

Enum validaion

func ValidateFloat

func ValidateFloat(f FielderFloat, val float64) error

Float validaion

func ValidateInt

func ValidateInt(f FielderInt, val int64) error

Int validaion

func ValidateJSON

func ValidateJSON(f FielderJSON, val []byte) error

String validaion

func ValidateText

func ValidateText(f FielderText, val string) error

String validaion

func ValidateTime

func ValidateTime(f Fielder, val string) error

String validaion

Types

type Field

type Field struct {
	Id            string
	PrimaryKey    bool
	AutoInc       bool
	Required      bool
	SysCol        bool
	DbRequired    bool
	Display       bool
	Alias         string
	Descr         string
	Length        int
	DefOrder      ParamBool
	DefOrderIndex byte //to preserve order
	//DefaultValue interface{}
	RefTable       string
	RefField       string
	Unique         bool
	EnumId         string
	Precision      int
	RegFieldType   string
	RetAfterInsert bool
	NoValueOnCopy  bool
	OrderInList    byte //to preserve order for getting comma separated list for select queries
	Encrypted      bool
	FieldIndex     int
}

Base metadata field

func (*Field) GetAlias

func (f *Field) GetAlias() string

func (*Field) GetAutoInc

func (f *Field) GetAutoInc() bool

func (*Field) GetDbRequired

func (f *Field) GetDbRequired() bool

func (*Field) GetDefOrder

func (f *Field) GetDefOrder() ParamBool

func (*Field) GetDefOrderIndex

func (f *Field) GetDefOrderIndex() byte

func (*Field) GetDescr

func (f *Field) GetDescr() string

func (*Field) GetDisplay

func (f *Field) GetDisplay() bool

func (*Field) GetEncrypted

func (f *Field) GetEncrypted() bool

func (*Field) GetEnumId

func (f *Field) GetEnumId() string

func (*Field) GetFieldIndex

func (f *Field) GetFieldIndex() int

func (*Field) GetId

func (f *Field) GetId() string

func (*Field) GetLength

func (f *Field) GetLength() int

func (*Field) GetNoValueOnCopy

func (f *Field) GetNoValueOnCopy() bool

func (*Field) GetOrderInList

func (f *Field) GetOrderInList() byte

func (*Field) GetPrecision

func (f *Field) GetPrecision() int

func (*Field) GetPrimaryKey

func (f *Field) GetPrimaryKey() bool
func (f *Field) GetDataType() FieldDataType {
	return f.DataType
}

func (*Field) GetRefField

func (f *Field) GetRefField() string

func (*Field) GetRefTable

func (f *Field) GetRefTable() string

func (*Field) GetRegFieldType

func (f *Field) GetRegFieldType() string

func (*Field) GetRequired

func (f *Field) GetRequired() bool

func (*Field) GetRetAfterInsert

func (f *Field) GetRetAfterInsert() bool

func (*Field) GetSysCol

func (f *Field) GetSysCol() bool

func (*Field) GetUnique

func (f *Field) GetUnique() bool

func (*Field) SetAlias

func (f *Field) SetAlias(v string)

func (*Field) SetDefOrder

func (f *Field) SetDefOrder(v ParamBool)

func (*Field) SetDefOrderIndex

func (f *Field) SetDefOrderIndex(v byte)

func (*Field) SetDescr

func (f *Field) SetDescr(v string)

func (*Field) SetEncrypted

func (f *Field) SetEncrypted(v bool)

func (*Field) SetFieldIndex

func (f *Field) SetFieldIndex(v int)

func (*Field) SetId

func (f *Field) SetId(v string)

func (*Field) SetNoValueOnCopy

func (f *Field) SetNoValueOnCopy(v bool)

func (*Field) SetOrderInList

func (f *Field) SetOrderInList(v byte)

func (*Field) SetPrecision

func (f *Field) SetPrecision(v int)

func (*Field) SetPrimaryKey

func (f *Field) SetPrimaryKey(v bool)

func (*Field) SetRequired

func (f *Field) SetRequired(v bool)

func (*Field) SetSysCol

func (f *Field) SetSysCol(v bool)

type FieldArray

type FieldArray struct {
	Field
	MinCount ParamInt
	MaxCount ParamInt
}

func (*FieldArray) GetDataType

func (f *FieldArray) GetDataType() FieldDataType

func (*FieldArray) GetMaxCount

func (f *FieldArray) GetMaxCount() ParamInt

func (*FieldArray) GetMinCount

func (f *FieldArray) GetMinCount() ParamInt

type FieldAssocArray

type FieldAssocArray struct {
	Field
	MinCount ParamInt
	MaxCount ParamInt
}

func (*FieldAssocArray) GetDataType

func (f *FieldAssocArray) GetDataType() FieldDataType

func (*FieldAssocArray) GetMaxCount

func (f *FieldAssocArray) GetMaxCount() ParamInt

func (*FieldAssocArray) GetMinCount

func (f *FieldAssocArray) GetMinCount() ParamInt

type FieldBool

type FieldBool struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldBool) GetDataType

func (f *FieldBool) GetDataType() FieldDataType

type FieldBytea

type FieldBytea struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldBytea) GetDataType

func (f *FieldBytea) GetDataType() FieldDataType

type FieldCollection

type FieldCollection map[string]Fielder

func GenModelMD

func GenModelMD(v reflect.Value) FieldCollection

function is executed on start, so we can panic

type FieldDataType

type FieldDataType byte
const (
	FIELD_TYPE_BOOL        FieldDataType = iota
	FIELD_TYPE_CHAR                      //1
	FIELD_TYPE_STRING                    //2
	FIELD_TYPE_INT                       //3
	FIELD_TYPE_DATE                      //4
	FIELD_TYPE_TIME                      //5
	FIELD_TYPE_TIMETZ                    //6
	FIELD_TYPE_DATETIME                  //7
	FIELD_TYPE_DATETIMETZ                //8
	FIELD_TYPE_FLOAT                     //9
	FIELD_TYPE_TEXT                      //10
	FIELD_TYPE_ENUM                      //11
	FIELD_TYPE_PASSWORD                  //12
	FIELD_TYPE_INTERVAL                  //13
	FIELD_TYPE_JSON                      //14
	FIELD_TYPE_JSONB                     //15
	FIELD_TYPE_ARRAY                     //16
	FIELD_TYPE_BYTEA                     //17
	FIELD_TYPE_XML                       //18
	FIELD_TYPE_GEOMPOLYGON               //19
	FIELD_TYPE_GEOMPOINT                 //20
)

type FieldDate

type FieldDate struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldDate) GetDataType

func (f *FieldDate) GetDataType() FieldDataType

type FieldDateTime

type FieldDateTime struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldDateTime) GetDataType

func (f *FieldDateTime) GetDataType() FieldDataType

type FieldDateTimeTZ

type FieldDateTimeTZ struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldDateTimeTZ) GetDataType

func (f *FieldDateTimeTZ) GetDataType() FieldDataType

type FieldEnum

type FieldEnum struct {
	FieldText
	Values []string
}

func (*FieldEnum) CheckValue

func (f *FieldEnum) CheckValue(val string) bool

func (*FieldEnum) GetDataType

func (f *FieldEnum) GetDataType() FieldDataType

type FieldFloat

type FieldFloat struct {
	Field
	MinValue  ParamFloat
	MaxValue  ParamFloat
	NotZero   ParamBool
	Precision ParamInt
	Length    ParamInt
}

func (*FieldFloat) GetDataType

func (f *FieldFloat) GetDataType() FieldDataType

func (*FieldFloat) GetLength

func (f *FieldFloat) GetLength() ParamInt

func (*FieldFloat) GetMaxValue

func (f *FieldFloat) GetMaxValue() ParamFloat

func (*FieldFloat) GetMinValue

func (f *FieldFloat) GetMinValue() ParamFloat

func (*FieldFloat) GetNotZero

func (f *FieldFloat) GetNotZero() ParamBool

func (*FieldFloat) GetPrecision

func (f *FieldFloat) GetPrecision() ParamInt

func (*FieldFloat) SetLength

func (f *FieldFloat) SetLength(v ParamInt)

func (*FieldFloat) SetMaxValue

func (f *FieldFloat) SetMaxValue(v ParamFloat)

func (*FieldFloat) SetMinValue

func (f *FieldFloat) SetMinValue(v ParamFloat)

func (*FieldFloat) SetNotZero

func (f *FieldFloat) SetNotZero(v ParamBool)

func (*FieldFloat) SetPrecision

func (f *FieldFloat) SetPrecision(v ParamInt)

type FieldInt

type FieldInt struct {
	Field
	MinValue ParamInt64
	MaxValue ParamInt64
	NotZero  ParamBool
}

func (*FieldInt) GetDataType

func (f *FieldInt) GetDataType() FieldDataType

func (*FieldInt) GetMaxValue

func (f *FieldInt) GetMaxValue() ParamInt64

func (*FieldInt) GetMinValue

func (f *FieldInt) GetMinValue() ParamInt64

func (*FieldInt) GetNotZero

func (f *FieldInt) GetNotZero() ParamBool

func (*FieldInt) SetMaxValue

func (f *FieldInt) SetMaxValue(v ParamInt64)

func (*FieldInt) SetMinValue

func (f *FieldInt) SetMinValue(v ParamInt64)

func (*FieldInt) SetNotZero

func (f *FieldInt) SetNotZero(v ParamBool)

type FieldJSON

type FieldJSON struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldJSON) GetDataType

func (f *FieldJSON) GetDataType() FieldDataType

type FieldText

type FieldText struct {
	Field
	Length ParamInt
}

***** Metadata text field:strings/texts ******************

func (*FieldText) GetDataType

func (f *FieldText) GetDataType() FieldDataType

func (*FieldText) GetLength

func (f *FieldText) GetLength() ParamInt

func (*FieldText) SetLength

func (f *FieldText) SetLength(v ParamInt)

type FieldTime

type FieldTime struct {
	Field
}

***** Metadata text field:strings/texts ******************

func (*FieldTime) GetDataType

func (f *FieldTime) GetDataType() FieldDataType

type Fielder

type Fielder interface {
	GetId() string
	SetId(string)
	GetAlias() string
	SetAlias(string)
	GetRequired() bool
	SetRequired(bool)
	GetDescr() string
	SetDescr(string)
	GetDataType() FieldDataType
	GetPrimaryKey() bool
	SetPrimaryKey(bool)
	GetAutoInc() bool
	GetSysCol() bool
	SetSysCol(bool)
	GetDbRequired() bool
	GetDisplay() bool
	GetRegFieldType() string
	GetRetAfterInsert() bool
	GetNoValueOnCopy() bool
	SetNoValueOnCopy(bool)
	GetDefOrder() ParamBool
	SetDefOrder(v ParamBool)
	GetOrderInList() byte
	SetOrderInList(byte)
	GetDefOrderIndex() byte
	SetDefOrderIndex(byte)
	SetEncrypted(bool)
	GetEncrypted() bool
	SetFieldIndex(int)
	GetFieldIndex() int
}

Base interface

type FielderArray

type FielderArray interface {
	Fielder
	GetMinCount() ParamInt
	GetMaxCount() ParamInt
}

type FielderAssocArray

type FielderAssocArray interface {
	Fielder
	GetMinCount() ParamInt
	GetMaxCount() ParamInt
}

type FielderBytea

type FielderBytea interface {
	Fielder
}

type FielderEnum

type FielderEnum interface {
	FielderText
	CheckValue(string) bool
}

type FielderFloat

type FielderFloat interface {
	Fielder
	GetMinValue() ParamFloat
	SetMinValue(ParamFloat)
	GetMaxValue() ParamFloat
	SetMaxValue(ParamFloat)
	GetNotZero() ParamBool
	SetNotZero(ParamBool)
	GetPrecision() ParamInt
	SetPrecision(ParamInt)
	GetLength() ParamInt
	SetLength(ParamInt)
}

type FielderInt

type FielderInt interface {
	Fielder
	GetMinValue() ParamInt64
	SetMinValue(ParamInt64)
	GetMaxValue() ParamInt64
	SetMaxValue(ParamInt64)
	GetNotZero() ParamBool
	SetNotZero(ParamBool)
}

type FielderJSON

type FielderJSON interface {
	Fielder
}

type FielderText

type FielderText interface {
	Fielder
	GetLength() ParamInt
	SetLength(ParamInt)
}

type ParamBool

type ParamBool struct {
	IsSet bool
	Value bool
}

func NewParamBool

func NewParamBool(value bool) ParamBool

type ParamFloat

type ParamFloat struct {
	IsSet bool
	Value float64
}

func NewParamFloat

func NewParamFloat(value float64) ParamFloat

type ParamInt

type ParamInt struct {
	IsSet bool
	Value int
}

func NewParamInt

func NewParamInt(value int) ParamInt

type ParamInt64

type ParamInt64 struct {
	IsSet bool
	Value int64
}

func NewParamInt64

func NewParamInt64(value int64) ParamInt64

type Ref

type Ref struct {
	Keys     map[string]interface{} `json:"keys"`
	Descr    string                 `json:"descr"`
	DataType string                 `json:"dataType"`
}

type Val

type Val struct {
	IsSet  bool
	IsNull bool
}

Base data type

type ValArray

type ValArray struct {
	Val
	TypedValue []interface{}
}

func (ValArray) GetIsNull

func (v ValArray) GetIsNull() bool

func (ValArray) GetIsSet

func (v ValArray) GetIsSet() bool

func (ValArray) GetValue

func (v ValArray) GetValue() []interface{}

func (*ValArray) MarshalJSON

func (v *ValArray) MarshalJSON() ([]byte, error)

func (*ValArray) MarshalXML

func (v *ValArray) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ValArray) Scan

func (v *ValArray) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValArray) SetNull

func (v *ValArray) SetNull()

func (ValArray) String

func (v ValArray) String() string

func (*ValArray) UnmarshalJSON

func (v *ValArray) UnmarshalJSON(data []byte) error

Custom Array unmarshal

func (ValArray) Value

func (v ValArray) Value() (driver.Value, error)

type ValArrayer

type ValArrayer interface {
	GetValue() []interface{}
}

type ValAssocArray

type ValAssocArray struct {
	Val
	TypedValue map[string]interface{}
}

func (ValAssocArray) GetIsNull

func (v ValAssocArray) GetIsNull() bool

func (ValAssocArray) GetIsSet

func (v ValAssocArray) GetIsSet() bool

func (ValAssocArray) GetValue

func (v ValAssocArray) GetValue() map[string]interface{}

func (*ValAssocArray) MarshalJSON

func (v *ValAssocArray) MarshalJSON() ([]byte, error)

func (ValAssocArray) String

func (v ValAssocArray) String() string

func (*ValAssocArray) UnmarshalJSON

func (v *ValAssocArray) UnmarshalJSON(data []byte) error

Custom AssocArray unmarshal

type ValAssocArrayer

type ValAssocArrayer interface {
	GetValue() map[string]interface{}
}

type ValBool

type ValBool struct {
	Val
	TypedValue bool
}

func NewValBool

func NewValBool(val bool, isNull bool) ValBool

func (ValBool) GetIsNull

func (v ValBool) GetIsNull() bool

func (ValBool) GetIsSet

func (v ValBool) GetIsSet() bool

func (ValBool) GetValue

func (v ValBool) GetValue() bool

func (*ValBool) MarshalJSON

func (v *ValBool) MarshalJSON() ([]byte, error)

func (*ValBool) Scan

func (v *ValBool) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValBool) SetNull

func (v *ValBool) SetNull()

func (*ValBool) SetValue

func (v *ValBool) SetValue(vV bool)

func (ValBool) String

func (v ValBool) String() string

func (*ValBool) UnmarshalJSON

func (v *ValBool) UnmarshalJSON(data []byte) error

Custom Bool unmarshal

func (ValBool) Value

func (v ValBool) Value() (driver.Value, error)

type ValBooler

type ValBooler interface {
	GetValue() bool
}

type ValBytea

type ValBytea struct {
	Val
	TypedValue []byte
}

func NewValBytea

func NewValBytea(val []byte, isNull bool) ValBytea

func (ValBytea) GetIsNull

func (v ValBytea) GetIsNull() bool

func (ValBytea) GetIsSet

func (v ValBytea) GetIsSet() bool

func (ValBytea) GetValue

func (v ValBytea) GetValue() []byte

func (*ValBytea) Len

func (v *ValBytea) Len() int

func (*ValBytea) MarshalJSON

func (v *ValBytea) MarshalJSON() ([]byte, error)

to base 64

func (*ValBytea) Scan

func (v *ValBytea) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValBytea) SetNull

func (v *ValBytea) SetNull()

func (*ValBytea) SetValue

func (v *ValBytea) SetValue(vAr []byte)

func (ValBytea) String

func (v ValBytea) String() string

func (*ValBytea) UnmarshalJSON

func (v *ValBytea) UnmarshalJSON(data []byte) error

Custom String unmarshal incoming string in Base64

func (ValBytea) Value

func (v ValBytea) Value() (driver.Value, error)

type ValBytera

type ValBytera interface {
	GetValue() []byte
}

type ValDate

type ValDate struct {
	ValDateTimeTZ
}

func (*ValDate) MarshalJSON

func (v *ValDate) MarshalJSON() ([]byte, error)

func (*ValDate) Scan

func (v *ValDate) Scan(value interface{}) error

func (ValDate) String

func (v ValDate) String() string

func (*ValDate) UnmarshalJSON

func (v *ValDate) UnmarshalJSON(data []byte) error

Custom Float unmarshal

type ValDateTime

type ValDateTime struct {
	ValDateTimeTZ
}

func (*ValDateTime) MarshalJSON

func (v *ValDateTime) MarshalJSON() ([]byte, error)

func (*ValDateTime) Scan

func (v *ValDateTime) Scan(value interface{}) error

func (ValDateTime) String

func (v ValDateTime) String() string

func (*ValDateTime) UnmarshalJSON

func (v *ValDateTime) UnmarshalJSON(data []byte) error

Custom Float unmarshal

type ValDateTimeTZ

type ValDateTimeTZ struct {
	Val
	TypedValue time.Time
}

func (ValDateTimeTZ) GetIsNull

func (v ValDateTimeTZ) GetIsNull() bool

func (ValDateTimeTZ) GetIsSet

func (v ValDateTimeTZ) GetIsSet() bool

func (ValDateTimeTZ) GetValue

func (v ValDateTimeTZ) GetValue() time.Time

func (*ValDateTimeTZ) MarshalJSON

func (v *ValDateTimeTZ) MarshalJSON() ([]byte, error)

func (*ValDateTimeTZ) Scan

func (v *ValDateTimeTZ) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValDateTimeTZ) SetNull

func (v *ValDateTimeTZ) SetNull()

func (*ValDateTimeTZ) SetValue

func (v *ValDateTimeTZ) SetValue(vT time.Time)

func (ValDateTimeTZ) String

func (v ValDateTimeTZ) String() string

func (*ValDateTimeTZ) UnmarshalJSON

func (v *ValDateTimeTZ) UnmarshalJSON(data []byte) error

Custom Float unmarshal

func (ValDateTimeTZ) Value

func (v ValDateTimeTZ) Value() (driver.Value, error)

type ValEnumer

type ValEnumer interface {
	GetValues() []string
}

type ValExt

type ValExt interface {
	GetIsSet() bool
	Value() (driver.Value, error)
}

type ValFloat

type ValFloat struct {
	Val
	TypedValue float64
}

func NewValFloat

func NewValFloat(val float64, isNull bool) ValFloat

func (ValFloat) GetIsNull

func (v ValFloat) GetIsNull() bool

func (ValFloat) GetIsSet

func (v ValFloat) GetIsSet() bool

func (ValFloat) GetValue

func (v ValFloat) GetValue() float64

func (*ValFloat) MarshalJSON

func (v *ValFloat) MarshalJSON() ([]byte, error)

func (*ValFloat) Scan

func (v *ValFloat) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValFloat) SetNull

func (v *ValFloat) SetNull()

func (*ValFloat) SetValue

func (v *ValFloat) SetValue(vF float64)

func (ValFloat) String

func (v ValFloat) String() string

func (*ValFloat) UnmarshalJSON

func (v *ValFloat) UnmarshalJSON(data []byte) error

Custom Float unmarshal

func (ValFloat) Value

func (v ValFloat) Value() (driver.Value, error)

type ValFloater

type ValFloater interface {
	GetValue() float64
}

type ValInt

type ValInt struct {
	Val
	TypedValue int64
}

Ext type int

func NewValInt

func NewValInt(val int64, isNull bool) ValInt

func (ValInt) GetIsNull

func (v ValInt) GetIsNull() bool

func (ValInt) GetIsSet

func (v ValInt) GetIsSet() bool

func (ValInt) GetValue

func (v ValInt) GetValue() int64

func (*ValInt) MarshalJSON

func (v *ValInt) MarshalJSON() ([]byte, error)

func (*ValInt) Scan

func (v *ValInt) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValInt) SetNull

func (v *ValInt) SetNull()

func (*ValInt) SetValue

func (v *ValInt) SetValue(vI int64)

func (ValInt) String

func (v ValInt) String() string

func (*ValInt) UnmarshalJSON

func (v *ValInt) UnmarshalJSON(data []byte) error

Custom Int unmarshal

func (ValInt) Value

func (v ValInt) Value() (driver.Value, error)

type ValInteger

type ValInteger interface {
	GetValue() int64
}

type ValJSON

type ValJSON struct {
	Val
	TypedValue []byte
}

func NewValJSON

func NewValJSON(val []byte, isNull bool) ValJSON

func (ValJSON) GetIsNull

func (v ValJSON) GetIsNull() bool

func (ValJSON) GetIsSet

func (v ValJSON) GetIsSet() bool

func (ValJSON) GetValue

func (v ValJSON) GetValue() []byte

func (*ValJSON) MarshalJSON

func (v *ValJSON) MarshalJSON() ([]byte, error)

func (*ValJSON) MarshalXML

func (v *ValJSON) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ValJSON) Scan

func (v *ValJSON) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValJSON) SetNull

func (v *ValJSON) SetNull()

func (*ValJSON) SetValue

func (v *ValJSON) SetValue(vAr []byte)

func (ValJSON) String

func (v ValJSON) String() string

func (*ValJSON) UnmarshalJSON

func (v *ValJSON) UnmarshalJSON(data []byte) error

Custom String unmarshal

func (ValJSON) Value

func (v ValJSON) Value() (driver.Value, error)

type ValRef

type ValRef struct {
	Val
	TypedValue Ref
}

func (ValRef) GetIsNull

func (v ValRef) GetIsNull() bool

func (ValRef) GetIsSet

func (v ValRef) GetIsSet() bool

func (ValRef) GetKeyAsInt

func (v ValRef) GetKeyAsInt(id string) int64

func (ValRef) GetKeyAsString

func (v ValRef) GetKeyAsString(id string) string

func (ValRef) GetValue

func (v ValRef) GetValue() *Ref

func (*ValRef) MarshalJSON

func (v *ValRef) MarshalJSON() ([]byte, error)

func (*ValRef) Scan

func (v *ValRef) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValRef) SetNull

func (v *ValRef) SetNull()

func (*ValRef) SetValue

func (v *ValRef) SetValue(vRef Ref)

func (ValRef) String

func (v ValRef) String() string

func (*ValRef) UnmarshalJSON

func (v *ValRef) UnmarshalJSON(data []byte) error

Custom String unmarshal

func (ValRef) Value

func (v ValRef) Value() (driver.Value, error)

type ValText

type ValText struct {
	Val
	TypedValue string
}

func NewValText

func NewValText(val string, isNull bool) ValText

func (ValText) GetIsNull

func (v ValText) GetIsNull() bool

func (ValText) GetIsSet

func (v ValText) GetIsSet() bool

func (ValText) GetValue

func (v ValText) GetValue() string

func (*ValText) MarshalJSON

func (v *ValText) MarshalJSON() ([]byte, error)

func (*ValText) Scan

func (v *ValText) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (*ValText) SetNull

func (v *ValText) SetNull()

func (*ValText) SetValue

func (v *ValText) SetValue(vStr string)

func (ValText) String

func (v ValText) String() string

func (*ValText) UnmarshalJSON

func (v *ValText) UnmarshalJSON(data []byte) error

Custom String unmarshal

func (ValText) Value

func (v ValText) Value() (driver.Value, error)

type ValTexter

type ValTexter interface {
	GetValue() string
}

type ValTime

type ValTime struct {
	ValDateTimeTZ
}

func (*ValTime) MarshalJSON

func (v *ValTime) MarshalJSON() ([]byte, error)

func (*ValTime) Scan

func (v *ValTime) Scan(value interface{}) error

func (ValTime) String

func (v ValTime) String() string

func (*ValTime) UnmarshalJSON

func (v *ValTime) UnmarshalJSON(data []byte) error

Custom Float unmarshal

type ValTimer

type ValTimer interface {
	GetValue() time.Time
}

type ValUint

type ValUint struct {
	Val
	TypedValue uint64
}

Ext type int

func NewValUint

func NewValUint(val uint64, isNull bool) ValUint

func (ValUint) GetIsNull

func (v ValUint) GetIsNull() bool

func (ValUint) GetIsSet

func (v ValUint) GetIsSet() bool

func (ValUint) GetValue

func (v ValUint) GetValue() uint64

func (*ValUint) MarshalJSON

func (v *ValUint) MarshalJSON() ([]byte, error)

func (*ValUint) Scan

func (v *ValUint) Scan(value interface{}) error

driver.Scanner, driver.Valuer interfaces

func (ValUint) SetNull

func (v ValUint) SetNull()

func (*ValUint) SetValue

func (v *ValUint) SetValue(vI uint64)

func (ValUint) String

func (v ValUint) String() string

func (*ValUint) UnmarshalJSON

func (v *ValUint) UnmarshalJSON(data []byte) error

Custom Int unmarshal

func (ValUint) Value

func (v ValUint) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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