web

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 30 Imported by: 19

Documentation

Index

Constants

View Source
const (
	WATCH    = "watch"
	CATCH    = "catch"
	WRITE    = "write"
	UPLOAD   = "upload"
	DOWNLOAD = "download"

	UPLOAD_WATCH = "upload_watch"
)
View Source
const (
	DREAM_CREATE = "dream.create"
	DREAM_START  = "dream.start"
	DREAM_STOP   = "dream.stop"
)
View Source
const (
	COOKIE = "cookie"
	STATUS = "status"
)
View Source
const (
	WEB_LOGIN = "_login"
	SSO       = "sso"

	DOMAIN = "domain"
	INDEX  = "index"
)
View Source
const (
	TOPIC = "topic"
	LOGIN = "login"
	RIVER = "river"
	STORM = "storm"
	FIELD = "field"

	SHARE_TOAST = "/share/toast/"
	SHARE_CACHE = "/share/cache/"
	SHARE_LOCAL = "/share/local/"
	SHARE_PROXY = "/share/proxy/"
	SHARE_REPOS = "/share/repos/"

	SHARE_LOCAL_AVATAR     = "/share/local/avatar/"
	SHARE_LOCAL_BACKGROUND = "/share/local/background/"
)
View Source
const (
	CHROME = "chrome"
	FRIEND = "friend"
	MASTER = "master"
	MYSELF = "myself"
	SERVER = "server"
	WORKER = "worker"
)
View Source
const (
	BUFFER  = "buffer"
	REDIAL  = "redial"
	TIMEOUT = "timeout"

	SPACE_OPEN  = "space.open"
	SPACE_CLOSE = "space.close"
	SPACE_START = "space.start"
	SPACE_STOP  = "space.stop"
)
View Source
const (
	// 缓存方法
	SPIDE_RAW   = "raw"
	SPIDE_MSG   = "msg"
	SPIDE_SAVE  = "save"
	SPIDE_CACHE = "cache"

	// 请求方法
	SPIDE_GET    = "GET"
	SPIDE_PUT    = "PUT"
	SPIDE_POST   = "POST"
	SPIDE_DELETE = "DELETE"

	// 请求参数
	SPIDE_BODY = "body"
	SPIDE_FORM = "form"
	SPIDE_PART = "part"
	SPIDE_JSON = "json"
	SPIDE_DATA = "data"
	SPIDE_FILE = "file"

	// 响应数据
	SPIDE_RES = "content_data"

	// 请求头
	Bearer        = "Bearer"
	Authorization = "Authorization"
	ContentType   = "Content-Type"
	ContentLength = "Content-Length"
	UserAgent     = "User-Agent"
	Referer       = "Referer"
	Accept        = "Accept"

	// 数据格式
	ContentFORM = "application/x-www-form-urlencoded"
	ContentJSON = "application/json"
	ContentPNG  = "image/png"
	ContentHTML = "text/html"
	ContentCSS  = "text/css"
)
View Source
const (
	SPIDE_CLIENT = "client"
	SPIDE_METHOD = "method"
	SPIDE_HEADER = "header"
	SPIDE_COOKIE = "cookie"

	CLIENT_NAME    = "client.name"
	CLIENT_METHOD  = "client.method"
	CLIENT_TIMEOUT = "client.timeout"
	CLIENT_URL     = "client.url"
	LOGHEADERS     = "logheaders"

	FORM     = "form"
	ADDRESS  = "address"
	REQUEST  = "request"
	RESPONSE = "response"

	MERGE  = "merge"
	SUBMIT = "submit"
)
View Source
const (
	SERVE_START = "serve.start"
	SERVE_STOP  = "serve.stop"
	WEBSITE     = "website"
)
View Source
const BROAD = "broad"
View Source
const CACHE = "cache"
View Source
const DREAM = "dream"
View Source
const ROUTE = "route"
View Source
const SERVE = "serve"
View Source
const SHARE = "share"
View Source
const SPACE = "space"
View Source
const SPIDE = "spide"
View Source
const WEB = "web"

Variables

View Source
var Index = &ice.Context{Name: WEB, Help: "网络模块"}

Functions

func AddRewrite added in v0.6.4

func AddRewrite(cb ice.Any)

func ApiAction added in v1.3.0

func ApiAction(arg ...string) ice.Actions

func CookieName added in v0.7.9

func CookieName(url string) string

func GoToast added in v1.3.0

func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int)))
func MergeLink(m *ice.Message, url string, arg ...ice.Any) string

