2016-05-30 16:08:09 +02:00
|
|
|
package context
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bufio"
|
|
|
|
"html/template"
|
|
|
|
"io"
|
|
|
|
"time"
|
2016-06-22 11:45:57 +02:00
|
|
|
|
|
|
|
"github.com/kataras/iris/sessions/store"
|
|
|
|
"github.com/valyala/fasthttp"
|
2016-05-30 16:08:09 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
2016-06-24 00:34:49 +02:00
|
|
|
// 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)
|
2016-06-26 07:46:04 +02:00
|
|
|
ParamInt64(string) (int64, error)
|
2016-05-30 16:08:09 +02:00
|
|
|
URLParam(string) string
|
|
|
|
URLParamInt(string) (int, error)
|
2016-06-26 07:44:10 +02:00
|
|
|
URLParamInt64(string) (int64, error)
|
2016-05-30 16:08:09 +02:00
|
|
|
URLParams() map[string]string
|
|
|
|
MethodString() string
|
|
|
|
HostString() string
|
2016-06-04 22:07:19 +02:00
|
|
|
Subdomain() string
|
2016-05-30 16:08:09 +02:00
|
|
|
PathString() string
|
2016-06-14 07:45:40 +02:00
|
|
|
RequestPath(bool) string
|
2016-05-30 16:08:09 +02:00
|
|
|
RequestIP() string
|
|
|
|
RemoteAddr() string
|
|
|
|
RequestHeader(k string) string
|
|
|
|
PostFormValue(string) string
|
2016-06-14 07:45:40 +02:00
|
|
|
PostFormMulti(string) []string
|
2016-05-30 16:08:09 +02:00
|
|
|
SetStatusCode(int)
|
|
|
|
SetContentType(string)
|
|
|
|
SetHeader(string, string)
|
|
|
|
Redirect(string, ...int)
|
2016-06-24 00:34:49 +02:00
|
|
|
RedirectTo(string, ...interface{})
|
2016-05-30 16:08:09 +02:00
|
|
|
NotFound()
|
|
|
|
Panic()
|
|
|
|
EmitError(int)
|
2016-06-24 00:34:49 +02:00
|
|
|
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{})
|
|
|
|
SetCookie(*fasthttp.Cookie)
|
|
|
|
SetCookieKV(string, string)
|
|
|
|
RemoveCookie(string)
|
2016-07-02 15:02:33 +02:00
|
|
|
GetFlash(string) (string, error)
|
2016-05-30 16:08:09 +02:00
|
|
|
SetFlash(string, string)
|
|
|
|
Session() store.IStore
|
|
|
|
SessionDestroy()
|
2016-06-24 00:34:49 +02:00
|
|
|
Log(string, ...interface{})
|
|
|
|
Reset(*fasthttp.RequestCtx)
|
|
|
|
GetRequestCtx() *fasthttp.RequestCtx
|
|
|
|
Clone() IContext
|
|
|
|
Do()
|
|
|
|
Next()
|
|
|
|
StopExecution()
|
|
|
|
IsStopped() bool
|
|
|
|
GetHandlerName() string
|
2016-06-22 03:22:12 +02:00
|
|
|
}
|
2016-05-30 16:08:09 +02:00
|
|
|
)
|