common

package
v0.0.0-...-34f7822 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientHelper

type ClientHelper interface {
	Database(string) DatabaseHelper
	Connect() error
	StartSession() (mongo.Session, error)
	Ping() error
}

ClientHelper Helper functions for the Client

func NewClient

func NewClient(cnf *Config) (ClientHelper, error)

NewClient creates a new ClientHelper

type CollectionHelper

type CollectionHelper interface {
	InsertOne(context.Context, interface{}) (interface{}, error)
}

CollectionHelper Helper functions for the Collection

type Config

type Config struct {
	Username     string
	Password     string
	Host         string
	Port         string
	DatabaseName string
	Collection   string
}

Config stores the configuration for the database

type DatabaseHelper

type DatabaseHelper interface {
	Collection(name string) CollectionHelper
	Client() ClientHelper
}

DatabaseHelper Helper functions for the Database

Jump to

Keyboard shortcuts

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