Results

type BinaryResult

type BinaryResult struct {
    Reader   io.Reader
    Name     string
    Length   int64
    Delivery ContentDisposition
    ModTime  time.Time
}

func (*BinaryResult) Apply

func (r *BinaryResult) Apply(req *Request, resp *Response)

type ContentDisposition

type ContentDisposition string
var (
    Attachment ContentDisposition = "attachment"
    Inline     ContentDisposition = "inline"
)

type ErrorResult

type ErrorResult struct {
    RenderArgs map[string]interface{}
    Error      error
}

This result handles all kinds of error codes (500, 404, ..). It renders the relevant error page (errors/CODE.format, e.g. errors/500.json). If RunMode is "dev", this results in a friendly error page.

func (ErrorResult) Apply

func (r ErrorResult) Apply(req *Request, resp *Response)

type PlaintextErrorResult

type PlaintextErrorResult struct {
    Error error
}

func (PlaintextErrorResult) Apply

func (r PlaintextErrorResult) Apply(req *Request, resp *Response)

This method is used when the template loader or error template is not available.

type RedirectToActionResult

type RedirectToActionResult struct {
    // contains filtered or unexported fields
}

func (*RedirectToActionResult) Apply

func (r *RedirectToActionResult) Apply(req *Request, resp *Response)

type RedirectToUrlResult

type RedirectToUrlResult struct {
    // contains filtered or unexported fields
}

func (*RedirectToUrlResult) Apply

func (r *RedirectToUrlResult) Apply(req *Request, resp *Response)

type RenderHtmlResult

type RenderHtmlResult struct {
    // contains filtered or unexported fields
}

func (RenderHtmlResult) Apply

func (r RenderHtmlResult) Apply(req *Request, resp *Response)

type RenderJsonResult

type RenderJsonResult struct {
    // contains filtered or unexported fields
}

func (RenderJsonResult) Apply

func (r RenderJsonResult) Apply(req *Request, resp *Response)

type RenderTemplateResult

type RenderTemplateResult struct {
    Template   Template
    RenderArgs map[string]interface{}
}

Action methods return this result to request a template be rendered.

func (*RenderTemplateResult) Apply

func (r *RenderTemplateResult) Apply(req *Request, resp *Response)

type RenderTextResult

type RenderTextResult struct {
    // contains filtered or unexported fields
}

func (RenderTextResult) Apply

func (r RenderTextResult) Apply(req *Request, resp *Response)

type RenderXmlResult

type RenderXmlResult struct {
    // contains filtered or unexported fields
}

func (RenderXmlResult) Apply

func (r RenderXmlResult) Apply(req *Request, resp *Response)

type Result

type Result interface {
    Apply(req *Request, resp *Response)
}