goapp

package
v0.0.0-...-e5e291b Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: MIT Imports: 8 Imported by: 1

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

func NewApp

func NewApp(configFile string) *App

NewApp creates new web application

func (*App) Run

func (a *App) Run()

Run runs this web application

type Config

type Config struct {
	Server   ServerConfig
	Database DatabaseConfig
}

Config is configuration structure

type DatabaseConfig

type DatabaseConfig struct {
	URI    string
	DBName string
}

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

Jump to

Keyboard shortcuts

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