model

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAIR = "pair"
	HASH = "hash"
	SET  = "set"
	ZSET = "zset"
	GEO  = "geo"
	LIST = "list"

	ERROR_SPLIT = "#-#"
)

Variables

View Source
var BlogColumns = struct {
	Id        string
	UserId    string
	Title     string
	Content   string
	Status    string
	Readed    string
	CreatedAt string
	UpdatedAt string
}{
	"id",
	"user_id",
	"title",
	"content",
	"status",
	"readed",
	"created_at",
	"updated_at",
}
View Source
var BlogElasticFields = struct {
	Title     string
	Content   string
	CreatedAt string
}{
	"title",
	"content",
	"created_at",
}

! orm.elastic

View Source
var BlogElasticMgr = &_BlogElasticMgr{}
View Source
var BlogMgr *_BlogMgr
View Source
var IndexedBlogElasticFields = struct {
	Title     string
	Content   string
	CreatedAt string
	UpdatedAt string
}{
	"title",
	"content",
	"created_at",
	"updated_at",
}

! orm.elastic

View Source
var IndexedBlogElasticMgr = &_IndexedBlogElasticMgr{}
View Source
var IndexedBlogMgr *_IndexedBlogMgr
View Source
var UserBaseInfoColumns = struct {
	Id       string
	Name     string
	Mailbox  string
	Password string
	Sex      string
}{
	"id",
	"name",
	"mailbox",
	"password",
	"sex",
}
View Source
var UserBaseInfoMgr *_UserBaseInfoMgr
View Source
var UserBlogsColumns = struct {
	UserId string
	BlogId string
}{
	"user_id",
	"blog_id",
}
View Source
var UserBlogsMgr *_UserBlogsMgr
View Source
var UserColumns = struct {
	Id          string
	Name        string
	Mailbox     string
	Sex         string
	Age         string
	Longitude   string
	Latitude    string
	Description string
	Password    string
	HeadUrl     string
	Status      string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   string
}{
	"id",
	"name",
	"mailbox",
	"sex",
	"age",
	"longitude",
	"latitude",
	"description",
	"password",
	"head_url",
	"status",
	"created_at",
	"updated_at",
	"deleted_at",
}
View Source
var UserInfoMgr *_UserInfoMgr
View Source
var UserMgr *_UserMgr

Functions

func AgeOfUserRNGRelationRedisMgr

func AgeOfUserRNGRelationRedisMgr(stores ...*orm.RedisStore) *_AgeOfUserRNGRelationRedisMgr

func BlogDBMgr

func BlogDBMgr(db orm.DB) *_BlogDBMgr

func ElasticSetup

func ElasticSetup(cfg ESConfig)

func IdOfUserRNGRelationRedisMgr

func IdOfUserRNGRelationRedisMgr(stores ...*orm.RedisStore) *_IdOfUserRNGRelationRedisMgr

func MailboxPasswordOfUserUKRelationRedisMgr

func MailboxPasswordOfUserUKRelationRedisMgr(stores ...*orm.RedisStore) *_MailboxPasswordOfUserUKRelationRedisMgr

func MySQL

func MySQL() *orm.DBStore

func MySQLSetup

func MySQLSetup(cf *MySQLConfig)

func Redis

func Redis() *orm.RedisStore

func RedisSetUp

func RedisSetUp(cf *RedisConfig)

func SexOfUserIDXRelationRedisMgr

func SexOfUserIDXRelationRedisMgr(stores ...*orm.RedisStore) *_SexOfUserIDXRelationRedisMgr

func SexUserLocationDBMgr

func SexUserLocationDBMgr(db orm.DB) *_SexUserLocationDBMgr

func SexUserLocationRedisMgr

func SexUserLocationRedisMgr(stores ...*orm.RedisStore) *_SexUserLocationRedisMgr

func SplitError

func SplitError(err error) []error

处理error,把一个error变成error数组

func UserBaseInfoDBMgr

func UserBaseInfoDBMgr(db orm.DB) *_UserBaseInfoDBMgr

func UserBlogsDBMgr

func UserBlogsDBMgr(db orm.DB) *_UserBlogsDBMgr

func UserDBMgr

func UserDBMgr(db orm.DB) *_UserDBMgr

func UserIdDBMgr

func UserIdDBMgr(db orm.DB) *_UserIdDBMgr

func UserIdRedisMgr

func UserIdRedisMgr(stores ...*orm.RedisStore) *_UserIdRedisMgr

func UserInfoDBMgr

func UserInfoDBMgr(db orm.DB) *_UserInfoDBMgr

func UserLocationDBMgr

func UserLocationDBMgr(db orm.DB) *_UserLocationDBMgr

func UserLocationRedisMgr

