func (c *Controller) PermanentRedirect(urlStr string) *RedirectResponse {
	return NewPermanentRedirectResponse(urlStr)
}
PermanentRedirect returns a new RedirectResponse with a permanent redirect
(HTTP 301)
package goanna
import (
	"bytes"
	"html/template"
	"net/http"
	"net/url"
)
type ControllerInterface interface {
	Init()
	Session() Session
	SetRequest(*http.Request)
}
type Controller struct {
	Request       *Request
	sessionFinder SessionFinder
}
func (c *Controller) SetRequest(req *http.Request) {
	c.Request = &Request{Request: req}
}
func (c *Controller) Session() Session {
	if c.Request.session == nil {
		c.Request.session = c.sessionFinder(c.Request)
	}
	return c.Request.session
}
func NewController(sessionFinder SessionFinder) Controller {
	return Controller{
		sessionFinder: sessionFinder,
	}
}
func (c *Controller) LogRequest(reason string) {
	LogRequest(c.Request, reason)
}
func (c *Controller) RenderView(templateStr string, vars interface{}) []byte {
	t, err := template.New("RenderView").Parse(templateStr)
	if err != nil {
		panic(err.Error())
	}
	return c.RenderTemplate(t, vars)
}
func RenderTemplate(t *template.Template, vars interface{}) []byte {
	out := bytes.NewBuffer(nil)
	err := t.Execute(out, vars)
	if err != nil {
		panic(err.Error())
	}
	return out.Bytes()
}
func (c *Controller) RenderTemplate(t *template.Template, vars interface{}) []byte {
	return RenderTemplate(t, vars)
}
func RenderTemplateResponse(t *template.Template, vars interface{}) *OkResponse {
	response := NewResponse()
	response.SetContent(RenderTemplate(t, vars))
	return response
}
func (c *Controller) RenderTemplateResponse(t *template.Template, vars interface{}) *OkResponse {
	return RenderTemplateResponse(t, vars)
}
func Redirect(urlStr string) *RedirectResponse {
	return NewRedirectResponse(urlStr)
}
func (c *Controller) Redirect(urlStr string) *RedirectResponse {
	return NewRedirectResponse(urlStr)
}