Documentation ¶
Index ¶
- type API
- type Collaborator
- type CollaboratorAPI
- type CollaboratorUI
- type Invite
- func (h Invite) Accept(r *http.Request) (*namespace.Namespace, *user.User, *user.User, error)
- func (h Invite) DeleteModel(r *http.Request) error
- func (h Invite) IndexWithRelations(s *namespace.InviteStore) ([]*namespace.Invite, error)
- func (h Invite) StoreModel(r *http.Request) (*namespace.Invite, namespace.InviteForm, error)
- type InviteAPI
- type InviteUI
- type Namespace
- func (h Namespace) Create(w http.ResponseWriter, r *http.Request)
- func (h Namespace) DeleteModel(r *http.Request) error
- func (h Namespace) Index(w http.ResponseWriter, r *http.Request)
- func (h Namespace) IndexWithRelations(s *namespace.Store, vals url.Values) ([]*namespace.Namespace, database.Paginator, error)
- func (h Namespace) Show(w http.ResponseWriter, r *http.Request)
- func (h Namespace) Store(w http.ResponseWriter, r *http.Request)
- func (h Namespace) StoreModel(r *http.Request) (*namespace.Namespace, namespace.Form, error)
- func (h Namespace) UpdateModel(r *http.Request) (*namespace.Namespace, namespace.Form, error)
- type UI
- type Webhook
- type WebhookAPI
- func (h WebhookAPI) Destroy(w http.ResponseWriter, r *http.Request)
- func (h WebhookAPI) Index(w http.ResponseWriter, r *http.Request)
- func (h WebhookAPI) Show(w http.ResponseWriter, r *http.Request)
- func (h WebhookAPI) Store(w http.ResponseWriter, r *http.Request)
- func (h WebhookAPI) Update(w http.ResponseWriter, r *http.Request)
- type WebhookUI
- func (h WebhookUI) Create(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Delivery(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Destroy(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Index(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Redeliver(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Show(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Store(w http.ResponseWriter, r *http.Request)
- func (h WebhookUI) Update(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Namespace // Prefix is the part of the URL under which the API is being served, for // example "/api". Prefix string }
API is the handler for handling API requests made for namespace creation, and management.
func (API) Destroy ¶
func (h API) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the namespace in the given request context from the database. This serves no content in the response body.
func (API) Index ¶
func (h API) Index(w http.ResponseWriter, r *http.Request)
Index serves the JSON encoded list of namespaces for the given request. If multiple pages of namespaces are returned then the database.Paginator is encoded in the Link response header.
func (API) Show ¶
func (h API) Show(w http.ResponseWriter, r *http.Request)
Show serves up the JSON response for the namespace in the given request. This serves different responses based on the base path of the request URL.
func (API) Store ¶
func (h API) Store(w http.ResponseWriter, r *http.Request)
Store stores the namespace from the given request body. If any validation errors occur then these will be sent back in the JSON response. On success the build is sent in the JSON response.
func (API) Update ¶
func (h API) Update(w http.ResponseWriter, r *http.Request)
Update applies the changes in the given request body to the existing namespace in the database. If any validation errors occur then these will be sent back in the JSON response. On success the updated namespace is sent in the JSON response.
type Collaborator ¶
Collaborator is the base handler that provides shared logic for the UI and API handlers for working with namespace collaborators.
func (Collaborator) DeleteModel ¶
func (h Collaborator) DeleteModel(r *http.Request) error
DeleteModel deletes the specified collaborator in the request from the namespace in the given request context. Upon deletion this will modify the ownership of any resources created by the original collaborator to the owner of the namespace.
type CollaboratorAPI ¶
type CollaboratorAPI struct { Collaborator // Prefix is the part of the URL under which the API is being served, for // example "/api". Prefix string }
CollaboratorAPI is the handler for handling API requests made for managing a namespace's collaborators.
func (CollaboratorAPI) Destroy ¶
func (h CollaboratorAPI) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the collaborator in the given request context from the database. This serves no content in the response body.
func (CollaboratorAPI) Index ¶
func (h CollaboratorAPI) Index(w http.ResponseWriter, r *http.Request)
Index serves the JSON encoded list of collaborators for the given request.
type CollaboratorUI ¶
type CollaboratorUI struct {
Collaborator
}
CollaboratorUI is the handler for handling UI requests made for managing namespace collaborators.
func (CollaboratorUI) Destroy ¶
func (h CollaboratorUI) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the given namespace collaborator in the request from the namespace.
func (CollaboratorUI) Index ¶
func (h CollaboratorUI) Index(w http.ResponseWriter, r *http.Request)
Index serves the HTML response detailing the list of namespace collaborators.
type Invite ¶
Invite is the base handler that provides shared logic for the UI and API handlers for working with build namespace invites.
func (Invite) Accept ¶
Accept accepts an invite in the given request, and adds the user the invite was sent to as a collaborator to the invite's namespace. Upon success this will return the namespace the user was invited to, the user who sent the invite, and the user who received the invite.
func (Invite) DeleteModel ¶
DeleteModel deletes the namespace invite in the given request context from the database.
func (Invite) IndexWithRelations ¶
IndexWithRelations returns all of the namespace invites with their relationships loaded into each return invite.
func (Invite) StoreModel ¶
StoreModel unmarshals the request's data into an invite, validates it and stores it in the database. Upon success this will return the newly created invite. This also returns the form for sending an invite.
type InviteAPI ¶
type InviteAPI struct { Invite // Prefix is the part of the URL under which the API is being served, for // example "/api". Prefix string }
InviteAPI is the handler for handling API requests made for sending and receiving namespace invites.
func (InviteAPI) Destroy ¶
func (h InviteAPI) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the invite in the given request context from the database. This serves no content in the response body.
func (InviteAPI) Index ¶
func (h InviteAPI) Index(w http.ResponseWriter, r *http.Request)
Index serves the JSON encoded list of invites for the given request.
type InviteUI ¶
type InviteUI struct {
Invite
}
InviteUI is the handler for handling UI requests made for sending and receiving namespace invites.
func (InviteUI) Destroy ¶
func (h InviteUI) Destroy(w http.ResponseWriter, r *http.Request)
Destroy will delete the invite in the request's context from the database.
func (InviteUI) Index ¶
func (h InviteUI) Index(w http.ResponseWriter, r *http.Request)
Index serves the HTML response detailing the list of namespace invites.
type Namespace ¶
Namespace is the base handler that provides shared logic for the UI and API handlers for namespace creation, and management.
func (Namespace) Create ¶
func (h Namespace) Create(w http.ResponseWriter, r *http.Request)
Create serves the HTML response for creating namespaces via the web frontend.
func (Namespace) DeleteModel ¶
DeleteModel removes the namespace and all of its children in the given request context from the database.
func (Namespace) Index ¶
func (h Namespace) Index(w http.ResponseWriter, r *http.Request)
Index serves the HTML response detailing the list of namespaces.
func (Namespace) IndexWithRelations ¶
func (h Namespace) IndexWithRelations(s *namespace.Store, vals url.Values) ([]*namespace.Namespace, database.Paginator, error)
IndexWithRelations retreives a slice of *namespace.Namespace models for the user in the given request context. All of the relations for each namespace will be loaded into each model we have. A database.Paginator will also be returned if there are multiple pages of namespaces.
func (Namespace) Show ¶
func (h Namespace) Show(w http.ResponseWriter, r *http.Request)
Show serves the HTML response for viewing an individual namespace in the given request. This serves different responses based on the base path of the request URL.
func (Namespace) Store ¶
func (h Namespace) Store(w http.ResponseWriter, r *http.Request)
Store validates the form submitted in the given request for creating a namespace. If validation fails then the user is redirected back to the request referer, otherwise they are redirect back to the namespace index.
func (Namespace) StoreModel ¶
StoreModel unmarshals the request's data into a namespace, validates it and stores it in the database. Upon success this will return the newly created namespace. This also returns the form for creating a namespace.
func (Namespace) UpdateModel ¶
UpdateModel unmarshals the request's data into a namespace, validates it and updates the existing namespace in the database with the content in the form. Upon success the updated namespace is returned. This also returns the form for modifying a namespace.
type UI ¶
type UI struct {
Namespace
}
UI is the handler for handling UI requests made for namespace creation, and management.
func (UI) Badge ¶ added in v1.1.0
func (h UI) Badge(w http.ResponseWriter, r *http.Request)
Badge renders an SVG badge of the latest build in the namespace, if any.
func (UI) Destroy ¶
func (h UI) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the namespace in the given request context from the database. This redirects back to the namespace index upon success.
type Webhook ¶ added in v1.1.0
func (Webhook) StoreModel ¶ added in v1.1.0
func (Webhook) UpdateModel ¶ added in v1.1.0
type WebhookAPI ¶ added in v1.1.0
type WebhookAPI struct { Webhook // Prefix is the part of the URL under which the API is being served, for // example "/api". Prefix string }
func (WebhookAPI) Destroy ¶ added in v1.1.0
func (h WebhookAPI) Destroy(w http.ResponseWriter, r *http.Request)
func (WebhookAPI) Index ¶ added in v1.1.0
func (h WebhookAPI) Index(w http.ResponseWriter, r *http.Request)
func (WebhookAPI) Show ¶ added in v1.1.0
func (h WebhookAPI) Show(w http.ResponseWriter, r *http.Request)
func (WebhookAPI) Store ¶ added in v1.1.0
func (h WebhookAPI) Store(w http.ResponseWriter, r *http.Request)
func (WebhookAPI) Update ¶ added in v1.1.0
func (h WebhookAPI) Update(w http.ResponseWriter, r *http.Request)
type WebhookUI ¶ added in v1.1.0
type WebhookUI struct {
Webhook
}
func (WebhookUI) Create ¶ added in v1.1.0
func (h WebhookUI) Create(w http.ResponseWriter, r *http.Request)
func (WebhookUI) Delivery ¶ added in v1.1.0
func (h WebhookUI) Delivery(w http.ResponseWriter, r *http.Request)
func (WebhookUI) Destroy ¶ added in v1.1.0
func (h WebhookUI) Destroy(w http.ResponseWriter, r *http.Request)
func (WebhookUI) Index ¶ added in v1.1.0
func (h WebhookUI) Index(w http.ResponseWriter, r *http.Request)
func (WebhookUI) Redeliver ¶ added in v1.1.0
func (h WebhookUI) Redeliver(w http.ResponseWriter, r *http.Request)
func (WebhookUI) Show ¶ added in v1.1.0
func (h WebhookUI) Show(w http.ResponseWriter, r *http.Request)