core

package
v0.0.0-...-0176d1c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: MIT Imports: 32 Imported by: 1

Documentation

Overview

The Hamster Server. The Server type holds instances of all the components, *effectively making it possible to collapse all the code into one file. The separation * of code is only for readability. To use it as a package simply: * import ("github.com/adnaan/hamster") * server := hamster.NewServer() * //server.Quiet()//disable logging * server.ListenAndServe() * Also change hamster.toml for custom configuration. * TODO: Pass hamster.toml as argument to the server * TODO: make handler methods local, model method exported for pkg/rpc support

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppResponse

type AppResponse struct {
	APIToken  string `json:"apitoken"`
	APISecret string `json:"apisecret"`
	Name      string `json:"name"`
	OS        string `json:"os"`
}

AppResponse app auth response

type NewDeveloperResponse

type NewDeveloperResponse struct {
	ObjectID    string `json:"objectID"`
	AccessToken string `json:"accessToken"`
}

NewDeveloperResponse developer created response

type SaveFileResponse

type SaveFileResponse struct {
	FileID   string `json:"fileID"`
	FileName string `json:"fileName"`
}

SaveFileResponse file is saved

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server The server type holds instances of all components

func NewServer

func NewServer(configPath string) *Server

NewServer creates a new server dbUrl:"mongodb://adnaan:pass@localhost:27017/hamster" db.addUser( { user: "adnaan",pwd: "pass",roles: [ "readWrite" ] } ) serverUrl:fmt.Sprintf("%s:%d", address, port) creates a new server, setups logging etc.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe: listen and serve a fastcgi server

func (*Server) Quiet

func (s *Server) Quiet()

Quiet down the log

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown the server.

Jump to

Keyboard shortcuts

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