orm

package
v0.0.0-...-64e2a4b Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package orm is a generated protocol buffer package.

It is generated from these files:

geometry.proto

It has these top-level messages:

Geometry

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQuery

func BuildQuery(components ...interface{}) (string, []interface{})

func HashStrings

func HashStrings(objects ...string) string

HashStrings will return a SHA256 hash of the provided arguments

func ISODate

func ISODate() string

ISODate returns a UTC date as string

func IsNullInt

func IsNullInt(v int32) bool

IsNullInt returns true if the value passed is a special null value

func JoinAsString

func JoinAsString(v []interface{}) string

JoinAsString will join the array passed as a string which is comma separated

func RandUID

func RandUID() int32

RandUID returns a random int32

func Stringify

func Stringify(v interface{}, opts ...interface{}) string

Stringify will return a JSON formatted string. pass an optional second argument to pretty print

func ToSQLBlob

func ToSQLBlob(buf []byte) sql.NullString

ToSQLBlob returns a sql.NullString from the value

func ToSQLBool

func ToSQLBool(v interface{}) sql.NullBool

ToSQLBool returns a sql.NullBool from the value

func ToSQLDate

func ToSQLDate(v interface{}) mysql.NullTime

ToSQLDate returns a mysql.NullTime for the value passed

func ToSQLFloat64

func ToSQLFloat64(v interface{}) sql.NullFloat64

ToSQLFloat64 returns a sql.NullFloat64 from the value

func ToSQLInt64

func ToSQLInt64(v interface{}) sql.NullInt64

ToSQLInt64 returns a sql.NullInt64 from the value

func ToSQLString

func ToSQLString(value interface{}) sql.NullString

ToSQLString returns a sql.NullString for value passed

func ToString

func ToString(v interface{}) string

ToString returns a string representation for the value passed

func ToTimestamp

func ToTimestamp(t mysql.NullTime) *tspb.Timestamp

ToTimestamp returns a proto Timestamp from a mysql.NullTime

func ToTimestampNow

func ToTimestampNow() *tspb.Timestamp

ToTimestampNow returns the proto Timestamp from curent time

func UUID

func UUID() string

UUID returns a unique ID

Types

type AndOr

type AndOr string
const (
	And AndOr = "AND"
	Or  AndOr = "OR"
)

type ColumnDef

type ColumnDef struct {
	Name  string
	Alias string
	Table string
	Expr  string
}

func Column

func Column(name string) ColumnDef

func ColumnAlias

func ColumnAlias(name, alias string) ColumnDef

func ColumnExpr

func ColumnExpr(expr string) ColumnDef

func ColumnExprAlias

func ColumnExprAlias(expr, alias string) ColumnDef

func Count

func Count(column string) ColumnDef

func CountAlias

func CountAlias(column, alias string) ColumnDef

func Max

func Max(column string) ColumnDef

func MaxAlias

func MaxAlias(column, alias string) ColumnDef

func Min

func Min(column string) ColumnDef

func MinAlias

func MinAlias(column, alias string) ColumnDef

func Sum

func Sum(column string) ColumnDef

func SumAlias

func SumAlias(column, alias string) ColumnDef

func TableColumn

func TableColumn(table, name string) ColumnDef

func TableColumnAlias

func TableColumnAlias(table, name, alias string) ColumnDef

func (ColumnDef) String

func (f ColumnDef) String() string

type ConditionDef

type ConditionDef struct {
	Name         string
	Func         string
	Operator     Operator
	OperatorExpr string
	Value        interface{}
}

func IsEqual

func IsEqual(name string, value interface{}) ConditionDef

func IsEqualExpr

func IsEqualExpr(expr string, value interface{}) ConditionDef

func IsGreaterThan

func IsGreaterThan(name string, value interface{}) ConditionDef

func IsGreaterThanEqual

func IsGreaterThanEqual(name string, value interface{}) ConditionDef

func IsGreaterThanEqualExpr

func IsGreaterThanEqualExpr(expr string, value interface{}) ConditionDef

func IsGreaterThanExpr

func IsGreaterThanExpr(expr string, value interface{}) ConditionDef

func IsIn

func IsIn(name string, value []interface{}) ConditionDef

func IsInExpr

func IsInExpr(expr string, value []interface{}) ConditionDef

func IsLessThan

func IsLessThan(name string, value interface{}) ConditionDef

func IsLessThanEqual

func IsLessThanEqual(name string, value interface{}) ConditionDef

func IsLessThanEqualExpr

