iris/context/context.go

89 lines
2.3 KiB
Go
Raw Normal View History

2016-05-30 16:08:09 +02:00
package context
import (
"bufio"
"html/template"
"io"
"time"
"github.com/kataras/iris/sessions/store"
"github.com/valyala/fasthttp"
2016-05-30 16:08:09 +02:00
)
type (
// IContext the interface for the iris/context
// Used mostly inside packages which shouldn't be import ,directly, the kataras/iris.
2016-05-30 16:08:09 +02:00
IContext interface {
Param(string) string
ParamInt(string) (int, error)
ParamInt64(string) (int64, error)
2016-05-30 16:08:09 +02:00
URLParam(string) string
URLParamInt(string) (int, error)
URLParamInt64(string) (int64, error)
2016-05-30 16:08:09 +02:00
URLParams() map[string]string
MethodString() string
HostString() string
Subdomain() string
2016-05-30 16:08:09 +02:00
PathString() string
RequestPath(bool) string
2016-05-30 16:08:09 +02:00
RequestIP() string
RemoteAddr() string
RequestHeader(k string) string
PostFormValue(string) string
PostFormMulti(string) []string
2016-05-30 16:08:09 +02:00
SetStatusCode(int)
SetContentType(string)
SetHeader(string, string)
Redirect(string, ...int)
RedirectTo(string, ...interface{})
2016-05-30 16:08:09 +02:00
NotFound()
Panic()
EmitError(int)
Write(string, ...interface{})
HTML(int, string)
Data(int, []byte) error
RenderWithStatus(int, string, interface{}, ...string) error
Render(string, interface{}, ...string) error
MustRender(string, interface{}, ...string)
TemplateString(string, interface{}, ...string) string
MarkdownString(string) string
Markdown(int, string)
JSON(int, interface{}) error
JSONP(int, string, interface{}) error
Text(int, string) error
XML(int, interface{}) error
ExecuteTemplate(*template.Template, interface{}) error
ServeContent(io.ReadSeeker, string, time.Time, bool) error
ServeFile(string, bool) error
SendFile(string, string) error
Stream(func(*bufio.Writer))
StreamWriter(cb func(*bufio.Writer))
StreamReader(io.Reader, int)
ReadJSON(interface{}) error
ReadXML(interface{}) error
ReadForm(interface{}) error
2016-05-30 16:08:09 +02:00
Get(string) interface{}
GetString(string) string
GetInt(string) int
Set(string, interface{})
2016-07-07 01:26:05 +02:00
VisitAllCookies(func(string, string))
2016-05-30 16:08:09 +02:00
SetCookie(*fasthttp.Cookie)
SetCookieKV(string, string)
RemoveCookie(string)
2016-07-07 01:26:05 +02:00
GetFlashes() map[string]string
GetFlash(string) (string, error)
2016-05-30 16:08:09 +02:00
SetFlash(string, string)
Session() store.IStore
SessionDestroy()
Log(string, ...interface{})
Reset(*fasthttp.RequestCtx)
GetRequestCtx() *fasthttp.RequestCtx
Clone() IContext
Do()
Next()
StopExecution()
IsStopped() bool
GetHandlerName() string
}
2016-05-30 16:08:09 +02:00
)