func UserLocationRedisMgr(stores ...*orm.RedisStore) *_UserLocationRedisMgr

func UserRedisMgr

func UserRedisMgr(store *orm.RedisStore) *_UserRedisMgr

Types

type AgeOfUserRNG

type AgeOfUserRNG struct {
	AgeBegin int64
	AgeEnd   int64
	// contains filtered or unexported fields
}

func (*AgeOfUserRNG) Begin

func (u *AgeOfUserRNG) Begin() int64

func (*AgeOfUserRNG) End

func (u *AgeOfUserRNG) End() int64

func (*AgeOfUserRNG) IncludeBegin

func (u *AgeOfUserRNG) IncludeBegin(f bool)

func (*AgeOfUserRNG) IncludeEnd

func (u *AgeOfUserRNG) IncludeEnd(f bool)

func (*AgeOfUserRNG) Key

func (u *AgeOfUserRNG) Key() string

func (*AgeOfUserRNG) Limit

func (u *AgeOfUserRNG) Limit(n int)

func (*AgeOfUserRNG) Offset

func (u *AgeOfUserRNG) Offset(n int)

func (*AgeOfUserRNG) PositionOffsetLimit

func (u *AgeOfUserRNG) PositionOffsetLimit(len int) (int, int)

func (*AgeOfUserRNG) RNGRelation

func (u *AgeOfUserRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*AgeOfUserRNG) Revert

func (u *AgeOfUserRNG) Revert(b bool)

func (*AgeOfUserRNG) SQLFormat

func (u *AgeOfUserRNG) SQLFormat(limit bool) string

func (*AgeOfUserRNG) SQLLimit

func (u *AgeOfUserRNG) SQLLimit() int

func (*AgeOfUserRNG) SQLParams

func (u *AgeOfUserRNG) SQLParams() []interface{}

type AgeOfUserRNGRelation

type AgeOfUserRNGRelation struct {
	Key   string  `db:"key" json:"key"`
	Score float64 `db:"score" json:"score"`
	Value string  `db:"value" json:"value"`
}

! relation

func (*AgeOfUserRNGRelation) GetClassName

func (relation *AgeOfUserRNGRelation) GetClassName() string

func (*AgeOfUserRNGRelation) GetIndexes

func (relation *AgeOfUserRNGRelation) GetIndexes() []string

func (*AgeOfUserRNGRelation) GetStoreType

func (relation *AgeOfUserRNGRelation) GetStoreType() string

type Blog

