Documentation
¶
Index ¶
- Constants
- Variables
- func AddMergeAction(h ...Any)
- func AddRender(key string, render func(*Message, ...Any) string)
- func Module(prefix string, arg ...Any)
- func PushNotice(m *Message, arg ...Any) bool
- func Render(m *Message, cmd string, args ...Any) string
- func Run(arg ...string) string
- func SaveImportant(m *Message, arg ...string)
- type Action
- type Actions
- type Any
- type Cache
- type Caches
- type Command
- type Commands
- type Config
- type Configs
- type Context
- func (c *Context) Begin(m *Message, arg ...string) *Context
- func (c *Context) Cap(key string, arg ...Any) string
- func (c *Context) Close(m *Message, arg ...string)
- func (c *Context) Cmd(m *Message, key string, arg ...string) *Message
- func (c *Context) ID() int32
- func (c *Context) Merge(s *Context) *Context
- func (c *Context) MergeCommands(Commands Commands) *Context
- func (c *Context) Prefix(arg ...string) string
- func (c *Context) Register(s *Context, x Server, cmd ...string) *Context
- func (c *Context) Server() Server
- func (c *Context) Start(m *Message, arg ...string)
- type Contexts
- type Frame
- type Handler
- type List
- type MakeInfo
- type Map
- type Maps
- type Message
- func (m *Message) Action(arg ...Any) *Message
- func (m *Message) ActionHand(cmd *Command, key, sub string, arg ...string) *Message
- func (m *Message) ActionKey() string
- func (m *Message) Actions(key string) *Action
- func (m *Message) Add(key string, arg ...string) *Message
- func (m *Message) Append(key string, arg ...Any) string
- func (m *Message) AppendSimple(key ...string) (res []string)
- func (m *Message) AppendTrans(cb func(value string, key string, index int) string) *Message
- func (m *Message) Appendv(key string, arg ...Any) []string
- func (m *Message) Assert(expr Any) bool
- func (m *Message) Auth(arg ...Any) *Message
- func (m *Message) Cmd(arg ...Any) *Message
- func (m *Message) CmdAppend(arg ...Any) string
- func (m *Message) CmdHand(cmd *Command, key string, arg ...string) *Message
- func (m *Message) CmdMap(arg ...string) map[string]map[string]string
- func (m *Message) Cmds(arg ...Any) *Message
- func (m *Message) Cmdv(arg ...Any) string
- func (m *Message) Cmdx(arg ...Any) string
- func (m *Message) Cmdy(arg ...Any) *Message
- func (m *Message) CommandKey() string
- func (m *Message) Commands(key string) *Command
- func (m *Message) Conf(arg ...Any) string
- func (m *Message) Confv(arg ...Any) (val Any)
- func (m *Message) Copy(msg *Message, arg ...string) *Message
- func (m *Message) Cost(arg ...Any) *Message
- func (m *Message) Cut(fields ...string) *Message
- func (m *Message) CutTo(key, to string) *Message
- func (m *Message) Debug(str string, arg ...Any)
- func (m *Message) Design(action Any, help string, input ...Any)
- func (m *Message) Detail(arg ...Any) string
- func (m *Message) Detailv(arg ...Any) []string
- func (m *Message) Echo(str string, arg ...Any) *Message
- func (m *Message) EchoAnchor(arg ...string) *Message
- func (m *Message) EchoButton(arg ...Any) *Message
- func (m *Message) EchoDownload(arg ...string) *Message
- func (m *Message) EchoFields(cmd string) *Message
- func (m *Message) EchoIFrame(src string) *Message
- func (m *Message) EchoImages(src string) *Message
- func (m *Message) EchoLine(str string, arg ...Any) *Message
- func (m *Message) EchoQRCode(src string) *Message
- func (m *Message) EchoScript(arg ...string) *Message
- func (m *Message) EchoVideos(src string) *Message
- func (m *Message) Error(err bool, arg ...Any) bool
- func (m *Message) ErrorNotImplement(arg ...Any) *Message
- func (m *Message) Fields(length int, fields ...string) string
- func (m *Message) FieldsIsDetail() bool
- func (m *Message) FormatChain() string
- func (m *Message) FormatCost() string
- func (m *Message) FormatMeta() string
- func (m *Message) FormatPrefix() string
- func (m *Message) FormatSize() string
- func (m *Message) FormatStack(s, n int) string
- func (m *Message) FormatsMeta(w io.Writer, arg ...string) (res string)
- func (m *Message) Go(cb func(), arg ...Any)
- func (m *Message) GoSleep(t string, arg ...Any)
- func (m *Message) Info(str string, arg ...Any) *Message
- func (m *Message) IsCliUA() bool
- func (m *Message) IsErr(arg ...string) bool
- func (m *Message) IsErrNotFound() bool
- func (m *Message) IsMobileUA() bool
- func (m *Message) IsOk() bool
- func (m *Message) Length() (max int)
- func (m *Message) Log(level string, str string, arg ...Any) *Message
- func (m *Message) Logs(level string, arg ...Any) *Message
- func (m *Message) MergePod(pod string, arg ...Any) string
- func (m *Message) MergePodCmd(pod, cmd string, arg ...Any) string
- func (m *Message) Message() *Message
- func (m *Message) Option(key string, arg ...Any) string
- func (m *Message) OptionCB(key string, cb ...Any) Any
- func (m *Message) OptionDefault(arg ...string) string
- func (m *Message) OptionFields(arg ...string) string
- func (m *Message) OptionSimple(key ...string) (res []string)
- func (m *Message) OptionSplit(key ...string) (res []string)
- func (m *Message) Options(arg ...Any) *Message
- func (m *Message) Optionv(key string, arg ...Any) Any
- func (m *Message) Prefix(arg ...string) string
- func (m *Message) PrefixKey(arg ...string) string
- func (m *Message) PrefixPath(arg ...Any) string
- func (m *Message) Process(cmd string, arg ...Any) *Message
- func (m *Message) ProcessAgain()
- func (m *Message) ProcessBack()
- func (m *Message) ProcessConfirm(arg ...Any)
- func (m *Message) ProcessDisplay(arg ...Any)
- func (m *Message) ProcessField(arg ...Any)
- func (m *Message) ProcessGrow(arg ...Any)
- func (m *Message) ProcessHistory(arg ...Any)
- func (m *Message) ProcessHold(text ...Any)
- func (m *Message) ProcessInner()
- func (m *Message) ProcessLocation(arg ...Any)
- func (m *Message) ProcessOpen(url string)
- func (m *Message) ProcessRefresh(arg ...string)
- func (m *Message) ProcessReplace(url string, arg ...Any)
- func (m *Message) ProcessRewrite(arg ...Any)
- func (m *Message) ProcessRich(arg ...Any)
- func (m *Message) Push(key string, value Any, arg ...Any) *Message
- func (m *Message) PushAction(arg ...Any) *Message
- func (m *Message) PushAnchor(arg ...string)
- func (m *Message) PushAudios(key, src string)
- func (m *Message) PushButton(arg ...Any) *Message
- func (m *Message) PushDetail(value Any, arg ...string) *Message
- func (m *Message) PushDownload(key string, arg ...string) *Message
- func (m *Message) PushIFrame(key, src string)
- func (m *Message) PushImages(key, src string)
- func (m *Message) PushQRCode(key, src string)
- func (m *Message) PushRecord(value Any, arg ...string) *Message
- func (m *Message) PushScript(arg ...string)
- func (m *Message) PushSearch(arg ...Any)
- func (m *Message) PushVideos(key, src string)
- func (m *Message) RenameAppend(arg ...string) *Message
- func (m *Message) RenameOption(from, to string) *Message
- func (m *Message) Render(cmd string, arg ...Any) *Message
- func (m *Message) RenderDownload(arg ...Any) *Message
- func (m *Message) RenderJson(arg ...Any) *Message
- func (m *Message) RenderRedirect(arg ...Any) *Message
- func (m *Message) RenderResult(arg ...Any) *Message
- func (m *Message) RenderStatus(status int, arg ...string) *Message
- func (m *Message) RenderStatusBadRequest(arg ...string) *Message
- func (m *Message) RenderStatusForbidden(arg ...string) *Message
- func (m *Message) RenderStatusNotFound(arg ...string) *Message
- func (m *Message) RenderStatusUnauthorized(arg ...string) *Message
- func (m *Message) RenderTemplate(arg ...Any) *Message
- func (m *Message) RenderVoid(arg ...Any) *Message
- func (m *Message) Result(arg ...Any) string
- func (m *Message) Results(arg ...Any) string
- func (m *Message) Resultv(arg ...Any) []string
- func (m *Message) Search(key string, cb Any) *Message
- func (m *Message) Set(key string, arg ...string) *Message
- func (m *Message) SetAppend(arg ...string) *Message
- func (m *Message) SetResult(arg ...string) *Message
- func (m *Message) Sleep(d Any, arg ...Any) *Message
- func (m *Message) Sleep300ms(arg ...Any) *Message
- func (m *Message) Sleep30ms(arg ...Any) *Message
- func (m *Message) Sleep3s(arg ...Any) *Message
- func (m *Message) Sort(key string, arg ...string) *Message
- func (m *Message) SortInt(key string) *Message
- func (m *Message) SortIntR(key string) *Message
- func (m *Message) SortStr(key string) *Message
- func (m *Message) SortStrR(key string) *Message
- func (m *Message) Source() *Context
- func (m *Message) Spawn(arg ...Any) *Message
- func (m *Message) Split(str string, arg ...string) *Message
- func (m *Message) SplitIndex(str string, arg ...string) *Message
- func (m *Message) Start(key string, arg ...string) *Message
- func (m *Message) Status(arg ...Any) *Message
- func (m *Message) StatusTime(arg ...Any) *Message
- func (m *Message) StatusTimeCount(arg ...Any) *Message
- func (m *Message) StatusTimeCountTotal(arg ...Any) *Message
- func (m *Message) Table(cb Any) *Message
- func (m *Message) TableEcho() *Message
- func (m *Message) TablesLimit(count int, cb func(value Maps)) *Message
- func (m *Message) Target() *Context
- func (m *Message) Time(arg ...string) string
- func (m *Message) ToLowerAppend(arg ...string) *Message
- func (m *Message) Travel(cb Any) *Message
- func (m *Message) TryCatch(msg *Message, catch bool, cb ...func(msg *Message))
- func (m *Message) Wait(cb ...Handler) (wait func(), done Handler)
- func (m *Message) Warn(err Any, arg ...Any) bool
- func (m *Message) WarnTimeNotValid(time Any, arg ...Any) bool
- type Messages
- type Option
- type Server
Constants ¶
View Source
const ( TB = "\t" SP = " " DF = ":" EQ = "=" AT = "@" QS = "?" PS = "/" PT = "." FS = "," NL = "\n" OK = "ok" TRUE = "true" FALSE = "false" SUCCESS = "success" FAILURE = "failure" PROCESS = "process" HTTPS = "https" HTTP = "http" AUTO = "auto" LIST = "list" BACK = "back" BASE = "base" CORE = "core" MISC = "misc" SHY = "shy" COM = "com" DEV = "dev" OPS = "ops" ICE = "ice" CAN = "can" POD = "pod" CMD = "cmd" ARG = "arg" ENV = "env" RUN = "run" RES = "res" ERR = "err" )
View Source
const ( CONTEXTS = "contexts" INTSHELL = "intshell" ICEBERGS = "icebergs" TOOLKITS = "toolkits" VOLCANOS = "volcanos" LEARNING = "learning" INSTALL = "install" REQUIRE = "require" PUBLISH = "publish" RELEASE = "release" )
View Source
const ( MOD_DIR = 0750 MOD_FILE = 0640 MOD_BUFS = 4096 MOD_DATE = kit.MOD_DATE MOD_TIME = kit.MOD_TIME MOD_TIMES = kit.MOD_TIMES )
View Source
const ( SRC = "src" ETC = "etc" BIN = "bin" VAR = "var" USR = "usr" JSON = "json" CSV = "csv" SH = "sh" GO = "go" JS = "js" CSS = "css" SVG = "svg" HTML = "html" LIB = "lib" PAGE = "page" PANEL = "panel" PLUGIN = "plugin" STORY = "story" INDEX_CSS = "index.css" PROTO_JS = "proto.js" FRAME_JS = "frame.js" INDEX_SH = "index.sh" FAVICON_ICO = "/favicon.ico" PLUGIN_INPUT = "/plugin/input/" PLUGIN_LOCAL = "/plugin/local/" PLUGIN_STORY = "/plugin/story/" ISH_PLUGED = ".ish/pluged/" USR_MODULES = "usr/node_modules/" USR_SCRIPT = "usr/script/" USR_INSTALL = "usr/install/" USR_REQUIRE = "usr/require/" USR_PUBLISH = "usr/publish/" USR_RELEASE = "usr/release/" USR_INTSHELL = "usr/intshell/" USR_ICEBERGS = "usr/icebergs/" USR_TOOLKITS = "usr/toolkits/" USR_VOLCANOS = "usr/volcanos/" USR_LEARNING = "usr/learning/" USR_LOCAL = "usr/local/" USR_LOCAL_GO = "usr/local/go/" USR_LOCAL_GO_BIN = "usr/local/go/bin/" USR_LOCAL_BIN = "usr/local/bin/" USR_LOCAL_LIB = "usr/local/lib/" USR_LOCAL_WORK = "usr/local/work/" USR_LOCAL_REPOS = "usr/local/repos/" USR_LOCAL_IMAGE = "usr/local/image/" USR_LOCAL_EXPORT = "usr/local/export/" USR_LOCAL_DAEMON = "usr/local/daemon/" VAR_DATA_IMPORTANT = "var/data/.important" VAR_LOG_BOOT_LOG = "var/log/boot.log" VAR_LOG_ICE_PID = "var/log/ice.pid" VAR_LOG = "var/log/" VAR_TMP = "var/tmp/" VAR_CONF = "var/conf/" VAR_DATA = "var/data/" VAR_FILE = "var/file/" VAR_PROXY = "var/proxy/" VAR_TRASH = "var/trash/" BIN_ICE_BIN = "bin/ice.bin" ETC_INIT_SHY = "etc/init.shy" ETC_LOCAL_SHY = "etc/local.shy" ETC_EXIT_SHY = "etc/exit.shy" ETC_MISS_SH = "etc/miss.sh" ETC_PATH = "etc/path" SRC_HELP = "src/help/" SRC_DEBUG = "src/debug/" SRC_RELEASE = "src/release/" SRC_MAIN_SHY = "src/main.shy" SRC_MAIN_SH = "src/main.sh" SRC_MAIN_JS = "src/main.js" SRC_MAIN_GO = "src/main.go" SRC_WEBVIEW_GO = "src/webview.go" SRC_VERSION_GO = "src/version.go" SRC_BINPACK_GO = "src/binpack.go" SRC_TEMPLATE = "src/template/" SRC_SCRIPT = "src/script/" README_MD = "README.md" MAKEFILE = "Makefile" LICENSE = "LICENSE" GO_MOD = "go.mod" GO_SUM = "go.sum" ICE_BIN = "ice.bin" CAN_PLUGIN = "can._plugin" )
View Source
const ( MSG_CMDS = "cmds" MSG_FIELDS = "fields" MSG_SESSID = "sessid" MSG_DETAIL = "detail" MSG_OPTION = "option" MSG_APPEND = "append" MSG_RESULT = "result" MSG_OPTS = "_option" MSG_UPLOAD = "_upload" MSG_SOURCE = "_source" MSG_TARGET = "_target" MSG_ACTION = "_action" MSG_STATUS = "_status" MSG_INDEX = "_index" MSG_ALIAS = "_alias" MSG_SCRIPT = "_script" MSG_OUTPUT = "_output" MSG_ARGS = "_args" MSG_PROCESS = "_process" MSG_DISPLAY = "_display" MSG_TOOLKIT = "_toolkit" MSG_USERIP = "user.ip" MSG_USERUA = "user.ua" MSG_USERWEB = "user.web" MSG_USERPOD = "user.pod" MSG_USERHOST = "user.host" MSG_USERADDR = "user.addr" MSG_USERDATA = "user.data" MSG_USERNICK = "user.nick" MSG_USERNAME = "user.name" MSG_USERROLE = "user.role" MSG_USERZONE = "user.zone" MSG_LANGUAGE = "user.lang" MSG_MODE = "sess.mode" MSG_TITLE = "sess.title" MSG_THEME = "sess.theme" MSG_RIVER = "sess.river" MSG_STORM = "sess.storm" MSG_WIDTH = "sess.width" MSG_HEIGHT = "sess.height" MSG_DAEMON = "sess.daemon" MSG_FILES = "file.system" YAC_STACK = "yac.stack" YAC_MESSAGE = "yac.message" LOG_DISABLE = "log.disable" )
View Source
const ( RENDER_BUTTON = "_button" RENDER_ANCHOR = "_anchor" RENDER_QRCODE = "_qrcode" RENDER_IMAGES = "_images" RENDER_VIDEOS = "_videos" RENDER_AUDIOS = "_audios" RENDER_IFRAME = "_iframe" RENDER_SCRIPT = "_script" RENDER_STATUS = "_status" RENDER_REDIRECT = "_redirect" RENDER_DOWNLOAD = "_download" RENDER_TEMPLATE = "_template" RENDER_RESULT = "_result" RENDER_JSON = "_json" RENDER_VOID = "_void" RENDER_RAW = "_raw" )
View Source
const ( PROCESS_LOCATION = "_location" PROCESS_REPLACE = "_replace" PROCESS_HISTORY = "_history" PROCESS_CONFIRM = "_confirm" PROCESS_REFRESH = "_refresh" PROCESS_REWRITE = "_rewrite" PROCESS_DISPLAY = "_display" PROCESS_FIELD = "_field" PROCESS_FLOAT = "_float" PROCESS_INNER = "_inner" PROCESS_AGAIN = "_again" PROCESS_HOLD = "_hold" PROCESS_BACK = "_back" PROCESS_RICH = "_rich" PROCESS_GROW = "_grow" PROCESS_OPEN = "_open" PROCESS_ARG = "_arg" FIELD_PREFIX = "_prefix" FIELDS_DETAIL = "detail" )
View Source
const ( CTX_ARG = "ctx_arg" CTX_DAEMON = "ctx_daemon" CTX_FOLLOW = "follow" CTX_BEGIN = "begin" CTX_START = "start" CTX_SERVE = "serve" CTX_CLOSE = "close" CTX_INIT = "_init" CTX_EXIT = "_exit" )
View Source
const ( LOG_CMDS = "cmds" LOG_AUTH = "auth" LOG_COST = "cost" LOG_INFO = "info" LOG_WARN = "warn" LOG_ERROR = "error" LOG_DEBUG = "debug" )
View Source
const ( ErrWarn = "warn: " ErrNotLogin = "not login: " ErrNotRight = "not right: " ErrNotValid = "not valid: " ErrNotFound = "not found: " ErrNotStart = "not start: " ErrNotImplement = "not implement: " )
View Source
const ( COMMAND = "command" ACTION = "action" STYLE = "style" INDEX = "index" )
View Source
const ( SEARCH = "search" INPUTS = "inputs" CREATE = "create" SELECT = "select" KEY = "key" FIELD = "field" VALUE = "value" EXTRA = "extra" META = "meta" HASH = "hash" TIME = "time" TYPE = "type" NAME = "name" TEXT = "text" LINK = "link" )
View Source
const ( SERVE = "serve" SPACE = "space" TITLE = "title" THEME = "theme" )
View Source
const ( EVENT = "event" ROUTINE = "routine" )
View Source
const ( SOURCE = "source" SCRIPT = "script" )
View Source
const ( FOREVER = "forever" SYSTEM = "system" START = "start" )
View Source
const ( CTX = "ctx" MDB = "mdb" WEB = "web" AAA = "aaa" LEX = "lex" YAC = "yac" SSH = "ssh" GDB = "gdb" TCP = "tcp" NFS = "nfs" CLI = "cli" LOG = "log" )
View Source
const ( INIT = "init" QUIT = "quit" EXIT = "exit" )
View Source
const ( STR = "str" STR_R = "str_r" INT_R = "int_r" INT = "int" )
View Source
const (
DEBUG = "debug"
)
Variables ¶
View Source
var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{ CTX_INIT: {Hand: func(m *Message, arg ...string) { m.Travel(func(p *Context, c *Context) { kit.If(p != nil, func() { c._command(m.Spawn(c), c.Commands[CTX_INIT], CTX_INIT, arg...) }) }) loadImportant(m) }}, INIT: {Hand: func(m *Message, arg ...string) { m.Cmd(kit.Keys(MDB, CTX_INIT)) m.Cmd(CTX_INIT) m.Cmd(SOURCE, ETC_INIT_SHY) }}, QUIT: {Hand: func(m *Message, arg ...string) { os.Exit(0) }}, EXIT: {Hand: func(m *Message, arg ...string) { m.root.Option(EXIT, kit.Select("0", arg, 0)) m.Cmd(SOURCE, ETC_EXIT_SHY) m.Cmd(CTX_EXIT) }}, CTX_EXIT: {Hand: func(m *Message, arg ...string) { defer m.Target().Close(m.Spawn(), arg...) m.Travel(func(p *Context, c *Context) { kit.If(p != nil, func() { c._command(m.Spawn(c), c.Commands[CTX_EXIT], CTX_EXIT, arg...) }) }) removeImportant(m) }}, }, server: &Frame{}}
View Source
var Info = struct { Make MakeInfo Hostname string Pathname string Username string PidPath string Colors bool Domain string NodeType string NodeName string Localhost bool Important bool File Maps Gomod Maps Route Maps Index Map Stack map[string]func(m *Message, key string, arg ...Any) Any merges []Any render map[string]func(*Message, ...Any) string Load func(m *Message, key ...string) *Message Save func(m *Message, key ...string) *Message Log func(m *Message, p, l, s string) }{ Localhost: true, File: Maps{}, Gomod: Maps{}, Route: Maps{}, Index: Map{}, Stack: map[string]func(m *Message, key string, arg ...Any) Any{}, Load: func(m *Message, key ...string) *Message { return m }, Save: func(m *Message, key ...string) *Message { return m }, Log: func(m *Message, p, l, s string) {}, // contains filtered or unexported fields }
Functions ¶
Types ¶
type Actions ¶ added in v1.2.7
type Any ¶ added in v1.2.7
type Any = interface{}
type Command ¶
type Context ¶
type Context struct { Name string Help string Caches Caches Configs Configs Commands Commands // contains filtered or unexported fields }
func (*Context) MergeCommands ¶ added in v1.2.7
type Frame ¶
type Frame struct{}
type Handler ¶ added in v1.3.0
type MakeInfo ¶ added in v0.9.8
type Message ¶
type Message struct { W http.ResponseWriter R *http.Request O io.Writer I io.Reader // contains filtered or unexported fields }
func (*Message) ActionHand ¶ added in v1.4.4
func (*Message) AppendTrans ¶ added in v0.4.7
func (*Message) CmdHand ¶ added in v1.4.4
func (*Message) CmdMap ¶ added in v1.2.9
func (*Message) Design ¶ added in v1.2.6
func (*Message) EchoLine ¶ added in v1.4.7
func (*Message) ErrorNotImplement ¶ added in v1.2.9
func (*Message) FormatsMeta ¶ added in v0.6.3
func (*Message) MergePod ¶ added in v1.1.7
func (*Message) MergePodCmd ¶ added in v1.5.5
func (*Message) OptionDefault ¶ added in v1.1.8
func (*Message) ProcessReplace ¶ added in v1.2.0
func (*Message) PushDetail ¶ added in v1.1.3
func (*Message) PushRecord ¶ added in v1.1.8
func (*Message) RenameOption ¶ added in v1.4.4
func (*Message) RenderStatus ¶ added in v1.2.7
func (*Message) RenderStatusBadRequest ¶ added in v1.2.7
func (*Message) RenderStatusForbidden ¶ added in v1.2.7
func (*Message) RenderStatusNotFound ¶ added in v1.2.7
func (*Message) RenderStatusUnauthorized ¶ added in v1.2.7
func (*Message) SplitIndex ¶ added in v0.7.8
func (*Message) TablesLimit ¶ added in v1.5.5
func (*Message) ToLowerAppend ¶ added in v1.1.2
func (*Message) TryCatch ¶
func (*Message) Wait ¶ added in v1.5.5
type Option ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.