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 ¶
NewDefaultMongoClient create a new default connected MongoDB client.
func NewMongoClient ¶
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.
Click to show internal directories.
Click to hide internal directories.