driver

package
v0.0.0-...-e0c2b11 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	GetDB() *mongo.Database
	SetClient(cfg config.DatabaseConfig) error
	SetClientWithContext(ctx context.Context, cfg config.DatabaseConfig) error
	Connect(ctx context.Context) error
	Disconnect(ctx context.Context) error
}

type MongoDriver

type MongoDriver struct {
	Client client.Client

	Config config.DatabaseConfig
	// contains filtered or unexported fields
}

func (*MongoDriver) Connect

func (md *MongoDriver) Connect(ctx context.Context) error

func (*MongoDriver) Disconnect

func (md *MongoDriver) Disconnect(ctx context.Context) error

func (*MongoDriver) GetDB

func (md *MongoDriver) GetDB() *mongo.Database

func (*MongoDriver) SetClient

func (md *MongoDriver) SetClient(cfg config.DatabaseConfig) error

func (*MongoDriver) SetClientWithContext

func (md *MongoDriver) SetClientWithContext(ctx context.Context, cfg config.DatabaseConfig) error

Jump to

Keyboard shortcuts

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