Documentation
¶
Index ¶
- Constants
- Variables
- func AUTHORIZED() string
- func Action(menuid string, args map[string]interface{})
- func Agent(gofunc string, args map[string]interface{})
- func Agentize(option string) string
- func Any(src map[string]string) map[string]any
- func ApiCall(endpoint string, sparam string) map[string]any
- func ApiOut(endpoint string, sparam string)
- func App() map[string]interface{}
- func ArgPost(args []string) map[string]interface{}
- func ArgPost2(args []string) [][]string
- func Arrange(data map[string]interface{}) []string
- func Array(data []interface{}, structure []string) [][]string
- func Ask(route string, sparam string)
- func BYBB(path string) map[string]map[string]map[string]string
- func Bool(data any) (any, error)
- func CSV(data string) [][]string
- func Call(endpoint string, moduleid string, functionid string, jsondata string) map[string]interface{}
- func Callup(level int) string
- func Capitalize(str string) string
- func Caption() map[string]map[string]string
- func Captioner(id string) map[string]string
- func Captioning(id string, attr string, defval string) string
- func Cash(num any) string
- func Cdate(data any) (any, error)
- func CheckExist(checkapi string, colid string) func(any) (any, error)
- func CheckNone(args ...any) func(any) (any, error)
- func CheckNotExist(checkapi string, colid string) func(any) (any, error)
- func CheckNothing(checkapi string, colid string) func(any) (any, error)
- func Cls()
- func Col(data map[string]any, structure []string, heads []string)
- func Column(id string, data map[string]any, structing []string, heading []string, ...)
- func Confirm() bool
- func Cookie()
- func Csv(path string) [][]string
- func CsvArray(data []interface{}, structure []string) [][]string
- func CsvOut(data [][]string)
- func Ctime(data any) (any, error)
- func Dat(data map[string]string, structure []string)
- func Data() map[string][]map[string]string
- func DataList(id string) (map[string]string, []string, []string)
- func DataReform(apifunc string, resultset []map[string]any)
- func DataTitle(text string)
- func Date(data string) (string, error)
- func DbBool(data bool) int
- func Default(data map[string]interface{}, key string, value any)
- func Deluser()
- func Delzadm()
- func Delzone()
- func Direct()
- func DirectCall(functionid string, jsondata string) map[string]interface{}
- func Do(command string, param string)
- func ERRORDELETE() string
- func ERRORINPUT() string
- func ERRORSAVE() string
- func Echo(id string, data map[string]any, defheader string)
- func Empty(result map[string]interface{}) bool
- func Endpoint(route string) string
- func Err(result map[string]interface{}) string
- func Error(text string)
- func Escape(data string) string
- func Exist(checkapi string, colid string, trueifexist bool) func(any) (any, error)
- func Extract(data string) []string
- func Failed(result map[string]interface{}) bool
- func False(data any) bool
- func FilePost(args []string) map[string]interface{}
- func FilePost2(args []string) [][]string
- func Find(data []map[string]string, key, term string) map[string]string
- func First(data []interface{}, structure []string) []string
- func Float(data any) (any, error)
- func Float64(data string) float64
- func Form(data string, format string) string
- func FromAny(src map[string]any) map[string]string
- func Fstr(rawstr string, agrs ...any) string
- func Get(data map[string]string, attr string) string
- func GetBool(prompt string, defval bool) bool
- func GetDate(require bool, prompt string, defval string) string
- func GetFloat(require bool, prompt string, hprompt string, defval float64, errvalue string) float64
- func GetInput(apifunc string) map[string]interface{}
- func GetInt(require bool, prompt string, hprompt string, defval int, errvalue string, ...) int
- func GetLogin(endpoint string)
- func GetOne(require bool, prompt string, values []string, defval string) string
- func GetPwd(prompt string) string
- func GetStr(require bool, prompt string) string
- func GetString(require bool, prompt string, hprompt string, defval string, errvalue string, ...) string
- func GetTime(require bool, prompt string, defval string) string
- func Getuser() string
- func Getzadm() string
- func Getzone() string
- func Go(menu string)
- func Head() map[string]map[string]string
- func Header(heading map[string]string, structure []string) []string
- func Heading(id string) []string
- func Heads(id string) map[string]string
- func HidTask() []map[string]string
- func INVALIDDATA() string
- func INVALIDINPUT() string
- func INVALIDSTRUCT() string
- func In(val int, data []int) bool
- func Include(val any, data []any) bool
- func InfoGen(apifunc string) bool
- func InfoTitle(text string)
- func Input(require bool, check func(any) (any, error), prompt string, hprompt string, ...) any
- func Inscript() map[string]map[string]map[string]string
- func Instruct() map[string][]string
- func Int(data any) (any, error)
- func Integer(data string) int
- func Integers(data string) []int
- func Interval(data string) []int
- func Ints(data string) ([]int, bool)
- func IsArray(data any) bool
- func IsBool(data any) bool
- func IsFloat(data any) bool
- func IsInt(data any) bool
- func IsMap(data any) bool
- func IsStr(value any) bool
- func JSON(data []byte) map[string]interface{}
- func Jname(name string) string
- func Json(path string) map[string]interface{}
- func JsonPost(path string) map[string]interface{}
- func JsonsPost(paths []string) map[string]map[string]interface{}
- func LOGINERROR() string
- func Label() map[string]string
- func Len(data string) int
- func List(id string, defheader string)
- func LoadToken() (string, error)
- func Login(endpoint string, username string, password string) error
- func Lower(str string) string
- func MD5(text string) string
- func MSG_back() string
- func MSG_choice() string
- func MSG_exit() string
- func MSG_login_name() string
- func MSG_login_password() string
- func MSG_password_not_matched() string
- func Map(data []interface{}) []map[string]any
- func Matched(var1 any, var2 any) bool
- func Menu() map[string][]string
- func MenuLine(text string)
- func MenuTitle(text string)
- func MultiOptioned(choices []string, total int) []int
- func NODATAFOUND() string
- func Named(name string, prefix string) bool
- func Nice(data any) string
- func Nil(data any) bool
- func None(data any) (any, error)
- func Now() string
- func Offset(inputs map[string]interface{}, deflimit int, defoffset int, page string, ...)
- func Option(menuid string, multi bool) any
- func Optioned(choice string, total int) int
- func Optionize(option string) string
- func Out(data map[string]any)
- func Output() map[string]map[string]string
- func Paginate(inputs map[string]interface{})
- func Paint(target string, text string)
- func Parse(sdata string) map[string]interface{}
- func Password(prompt string, errinput string) string
- func Pick(data []string, id string, structure []string) string
- func Post()
- func Print(id string, endpoint string, sparam string)
- func Prompt() string
- func Pull(data map[string]any, attr string) any
- func Ranged(val int, data []int) bool
- func RawCsvArray(data []interface{}) [][]string
- func Reform() map[string]map[string]string
- func Response(resp *http.Response) (map[string]interface{}, error)
- func Result(data map[string]interface{}) []interface{}
- func Return() map[string]map[string]string
- func Row(index int, data []interface{}, structure []string) []string
- func SaveCsv(data [][]string, path string) (string, error)
- func SaveToken(token string) error
- func Scan(prompt string, hprompt string, errinput string) string
- func Search(data []map[string]string, key, term string) []map[string]string
- func Select(multi bool, title string, options []string, labels map[string]string) any
- func SelfUser(apifunc string) bool
- func SelfZone(apifunc string) bool
- func Server(endpoint string, sparam string) (map[string]interface{}, error)
- func ServerDo(endpoint string, sparam string, access_token string) (map[string]interface{}, error)
- func ServerGet(endpoint string, sparam string) (map[string]interface{}, error)
- func Setuser(name string)
- func Setzadm(status string)
- func Setzone(id string)
- func Sfalse(data string) bool
- func Snil(data string) bool
- func Split(data string, separator string) []string
- func StdJson(name string, arg ...string) map[string]interface{}
- func Str(data any) (any, error)
- func StrBool(data string) string
- func StrCash(num string) string
- func StrCut(text string) string
- func StrDate(time string) string
- func StrZip(text string) string
- func String(data any) string
- func Stringify(data map[string]interface{}) string
- func Strs(data string) ([]string, bool)
- func Struct() map[string][]string
- func Structify(data map[string]any, structure []string) []string
- func Structing(id string) []string
- func Strue(data string) bool
- func Tab(data []string) string
- func TabEcho(id string, data []map[string]any, defheader string)
- func Table(head []string, data [][]string, pad int)
- func Tablet(data []map[string]any, cols []string, heads map[string]string)
- func Task() map[string][]map[string]string
- func Text() map[string]string
- func Time(data string) (string, error)
- func ToUpdate(apifunc string) bool
- func TopTask() []map[string]string
- func True(data any) bool
- func Truncate(data string, maxlen int) string
- func Type(data any) string
- func Uid(name string) int
- func UpUser(apifunc string) bool
- func UpZone(apifunc string) bool
- func Update(data map[string]interface{}, key string, value any)
- func Upper(str string) string
- func Url(endpoint string, sparam string) string
- func User(input map[string]interface{})
- func Valid(funcname string) bool
- func Warning(text string)
- func Wide(data [][]string) int
- func Widths(data [][]string) []int
- func Writer(pad int) *tabwriter.Writer
- func YAML(data []byte) map[string]interface{}
- func YB(path string) map[string]string
- func YBB(path string) map[string]map[string]string
- func YBBS(path string) map[string][]map[string]string
- func YBS(path string) map[string][]string
- func Yaml(path string) map[string]interface{}
- func Yamlb(path string) []byte
- func Yes(data string) bool
- func Zid(name string) int
- func Zone(input map[string]interface{})
- func Zoner(route string)
- type Standalone
- func (c Standalone) An_direct_api_call()
- func (c Standalone) An_direct_api_post()
- func (c Standalone) An_init_accounting()
- func (c Standalone) An_init_zone()
- func (c Standalone) Ask(args map[string]interface{})
- func (c Standalone) Black(args map[string]interface{})
- func (c Standalone) Blue(args map[string]interface{})
- func (c Standalone) Cyan(args map[string]interface{})
- func (c Standalone) Green(args map[string]interface{})
- func (c Standalone) Im()
- func (c Standalone) Login()
- func (c Standalone) Logout()
- func (c Standalone) Magenta(args map[string]interface{})
- func (c Standalone) Me()
- func (c Standalone) Red(args map[string]interface{})
- func (c Standalone) White(args map[string]interface{})
- func (c Standalone) Yellow(args map[string]interface{})
- type StrFunc
Constants ¶
const APPYAML = "app.yaml"
const ASTERISK = "*"
const BACKCOLON = "\b:"
const BACKCOMMA = "\b,"
const BACKDOT = "\b."
const CAPTIONYAML = "outcaption.yaml"
const COLON = ":"
const COMMA = ","
const COOKIE = "cookie"
const CR = '\n'
const DATAYAML = "data.yaml"
const DEFLIMIT = 50
const DEFOFFSET = 0
const DOT = "."
const ERROR = "error"
const EXIT = "exit"
const FOOTER = "footer"
const HEADER = "header"
const HEADYAML = "outhead.yaml"
const HYPHEN = "-"
const IDATTR = "id"
const INSTRUCTYAML = "instruct.yaml"
const LABELYAML = "label.yaml"
const LIMIT = "limit"
const MENUYAML = "menu.yaml"
const MESSAGE = "message"
const NAMEATTR = "name"
const OAUTH2 = "oauth2"
const OFFSET = "offset"
const OUTPUTYAML = "print.yaml"
const PAGE = "page"
const PLUS = "+"
const QUESTION = "?"
const QUIT = "quit"
const REFORMYAML = "reform.yaml"
const RESULT = "result"
const RETURNYAML = "return.yaml"
const SCRIPTYAML = "inscript.yaml"
const SESSIONUSER = "session_user"
const SESSIONZADM = "session_zadm"
const SESSIONZONE = "session_zone"
const SPACE = " "
const STRUCTYAML = "outstruct.yaml"
const TAB = "\t"
const TASKYAML = "task.yaml"
const TEXTYAML = "text.yaml"
const THREEDOT = "..."
const TID_InfoGen = "INFO_"
const TID_SelfUser = "me_"
const TID_SelfZone = "us_"
const TID_UpUser = "ui_"
const TID_UpZone = "zi_"
const TOKEN = "access_token"
const TOKENJSON = "token.json"
const TOKENTYPE = "token_type"
const T_bool = "bool"
const T_date = "date"
const T_float = "float"
const T_int = "int"
const T_ints = "int[]"
const T_pwd = "pwd"
const T_str = "str"
const T_strs = "str[]"
const T_time = "time"
const UNDERSCORE = "_"
const USERATTR = "user"
const ZADMATTR = "zadmin"
const ZONEATTR = "zone"
Variables ¶
var ACCESSTOKEN string
var APIACCESS string
var Agented = Valid // alias
var CANCEL string
var DATA map[string][]map[string]string
var HIDTASKS []map[string]string
var INPUT_NATIVE_TYPES = []string{T_int, T_float, T_bool, T_date, T_time, T_pwd, T_str, T_strs, T_ints}
var LABELS map[string]string
var MAXSTRLEN int
var NO string
var OUTPUTS map[string]map[string]string
var PROMPT string
var REFORMS map[string]map[string]string
var RETURNS map[string]map[string]string
var SERVERENDPOINT string
var StrFunctions map[string]StrFunc
var TEXTS map[string]string
var TOPTASKS []map[string]string
var YES string
Functions ¶
func AUTHORIZED ¶
func AUTHORIZED() string
func Call ¶
func Call(endpoint string, moduleid string, functionid string, jsondata string) map[string]interface{}
call for data function and get response from server
func Captioning ¶
get exact caption in module <id> using default value
func DataReform ¶
reformat time and number strings as required
func DirectCall ¶
use shortened Call() to call for server data as an agent function
func ERRORDELETE ¶
func ERRORDELETE() string
func ERRORINPUT ¶
func ERRORINPUT() string
func GetInput ¶
make data input for calling api service need further process for int[] before posting
func GetInt ¶
func GetInt(require bool, prompt string, hprompt string, defval int, errvalue string, checkfunc func(any) (any, error)) int
user enters an integer with api check
func GetString ¶
func GetString(require bool, prompt string, hprompt string, defval string, errvalue string, checkfunc func(any) (any, error)) string
user enters a string with api check
func INVALIDDATA ¶
func INVALIDDATA() string
func INVALIDINPUT ¶
func INVALIDINPUT() string
func INVALIDSTRUCT ¶
func INVALIDSTRUCT() string
func Input ¶
func Input(require bool, check func(any) (any, error), prompt string, hprompt string, defval any, errinput string, errvalue string) any
input from stdin with value checking
func LOGINERROR ¶
func LOGINERROR() string
func MSG_choice ¶
func MSG_choice() string
func MSG_login_name ¶
func MSG_login_name() string
func MSG_login_password ¶
func MSG_login_password() string
func MSG_password_not_matched ¶
func MSG_password_not_matched() string
func MultiOptioned ¶
get valid menu multi-options index+1
func NODATAFOUND ¶
func NODATAFOUND() string
func Offset ¶
func Offset(inputs map[string]interface{}, deflimit int, defoffset int, page string, limit string, offset string)
recalculate database result offset for server calling
func Paginate ¶
func Paginate(inputs map[string]interface{})
recalculate offset value for database resulset paginating
func RawCsvArray ¶ added in v1.0.7
func RawCsvArray(data []interface{}) [][]string
get resultset["result"] as head-sorted csv
func Result ¶
func Result(data map[string]interface{}) []interface{}
get raw data (list of dicts) from resultset
Types ¶
type Standalone ¶
type Standalone struct{} // container of functions
func (Standalone) An_direct_api_call ¶
func (c Standalone) An_direct_api_call()
launch direct api call [An_] stands for anonymous
func (Standalone) An_direct_api_post ¶
func (c Standalone) An_direct_api_post()
post file data to server [An_] stands for anonymous
func (Standalone) An_init_accounting ¶
func (c Standalone) An_init_accounting()
initialize client database [An_] stands for anonymous
func (Standalone) An_init_zone ¶
func (c Standalone) An_init_zone()
initialize client zone [An_] stands for anonymous
func (Standalone) Ask ¶
func (c Standalone) Ask(args map[string]interface{})
send request to server to get raw data
func (Standalone) Black ¶
func (c Standalone) Black(args map[string]interface{})
func (Standalone) Blue ¶
func (c Standalone) Blue(args map[string]interface{})
func (Standalone) Cyan ¶
func (c Standalone) Cyan(args map[string]interface{})
func (Standalone) Green ¶
func (c Standalone) Green(args map[string]interface{})
func (Standalone) Login ¶
func (c Standalone) Login()
func (Standalone) Logout ¶
func (c Standalone) Logout()
func (Standalone) Magenta ¶
func (c Standalone) Magenta(args map[string]interface{})
func (Standalone) Red ¶
func (c Standalone) Red(args map[string]interface{})
func (Standalone) White ¶
func (c Standalone) White(args map[string]interface{})
func (Standalone) Yellow ¶
func (c Standalone) Yellow(args map[string]interface{})