type Blog struct {
	Id        int32     `db:"id" json:"id"`
	UserId    int32     `db:"user_id" json:"user_id"`
	Title     string    `db:"title" json:"title"`
	Content   string    `db:"content" json:"content"`
	Status    int32     `db:"status" json:"status"`
	Readed    int32     `db:"readed" json:"readed"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

func (*Blog) GetClassName

func (obj *Blog) GetClassName() string

func (*Blog) GetColumns

func (obj *Blog) GetColumns() []string

func (*Blog) GetNameSpace

func (obj *Blog) GetNameSpace() string

func (*Blog) GetNoneIncrementColumns

func (obj *Blog) GetNoneIncrementColumns() []string

func (*Blog) GetPrimaryKey

func (obj *Blog) GetPrimaryKey() PrimaryKey

func (*Blog) GetTableName

func (obj *Blog) GetTableName() string

func (*Blog) Validate

func (obj *Blog) Validate() error

type DBFetcher

type DBFetcher interface {
	FetchBySQL(sql string, args ...interface{}) ([]interface{}, error)
}

type ESClient

type ESClient struct {
	*elastic.Client
	IndexName string
}

func ElasticClient

func ElasticClient() *ESClient

func (*ESClient) IndexService

func (e *ESClient) IndexService(index string) *elastic.IndexService

func (*ESClient) PutMappingService

func (e *ESClient) PutMappingService(index string) *elastic.PutMappingService

type ESConfig

type ESConfig struct {
	Endpoints   []string
	MaxRetries  int
	EnableGzip  bool
	HTTPTimeout time.Duration
	IndexName   string
}

func (*ESConfig) NewClient

func (e *ESConfig) NewClient() (*ESClient, error)

type Finder

type Finder interface {
	FindOne(unique Unique) (PrimaryKey, error)
	Find(index Index) (int64, []PrimaryKey, error)
	Range(scope Range) (int64, []PrimaryKey, error)
	RangeRevert(scope Range) (int64, []PrimaryKey, error)
}

type IdOfIndexedBlogPK

type IdOfIndexedBlogPK struct {
	Id int32
}

func (*IdOfIndexedBlogPK) Columns

func (u *IdOfIndexedBlogPK) Columns() []string

func (*IdOfIndexedBlogPK) Key

func (u *IdOfIndexedBlogPK) Key() string

func (*IdOfIndexedBlogPK) Parse

func (u *IdOfIndexedBlogPK) Parse(key string) error

func (*IdOfIndexedBlogPK) SQLFormat

func (u *IdOfIndexedBlogPK) SQLFormat() string

func (*IdOfIndexedBlogPK) SQLParams

func (u *IdOfIndexedBlogPK) SQLParams() []interface{}

type IdOfIndexedBlogRNG

type IdOfIndexedBlogRNG struct {
	IdBegin int64
	IdEnd   int64
	// contains filtered or unexported fields
}

func (*IdOfIndexedBlogRNG) Begin

func (u *IdOfIndexedBlogRNG) Begin() int64

func (*IdOfIndexedBlogRNG) End

func (u *IdOfIndexedBlogRNG) End() int64

func (*IdOfIndexedBlogRNG) IncludeBegin

func (u *IdOfIndexedBlogRNG) IncludeBegin(f bool)

func (*IdOfIndexedBlogRNG) IncludeEnd

func (u *IdOfIndexedBlogRNG) IncludeEnd(f bool)

func (*IdOfIndexedBlogRNG) Key

func (u *IdOfIndexedBlogRNG) Key() string

func (*IdOfIndexedBlogRNG) Limit

func (u *IdOfIndexedBlogRNG) Limit(n int)

func (*IdOfIndexedBlogRNG) Offset

func (u *IdOfIndexedBlogRNG) Offset(n int)

func (*IdOfIndexedBlogRNG) PositionOffsetLimit

func (u *IdOfIndexedBlogRNG) PositionOffsetLimit(len int) (int, int)

func (*IdOfIndexedBlogRNG) RNGRelation

func (u *IdOfIndexedBlogRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*IdOfIndexedBlogRNG) Revert

func (u *IdOfIndexedBlogRNG) Revert(b bool)

func (*IdOfIndexedBlogRNG) SQLFormat

func (u *IdOfIndexedBlogRNG) SQLFormat(limit bool) string

func (*IdOfIndexedBlogRNG) SQLLimit

func (u *IdOfIndexedBlogRNG) SQLLimit() int

func (*IdOfIndexedBlogRNG) SQLParams

func (u *IdOfIndexedBlogRNG) SQLParams() []interface{}

type IdOfUserBaseInfoPK

type IdOfUserBaseInfoPK struct {
	Id int32
}

func (*IdOfUserBaseInfoPK) Columns

func (u *IdOfUserBaseInfoPK) Columns() []string

func (*IdOfUserBaseInfoPK) Key

func (u *IdOfUserBaseInfoPK) Key() string

func (*IdOfUserBaseInfoPK) Parse

func (u *IdOfUserBaseInfoPK) Parse(key string) error

func (*IdOfUserBaseInfoPK) SQLFormat

func (u *IdOfUserBaseInfoPK) SQLFormat() string

func (*IdOfUserBaseInfoPK) SQLParams

func (u *IdOfUserBaseInfoPK) SQLParams() []interface{}

type IdOfUserBaseInfoRNG

type IdOfUserBaseInfoRNG struct {
	IdBegin int64
	IdEnd   int64
	// contains filtered or unexported fields
}

func (*IdOfUserBaseInfoRNG) Begin

func (u *IdOfUserBaseInfoRNG) Begin() int64

func (*IdOfUserBaseInfoRNG) End

func (u *IdOfUserBaseInfoRNG) End() int64

func (*IdOfUserBaseInfoRNG) IncludeBegin

func (u *IdOfUserBaseInfoRNG) IncludeBegin(f bool)

func (*IdOfUserBaseInfoRNG) IncludeEnd

func (u *IdOfUserBaseInfoRNG) IncludeEnd(f bool)

func (*IdOfUserBaseInfoRNG) Key

func (u *IdOfUserBaseInfoRNG) Key() string

func (*IdOfUserBaseInfoRNG) Limit

func (u *IdOfUserBaseInfoRNG) Limit(n int)

func (*IdOfUserBaseInfoRNG) Offset

func (u *IdOfUserBaseInfoRNG) Offset(n int)

func (*IdOfUserBaseInfoRNG) PositionOffsetLimit

func (u *IdOfUserBaseInfoRNG) PositionOffsetLimit(len int) (int, int)

func (*IdOfUserBaseInfoRNG) RNGRelation

func (u *IdOfUserBaseInfoRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*IdOfUserBaseInfoRNG) Revert

func (u *IdOfUserBaseInfoRNG) Revert(b bool)

func (*IdOfUserBaseInfoRNG) SQLFormat

func (u *IdOfUserBaseInfoRNG) SQLFormat(limit bool) string

func (*IdOfUserBaseInfoRNG) SQLLimit

func (u *IdOfUserBaseInfoRNG) SQLLimit() int

func (*IdOfUserBaseInfoRNG) SQLParams

func (u *IdOfUserBaseInfoRNG) SQLParams() []interface{}

type IdOfUserPK

type IdOfUserPK struct {
	Id int32
}

func (*IdOfUserPK) Columns

func (u *IdOfUserPK) Columns() []string

func (*IdOfUserPK) Key

func (u *IdOfUserPK) Key() string

func (*IdOfUserPK) Parse

func (u *IdOfUserPK) Parse(key string) error

func (*IdOfUserPK) SQLFormat

func (u *IdOfUserPK) SQLFormat() string

func (*IdOfUserPK) SQLParams

func (u *IdOfUserPK) SQLParams() []interface{}

type IdOfUserRNG

type IdOfUserRNG struct {
	IdBegin int64
	IdEnd   int64
	// contains filtered or unexported fields
}

func (*IdOfUserRNG) Begin

func (u *IdOfUserRNG) Begin() int64

func (*IdOfUserRNG) End

func (u *IdOfUserRNG) End() int64

func (*IdOfUserRNG) IncludeBegin

func (u *IdOfUserRNG) IncludeBegin(f bool)

func (*IdOfUserRNG) IncludeEnd

func (u *IdOfUserRNG) IncludeEnd(f bool)

func (*IdOfUserRNG) Key

func (u *IdOfUserRNG) Key() string

func (*IdOfUserRNG) Limit

func (u *IdOfUserRNG) Limit(n int)

func (*IdOfUserRNG) Offset

func (u *IdOfUserRNG) Offset(n int)

func (*IdOfUserRNG) PositionOffsetLimit

func (u *IdOfUserRNG) PositionOffsetLimit(len int) (int, int)

func (*IdOfUserRNG) RNGRelation

func (u *IdOfUserRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*IdOfUserRNG) Revert

func (u *IdOfUserRNG) Revert(b bool)

func (*IdOfUserRNG) SQLFormat

func (u *IdOfUserRNG) SQLFormat(limit bool) string

func (*IdOfUserRNG) SQLLimit

func (u *IdOfUserRNG) SQLLimit() int

func (*IdOfUserRNG) SQLParams

func (u *IdOfUserRNG) SQLParams() []interface{}

type IdOfUserRNGRelation

type IdOfUserRNGRelation struct {
	Key   string  `db:"key" json:"key"`
	Score float64 `db:"score" json:"score"`
	Value string  `db:"value" json:"value"`
}

! relation

func (*IdOfUserRNGRelation) GetClassName

func (relation *IdOfUserRNGRelation) GetClassName() string

func (*IdOfUserRNGRelation) GetIndexes

func (relation *IdOfUserRNGRelation) GetIndexes() []string

func (*IdOfUserRNGRelation) GetStoreType

func (relation *IdOfUserRNGRelation) GetStoreType() string

type IdUserIdOfBlogPK

type IdUserIdOfBlogPK struct {
	Id     int32
	UserId int32
}

func (*IdUserIdOfBlogPK) Columns

func (u *IdUserIdOfBlogPK) Columns() []string

func (*IdUserIdOfBlogPK) Key

func (u *IdUserIdOfBlogPK) Key() string

func (*IdUserIdOfBlogPK) Parse

func (u *IdUserIdOfBlogPK) Parse(key string) error

func (*IdUserIdOfBlogPK) SQLFormat

func (u *IdUserIdOfBlogPK) SQLFormat() string

func (*IdUserIdOfBlogPK) SQLParams

func (u *IdUserIdOfBlogPK) SQLParams() []interface{}

type IdUserIdOfBlogRNG

type IdUserIdOfBlogRNG struct {
	Id          int32
	UserIdBegin int64
	UserIdEnd   int64
	// contains filtered or unexported fields
}

func (*IdUserIdOfBlogRNG) Begin

func (u *IdUserIdOfBlogRNG) Begin() int64

func (*IdUserIdOfBlogRNG) End

func (u *IdUserIdOfBlogRNG) End() int64

func (*IdUserIdOfBlogRNG) IncludeBegin

func (u *IdUserIdOfBlogRNG) IncludeBegin(f bool)

func (*IdUserIdOfBlogRNG) IncludeEnd

func (u *IdUserIdOfBlogRNG) IncludeEnd(f bool)

func (*IdUserIdOfBlogRNG) Key

func (u *IdUserIdOfBlogRNG) Key() string

func (*IdUserIdOfBlogRNG) Limit

func (u *IdUserIdOfBlogRNG) Limit(n int)

func (*IdUserIdOfBlogRNG) Offset

func (u *IdUserIdOfBlogRNG) Offset(n int)

func (*IdUserIdOfBlogRNG) PositionOffsetLimit

func (u *IdUserIdOfBlogRNG) PositionOffsetLimit(len int) (int, int)

func (*IdUserIdOfBlogRNG) RNGRelation

func (u *IdUserIdOfBlogRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*IdUserIdOfBlogRNG) Revert

func (u *IdUserIdOfBlogRNG) Revert(b bool)

func (*IdUserIdOfBlogRNG) SQLFormat

func (u *IdUserIdOfBlogRNG) SQLFormat(limit bool) string

func (*IdUserIdOfBlogRNG) SQLLimit

func (u *IdUserIdOfBlogRNG) SQLLimit() int

func (*IdUserIdOfBlogRNG) SQLParams

func (u *IdUserIdOfBlogRNG) SQLParams() []interface{}

type Index

type Index interface {
	SQL
	Key() string
	PositionOffsetLimit(len int) (int, int)
	IDXRelation(store *orm.RedisStore) IndexRelation
}

type IndexRelation

type IndexRelation interface {
	Find(key string) ([]string, error)
}

type IndexedBlog

type IndexedBlog struct {
	Id        int32     `json:"id"`
	UserId    int32     `json:"user_id"`
	Hash      string    `json:"hash"`
	Title     string    `json:"title"`
	Content   string    `json:"content"`
	Readed    int32     `json:"readed"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*IndexedBlog) GetClassName

