persistence

package
v0.0.0-...-2758cc9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Localhost is the localhost domain.
	Localhost = "localhost"
	// MongoDBProtocol is the MongoDB protocol.
	MongoDBProtocol = "mongodb"
	// MongoDBDefaultPort is the MongoDB default port.
	MongoDBDefaultPort = 27017
)

Variables

This section is empty.

Functions

func NewDefaultMongoClient

func NewDefaultMongoClient() *mongo.Client

NewDefaultMongoClient create a new default connected MongoDB client.

func NewMongoClient

func NewMongoClient(config *Config) *mongo.Client

NewMongoClient creates a new connected MongoDB client.

Types

type Config

type Config struct {
	Connection *ConnectionConfig `json:"connection" binding:"optional"`
}

Config denotes the configuration of the server controller.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default MongoDB configuration.

type ConnectionConfig

type ConnectionConfig struct {
	Protocol string `json:"protocol" binding:"required"`
	Host     string `json:"host" binding:"required"`
	Port     int    `json:"port" binding:"required"`
}

ConnectionConfig denotes the configuration of the datastore.

Jump to

Keyboard shortcuts

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