mongocache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*mongo.Client
	// contains filtered or unexported fields
}

func Get

func Get(ctx context.Context, config Config) (ret *Client, err error)

func MustGet

func MustGet(ctx context.Context, config Config) *Client

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context) error

func (*Client) DisconnectForce

func (c *Client) DisconnectForce(ctx context.Context) error

一个client可能在很多地方使用,调用此函数时,所有基于此client的请求都将失败

type Config

type Config struct {
	URI      string `conf:"uri"`
	User     string `conf:"user"`
	Password string `conf:"passwd"`
	MaxConn  uint64 `conf:"maxconn"`
}

Jump to

Keyboard shortcuts

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