func (obj *IndexedBlog) GetClassName() string

func (*IndexedBlog) GetColumns

func (obj *IndexedBlog) GetColumns() []string

func (*IndexedBlog) GetNameSpace

func (obj *IndexedBlog) GetNameSpace() string

func (*IndexedBlog) GetNoneIncrementColumns

func (obj *IndexedBlog) GetNoneIncrementColumns() []string

func (*IndexedBlog) GetPrimaryKey

func (obj *IndexedBlog) GetPrimaryKey() PrimaryKey

func (*IndexedBlog) GetTableName

func (obj *IndexedBlog) GetTableName() string

func (*IndexedBlog) Validate

func (obj *IndexedBlog) Validate() error

type MailboxPasswordOfUserBaseInfoUK

type MailboxPasswordOfUserBaseInfoUK struct {
	Mailbox  string
	Password string
}

func (*MailboxPasswordOfUserBaseInfoUK) Key

func (*MailboxPasswordOfUserBaseInfoUK) Limit

func (*MailboxPasswordOfUserBaseInfoUK) Offset

func (u *MailboxPasswordOfUserBaseInfoUK) Offset(n int)

func (*MailboxPasswordOfUserBaseInfoUK) SQLFormat

func (u *MailboxPasswordOfUserBaseInfoUK) SQLFormat(limit bool) string

