driver

package
v0.0.0-...-628ffd6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoClient *mongo.Client
View Source
var MongoCollection *mongo.Collection
View Source
var MongoDatabase *mongo.Database

Functions

func MustInitMongoClient

func MustInitMongoClient(
	uri string,
	dbName string,
	collectionName string,
)

Types

type OpenRecord

type OpenRecord struct {
	Id        primitive.ObjectID `bson:"_id,omitempty"`
	ChannelId string             `bson:"channel_id"`
	AppName   string             `bson:"app_name"`
	Ip        string             `bson:"ip"`
	Region    Region             `bson:"region"`
	// 域名
	Origin         string              `bson:"origin"`
	IsCountryChina bool                `bson:"is_country_china"`
	IsChinaInland  bool                `bson:"is_china_inland"`
	CreatedAt      primitive.Timestamp `bson:"created_at"`
}

func (*OpenRecord) Insert

func (m *OpenRecord) Insert() error

type Region

type Region struct {
	Country  string `json:"country" bson:"country"`
	District string `json:"district" bson:"district"`
	Province string `json:"province" bson:"province"`
	City     string `json:"city" bson:"city"`
	ISP      string `json:"isp" bson:"isp"`
}

Jump to

Keyboard shortcuts

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