Documentation ¶
Index ¶
- Constants
- type TerseRedirect
- type TerseRedirectFound
- type TerseRedirectHandler
- type TerseRedirectHandlerFunc
- type TerseRedirectNotFound
- type TerseRedirectOK
- type TerseRedirectParams
- type TerseRedirectURL
- func (o *TerseRedirectURL) Build() (*url.URL, error)
- func (o *TerseRedirectURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *TerseRedirectURL) Must(u *url.URL, err error) *url.URL
- func (o *TerseRedirectURL) SetBasePath(bp string)
- func (o *TerseRedirectURL) String() string
- func (o *TerseRedirectURL) StringFull(scheme, host string) string
- func (o *TerseRedirectURL) WithBasePath(bp string) *TerseRedirectURL
Constants ¶
const TerseRedirectFoundCode int = 302
TerseRedirectFoundCode is the HTTP code returned for type TerseRedirectFound
const TerseRedirectNotFoundCode int = 404
TerseRedirectNotFoundCode is the HTTP code returned for type TerseRedirectNotFound
const TerseRedirectOKCode int = 200
TerseRedirectOKCode is the HTTP code returned for type TerseRedirectOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TerseRedirect ¶
type TerseRedirect struct { Context *middleware.Context Handler TerseRedirectHandler }
TerseRedirect swagger:route GET /{shortened} public terseRedirect
Typically a web browser would visit this endpoint, then get redirected.
Use the shortened URL. It will redirect to the full URL if it has not expired.
func NewTerseRedirect ¶
func NewTerseRedirect(ctx *middleware.Context, handler TerseRedirectHandler) *TerseRedirect
NewTerseRedirect creates a new http.Handler for the terse redirect operation
func (*TerseRedirect) ServeHTTP ¶
func (o *TerseRedirect) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type TerseRedirectFound ¶
type TerseRedirectFound struct { /*The full URL that the redirect leads to. */ Location string `json:"Location"` }
TerseRedirectFound An HTTP response that will redirect to the shortened URL's full URL.
swagger:response terseRedirectFound
func NewTerseRedirectFound ¶
func NewTerseRedirectFound() *TerseRedirectFound
NewTerseRedirectFound creates TerseRedirectFound with default headers values
func (*TerseRedirectFound) SetLocation ¶
func (o *TerseRedirectFound) SetLocation(location string)
SetLocation sets the location to the terse redirect found response
func (*TerseRedirectFound) WithLocation ¶
func (o *TerseRedirectFound) WithLocation(location string) *TerseRedirectFound
WithLocation adds the location to the terse redirect found response
func (*TerseRedirectFound) WriteResponse ¶
func (o *TerseRedirectFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type TerseRedirectHandler ¶
type TerseRedirectHandler interface {
Handle(TerseRedirectParams) middleware.Responder
}
TerseRedirectHandler interface for that can handle valid terse redirect params
type TerseRedirectHandlerFunc ¶
type TerseRedirectHandlerFunc func(TerseRedirectParams) middleware.Responder
TerseRedirectHandlerFunc turns a function with the right signature into a terse redirect handler
func (TerseRedirectHandlerFunc) Handle ¶
func (fn TerseRedirectHandlerFunc) Handle(params TerseRedirectParams) middleware.Responder
Handle executing the request and returning a response
type TerseRedirectNotFound ¶
type TerseRedirectNotFound struct { }
TerseRedirectNotFound The shortened URL expired or never existed.
swagger:response terseRedirectNotFound
func NewTerseRedirectNotFound ¶
func NewTerseRedirectNotFound() *TerseRedirectNotFound
NewTerseRedirectNotFound creates TerseRedirectNotFound with default headers values
func (*TerseRedirectNotFound) WriteResponse ¶
func (o *TerseRedirectNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type TerseRedirectOK ¶
type TerseRedirectOK struct { /* In: Body */ Payload io.ReadCloser `json:"body,omitempty"` }
TerseRedirectOK The HTML document containing a social media link preview and or JavaScript fingerprinting. Any visitor will be automatically redirected to the original link with JavaScript.
swagger:response terseRedirectOK
func NewTerseRedirectOK ¶
func NewTerseRedirectOK() *TerseRedirectOK
NewTerseRedirectOK creates TerseRedirectOK with default headers values
func (*TerseRedirectOK) SetPayload ¶
func (o *TerseRedirectOK) SetPayload(payload io.ReadCloser)
SetPayload sets the payload to the terse redirect o k response
func (*TerseRedirectOK) WithPayload ¶
func (o *TerseRedirectOK) WithPayload(payload io.ReadCloser) *TerseRedirectOK
WithPayload adds the payload to the terse redirect o k response
func (*TerseRedirectOK) WriteResponse ¶
func (o *TerseRedirectOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type TerseRedirectParams ¶
type TerseRedirectParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* Required: true In: path */ Shortened string }
TerseRedirectParams contains all the bound params for the terse redirect operation typically these are obtained from a http.Request
swagger:parameters terseRedirect
func NewTerseRedirectParams ¶
func NewTerseRedirectParams() TerseRedirectParams
NewTerseRedirectParams creates a new TerseRedirectParams object no default values defined in spec.
func (*TerseRedirectParams) BindRequest ¶
func (o *TerseRedirectParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewTerseRedirectParams() beforehand.
type TerseRedirectURL ¶
type TerseRedirectURL struct { Shortened string // contains filtered or unexported fields }
TerseRedirectURL generates an URL for the terse redirect operation
func (*TerseRedirectURL) Build ¶
func (o *TerseRedirectURL) Build() (*url.URL, error)
Build a url path and query string
func (*TerseRedirectURL) BuildFull ¶
func (o *TerseRedirectURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*TerseRedirectURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*TerseRedirectURL) SetBasePath ¶
func (o *TerseRedirectURL) SetBasePath(bp string)
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*TerseRedirectURL) String ¶
func (o *TerseRedirectURL) String() string
String returns the string representation of the path with query string
func (*TerseRedirectURL) StringFull ¶
func (o *TerseRedirectURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*TerseRedirectURL) WithBasePath ¶
func (o *TerseRedirectURL) WithBasePath(bp string) *TerseRedirectURL
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string