func (*MailboxPasswordOfUserBaseInfoUK) SQLLimit

func (u *MailboxPasswordOfUserBaseInfoUK) SQLLimit() int

func (*MailboxPasswordOfUserBaseInfoUK) SQLParams

func (u *MailboxPasswordOfUserBaseInfoUK) SQLParams() []interface{}

func (*MailboxPasswordOfUserBaseInfoUK) UKRelation

type MailboxPasswordOfUserUK

type MailboxPasswordOfUserUK struct {
	Mailbox  string
	Password string
}

func (*MailboxPasswordOfUserUK) Key

func (*MailboxPasswordOfUserUK) Limit

func (u *MailboxPasswordOfUserUK) Limit(n int)

func (*MailboxPasswordOfUserUK) Offset

func (u *MailboxPasswordOfUserUK) Offset(n int)

func (*MailboxPasswordOfUserUK) SQLFormat

func (u *MailboxPasswordOfUserUK) SQLFormat(limit bool) string

func (*MailboxPasswordOfUserUK) SQLLimit

func (u *MailboxPasswordOfUserUK) SQLLimit() int

func (*MailboxPasswordOfUserUK) SQLParams

func (u *MailboxPasswordOfUserUK) SQLParams() []interface{}

func (*MailboxPasswordOfUserUK) UKRelation

func (u *MailboxPasswordOfUserUK) UKRelation(store *orm.RedisStore) UniqueRelation

type MailboxPasswordOfUserUKRelation

type MailboxPasswordOfUserUKRelation struct {
	Key   string `db:"key" json:"key"`
	Value string `db:"value" json:"value"`
}

! relation

func (*MailboxPasswordOfUserUKRelation) GetClassName

func (relation *MailboxPasswordOfUserUKRelation) GetClassName() string

func (*MailboxPasswordOfUserUKRelation) GetIndexes

func (relation *MailboxPasswordOfUserUKRelation) GetIndexes() []string

