Documentation ¶
Index ¶
- Constants
- Variables
- func Callback(name string, eptr reflect.Value, arg []reflect.Value) error
- type ActiveRecord
- func (ar *ActiveRecord) Delete() error
- func (ar *ActiveRecord) Distinct() *ActiveRecord
- func (ar *ActiveRecord) Errors() map[string]*validations.ValidationError
- func (ar *ActiveRecord) ModelName() string
- func (ar *ActiveRecord) Order(orderBy OrderBy) *ActiveRecord
- func (ar *ActiveRecord) Pluck(keys ...interface{}) *ActiveRecord
- func (ar *ActiveRecord) Query() *Query
- func (ar *ActiveRecord) Run(results interface{}) error
- func (ar *ActiveRecord) Save() (success bool, err error)
- func (ar *ActiveRecord) Self() ActiveRecordInterfacer
- func (ar *ActiveRecord) SetQuery(query *Query)
- func (ar *ActiveRecord) SetSelf(ari ActiveRecordInterfacer)
- func (ar *ActiveRecord) Sum(fields ...interface{}) *ActiveRecord
- func (ar *ActiveRecord) Valid() bool
- func (ar *ActiveRecord) Where(where QueryCondition) *ActiveRecord
- type ActiveRecordInterfacer
- type CouchbaseConfig
- type CustomModelNamer
- type DynamoDBConfig
- type EnumAggregations
- type EnumLogicalOperators
- type EnumRelationalOperators
- type EnumSortOrders
- type MSSQLConfig
- type OrchestrateConfig
- type OrderBy
- type Persister
- type PostgresqlDBConfig
- type Querier
- type Query
- type QueryCondition
- type RDBMSer
- type RethinkDBConfig
- type Timestamps
- type Validater
Constants ¶
View Source
const COUCHBASE = "couchbase"
View Source
const DYNAMODB = "dynamodb"
View Source
const MSSQL = "mssql"
View Source
const ORCHESTRATE = "orchestrate"
View Source
const POSTGRESQL = "postgresql"
View Source
const RETHINKDB = "rethinkdb"
Variables ¶
View Source
var Config *config
Functions ¶
Types ¶
type ActiveRecord ¶
type ActiveRecord struct { validations.Validation // contains filtered or unexported fields }
func (*ActiveRecord) Delete ¶
func (ar *ActiveRecord) Delete() error
func (*ActiveRecord) Distinct ¶
func (ar *ActiveRecord) Distinct() *ActiveRecord
func (*ActiveRecord) Errors ¶
func (ar *ActiveRecord) Errors() map[string]*validations.ValidationError
func (*ActiveRecord) ModelName ¶
func (ar *ActiveRecord) ModelName() string
func (*ActiveRecord) Order ¶
func (ar *ActiveRecord) Order(orderBy OrderBy) *ActiveRecord
func (*ActiveRecord) Pluck ¶
func (ar *ActiveRecord) Pluck(keys ...interface{}) *ActiveRecord
func (*ActiveRecord) Query ¶
func (ar *ActiveRecord) Query() *Query
func (*ActiveRecord) Run ¶
func (ar *ActiveRecord) Run(results interface{}) error
func (*ActiveRecord) Save ¶
func (ar *ActiveRecord) Save() (success bool, err error)
func (*ActiveRecord) Self ¶
func (ar *ActiveRecord) Self() ActiveRecordInterfacer
func (*ActiveRecord) SetQuery ¶
func (ar *ActiveRecord) SetQuery(query *Query)
func (*ActiveRecord) SetSelf ¶
func (ar *ActiveRecord) SetSelf(ari ActiveRecordInterfacer)
func (*ActiveRecord) Sum ¶
func (ar *ActiveRecord) Sum(fields ...interface{}) *ActiveRecord
func (*ActiveRecord) Valid ¶
func (ar *ActiveRecord) Valid() bool
func (*ActiveRecord) Where ¶
func (ar *ActiveRecord) Where(where QueryCondition) *ActiveRecord
type ActiveRecordInterfacer ¶
type ActiveRecordInterfacer interface { Validater Querier ModelName() string DBConnectionName() string // EX: aws1, aws2, azure1, azure2, default DBConnectionEnvironment() string // EX: dev, qa, ci, prod SetKey(string) //PrimaryKey() string Self() ActiveRecordInterfacer SetSelf(ActiveRecordInterfacer) //Query() *Query //SetQuery(*Query) Truncate() (numRowsDeleted int, err error) All(results interface{}, opts map[string]interface{}) error Find(id interface{}, out interface{}) error Save() (success bool, err error) Delete() error }
func ToAR ¶
func ToAR(ari ActiveRecordInterfacer) ActiveRecordInterfacer
type CouchbaseConfig ¶
type CouchbaseConfig struct { ConnectionName string ClusterAddress string BucketName string BucketPassword string }
CouchbaseConfig => contains couchbase db connection info
type CustomModelNamer ¶
type CustomModelNamer interface {
CustomModelName() string
}
type DynamoDBConfig ¶
type DynamoDBConfig struct { ConnectionName string Region string AccessKey string SecretKey string }
DynamoDBConfig => contains dynamodb db connection info
type EnumRelationalOperators ¶
type EnumRelationalOperators int
const ( EQ EnumRelationalOperators // equal NE // not equal LT // less than LTE // less than or equal GT // greater than GTE // greater than or equal IN )
type MSSQLConfig ¶
type MSSQLConfig struct { ConnectionName string Server string Port int DBName string Username string Password string MaxIdleConnections int MaxOpenConnections int Debug bool }
MSSQLConfig => contains mssql db connection info
type OrchestrateConfig ¶
OrchestrateConfig => contains orchestrate db connection info
type OrderBy ¶
type OrderBy struct { Key string SortOrder EnumSortOrders }
type PostgresqlDBConfig ¶
type PostgresqlDBConfig struct { ConnectionName string Server string Port int DBName string Username string Password string MaxIdleConnections int MaxOpenConnections int Debug bool }
PostgresqlDBConfig => contains postgresql db connection info
type Querier ¶
type Querier interface { Query() *Query SetQuery(*Query) Pluck(...interface{}) *ActiveRecord Where(QueryCondition) *ActiveRecord Order(OrderBy) *ActiveRecord Sum(fields ...interface{}) *ActiveRecord Distinct() *ActiveRecord //Or(QueryCondition) *ActiveRecord Run(results interface{}) error }
type Query ¶
type Query struct { //db *DB //OrConditions []QueryCondition //NotConditions []QueryCondition Plucks []interface{} WhereConditions []QueryCondition OrderBys []OrderBy Joins string Offset string Limit string Aggregations map[EnumAggregations][]interface{} Distinct bool // contains filtered or unexported fields }
type QueryCondition ¶
type QueryCondition struct { LogicalOperator EnumLogicalOperators Key string RelationalOperator EnumRelationalOperators Value interface{} }
type RethinkDBConfig ¶
type RethinkDBConfig struct { ConnectionName string Addresses []string DBName string AuthKey string DiscoverHosts bool MaxIdleConnections int MaxOpenConnections int Debug bool }
RethinkDBConfig => contains rethinkdb db connection info
type Timestamps ¶
type Validater ¶
type Validater interface { Valid() bool Validate() Errors() map[string]*validations.ValidationError }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.