Documentation
¶
Index ¶
- Variables
- func Cache() *codecStruct
- func Codec() *codecStruct
- func Conn() (db *gorm.DB, err error)
- func DeleteLookup(id string)
- func FlushCache()
- func GetCache(key string, data interface{}, options ...interface{}) error
- func GetStructName(data interface{}) string
- func GetValue(v reflect.Value) interface{}
- func IsFileExist(path string) bool
- func MD5(plain string) string
- func OpenConnectionStats() int
- func PingCache() error
- func Redis() *redis.Client
- func SetCache(key string, data interface{}, options ...interface{})
- func ToSnake(in string) string
- type Db
- func (db Db) AppendLookup(lu *lookUp, key string) *lookUp
- func (db Db) Association(qry string) Db
- func (db Db) Begin() Db
- func (db Db) Commit() Db
- func (db Db) Count(data interface{}) Db
- func (db Db) Delete() Db
- func (db Db) Error() error
- func (db Db) Find(data interface{}) Db
- func (db Db) First() Db
- func (db Db) ForceUpdate() Db
- func (db Db) GenerateSelectRaw() string
- func (db Db) GetTableName() string
- func (db Db) GetTx() *gorm.DB
- func (db Db) Group(qry string) Db
- func (db Db) Join(qry string, params ...interface{}) Db
- func (db Db) Limit(qry int, filters ...func(int) int) Db
- func (db Db) LookupKey(id string) string
- func (db Db) Model(data interface{}) Db
- func (db Db) NewLookup() *lookUp
- func (db Db) Offset(qry int, filters ...func(int) int) Db
- func (db Db) Or(qry string, params ...interface{}) Db
- func (db Db) OrderBy(qry string, filters ...func(string) string) Db
- func (db Db) Preload(qry string) Db
- func (db Db) Replace(data interface{}) Db
- func (db Db) Rollback() Db
- func (db Db) Save() Db
- func (db Db) Select(qry string, filters ...func(string) string) Db
- func (db Db) SetCacheDuration(duration time.Duration) Db
- func (db Db) SetData(data interface{}) Db
- func (db Db) SetTx(tx *gorm.DB) Db
- func (db Db) Update() Db
- func (db Db) UpdateMap(data map[string]interface{}) Db
- func (db Db) Where(qry string, params ...interface{}) Db
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileNotExist = errors.New("config file not exist(default : conf.yaml)") ErrDbDriverRequired = errors.New("database driver is required") ErrDbUrlRequired = errors.New("database url is required") ErrDbNameRequired = errors.New("database name is required") ErrCacheDisabled = errors.New("cache is disabled") ErrCacheNotFound = errors.New("cache not found") )
View Source
var ( Config growlConfig YamlConfig growlYamlConfig )
View Source
var LocalCache = gocache.New(YamlConfig.Growl.Redis.duration, 30*time.Minute)
Functions ¶
func DeleteLookup ¶
func DeleteLookup(id string)
func FlushCache ¶
func FlushCache()
func GetStructName ¶
func GetStructName(data interface{}) string
func IsFileExist ¶
func OpenConnectionStats ¶
func OpenConnectionStats() int
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
func (Db) AppendLookup ¶
func (Db) Association ¶
func (Db) ForceUpdate ¶
func (Db) GenerateSelectRaw ¶
func (Db) GetTableName ¶
Click to show internal directories.
Click to hide internal directories.