func (*MailboxPasswordOfUserUKRelation) GetStoreType

func (relation *MailboxPasswordOfUserUKRelation) GetStoreType() string

type MySQLConfig

type MySQLConfig struct {
	Host            string
	Port            int
	UserName        string
	Password        string
	Database        string
	PoolSize        int
	ConnMaxLifeTime time.Duration
}

type NameOfUserBaseInfoIDX

type NameOfUserBaseInfoIDX struct {
	Name string
	// contains filtered or unexported fields
}

func (*NameOfUserBaseInfoIDX) IDXRelation

func (u *NameOfUserBaseInfoIDX) IDXRelation(store *orm.RedisStore) IndexRelation

func (*NameOfUserBaseInfoIDX) Key

func (u *NameOfUserBaseInfoIDX) Key() string

func (*NameOfUserBaseInfoIDX) Limit

func (u *NameOfUserBaseInfoIDX) Limit(n int)

func (*NameOfUserBaseInfoIDX) Offset

func (u *NameOfUserBaseInfoIDX) Offset(n int)

func (*NameOfUserBaseInfoIDX) PositionOffsetLimit

func (u *NameOfUserBaseInfoIDX) PositionOffsetLimit(len int) (int, int)

func (*NameOfUserBaseInfoIDX) SQLFormat

func (u *NameOfUserBaseInfoIDX) SQLFormat(limit bool) string

func (*NameOfUserBaseInfoIDX) SQLLimit

func (u *NameOfUserBaseInfoIDX) SQLLimit() int

func (*NameOfUserBaseInfoIDX) SQLParams

func (u *NameOfUserBaseInfoIDX) SQLParams() []interface{}

type Object

type Object interface {
	GetClassName() string
	GetStoreType() string
	GetPrimaryName() string
	GetIndexes() []string
}

type PrimaryKey

type PrimaryKey interface {
	Key() string
	SQLFormat() string
	SQLParams() []interface{}
	Columns() []string
	Parse(key string) error
}

! conf.orm

type Range

type Range interface {
	SQL
	IncludeBegin(flag bool)
	IncludeEnd(flag bool)
	Begin() int64
	End() int64
	Revert(flag bool)
	Key() string
	PositionOffsetLimit(len int) (int, int)
	RNGRelation(store *orm.RedisStore) RangeRelation
}

type RangeRelation

type RangeRelation interface {
	Range(key string, start, end int64) ([]string, error)
	RangeRevert(key string, start, end int64) ([]string, error)
}

type RedisConfig

type RedisConfig struct {
	Host     string
	Port     int
	Password string
}

type SQL

type SQL interface {
	SQLFormat(limit bool) string
	SQLParams() []interface{}
	SQLLimit() int
	Offset(n int)
	Limit(n int)
}

type SexOfUserIDX

type SexOfUserIDX struct {
	Sex bool
	// contains filtered or unexported fields
}

func (*SexOfUserIDX) IDXRelation

func (u *SexOfUserIDX) IDXRelation(store *orm.RedisStore) IndexRelation

func (*SexOfUserIDX) Key

func (u *SexOfUserIDX) Key() string

func (*SexOfUserIDX) Limit

func (u *SexOfUserIDX) Limit(n int)

func (*SexOfUserIDX) Offset

func (u *SexOfUserIDX) Offset(n int)

func (*SexOfUserIDX) PositionOffsetLimit

func (u *SexOfUserIDX) PositionOffsetLimit(len int) (int, int)

func (*SexOfUserIDX) SQLFormat

func (u *SexOfUserIDX) SQLFormat(limit bool) string

func (*SexOfUserIDX) SQLLimit

func (u *SexOfUserIDX) SQLLimit() int

func (*SexOfUserIDX) SQLParams

func (u *SexOfUserIDX) SQLParams() []interface{}

type SexOfUserIDXRelation

type SexOfUserIDXRelation struct {
	Key   string `db:"key" json:"key"`
	Value string `db:"value" json:"value"`
}

! relation

func (*SexOfUserIDXRelation) GetClassName

func (relation *SexOfUserIDXRelation) GetClassName() string

func (*SexOfUserIDXRelation) GetIndexes

func (relation *SexOfUserIDXRelation) GetIndexes() []string

func (*SexOfUserIDXRelation) GetStoreType

func (relation *SexOfUserIDXRelation) GetStoreType() string

type SexUserLocation

type SexUserLocation struct {
	Key       string  `db:"key" json:"key"`
	Longitude float64 `db:"longitude" json:"longitude"`
	Latitude  float64 `db:"latitude" json:"latitude"`
	Value     int32   `db:"value" json:"value"`
}

! relation

func (*SexUserLocation) GetClassName