func IsLessThanEqualExpr(expr string, value interface{}) ConditionDef

func IsLessThanExpr

func IsLessThanExpr(expr string, value interface{}) ConditionDef

func IsNotEqual

func IsNotEqual(name string, value interface{}) ConditionDef

func IsNotEqualExpr

func IsNotEqualExpr(expr string, value interface{}) ConditionDef

func IsNotExpr

func IsNotExpr(expr string) ConditionDef

func IsNotNull

func IsNotNull(name string) ConditionDef

func IsNull

func IsNull(name string) ConditionDef

func IsNullExpr

func IsNullExpr(expr string) ConditionDef

func (ConditionDef) AddValue

func (f ConditionDef) AddValue(array []interface{}) []interface{}

func (ConditionDef) String

func (f ConditionDef) String() string

type ConditionGroupDef

type ConditionGroupDef struct {
	Conditions []ConditionDef
	AndOr      AndOr
}

func AndGrouping

func AndGrouping(conditions ...ConditionDef) ConditionGroupDef

func OrGrouping

func OrGrouping(conditions ...ConditionDef) ConditionGroupDef

func (*ConditionGroupDef) Add

func (g *ConditionGroupDef) Add(conditions ...ConditionDef)

func (ConditionGroupDef) AddValue

func (g ConditionGroupDef) AddValue(params []interface{}) []interface{}

func (ConditionGroupDef) String

func (g ConditionGroupDef) String() string

type Direction

type Direction string
const (
	DirectionAscending  Direction = "ASC"
	DirectionDescending Direction = "DESC"
)

type Geometry

type Geometry struct {
	Latitude  float32 `protobuf:"fixed32,1,opt,name=latitude" json:"latitude,omitempty"`
	Longitude float32 `protobuf:"fixed32,2,opt,name=longitude" json:"longitude,omitempty"`
}

func ToGeometry

func ToGeometry(point string) *Geometry

ToGeometry will return a Geometry from a POINT string

func (*Geometry) Descriptor

func (*Geometry) Descriptor() ([]byte, []int)

func (*Geometry) GetLatitude

func (m *Geometry) GetLatitude() float32

func (*Geometry) GetLongitude

func (m *Geometry) GetLongitude() float32

func (*Geometry) ProtoMessage

func (*Geometry) ProtoMessage()

func (*Geometry) Reset

func (m *Geometry) Reset()

func (*Geometry) String

func (m *Geometry) String() string

type GroupDef

type GroupDef struct {
	Name string
}

func GroupBy

func GroupBy(name string) GroupDef

func (GroupDef) String

func (g GroupDef) String() string

type JoinDef

type JoinDef struct {
	A string
	B string
}

func Join

func Join(a, b string) JoinDef

func (JoinDef) String

func (j JoinDef) String() string

type LimitDef

type LimitDef struct {
	Total int32
}

func Limit

func Limit(max int32) LimitDef

func (LimitDef) String

func (l LimitDef) String() string

type NullIntType

type NullIntType int32

NullIntType is a special null type int32

const NullInt32 NullIntType = -2147483647

NullInt32 is a magic int32 which represents null

func (*NullIntType) Scan

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

Scan will do the proper deserialization for SQL inserting

func (NullIntType) String

func (v NullIntType) String() string

func (NullIntType) Value

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

Value will do the proper serialization for SQL inserting

type Operator

type Operator string
const (
	OperatorEqual            Operator = "="
	OperatorNotEqual         Operator = "!="
	OperatorGreaterThan      Operator = ">"
	OperatorLessThan         Operator = "<"
	OperatorGreaterThanEqual Operator = ">="
	OperatorLessThanEqual    Operator = "<="
	OperatorNull             Operator = "IS NULL"
	OperatorNotNull          Operator = "IS NOT NULL"
	OperatorIn               Operator = "IN"
)

type OrderDef

type OrderDef struct {
	Name      string
	Direction Direction
}

func Ascending

func Ascending(name string) OrderDef

func Descending

func Descending(name string) OrderDef

func (OrderDef) String

func (o OrderDef) String() string

type RangeDef

type RangeDef struct {
	Offset int32
	Max    int32
}

func Range

func Range(offset, max int32) RangeDef

func (RangeDef) String

func (r RangeDef) String() string

type TableDef

type TableDef struct {
	Name  string
	Alias string
}

func Table

func Table(name string) TableDef

func TableAlias

func TableAlias(name, alias string) TableDef

func (TableDef) String

func (t TableDef) String() string

Jump to

Keyboard shortcuts

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