Documentation ¶
Overview ¶
Package types contains generic data types for use with SQL
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BigUint64 ¶
type BigUint64 uint64
BigUint64 is an encapsulated uint64 that can be stored in a database
type Duration ¶
Duration is an instance of time.Duration which implements the SQL Valuer and Scanner interfaces, so it can be stored in a database. Its SQL type should be integer.
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
Language represents an ISO639 language. Its SQL type could be varchar(3).
func MustParseLanguage ¶
MustParseLanguage parses a language code (either 2-letter or 3-letter). Panics on failiure.
func NewLanguage ¶
NewLanguage creates a language from language.Base
func ParseLanguage ¶
ParseLanguage parses a language code (either 2-letter or 3-letter)
func (*Language) String ¶
String returns the 2-letter representation of the language (same as ISO2, implements the fmt.Stringer interface)
func (*Language) UnmarshalText ¶
UnmarshalText parses a language code from raw text
type Languages ¶
type Languages []Language
Languages represents an array of languages (its SQL type should be text or varchar)
func MustParseLanguages ¶
MustParseLanguages parses languages from a space-separated list of language codes, and panics on failiure
func NewLanguages ¶
NewLanguages creates a list of languages based on bases
func ParseLanguages ¶
ParseLanguages parses languages from a space-separated list of language codes
type MapStringStepStatus ¶
type MapStringStepStatus map[string]*StepStatus
MapStringStepStatus is an instance of map[string]*StepStatus which implements the SQL Valuer and Scanner interfaces, so it can be stored in a database. Its SQL type should be blob.
func (MapStringStepStatus) For ¶
func (m MapStringStepStatus) For(key string) *StepStatus
For returns the status for the given step (key). Same as using [], but when the key is not found it fills it with a default status instead of returning nil
func (*MapStringStepStatus) Scan ¶
func (m *MapStringStepStatus) Scan(src interface{}) error
Scan deserialises the object from raw database data
type MapStringString ¶
MapStringString is an instance of map[string]string which implements the SQL Valuer and Scanner interfaces, so it can be stored in a database. Its SQL type should be integer.
func (*MapStringString) Scan ¶
func (m *MapStringString) Scan(src interface{}) error
Scan deserialises the object from raw database data
type SliceString ¶
type SliceString []string
SliceString is an instance of []string which implements the SQL Valuer and Scanner interfaces, so it can be stored in a database. Its SQL type should be blob.
func (*SliceString) Scan ¶
func (m *SliceString) Scan(src interface{}) error
Scan deserialises the object from raw database data
type StepStatus ¶
StepStatus contains the state of an import state and a string message
func (*StepStatus) Errorf ¶
func (m *StepStatus) Errorf(message string, arguments ...interface{})
Errorf sets the status to Error and writes a message
type Template ¶
Template wraps a text template for generating strings
func MustParseTemplate ¶
MustParseTemplate creates a new template from the string and panics on failiure.
func ParseTemplate ¶
ParseTemplate creates a new template from the string
func (*Template) UnmarshalString ¶
UnmarshalString parses the template from a string
func (*Template) UnmarshalText ¶
UnmarshalText parses the template from text