web

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 29 Imported by: 14

Documentation

Index

Constants

View Source
const (
	WATCH    = "watch"
	CATCH    = "catch"
	WRITE    = "write"
	UPLOAD   = "upload"
	DOWNLOAD = "download"
	DISPLAY  = "display"
)
View Source
const (
	DREAM_CREATE = "dream.create"
	DREAM_OPEN   = "dream.open"
	DREAM_CLOSE  = "dream.close"

	DREAM_INPUTS = "dream.inputs"
	DREAM_TABLES = "dream.tables"
	DREAM_ACTION = "dream.action"
)
View Source
const (
	COOKIE = "cookie"
	STATUS = "status"
)
View Source
const (
	WEBSITE = "website"

	CODE_INNER = "web.code.inner"
	WIKI_WORD  = "web.wiki.word"
)
View Source
const (
	SERVE_START   = "serve.start"
	SERVE_REWRITE = "serve.rewrite"
	SERVE_PARSE   = "serve.parse"
	SERVE_LOGIN   = "serve.login"
	SERVE_CHECK   = "serve.check"
	SERVE_STOP    = "serve.stop"

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

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

	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_START = "space.start"
	SPACE_OPEN  = "space.open"
	SPACE_LOGIN = "space.login"
	SPACE_CLOSE = "space.close"
	SPACE_STOP  = "space.stop"
)
View Source
const (
	SPIDE_RAW   = "raw"
	SPIDE_MSG   = "msg"
	SPIDE_CACHE = "cache"
	SPIDE_SAVE  = "save"

	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_PROTOCOL = "client.protocol"
	CLIENT_HOSTNAME = "client.hostname"

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

	OPEN     = "open"
	FULL     = "full"
	LINK     = "link"
	HTTP     = "http"
	FORM     = "form"
	MERGE    = "merge"
	ADDRESS  = "address"
	REQUEST  = "request"
	RESPONSE = "response"
)
View Source
const BROAD = "broad"
View Source
const CACHE = "cache"
View Source
const DREAM = "dream"
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 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 Download added in v1.4.7

func Download(m *ice.Message, link string, cb func(count, total, value int)) *ice.Message

func DreamAction added in v1.4.4

func DreamAction() ice.Actions

func GoToast added in v1.3.0

func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int)))

func IsNotValidShare added in v1.4.4

func IsNotValidShare(m *ice.Message, time string) bool
func MergeLink(m Message, url string, arg ...ice.Any) string

func MergePod added in v1.3.0

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

func MergePodCmd added in v1.4.2

func MergePodCmd(m Message, pod, cmd string, arg ...ice.Any) string

func MergePodWebSite added in v1.4.3

func MergePodWebSite(m Message, pod, web string, arg ...ice.Any) string

func MergeURL2 added in v1.3.0

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

func OptionAgentIs added in v1.3.0

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

func OptionUserWeb added in v1.3.0

func OptionUserWeb(m 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 Prefix added in v1.4.4

func Prefix(arg ...string) string

func ProcessIframe added in v1.4.2

func ProcessIframe(m *ice.Message, link string, arg ...string)

func ProcessWebsite added in v1.4.2

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

func PushDisplay added in v1.4.4

func PushDisplay(m *ice.Message, mime, name, link 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, cmds ...ice.Any) *ice.Message

func Render

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

func RenderCache added in v1.4.7

func RenderCache(m *ice.Message, h string)

func RenderCmd added in v1.3.0

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

func RenderCookie

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

func RenderDownload added in v0.7.7

func RenderDownload(m *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 RenderMain added in v1.4.4

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

func RenderPodCmd added in v1.4.4

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

func RenderRedirect added in v0.9.2

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

func RenderRefresh added in v1.2.6

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

func RenderResult added in v0.7.7

func RenderResult(m *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 ServeAction added in v1.4.4

func ServeAction() ice.Actions

func Space added in v1.3.0

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

func SpaceAction added in v1.4.4

func SpaceAction() ice.Actions

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 SpideSave added in v1.4.3

func SpideSave(m *ice.Message, file, link string, cb func(int, int, int)) *ice.Message

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) *ice.Message

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.Server
	*http.ServeMux
	// contains filtered or unexported fields
}

func (*Frame) Begin

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

func (*Frame) Close

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

func (*Frame) ServeHTTP

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

func (*Frame) Spawn

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

func (*Frame) Start

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

type Message added in v1.4.0

type Message interface {
	Option(key string, arg ...ice.Any) string
	PrefixKey(arg ...ice.Any) string
}

Jump to

Keyboard shortcuts

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