func (relation *SexUserLocation) GetClassName() string

func (*SexUserLocation) GetIndexes

func (relation *SexUserLocation) GetIndexes() []string

func (*SexUserLocation) GetStoreType

func (relation *SexUserLocation) GetStoreType() string

type StatusOfBlogIDX

type StatusOfBlogIDX struct {
	Status int32
	// contains filtered or unexported fields
}

func (*StatusOfBlogIDX) IDXRelation

func (u *StatusOfBlogIDX) IDXRelation(store *orm.RedisStore) IndexRelation

func (*StatusOfBlogIDX) Key

func (u *StatusOfBlogIDX) Key() string

func (*StatusOfBlogIDX) Limit

func (u *StatusOfBlogIDX) Limit(n int)

func (*StatusOfBlogIDX) Offset

func (u *StatusOfBlogIDX) Offset(n int)

func (*StatusOfBlogIDX) PositionOffsetLimit

func (u *StatusOfBlogIDX) PositionOffsetLimit(len int) (int, int)

func (*StatusOfBlogIDX) SQLFormat

func (u *StatusOfBlogIDX) SQLFormat(limit bool) string

func (*StatusOfBlogIDX) SQLLimit

func (u *StatusOfBlogIDX) SQLLimit() int

func (*StatusOfBlogIDX) SQLParams

func (u *StatusOfBlogIDX) SQLParams() []interface{}

type Unique

type Unique interface {
	SQL
	Key() string
	UKRelation(store *orm.RedisStore) UniqueRelation
}

type UniqueRelation

type UniqueRelation interface {
	FindOne(key string) (string, error)
}

type User

