Documentation ¶
Index ¶
- Constants
- type App
- func (a *App) Auth() negroni.HandlerFunc
- func (a *App) AuthProject() negroni.HandlerFunc
- func (a *App) IndexHost(w http.ResponseWriter, req *http.Request)
- func (a *App) IndexProject(w http.ResponseWriter, req *http.Request)
- func (a *App) IsValidStatus(status string) bool
- func (a *App) Mongo() negroni.HandlerFunc
- func (a *App) RemoveFile(w http.ResponseWriter, req *http.Request)
- func (a *App) Router() *mux.Router
- func (a *App) ServeFile(w http.ResponseWriter, req *http.Request)
- func (a *App) ShowProject(w http.ResponseWriter, req *http.Request)
- func (a *App) UpdateProject(w http.ResponseWriter, req *http.Request)
- func (a *App) UploadFile(w http.ResponseWriter, req *http.Request)
- type C
- type O
- type Response
- type Transform
- type User
Constants ¶
const (
// MAXPORTS is the maximum number of ports allowable for a single host without ForcePorts enabled.
MAXPORTS = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { R *render.Render C C S *mgo.Session Version string History int Filepath string DName string Transforms []Transform }
App is used to map global variables used in handlers.
func (*App) Auth ¶
func (a *App) Auth() negroni.HandlerFunc
Auth is a middleware to authenicate a user to Lair's meteor resources and ensures it has access the project provided in the url parameter.
func (*App) AuthProject ¶
func (a *App) AuthProject() negroni.HandlerFunc
AuthProject is a middleware to authorize a user to a project.
func (*App) IndexHost ¶
func (a *App) IndexHost(w http.ResponseWriter, req *http.Request)
IndexHost is an HTTP handler to retrieve a list hosts for a given project.
func (*App) IndexProject ¶
func (a *App) IndexProject(w http.ResponseWriter, req *http.Request)
IndexProject is an HTTP handler to retrieve a list of all projects that a user owns or is a contributor for.
func (*App) IsValidStatus ¶
IsValidStatus returns true if the provided string is a valid lair status.
func (*App) Mongo ¶
func (a *App) Mongo() negroni.HandlerFunc
Mongo maps a copy of the session to the request context.
func (*App) RemoveFile ¶
func (a *App) RemoveFile(w http.ResponseWriter, req *http.Request)
RemoveFile is an http handler for a DELETE request to remove a file.
func (*App) ServeFile ¶
func (a *App) ServeFile(w http.ResponseWriter, req *http.Request)
ServeFile is an http handler for a GET request to download a file.
func (*App) ShowProject ¶
func (a *App) ShowProject(w http.ResponseWriter, req *http.Request)
ShowProject is an HTTP handler to retrieve a single project.
func (*App) UpdateProject ¶
func (a *App) UpdateProject(w http.ResponseWriter, req *http.Request)
UpdateProject is an HTTP handler to add/update a project using additive, smart merge
func (*App) UploadFile ¶
func (a *App) UploadFile(w http.ResponseWriter, req *http.Request)
UploadFile is a http handler for POST request to upload a file.
type C ¶
type C struct { AuthInterfaces string Credentials string Files string Hosts string Issues string Netblocks string People string Projects string Services string Versions string WebDirectories string }
C is used to map collection names.
type Transform ¶ added in v1.3.0
type Transform struct {
Update func(*lair.Project)
}
Transform is a plugin that will transorm a lair.Project during update.
type User ¶
type User struct { ID string `bson:"_id"` Services struct { Password struct { Bcrypt string `bson:"bcrypt"` } `bson:"password"` Resume struct { Logintokens []struct { Hashedtoken string `bson:"hashedToken"` } `bson:"loginTokens"` } `bson:"resume"` } `bson:"services"` Emails []struct { Address string `bson:"address"` } `bson:"emails"` }
User is a user from meteor.js.