Documentation ¶
Index ¶
- Constants
- type BaseDao
- func (bd BaseDao) Delete(sql string, p ...interface{}) (int64, error)
- func (bd BaseDao) Find(sql string, p ...interface{}) *sql.Row
- func (bd *BaseDao) Init(dao interface{})
- func (bd *BaseDao) Insert(table string, params map[string]interface{}) (int64, error)
- func (bd *BaseDao) MultiInsert(table string, params []map[string]interface{}) (int, error)
- func (bd BaseDao) Select(sql string, p ...interface{}) (*sql.Rows, error)
- func (bd BaseDao) TDelete(conn *sql.Tx, sql string, p ...interface{}) (int64, error)
- func (bd BaseDao) TFind(conn *sql.Tx, sql string, p ...interface{}) *sql.Row
- func (bd *BaseDao) TInsert(conn *sql.Tx, table string, params map[string]interface{}) (int64, error)
- func (bd *BaseDao) TMultiInsert(conn *sql.Tx, table string, params []map[string]interface{}) (int, error)
- func (bd BaseDao) TSelect(conn *sql.Tx, sql string, p ...interface{}) (*sql.Rows, error)
- func (bd BaseDao) TUpdate(conn *sql.Tx, sql string, p ...interface{}) (int64, error)
- func (bd BaseDao) TUpdateById(conn *sql.Tx, table string, id int32, params map[string]interface{}) (int64, error)
- func (bd BaseDao) Transaction(f func(*sql.Tx) (interface{}, error)) (interface{}, error)
- func (bd BaseDao) Update(sql string, p ...interface{}) (int64, error)
- func (bd BaseDao) UpdateById(table string, id int32, params map[string]interface{}) (int64, error)
- type DatabaseConf
- type DbManager
- type HttpClient
- type KafkaSyncProducer
- type Redis
- type RedisConf
- type RequestBody
- type ResponseBody
Constants ¶
View Source
const ( CONNECTION_KEY = "connections" MAX_OPEN_CONNS = 20 MAX_IDLE_CONNS = 10 CONN_MAX_LIFE_TIME = 14400 * time.Second )
View Source
const ( GET_REQUEST_TIMEOUT = 3 POST_REQUEST_TIMEOUT = 5 DOWNLOAD_REQUEST_TIMEOUT = 10 )
View Source
const ( REDIS_KEY = "redis" REDIS_HOST = "" REDIS_PORT = 6379 REDIS_DATABASE = 0 REDIS_PASSWORD = "" REDIS_POOL_MAX_IDLE = 10 REDIS_POOL_MAX_ACTIVE = 100 REDIS_POOL_IDLE_TIMEOUT = 300 REDIS_POOL_MAX_CONN_LIFETIME = 0 REDIS_POOL_IDLE_CHECK_FREQUENCY = 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDao ¶
type BaseDao struct { Ctx context.Context DbManager *DbManager `wired:"true"` // contains filtered or unexported fields }
func (*BaseDao) TInsert ¶
func (bd *BaseDao) TInsert(conn *sql.Tx, table string, params map[string]interface{}) (int64, error)
*
- 插入一条记录(事务内使用)
func (*BaseDao) TMultiInsert ¶
func (bd *BaseDao) TMultiInsert(conn *sql.Tx, table string, params []map[string]interface{}) (int, error)
*
- 插入多条记录(事务内使用)
func (BaseDao) TUpdateById ¶
func (bd BaseDao) TUpdateById(conn *sql.Tx, table string, id int32, params map[string]interface{}) (int64, error)
*
- 根据主键id更新记录(事务内使用)
type DatabaseConf ¶
type HttpClient ¶
type HttpClient struct { Ctx context.Context Proxy string `value:"client.http.proxy"` SkipHttps bool `value:"client.http.skip_https"` // contains filtered or unexported fields }
func (*HttpClient) Construct ¶
func (c *HttpClient) Construct()
func (*HttpClient) Get ¶
func (c *HttpClient) Get(r *RequestBody) (res *ResponseBody, err error)
func (*HttpClient) Post ¶
func (c *HttpClient) Post(r *RequestBody) (res *ResponseBody, err error)
type KafkaSyncProducer ¶
type KafkaSyncProducer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(broker []string, debug bool) *KafkaSyncProducer
type RequestBody ¶ added in v1.0.8
type ResponseBody ¶ added in v1.0.8
Click to show internal directories.
Click to hide internal directories.