Documentation ¶
Index ¶
Constants ¶
const ( MinUsernameLen = 3 MinPasswordLen = 6 )
Minimum lengths for validation of user registration
const MinGroupNameLen = 3
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server handles routing and dependency injection into the routes. This is the main controller of the application: all "top level" handlers hang off of it.
If you want to add a route, look at Server.routes. Routes should be methods of the server type that return an http.HandlerFunc. In general, this should be an anonymous function. This design was done to:
- Allow initialization to happen per route at definition time
- Allow the handlers to close over the parts of the server they need access to.
- Not require any "magic" to understand what's being called in response to a route.
Currently, we're just using the standard library http.ServeMux - we haven't needed any features of the more advanced routers. If we need those features, we'll cross that bridge when we come to it - we're not opposed to them.
In general, this package should be the only one that's aware of the http part of the app.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package db defines the requirements for our database, via the Store interface, and implements it for postgres.
|
Package db defines the requirements for our database, via the Store interface, and implements it for postgres. |