database

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MongoPrefix = "mongodb://"
)
View Source
const (
	Name = "ApolloMongo"
)

Variables

View Source
var DBName = config.ApolloConf.DB.Mongo.Name
View Source
var MongoPing bool

MongoPing 当mongo无法连接时不应该阻塞后续数据库操作,应该直接跳过

Functions

func InitDBMongo

func InitDBMongo() error

InitDBMongo 连接mongo

func ParseDSN added in v1.1.2

func ParseDSN(conf config.Mongo) string

ParseDSN 解析配置拼接mongo URI

func Ping

func Ping() error

Ping 异步的连接返回 使用轮询尝试

func WritePing

func WritePing()

WritePing 尝试写ping数据

Types

type PingCtx

type PingCtx struct {
	mgm.Model
}

Jump to

Keyboard shortcuts

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