Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WebHandler ¶
Types ¶
type CreatePayload ¶
type CreatePayload struct {
Target string `json:"target,omitempty" valid:"url,required"`
SubDomain string `json:"sub_domain,omitempty" valid:"alphanum,required"`
}
CreatePayload represents the JSON payload for HandleCreate.
type Error ¶
type Error struct {
Code string `json:"code"`
Message string `json:"message"`
Details string `json:"details"`
}
Error represents an error encoded in JSON given as response for HTTP requests when an error occurs.
func NewJSONError ¶
NewJSONError creates a JSON serializable error.
type JSONRedirection ¶
type JSONRedirection struct {
ID int `json:"id"`
SubDomain string `json:"sub_domain"`
URL string `json:"url"`
}
JSONRedirection is the struct that represents a cochonou.Redirection in JSON.
type RedirectionHandler ¶
type RedirectionHandler struct {
DomainHandler cochonou.DomainHandler
Store cochonou.RedirectionStore
}
RedirectionHandler is the struct containing all functions to handle HTTP actions with Redirections.
func (*RedirectionHandler) HandleCreate ¶
func (h *RedirectionHandler) HandleCreate(c echo.Context) error
HandleCreate creates a DomainRedirection from an HTTP request.
func (*RedirectionHandler) HandleGetList ¶
func (h *RedirectionHandler) HandleGetList(c echo.Context) error
HandleGetList gets all Redirection from the store and returns them as JSON.
Click to show internal directories.
Click to hide internal directories.