Documentation ¶
Index ¶
- Constants
- Variables
- func Cat(ctx context.Context, args ...string) error
- func CompleteFiles(args []string) (c []string)
- func CompleteFlags(fs *flag.FlagSet, args []string) (c []string)
- func CompleteInterfaces(args []string) (c []string)
- func CompleteStrings(l []string, args []string) (c []string)
- func Echo(ctx context.Context, args ...string) error
- func ErrorfWith(ctx context.Context, format string, args ...interface{}) error
- func Hereby(ctx context.Context, args []string) (context.Context, []string)
- func Herein(ctx context.Context, args []string) (context.Context, []string)
- func LastArg(args []string) (s string)
- func Listen() (net.Listener, error)
- func PathOf(ctx context.Context) []string
- func PlainLog()
- func Preempt(ctx context.Context, args []string) (context.Context, []string)
- func Preemption(ctx context.Context) string
- func RPC(ctx context.Context, args ...string) error
- func StyleLog()
- func Usage(ctx context.Context, args ...interface{})
- func UsageOf(ctx context.Context) func()
- func WithInput(ctx context.Context, r io.Reader) context.Context
- func WithOutput(ctx context.Context, w io.Writer) context.Context
- func WithPath(ctx context.Context, name string) context.Context
- func WithRoot(ctx context.Context, m Selection) context.Context
- func WithUsage(ctx context.Context, f func()) context.Context
- type BuildId
- type EmbeddedFile
- type Func
- type Input
- type LANG
- type Lang
- type Output
- func (o Output) Print(args ...interface{})
- func (o Output) Printf(format string, args ...interface{})
- func (o Output) Println(args ...interface{})
- func (o Output) ReadFrom(r io.Reader) (n int64, err error)
- func (o Output) Value(k interface{}) interface{}
- func (o Output) Write(data []byte) (int, error)
- type Selection
- type Service
- type Value
Constants ¶
View Source
const LogFlags = log.Lshortfile
View Source
const RpcNet = "unix"
View Source
const ServiceTimeout = 30 * time.Second
View Source
const ThisBuildId = BuildId("/proc/self/exe")
Variables ¶
View Source
var ( PageSz = os.Getpagesize() Page = sync.Pool{ New: func() interface{} { return make([]byte, PageSz, PageSz) }, } )
View Source
var BuiltIn = Selection{ "build-id": func(ctx context.Context, args ...string) error { OutputOf(ctx).Println(ThisBuildId) return nil }, "build-info": func(ctx context.Context, args ...string) error { if bi, ok := debug.ReadBuildInfo(); ok { OutputOf(ctx).Print(bi) } return nil }, "cat": Cat, "echo": Echo, "version": func(ctx context.Context, args ...string) error { if bi, ok := debug.ReadBuildInfo(); ok { OutputOf(ctx).Println(bi.Main.Version) } return nil }, }
View Source
var Fatal = log.Fatal
View Source
var Prog = filepath.Base(os.Args[0])
View Source
var RpcAddr = "@" + Prog
Functions ¶
func CompleteFiles ¶
func CompleteInterfaces ¶
func CompleteStrings ¶
func ErrorfWith ¶
ErrorfWith context path preface.
func Preemption ¶
Preemption returns "complete" or "help" if the context path is preempted by either; otherwise, this returns an empty string.
func Usage ¶
Usage prints this formatted text.
usage: PATH ARGS...
Where PATH is the space separated elements pushed onto the context. The ARGS are fomatted with `fmt.Print` WITHOUT space separation so include this w/in if desired.
A *flag.FlagSet arg is // printed with FlagSet.PrintDefault, and similarly for a Selection arg.
Types ¶
type EmbeddedFile ¶
func (EmbeddedFile) Bytes ¶
func (f EmbeddedFile) Bytes() []byte
func (EmbeddedFile) String ¶
func (f EmbeddedFile) String() string
type LANG ¶
type LANG string
const ( AaDJ LANG = "aa_DJ.UTF-8" AfZA LANG = "af_ZA.UTF-8" AnES LANG = "an_ES.UTF-8" ArAE LANG = "ar_AE.UTF-8" ArBH LANG = "ar_BH.UTF-8" ArDZ LANG = "ar_DZ.UTF-8" ArEG LANG = "ar_EG.UTF-8" ArIQ LANG = "ar_IQ.UTF-8" ArJO LANG = "ar_JO.UTF-8" ArKW LANG = "ar_KW.UTF-8" ArLB LANG = "ar_LB.UTF-8" ArLY LANG = "ar_LY.UTF-8" ArMA LANG = "ar_MA.UTF-8" ArOM LANG = "ar_OM.UTF-8" ArQA LANG = "ar_QA.UTF-8" ArSA LANG = "ar_SA.UTF-8" ArSD LANG = "ar_SD.UTF-8" ArSY LANG = "ar_SY.UTF-8" ArTN LANG = "ar_TN.UTF-8" ArYE LANG = "ar_YE.UTF-8" AstES LANG = "ast_ES.UTF-8" BeBY LANG = "be_BY.UTF-8" BgBG LANG = "bg_BG.UTF-8" BrFR LANG = "br_FR.UTF-8" BsBA LANG = "bs_BA.UTF-8" CaAD LANG = "ca_AD.UTF-8" CaES LANG = "ca_ES.UTF-8" CaFR LANG = "ca_FR.UTF-8" CaIT LANG = "ca_IT.UTF-8" CsCZ LANG = "cs_CZ.UTF-8" CyGB LANG = "cy_GB.UTF-8" DaDK LANG = "da_DK.UTF-8" DeAT LANG = "de_AT.UTF-8" DeBE LANG = "de_BE.UTF-8" DeCH LANG = "de_CH.UTF-8" DeDE LANG = "de_DE.UTF-8" DeLI LANG = "de_LI.UTF-8" DeLU LANG = "de_LU.UTF-8" ElCY LANG = "el_CY.UTF-8" ElGR LANG = "el_GR.UTF-8" EnAU LANG = "en_AU.UTF-8" EnBW LANG = "en_BW.UTF-8" EnCA LANG = "en_CA.UTF-8" EnDK LANG = "en_DK.UTF-8" EnGB LANG = "en_GB.UTF-8" EnHK LANG = "en_HK.UTF-8" EnIE LANG = "en_IE.UTF-8" EnNZ LANG = "en_NZ.UTF-8" EnPH LANG = "en_PH.UTF-8" EnSG LANG = "en_SG.UTF-8" EnUS LANG = "en_US.UTF-8" EnZA LANG = "en_ZA.UTF-8" EnZW LANG = "en_ZW.UTF-8" EsAR LANG = "es_AR.UTF-8" EsBO LANG = "es_BO.UTF-8" EsCL LANG = "es_CL.UTF-8" EsCO LANG = "es_CO.UTF-8" EsCR LANG = "es_CR.UTF-8" EsDO LANG = "es_DO.UTF-8" EsEC LANG = "es_EC.UTF-8" EsES LANG = "es_ES.UTF-8" EsGT LANG = "es_GT.UTF-8" EsHN LANG = "es_HN.UTF-8" EsMX LANG = "es_MX.UTF-8" EsNI LANG = "es_NI.UTF-8" EsPA LANG = "es_PA.UTF-8" EsPE LANG = "es_PE.UTF-8" EsPR LANG = "es_PR.UTF-8" EsPY LANG = "es_PY.UTF-8" EsSV LANG = "es_SV.UTF-8" EsUS LANG = "es_US.UTF-8" EsUY LANG = "es_UY.UTF-8" EsVE LANG = "es_VE.UTF-8" EtEE LANG = "et_EE.UTF-8" EuES LANG = "eu_ES.UTF-8" EuFR LANG = "eu_FR.UTF-8" FiFI LANG = "fi_FI.UTF-8" FoFO LANG = "fo_FO.UTF-8" FrBE LANG = "fr_BE.UTF-8" FrCA LANG = "fr_CA.UTF-8" FrCH LANG = "fr_CH.UTF-8" FrFR LANG = "fr_FR.UTF-8" FrLU LANG = "fr_LU.UTF-8" GaIE LANG = "ga_IE.UTF-8" GdGB LANG = "gd_GB.UTF-8" GlES LANG = "gl_ES.UTF-8" GvGB LANG = "gv_GB.UTF-8" HeIL LANG = "he_IL.UTF-8" HrHR LANG = "hr_HR.UTF-8" HsbDE LANG = "hsb_DE.UTF-8" HuHU LANG = "hu_HU.UTF-8" IdID LANG = "id_ID.UTF-8" IsIS LANG = "is_IS.UTF-8" ItCH LANG = "it_CH.UTF-8" ItIT LANG = "it_IT.UTF-8" IwIL LANG = "iw_IL.UTF-8" JaJP LANG = "ja_JP.UTF-8" KaGE LANG = "ka_GE.UTF-8" KkKZ LANG = "kk_KZ.UTF-8" KlGL LANG = "kl_GL.UTF-8" KoKR LANG = "ko_KR.UTF-8" KuTR LANG = "ku_TR.UTF-8" KwGB LANG = "kw_GB.UTF-8" LgUG LANG = "lg_UG.UTF-8" LtLT LANG = "lt_LT.UTF-8" LvLV LANG = "lv_LV.UTF-8" MgMG LANG = "mg_MG.UTF-8" MiNZ LANG = "mi_NZ.UTF-8" MkMK LANG = "mk_MK.UTF-8" MsMY LANG = "ms_MY.UTF-8" MtMT LANG = "mt_MT.UTF-8" NbNO LANG = "nb_NO.UTF-8" NlBE LANG = "nl_BE.UTF-8" NlNL LANG = "nl_NL.UTF-8" NnNO LANG = "nn_NO.UTF-8" OcFR LANG = "oc_FR.UTF-8" OmKE LANG = "om_KE.UTF-8" PlPL LANG = "pl_PL.UTF-8" PtBR LANG = "pt_BR.UTF-8" PtPT LANG = "pt_PT.UTF-8" RoRO LANG = "ro_RO.UTF-8" RuRU LANG = "ru_RU.UTF-8" RuUA LANG = "ru_UA.UTF-8" SkSK LANG = "sk_SK.UTF-8" SlSI LANG = "sl_SI.UTF-8" SoDJ LANG = "so_DJ.UTF-8" SoKE LANG = "so_KE.UTF-8" SoSO LANG = "so_SO.UTF-8" SqAL LANG = "sq_AL.UTF-8" StZA LANG = "st_ZA.UTF-8" SvFI LANG = "sv_FI.UTF-8" SvSE LANG = "sv_SE.UTF-8" TgTJ LANG = "tg_TJ.UTF-8" ThTH LANG = "th_TH.UTF-8" TlPH LANG = "tl_PH.UTF-8" TrCY LANG = "tr_CY.UTF-8" TrTR LANG = "tr_TR.UTF-8" UkUA LANG = "uk_UA.UTF-8" UzUZ LANG = "uz_UZ.UTF-8" WaBE LANG = "wa_BE.UTF-8" XhZA LANG = "xh_ZA.UTF-8" YiUS LANG = "yi_US.UTF-8" ZhCN LANG = "zh_CN.UTF-8" ZhHK LANG = "zh_HK.UTF-8" ZhSG LANG = "zh_SG.UTF-8" ZhTW LANG = "zh_TW.UTF-8" ZuZA LANG = "zu_ZA.UTF-8" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.