func MergePod added in v1.3.0

func MergePod(m *ice.Message, pod string, arg ...ice.Any) string

func MergeURL2 added in v1.3.0

func MergeURL2(m *ice.Message, url string, arg ...ice.Any) string

func OptionAgentIs added in v1.3.0

func OptionAgentIs(m *ice.Message, arg ...string) bool

func OptionUserWeb added in v1.3.0

func OptionUserWeb(m *ice.Message) *url.URL

func P added in v1.2.7

func P(arg ...string) string

func PP added in v1.2.9

func PP(arg ...string) string

func PushNotice added in v1.3.0

func PushNotice(m *ice.Message, arg ...ice.Any)

func PushNoticeGrow added in v1.3.0

func PushNoticeGrow(m *ice.Message, arg ...ice.Any)

func PushNoticeRefresh added in v1.3.0

func PushNoticeRefresh(m *ice.Message, arg ...ice.Any)

func PushNoticeToast added in v1.3.0

func PushNoticeToast(m *ice.Message, arg ...ice.Any)

func PushPodCmd added in v1.3.0

func PushPodCmd(m *ice.Message, cmd string, arg ...string)

func PushStream

func PushStream(m *ice.Message)

func Render

func Render(msg *ice.Message, cmd string, args ...ice.Any)

func RenderCmd added in v1.3.0

func RenderCmd(m *ice.Message, index string, args ...ice.Any)

func RenderCookie

func RenderCookie(msg *ice.Message, value string, arg ...string)

func RenderDownload added in v0.7.7

func RenderDownload(msg *ice.Message, arg ...ice.Any)

func RenderHeader added in v0.4.1

func RenderHeader(w http.ResponseWriter, key, value string)

func RenderIndex added in v1.3.0

func RenderIndex(m *ice.Message, repos string, file ...string) *ice.Message

func RenderRedirect added in v0.9.2

func RenderRedirect(msg *ice.Message, arg ...ice.Any)

func RenderRefresh added in v1.2.6

func RenderRefresh(msg *ice.Message, arg ...string)

func RenderResult added in v0.7.7

func RenderResult(msg *ice.Message, arg ...ice.Any)

func RenderStatus

func RenderStatus(w http.ResponseWriter, code int, text string)

func RenderType

func RenderType(w http.ResponseWriter, name, mime string)

func RenderWebsite added in v1.3.0

func RenderWebsite(m *ice.Message, pod string, dir string, arg ...string) *ice.Message

func Space added in v1.3.0

func Space(m *ice.Message, arg ice.Any) []string

func SpideDelete added in v1.3.0

func SpideDelete(m *ice.Message, arg ...ice.Any) ice.Any

func SpideGet added in v1.3.0

func SpideGet(m *ice.Message, arg ...ice.Any) ice.Any

func SpidePost added in v1.3.0

func SpidePost(m *ice.Message, arg ...ice.Any) ice.Any

func SpidePut added in v1.3.0

func SpidePut(m *ice.Message, arg ...ice.Any) ice.Any

func Toast added in v1.3.0

func Toast(m *ice.Message, text string, arg ...ice.Any)

func Toast30s added in v1.3.0

func Toast30s(m *ice.Message, text string, arg ...ice.Any)

func Toast3s added in v1.3.0

func Toast3s(m *ice.Message, text string, arg ...ice.Any)

func ToastFailure added in v1.3.0

func ToastFailure(m *ice.Message, arg ...ice.Any)

func ToastProcess added in v1.3.0

func ToastProcess(m *ice.Message, arg ...ice.Any) func()

func ToastRestart added in v1.3.0

func ToastRestart(m *ice.Message, arg ...ice.Any)

func ToastSuccess added in v1.3.0

func ToastSuccess(m *ice.Message, arg ...ice.Any)

func Upload added in v1.3.0

func Upload(m *ice.Message) []string

Types

type Frame

type Frame struct {
	*ice.Message
	*http.Client
	*http.Server
	*http.ServeMux
	// contains filtered or unexported fields
}

func (*Frame) Begin

func (frame *Frame) Begin(m *ice.Message, arg ...string) ice.Server

func (*Frame) Close

func (frame *Frame) Close(m *ice.Message, arg ...string) bool

func (*Frame) ServeHTTP

func (frame *Frame) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Frame) Spawn

func (frame *Frame) Spawn(m *ice.Message, c *ice.Context, arg ...string) ice.Server

func (*Frame) Start

func (frame *Frame) Start(m *ice.Message, arg ...string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL