Documentation ¶
Index ¶
- Constants
- func NewMongoLogger(logger golog.ILogger) *mongoLogger
- type Client
- func (this *Client) BuildQuery(query *Query) *mgo.Query
- func (this *Client) Collection(col string) *mgo.Collection
- func (this *Client) Connect() error
- func (this *Client) Connected() bool
- func (this *Client) Count() (n int, err error)
- func (this *Client) DB(name string) *mgo.Database
- func (this *Client) Find(query interface{}) *mgo.Query
- func (this *Client) FindId(id interface{}) *mgo.Query
- func (this *Client) Free()
- func (this *Client) Indexes() (indexes []mgo.Index, err error)
- func (this *Client) Insert(docs ...interface{}) error
- func (this *Client) Query(query *Query) (result []bson.M, err error)
- func (this *Client) QueryCount(query *Query) (n int, err error)
- func (this *Client) QueryId(id interface{}) (result bson.M, err error)
- func (this *Client) QueryOne(query *Query) (result bson.M, err error)
- func (this *Client) Remove(selector interface{}) error
- func (this *Client) RemoveAll(selector interface{}) error
- func (this *Client) RemoveId(id interface{}) error
- func (this *Client) SetCmdLogFmtFunc(clff CmdLogFmtFunc) *Client
- func (this *Client) SetDebug(debug bool)
- func (this *Client) SetLogger(logger golog.ILogger) *Client
- func (this *Client) Update(selector, updater interface{}) error
- func (this *Client) UpdateAll(selector, updater interface{}) error
- func (this *Client) UpdateId(id interface{}, updater interface{}) error
- func (this *Client) Upsert(selector, updater interface{}) error
- type CmdLogFmtFunc
- type Config
- type PConfig
- type Pool
- type Query
Constants ¶
View Source
const (
DEFAULT_QUERY_TIMEOUT = 10 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func NewMongoLogger ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Collection ¶
func (this *Client) Collection(col string) *mgo.Collection
func (*Client) SetCmdLogFmtFunc ¶
func (this *Client) SetCmdLogFmtFunc(clff CmdLogFmtFunc) *Client
type CmdLogFmtFunc ¶
type Config ¶
Click to show internal directories.
Click to hide internal directories.