Documentation ¶
Index ¶
- type Backend
- type Client
- func (c *Client) Get(key string) (Result, error)
- func (c *Client) GetClient(ctx context.Context) (*mongo.Client, error)
- func (c *Client) GetCollection() *mongo.Collection
- func (c *Client) Init() error
- func (c *Client) InitIndex(ctx context.Context, index mongo.IndexView) error
- func (c *Client) Set(key string, value []byte) error
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (Backend) Clone ¶
func (r Backend) Clone() backends.BackendInterface
func (*Backend) GetPoolSize ¶
func (*Backend) SetPoolSize ¶
type Client ¶
type Client struct { Uri string DB string Collection string Expires int // contains filtered or unexported fields }
func NewMongoClient ¶
NewMongoClient 经测试mongo-driver会自动断线重连,且自带连接池,但貌似设置连接池大小没有作用,因此就不需要poolSize选项了
func (*Client) GetCollection ¶
func (c *Client) GetCollection() *mongo.Collection
Click to show internal directories.
Click to hide internal directories.