mongodb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

DB mongo db

View Source
var Enforcer casbin.IEnforcer

Enforcer casbin enforcer

Functions

func AppendTable

func AppendTable(t Tabler)

AppendTable append table

Types

type Database

type Database struct {
	// URL db url
	URL string `yaml:"url" json:"url"`
	// Name db name
	Name string `yaml:"name" json:"name"`
	// Timeout connect db timeout
	Timeout time.Duration `yaml:"timeout" json:"timeout"`
	// CasbinModel casbin model
	CasbinModel string `yaml:"casbinModel" json:"casbinModel"`
}

Database database config

func (*Database) C

func (e *Database) C(t Tabler) *mongo.Collection

C get table's Collection

func (*Database) Init

func (e *Database) Init()

Init init db

type Tabler

type Tabler interface {
	mgm.Model
	Make()
}

Tabler table interface

Jump to

Keyboard shortcuts

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