types

package
v0.0.0-...-2b35e24 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

A Context is a map of objects that is passed along from function to function during a transaction. A Context is read only.

func NewContext

func NewContext(data ...map[string]interface{}) *Context

NewContext returns a new Context instance

func (Context) Copy

func (c Context) Copy() *Context

Copy returns a shallow copy of the Context

func (*Context) Get

func (c *Context) Get(key string) interface{}

Get returns the value of this Context for the given key

func (*Context) HasKey

func (c *Context) HasKey(key string) bool

HasKey returns true if this Context has the given key

func (Context) IsEmpty

func (c Context) IsEmpty() bool

IsEmpty returns true if this Context has no entries.

func (Context) ToMap

func (c Context) ToMap() map[string]interface{}

ToMap returns a copy of the map of values of this context

func (Context) WithKey

func (c Context) WithKey(key string, value interface{}) *Context

WithKey returns a copy of this context with the given key/value. If key already exists, it is overwritten.

type Date

type Date time.Time

Date type that JSON marshal and unmarshals as "YYYY-MM-DD"

func Today

func Today() Date

Today returns the current date

func (Date) IsNull

func (d Date) IsNull() bool

IsNull returns true if the Date is the zero value

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON for Date type

func (Date) Value

func (d Date) Value() (driver.Value, error)

Value formats our Date for storing in database Especially handles empty Date.

type DateTime

type DateTime time.Time

DateTime type that JSON marshals and unmarshals as "YYYY-MM-DD HH:MM:SS"

func Now

func Now() DateTime

Now returns the current date/time

func (DateTime) IsNull

func (d DateTime) IsNull() bool

IsNull returns true if the DateTime is the zero value

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

MarshalJSON for DateTime type

func (DateTime) Value

func (d DateTime) Value() (driver.Value, error)

Value formats our DateTime for storing in database Especially handles empty DateTime.

type Digits

type Digits struct {
	Precision int8
	Scale     int8
}

Digits holds precision and scale information for a float (numeric) type: - The precision: the total number of digits - The scale: the number of digits to the right of the decimal point (PostgresSQL definitions)

type Selection

type Selection map[string]string

A Selection is a set of possible (key, label) values for a model "selection" field.

Jump to

Keyboard shortcuts

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