Documentation ¶
Index ¶
- func MountShortnerController(service *goa.Service, ctrl ShortnerController)
- type Analytics
- type AnalyticsShortnerContext
- type CreateLinkPayload
- type CreateShortnerContext
- type DeleteShortnerContext
- type GetShortnerContext
- type ShortnerController
- type URL
- type UpdateLinkPayload
- type UpdateShortnerContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountShortnerController ¶
func MountShortnerController(service *goa.Service, ctrl ShortnerController)
MountShortnerController "mounts" a Shortner resource controller on the given service.
Types ¶
type Analytics ¶
type Analytics struct {
Hits *int `form:"hits,omitempty" json:"hits,omitempty" yaml:"hits,omitempty" xml:"hits,omitempty"`
}
Url analytics (default view)
Identifier: application/vnd.analytics+json; view=default
type AnalyticsShortnerContext ¶
type AnalyticsShortnerContext struct { context.Context *goa.ResponseData *goa.RequestData Path string }
AnalyticsShortnerContext provides the shortner analytics action context.
func NewAnalyticsShortnerContext ¶
func NewAnalyticsShortnerContext(ctx context.Context, r *http.Request, service *goa.Service) (*AnalyticsShortnerContext, error)
NewAnalyticsShortnerContext parses the incoming request URL and body, performs validations and creates the context used by the shortner controller analytics action.
func (*AnalyticsShortnerContext) InternalServerError ¶
func (ctx *AnalyticsShortnerContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*AnalyticsShortnerContext) NotFound ¶
func (ctx *AnalyticsShortnerContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*AnalyticsShortnerContext) OK ¶
func (ctx *AnalyticsShortnerContext) OK(r *Analytics) error
OK sends a HTTP response with status code 200.
type CreateLinkPayload ¶
type CreateLinkPayload struct { Path string `form:"path" json:"path" yaml:"path" xml:"path"` URL string `form:"url" json:"url" yaml:"url" xml:"url"` }
CreateLinkPayload user type.
func (*CreateLinkPayload) Validate ¶
func (ut *CreateLinkPayload) Validate() (err error)
Validate validates the CreateLinkPayload type instance.
type CreateShortnerContext ¶
type CreateShortnerContext struct { context.Context *goa.ResponseData *goa.RequestData Payload *CreateLinkPayload }
CreateShortnerContext provides the shortner create action context.
func NewCreateShortnerContext ¶
func NewCreateShortnerContext(ctx context.Context, r *http.Request, service *goa.Service) (*CreateShortnerContext, error)
NewCreateShortnerContext parses the incoming request URL and body, performs validations and creates the context used by the shortner controller create action.
func (*CreateShortnerContext) Created ¶
func (ctx *CreateShortnerContext) Created() error
Created sends a HTTP response with status code 201.
func (*CreateShortnerContext) InternalServerError ¶
func (ctx *CreateShortnerContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
type DeleteShortnerContext ¶
type DeleteShortnerContext struct { context.Context *goa.ResponseData *goa.RequestData Path string }
DeleteShortnerContext provides the shortner delete action context.
func NewDeleteShortnerContext ¶
func NewDeleteShortnerContext(ctx context.Context, r *http.Request, service *goa.Service) (*DeleteShortnerContext, error)
NewDeleteShortnerContext parses the incoming request URL and body, performs validations and creates the context used by the shortner controller delete action.
func (*DeleteShortnerContext) InternalServerError ¶
func (ctx *DeleteShortnerContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*DeleteShortnerContext) NotFound ¶
func (ctx *DeleteShortnerContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*DeleteShortnerContext) OK ¶
func (ctx *DeleteShortnerContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type GetShortnerContext ¶
type GetShortnerContext struct { context.Context *goa.ResponseData *goa.RequestData Path string }
GetShortnerContext provides the shortner get action context.
func NewGetShortnerContext ¶
func NewGetShortnerContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetShortnerContext, error)
NewGetShortnerContext parses the incoming request URL and body, performs validations and creates the context used by the shortner controller get action.
func (*GetShortnerContext) InternalServerError ¶
func (ctx *GetShortnerContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*GetShortnerContext) NotFound ¶
func (ctx *GetShortnerContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*GetShortnerContext) OK ¶
func (ctx *GetShortnerContext) OK(r *URL) error
OK sends a HTTP response with status code 200.
type ShortnerController ¶
type ShortnerController interface { goa.Muxer Analytics(*AnalyticsShortnerContext) error Create(*CreateShortnerContext) error Delete(*DeleteShortnerContext) error Get(*GetShortnerContext) error Update(*UpdateShortnerContext) error }
ShortnerController is the controller interface for the Shortner actions.
type URL ¶
type URL struct { // URL ID ID *int `form:"id,omitempty" json:"id,omitempty" yaml:"id,omitempty" xml:"id,omitempty"` // URL path key Path *string `form:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty" xml:"path,omitempty"` // External URL URL *string `form:"url,omitempty" json:"url,omitempty" yaml:"url,omitempty" xml:"url,omitempty"` }
A URL (default view)
Identifier: application/vnd.url+json; view=default
type UpdateLinkPayload ¶
type UpdateLinkPayload struct { Path string `form:"path" json:"path" yaml:"path" xml:"path"` URL string `form:"url" json:"url" yaml:"url" xml:"url"` }
UpdateLinkPayload user type.
func (*UpdateLinkPayload) Validate ¶
func (ut *UpdateLinkPayload) Validate() (err error)
Validate validates the UpdateLinkPayload type instance.
type UpdateShortnerContext ¶
type UpdateShortnerContext struct { context.Context *goa.ResponseData *goa.RequestData Path string Payload *UpdateLinkPayload }
UpdateShortnerContext provides the shortner update action context.
func NewUpdateShortnerContext ¶
func NewUpdateShortnerContext(ctx context.Context, r *http.Request, service *goa.Service) (*UpdateShortnerContext, error)
NewUpdateShortnerContext parses the incoming request URL and body, performs validations and creates the context used by the shortner controller update action.
func (*UpdateShortnerContext) InternalServerError ¶
func (ctx *UpdateShortnerContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*UpdateShortnerContext) NotFound ¶
func (ctx *UpdateShortnerContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*UpdateShortnerContext) OK ¶
func (ctx *UpdateShortnerContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.