type User struct {
	Id          int32      `db:"id" json:"id"`
	Name        string     `db:"name" json:"name" validate:"required"`
	Mailbox     string     `db:"mailbox" json:"mailbox" validate:"required"`
	Sex         bool       `db:"sex" json:"sex"`
	Age         int32      `db:"age" json:"age"`
	Longitude   float64    `db:"longitude" json:"longitude"`
	Latitude    float64    `db:"latitude" json:"latitude"`
	Description string     `db:"description" json:"description"`
	Password    string     `db:"password" json:"password"`
	HeadUrl     string     `db:"head_url" json:"head_url"`
	Status      int32      `db:"status" json:"status"`
	CreatedAt   time.Time  `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time  `db:"updated_at" json:"updated_at"`
	DeletedAt   *time.Time `db:"deleted_at" json:"deleted_at"`
}

func (*User) GetClassName

func (obj *User) GetClassName() string

func (*User) GetColumns

func (obj *User) GetColumns() []string

func (*User) GetIndexes

func (obj *User) GetIndexes() []string

func (*User) GetNameSpace

func (obj *User) GetNameSpace() string

func (*User) GetNoneIncrementColumns

func (obj *User) GetNoneIncrementColumns() []string

func (*User) GetPrimaryKey

func (obj *User) GetPrimaryKey() PrimaryKey

func (*User) GetPrimaryName

func (obj *User) GetPrimaryName() string

func (*User) GetStoreType

func (obj *User) GetStoreType() string

func (*User) GetTableName

func (obj *User) GetTableName() string

func (*User) Validate

func (obj *User) Validate() error

type UserBaseInfo

type UserBaseInfo struct {
	Id       int32  `db:"id"`
	Name     string `db:"name"`
	Mailbox  string `db:"mailbox"`
	Password string `db:"password"`
	Sex      bool   `db:"sex"`
}

func (*UserBaseInfo) GetClassName

func (obj *UserBaseInfo) GetClassName() string

func (*UserBaseInfo) GetColumns

func (obj *UserBaseInfo) GetColumns() []string

func (*UserBaseInfo) GetNameSpace

func (obj *UserBaseInfo) GetNameSpace() string

func (*UserBaseInfo) GetNoneIncrementColumns

func (obj *UserBaseInfo) GetNoneIncrementColumns() []string

func (*UserBaseInfo) GetPrimaryKey

func (obj *UserBaseInfo) GetPrimaryKey() PrimaryKey

func (*UserBaseInfo) GetTableName

func (obj *UserBaseInfo) GetTableName() string

func (*UserBaseInfo) Validate

func (obj *UserBaseInfo) Validate() error

type UserBlogs

type UserBlogs struct {
	UserId int32 `db:"user_id"`
	BlogId int32 `db:"blog_id"`
}

func (*UserBlogs) GetClassName

func (obj *UserBlogs) GetClassName() string

func (*UserBlogs) GetColumns

func (obj *UserBlogs) GetColumns() []string

func (*UserBlogs) GetNameSpace

func (obj *UserBlogs) GetNameSpace() string

func (*UserBlogs) GetNoneIncrementColumns

func (obj *UserBlogs) GetNoneIncrementColumns() []string

func (*UserBlogs) GetPrimaryKey

func (obj *UserBlogs) GetPrimaryKey() PrimaryKey

func (*UserBlogs) GetTableName

func (obj *UserBlogs) GetTableName() string

func (*UserBlogs) Validate

func (obj *UserBlogs) Validate() error

type UserId

type UserId struct {
	Key   string `db:"key" json:"key"`
	Value int32  `db:"value" json:"value"`
}

! relation

func (*UserId) GetClassName

func (relation *UserId) GetClassName() string

func (*UserId) GetIndexes

func (relation *UserId) GetIndexes() []string

func (*UserId) GetStoreType

func (relation *UserId) GetStoreType() string

type UserIdBlogIdOfUserBlogsPK

type UserIdBlogIdOfUserBlogsPK struct {
	UserId int32
	BlogId int32
}

func (*UserIdBlogIdOfUserBlogsPK) Columns

func (u *UserIdBlogIdOfUserBlogsPK) Columns() []string

func (*UserIdBlogIdOfUserBlogsPK) Key

func (*UserIdBlogIdOfUserBlogsPK) Parse

func (u *UserIdBlogIdOfUserBlogsPK) Parse(key string) error

func (*UserIdBlogIdOfUserBlogsPK) SQLFormat

func (u *UserIdBlogIdOfUserBlogsPK) SQLFormat() string

func (*UserIdBlogIdOfUserBlogsPK) SQLParams

func (u *UserIdBlogIdOfUserBlogsPK) SQLParams() []interface{}

type UserIdBlogIdOfUserBlogsRNG

type UserIdBlogIdOfUserBlogsRNG struct {
	UserId      int32
	BlogIdBegin int64
	BlogIdEnd   int64
	// contains filtered or unexported fields
}

func (*UserIdBlogIdOfUserBlogsRNG) Begin

func (u *UserIdBlogIdOfUserBlogsRNG) Begin() int64

func (*UserIdBlogIdOfUserBlogsRNG) End

func (*UserIdBlogIdOfUserBlogsRNG) IncludeBegin

func (u *UserIdBlogIdOfUserBlogsRNG) IncludeBegin(f bool)

func (*UserIdBlogIdOfUserBlogsRNG) IncludeEnd

func (u *UserIdBlogIdOfUserBlogsRNG) IncludeEnd(f bool)

func (*UserIdBlogIdOfUserBlogsRNG) Key

func (*UserIdBlogIdOfUserBlogsRNG) Limit

func (u *UserIdBlogIdOfUserBlogsRNG) Limit(n int)

func (*UserIdBlogIdOfUserBlogsRNG) Offset

func (u *UserIdBlogIdOfUserBlogsRNG) Offset(n int)

func (*UserIdBlogIdOfUserBlogsRNG) PositionOffsetLimit

func (u *UserIdBlogIdOfUserBlogsRNG) PositionOffsetLimit(len int) (int, int)

func (*UserIdBlogIdOfUserBlogsRNG) RNGRelation

func (u *UserIdBlogIdOfUserBlogsRNG) RNGRelation(store *orm.RedisStore) RangeRelation

func (*UserIdBlogIdOfUserBlogsRNG) Revert

func (u *UserIdBlogIdOfUserBlogsRNG) Revert(b bool)

func (*UserIdBlogIdOfUserBlogsRNG) SQLFormat

func (u *UserIdBlogIdOfUserBlogsRNG) SQLFormat(limit bool) string

func (*UserIdBlogIdOfUserBlogsRNG) SQLLimit

func (u *UserIdBlogIdOfUserBlogsRNG) SQLLimit() int

func (*UserIdBlogIdOfUserBlogsRNG) SQLParams

func (u *UserIdBlogIdOfUserBlogsRNG) SQLParams() []interface{}

type UserInfo

type UserInfo struct {
	Id       int32  `db:"id"`
	Name     string `db:"name"`
	Mailbox  string `db:"mailbox"`
	Password string `db:"password"`
	Sex      bool   `db:"sex"`
}

type UserLocation

type UserLocation struct {
	Key       string  `db:"key" json:"key"`
	Longitude float64 `db:"longitude" json:"longitude"`
	Latitude  float64 `db:"latitude" json:"latitude"`
	Value     int32   `db:"value" json:"value"`
}

! relation

func (*UserLocation) GetClassName

func (relation *UserLocation) GetClassName() string

func (*UserLocation) GetIndexes

func (relation *UserLocation) GetIndexes() []string

func (*UserLocation) GetStoreType

func (relation *UserLocation) GetStoreType() string

Jump to

Keyboard shortcuts

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