Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { *httprouter.Router // httprouter // contains filtered or unexported fields }
App is main web application
type Config ¶
type Config struct { Server ServerConfig Database DatabaseConfig }
Config is configuration structure
type DatabaseConfig ¶
DatabaseConfig contains database-related configs
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
MongoClient holds master session and other db-related info
func NewMongoClient ¶
func NewMongoClient(uri, dbName string) *MongoClient
NewMongoClient establishes connection to MongoDB database and returns new MongoClient object
func (*MongoClient) GetSession ¶
func (mc *MongoClient) GetSession() *mgo.Session
GetSession returns mgo.Session copied from MongoClient's master session Be sure to close the session after done
type ServerConfig ¶
type ServerConfig struct {
Port int
}
ServerConfig contains server-related configs
Click to show internal directories.
Click to hide internal directories.