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 ¶
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 ¶
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 ¶
ListenAndServe: listen and serve a fastcgi server