diff options
| author | Christine Dodrill <me@christine.website> | 2018-12-08 09:34:00 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2018-12-08 09:34:00 -0800 |
| commit | ceec35812913a70f94029c7933428ab79ca34db0 (patch) | |
| tree | 0fbb9368dd7c346ab4f3f9b19e6eac2ff53f01ac | |
| parent | 28e2d4e4ca734e6b5ffbc07d4f4631c02b003ea9 (diff) | |
| download | x-ceec35812913a70f94029c7933428ab79ca34db0.tar.xz x-ceec35812913a70f94029c7933428ab79ca34db0.zip | |
rescue glue
| -rw-r--r-- | glue/CHEATSHEET.md | 661 | ||||
| -rw-r--r-- | glue/glue.go | 216 | ||||
| -rw-r--r-- | go.mod | 25 | ||||
| -rw-r--r-- | go.sum | 53 | ||||
| -rw-r--r-- | internal/gluaexpect/expect.go | 35 | ||||
| -rw-r--r-- | internal/gluasimplebox/sb.go | 100 |
6 files changed, 1090 insertions, 0 deletions
diff --git a/glue/CHEATSHEET.md b/glue/CHEATSHEET.md new file mode 100644 index 0000000..0536567 --- /dev/null +++ b/glue/CHEATSHEET.md @@ -0,0 +1,661 @@ +## `json` + +```lua +local json = require "json" +``` + +Json encoder/decoder + +The following functions are exposed by the library: + + decode(string): Decodes a JSON string. Returns nil and an error string if + the string could not be decoded. + encode(value): Encodes a value into a JSON string. Returns nil and an error + string if the value could not be encoded. + +## `xmlpath` + +```lua +local xmlpath = require "xmlpath" +``` + +XMLPath style iteration + + xml ="<bookist><book>x1</book><book>x2</book><book>x3</book></booklist>" + local xmlpath = require("xmlpath") + node,err = xmlpath.loadxml(xml) + path,err = xmlpath.compile("//book") + + it = path:iter(node) + for k,v in pairs(it) do + print(k,v:string()) + end + +## `http` + +```lua +local http = require("http") +``` + +HTTP client library + +### API + +- [`http.delete(url [, options])`](#httpdeleteurl--options) +- [`http.get(url [, options])`](#httpgeturl--options) +- [`http.head(url [, options])`](#httpheadurl--options) +- [`http.patch(url [, options])`](#httppatchurl--options) +- [`http.post(url [, options])`](#httpposturl--options) +- [`http.put(url [, options])`](#httpputurl--options) +- [`http.request(method, url [, options])`](#httprequestmethod-url--options) +- [`http.request_batch(requests)`](#httprequest_batchrequests) +- [`http.response`](#httpresponse) + +#### http.delete(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.get(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.head(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.patch(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| body | String | Request body. | +| form | String | Deprecated. URL encoded request body. This will also set the `Content-Type` header to `application/x-www-form-urlencoded` | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.post(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| body | String | Request body. | +| form | String | Deprecated. URL encoded request body. This will also set the `Content-Type` header to `application/x-www-form-urlencoded` | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.put(url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| body | String | Request body. | +| form | String | Deprecated. URL encoded request body. This will also set the `Content-Type` header to `application/x-www-form-urlencoded` | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.request(method, url [, options]) + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| method | String | The HTTP request method | +| url | String | URL of the resource to load | +| options | Table | Additional options | + +**Options** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| query | String | URL encoded query params | +| cookies | Table | Additional cookies to send with the request | +| body | String | Request body. | +| form | String | Deprecated. URL encoded request body. This will also set the `Content-Type` header to `application/x-www-form-urlencoded` | +| headers | Table | Additional headers to send with the request | + +**Returns** + +[http.response](#httpresponse) or (nil, error message) + +#### http.request_batch(requests) + +**Attributes** + +| Name | Type | Description | +| -------- | ----- | ----------- | +| requests | Table | A table of requests to send. Each request item is by itself a table containing [http.request](#httprequestmethod-url--options) parameters for the request | + +**Returns** + +[[http.response](#httpresponse)] or ([[http.response](#httpresponse)], [error message]) + +#### http.response + +The `http.response` table contains information about a completed HTTP request. + +**Attributes** + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| body | String | The HTTP response body | +| body_size | Number | The size of the HTTP reponse body in bytes | +| headers | Table | The HTTP response headers | +| cookies | Table | The cookies sent by the server in the HTTP response | +| status_code | Number | The HTTP response status code | +| url | String | The final URL the request ended pointing to after redirects | + +## `url` + +```lua +local url = require "url" +``` + +URL parsing library + +### API + +- [`url.parse(url)`](#urlparseurl) +- [`url.build(options)`](#urlbuildoptions) +- [`url.build_query_string(query_params)`](#urlbuild_query_stringquery_params) +- [`url.resolve(from, to)`](#urlresolvefrom-to) + +#### url.parse(url) + +Parse URL into a table of key/value components. + +**Attributes** + +| Name | Type | Description | +| ------- | ------ | ----------- | +| url | String | URL to parsed | + +**Returns** + +Table with parsed URL or (nil, error message) + +| Name | Type | Description | +| -------- | ------ | ----------- | +| scheme | String | Scheme of the URL | +| username | String | Username | +| password | String | Password | +| host | String | Host and port of the URL | +| path | String | Path | +| query | String | Query string | +| fragment | String | Fragment | + +#### url.build(options) + +Assemble a URL string from a table of URL components. + +**Attributes** + +| Name | Type | Description | +| ------- | ----- | ----------- | +| options | Table | Table with URL components, see [`url.parse`](#urlparseurl) for list of valid components | + +**Returns** + +String + +#### url.build_query_string(query_params) + +Assemble table of query string parameters into a string. + +**Attributes** + +| Name | Type | Description | +| ------------ | ----- | ----------- | +| query_params | Table | Table with query parameters | + +**Returns** + +String + +#### url.resolve(from, to) + +Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. + +| Name | Type | Description | +| ---- | ------ | ----------- | +| from | String | base URL | +| to | String | href URL | + +**Returns** + +String or (nil, error message) + +## `env` + +```lua +local env = require "env" +``` + +Environment manipulation + +### API + +#### `env.set(key, value)` + +Same `os.setenv` + +#### `env.get(key)` + +Same `os.getenv` + +#### `env.loadfile(file)` + +Loads environment variables from a file. The file is as the following: + +``` +AAA=BBB +CCC=DDD +``` + +If this function fails, it returns `nil`, plus a string describing the error. + +## `fs` + +```lua +local fs = require "fs" +``` + +Filesystem manipulation + +### API + +#### `fs.exists(file)` + +Returns true if the file exists. + +#### `fs.read(file)` + +Reads file content and return it. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.write(file, content, [mode])` + +Writes content to the file. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.mkdir(path, [mode, recursive])` + +Create directory. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.remove(path, [recursive])` + +Remove path. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.symlink(target, link)` + +Create symbolic link. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.dirname(path)` + +Returns all but the last element of path. + +#### `fs.basename(path)` + +Returns the last element of path. + +#### `fs.realpath(path)` + +Returns the real path of a given path in the os. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.getcwd()` + +Returns the current working directory. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.chdir(path)` + +Changes the current working directory. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.file()` + +Returns the script file path. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.dir()` + +Returns the directory path that is parent of the script file. If this function fails, it returns `nil`, plus a string describing the error. + +#### `fs.glob(pattern, function)` + +Run the callback function with the files matching pattern. See below example: + +```lua +local fs = require("fs") +local ret, err = fs.glob("/tmp/*", function(file) + print(file.path) + print(file.realpath) +end) +``` + +## `markdown` + +```lua +local markdown = require "markdown" +``` + +Markdown -> HTML for string and file + +### API + +#### `markdown.dostring(text)` + +Returns HTML string generated from the markdown text. + +#### `markdown.dofile(file)` + +Returns HTML string generated from the markdown text file. If this function fails, it returns `nil`, plus a string describing the error. + +## `question` + +```lua +local question = require "question" +``` + +Prompt library + +### API + +* `question.ask(text)` +* `question.secret(text)` + +## `ssh` + +```lua +local ssh = require "ssh" +``` + +SSH client library + +https://github.com/kohkimakimoto/gluassh/blob/master/gluassh_test.go + +## `template` + +```lua +local template = require "template" +``` + +Go text templates + +### API + +#### `template.dostring(text, table)` + +Returns string generated by text template with the table values. If this function fails, it returns `nil`, plus a string describing the error. + +#### `template.dofile(file, table)` + +Returns string generated by file template with the table values. If this function fails, it returns `nil`, plus a string describing the error. + +## `yaml` + +```lua +local yaml = require "yaml" +``` + +Yaml -> table parser + +### API + +#### `yaml.parse(string)` + +Parses yaml formatted string and returns a table. If this function fails, it returns `nil`, plus a string describing the error. + +## `flag` + +```lua +local flag = require "flag" +``` + +Command line flag parsing. + +See the tests here: https://github.com/otm/gluaflag + +```lua +local flag = require "flag" + +fs = flag.new() + +fs:string("name", "foo", "String help string") +fs:intArg("title", 1, "Title") +fs:numberArg("title", 1, "Title") + +flags = fs:parse(arg) -- arg is the remaining command line arguments +assert(flags.title == 2, "expected title to be 2") +assert(flags.title == 2.32, "expected title to be 2.32") +``` + +## `sh` + +```lua +local sh = require "sh" +``` + +gluash is a interface to call any program as it were a function. Programs are executed asynchronously to enable streaming of data in pipes. + +In all discussions bellow the imported module will be referred to as `sh`. + +Commands are called just like functions, executed on the sh module. + +```lua +sh.ls("/") +``` + +For commands that have exotic names, names that are reserved words, or to execute absolute or relative paths call the sh module directly. + +```lua +sh("/bin/ls", "/") +``` + +#### Multiple Arguments +Commands with multiple arguments have to be invoked with a separate string for each argument. + +```lua +-- this works +sh.ls("-la", "/") + +-- this does not work +sh.ls("-la /") +``` + +#### Piping +Piping in sh is done almost like piping in the shell. Just call next command as a method on the previous command. + +```lua +sh.du("-sb"):sort("-rn"):print() +``` + +If the command has a exotic name, or a reserved word, call the command through `cmd(path, ...args)`. The first argument in `cmd` is the path. + +```lua +sh.du("-sb"):cmd("sort", "-rn"):print() +``` + +### Waiting for Processes +All commands are executed by default in the background, so one have to explicitly wait for a process to finish. There are several ways to wait for the command to finish. + +* `print()` - write stdout and stderr to stdout. +* `ok()` - aborts execution if the command's exit code is not zero +* `success()` - returns true of the commands exit code is zero +* `exitcode()` - returns the exit code of the command + +### Abort by Default +It is possible to set the module to abort on errors without checking. It can be practical in some occasions, however performance will be degraded. When global exit code checks are done the commands are run in series, even in pipes, and output is saved in memory buffers. + +To enable global exit code settings call the sh module with an table with the key `abort` set to true. + +```lua +sh{abort=true} +``` + +To read current settings in the module call the module with an empty table. +```lua +configuration = sh{} +print("abort:", configuration.abort) +``` + +### Analyzing Output +There are several options to analyze the output of a command. + +#### lines() +An iterator is accessible by calling the method `lines()` on the command. + +```lua +for line in sh.cat("/etc/hosts"):lines() do + print(line) +end +``` + +#### stdout([filename]), stderr([filename]), combinedOutput([filename]) +`stdout()`, `stderr()`, and `combinedOutput()` all returns the output of the command as a string. An optional `filename` can be given to the method, in that case the output is also written to the file. The file will be truncated. + +```lua +-- print output of command +output = sh.echo("hello world"):combinedOutput("/tmp/output") +print(output) +``` + +In the example above will print `hello world` and it will write it to `/tmp/output` + +### Glob Expansion +There is no glob expansion done on arguments, however there is a glob functionality in sh. + +```lua +sh.ls(sh.glob("*.go")) +``` + +## `re` + +```lua +local re = require "re" +``` + +Regular Expressions + +### API + +re.find , re.gsub, re.match, re.gmatch are available. These functions have the same API as Lua pattern match. +gluare uses the Go regexp package, so you can use regular expressions that are supported in the Go regexp package. + +In addition, the following functions are defined: +``` +gluare.quote(s string) -> string +Arguments: + +s string: a string value to escape meta characters + +Returns: + +string: escaped string +gluare.quote returns a string that quotes all regular expression metacharacters inside the given text. +``` + +## `simplebox` + +```lua +local simplebox = require "simplebox" +``` + +Simple encryption + +### API + +#### Create a new instance of simplebox with a newly generated key + +```lua +local simplebox = require "simplebox" +local key = simplebox.genkey() +print("key is: " .. key) +local sb = simplebox.new() + + +``` diff --git a/glue/glue.go b/glue/glue.go new file mode 100644 index 0000000..156daca --- /dev/null +++ b/glue/glue.go @@ -0,0 +1,216 @@ +package main + +import ( + "bufio" + "flag" + "fmt" + "net/http" + "os" + "runtime/pprof" + + "github.com/Xe/x/internal/gluaexpect" + "github.com/Xe/x/internal/gluasimplebox" + "github.com/ailncode/gluaxmlpath" + "github.com/cjoudrey/gluahttp" + "github.com/cjoudrey/gluaurl" + "github.com/kohkimakimoto/gluaenv" + "github.com/kohkimakimoto/gluafs" + "github.com/kohkimakimoto/gluamarkdown" + "github.com/kohkimakimoto/gluaquestion" + "github.com/kohkimakimoto/gluassh" + "github.com/kohkimakimoto/gluatemplate" + "github.com/kohkimakimoto/gluayaml" + "github.com/otm/gluaflag" + "github.com/otm/gluash" + "github.com/yuin/gluare" + lua "github.com/yuin/gopher-lua" + "github.com/yuin/gopher-lua/parse" + json "layeh.com/gopher-json" +) + +func main() { + os.Exit(mainAux()) +} + +func mainAux() int { + var opt_e, opt_l, opt_p string + var opt_i, opt_v, opt_dt, opt_dc bool + var opt_m int + flag.StringVar(&opt_e, "e", "", "") + flag.StringVar(&opt_l, "l", "", "") + flag.StringVar(&opt_p, "p", "", "") + flag.IntVar(&opt_m, "mx", 0, "") + flag.BoolVar(&opt_i, "i", false, "") + flag.BoolVar(&opt_v, "v", false, "") + flag.BoolVar(&opt_dt, "dt", false, "") + flag.BoolVar(&opt_dc, "dc", false, "") + flag.Usage = func() { + fmt.Println(`Usage: glue [options] [script [args]]. +Available options are: + -e stat execute string 'stat' + -l name require library 'name' + -mx MB memory limit(default: unlimited) + -dt dump AST trees + -dc dump VM codes + -i enter interactive mode after executing 'script' + -p file write cpu profiles to the file + -v show version information +`) + } + flag.Parse() + if len(opt_p) != 0 { + f, err := os.Create(opt_p) + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + pprof.StartCPUProfile(f) + defer pprof.StopCPUProfile() + } + if len(opt_e) == 0 && !opt_i && !opt_v && flag.NArg() == 0 { + opt_i = true + } + + status := 0 + + L := lua.NewState() + defer L.Close() + if opt_m > 0 { + L.SetMx(opt_m) + } + + preload(L) + + if opt_v || opt_i { + fmt.Println(lua.PackageCopyRight) + fmt.Println("Plus glue + <3 from Within") + } + + if len(opt_l) > 0 { + if err := L.DoFile(opt_l); err != nil { + fmt.Println(err.Error()) + } + } + + if nargs := flag.NArg(); nargs > 0 { + script := flag.Arg(0) + argtb := L.NewTable() + for i := 1; i < nargs; i++ { + L.RawSet(argtb, lua.LNumber(i), lua.LString(flag.Arg(i))) + } + L.SetGlobal("arg", argtb) + if opt_dt || opt_dc { + file, err := os.Open(script) + if err != nil { + fmt.Println(err.Error()) + return 1 + } + chunk, err2 := parse.Parse(file, script) + if err2 != nil { + fmt.Println(err2.Error()) + return 1 + } + if opt_dt { + fmt.Println(parse.Dump(chunk)) + } + if opt_dc { + proto, err3 := lua.Compile(chunk, script) + if err3 != nil { + fmt.Println(err3.Error()) + return 1 + } + fmt.Println(proto.String()) + } + } + + if err := L.DoFile(script); err != nil { + fmt.Println(err.Error()) + status = 1 + } + } + + if len(opt_e) > 0 { + if err := L.DoString(opt_e); err != nil { + fmt.Println(err.Error()) + status = 1 + } + } + + if opt_i { + doREPL(L) + } + return status +} + +func preload(L *lua.LState) { + L.PreloadModule("re", gluare.Loader) + L.PreloadModule("sh", gluash.Loader) + L.PreloadModule("markdown", gluamarkdown.Loader) + L.PreloadModule("fs", gluafs.Loader) + L.PreloadModule("env", gluaenv.Loader) + L.PreloadModule("yaml", gluayaml.Loader) + L.PreloadModule("question", gluaquestion.Loader) + L.PreloadModule("ssh", gluassh.Loader) + L.PreloadModule("http", gluahttp.NewHttpModule(&http.Client{}).Loader) + L.PreloadModule("flag", gluaflag.Loader) + L.PreloadModule("template", gluatemplate.Loader) + L.PreloadModule("url", gluaurl.Loader) + gluaexpect.Preload(L) + gluasimplebox.Preload(L) + gluaxmlpath.Preload(L) + json.Preload(L) +} + +// do read/eval/print/loop +func doREPL(L *lua.LState) { + reader := bufio.NewReader(os.Stdin) + for { + if str, err := loadline(reader, L); err == nil { + if err := L.DoString(str); err != nil { + fmt.Println(err) + } + } else { // error on loadline + fmt.Println(err) + return + } + } +} + +func incomplete(err error) bool { + if lerr, ok := err.(*lua.ApiError); ok { + if perr, ok := lerr.Cause.(*parse.Error); ok { + return perr.Pos.Line == parse.EOF + } + } + return false +} + +func loadline(reader *bufio.Reader, L *lua.LState) (string, error) { + fmt.Print("glue> ") + if line, err := reader.ReadString('\n'); err == nil { + if _, err := L.LoadString("return " + line); err == nil { // try add return <...> then compile + return line, nil + } else { + return multiline(line, reader, L) + } + } else { + return "", err + } +} + +func multiline(ml string, reader *bufio.Reader, L *lua.LState) (string, error) { + for { + if _, err := L.LoadString(ml); err == nil { // try compile + return ml, nil + } else if !incomplete(err) { // syntax error , but not EOF + return ml, nil + } else { + fmt.Print(">> ") + if line, err := reader.ReadString('\n'); err == nil { + ml = ml + "\n" + line + } else { + return "", err + } + } + } +} @@ -3,12 +3,17 @@ module github.com/Xe/x require ( github.com/McKael/madon v2.3.0+incompatible github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6 + github.com/ThomasRooney/gexpect v0.0.0-20161231170123-5482f0350944 github.com/Xe/johaus v0.0.0-20181126154118-fe870a11f3b2 github.com/Xe/ln v0.1.2 github.com/aclements/go-moremath v0.0.0-20180329182055-b1aff36309c7 // indirect + github.com/ailncode/gluaxmlpath v0.0.0-20161126153117-6ce478ecb4a6 github.com/bearbin/mcgorcon v0.0.0-20141104170123-f611ad04551a + github.com/brandur/simplebox v0.0.0-20150921201729-84e9865bb03a github.com/bwmarrin/discordgo v0.18.0 github.com/caarlos0/env v3.4.0+incompatible + github.com/cjoudrey/gluahttp v0.0.0-20180401075744-7065ce73b887 + github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199 github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd github.com/dgryski/go-failure v0.0.0-20151001134759-4963dbd58fd0 github.com/dgryski/go-onlinestats v0.0.0-20170612111826-1c7d19468768 // indirect @@ -25,6 +30,7 @@ require ( github.com/google/go-github v17.0.0+incompatible github.com/google/go-querystring v1.0.0 // indirect github.com/google/gops v0.3.5 + github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c // indirect github.com/hullerob/go.farbfeld v0.0.0-20160317142651-b572f0728b69 github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 github.com/joeshaw/envdecode v0.0.0-20180312135643-c9e015854467 @@ -34,17 +40,34 @@ require ( github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e // indirect github.com/klauspost/crc32 v0.0.0-20170628072449-bab58d77464a // indirect github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510 // indirect + github.com/kohkimakimoto/gluaenv v0.0.0-20160815032729-2888db6bbe38 + github.com/kohkimakimoto/gluafs v0.0.0-20160815050327-01391ed2d7ab + github.com/kohkimakimoto/gluamarkdown v0.0.0-20160902030455-a1c413d7bbfb + github.com/kohkimakimoto/gluaquestion v0.0.0-20160428074244-311437c29ba5 + github.com/kohkimakimoto/gluassh v0.0.0-20160112074309-2a7bd48d7568 + github.com/kohkimakimoto/gluatemplate v0.0.0-20160815033744-d9e2c9d6b00f + github.com/kohkimakimoto/gluayaml v0.0.0-20160815032708-6fe413d49d73 + github.com/kr/fs v0.1.0 // indirect github.com/kr/pretty v0.1.0 + github.com/layeh/gopher-luar v1.0.4 + github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc // indirect + github.com/otm/gluaflag v0.0.0-20160113203828-078088de6891 + github.com/otm/gluash v0.0.0-20151226163409-e145c563986f github.com/pborman/uuid v1.2.0 github.com/peterh/liner v1.1.0 github.com/pkg/errors v0.8.0 + github.com/pkg/sftp v1.8.3 // indirect github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect github.com/streamrail/concurrent-map v0.0.0-20160823150647-8bf1e9bacbf6 github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9 // indirect github.com/tmc/scp v0.0.0-20170824174625-f7b48647feef github.com/xtaci/kcp-go v2.0.3+incompatible github.com/xtaci/smux v1.0.7 + github.com/yookoala/realpath v1.0.0 // indirect + github.com/yuin/gluamapper v0.0.0-20150323120927-d836955830e7 // indirect + github.com/yuin/gluare v0.0.0-20170607022532-d7c94f1a80ed + github.com/yuin/gopher-lua v0.0.0-20181109042959-a0dfe84f6227 go4.org v0.0.0-20180809161055-417644f6feb5 golang.org/x/build v0.0.0-20181004175654-90ec83e7f349 golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 @@ -53,5 +76,7 @@ require ( golang.org/x/sys v0.0.0-20181004145325-8469e314837c // indirect gopkg.in/irc.v1 v1.3.0 gopkg.in/tucnak/telebot.v2 v2.0.0-20181115150921-4688194c178d + gopkg.in/xmlpath.v2 v2.0.0-20150820204837-860cbeca3ebc // indirect gopkg.in/yaml.v2 v2.2.2 // indirect + layeh.com/gopher-json v0.0.0-20181116191917-d3d498bb4913 ) @@ -6,20 +6,31 @@ github.com/McKael/madon v2.3.0+incompatible h1:xMUA+Fy4saDV+8tN3MMnwJUoYWC//5Fy8 github.com/McKael/madon v2.3.0+incompatible/go.mod h1:+issnvJjN1rpjAHZwXRB/x30uHh/NoQR7QaojJK/lSI= github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6 h1:9cJcTOeILzInNo+DCYmXKME1QfAP07FYdo3M9/9jyc4= github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6/go.mod h1:mvlJhxZCchfiasx3XvN3hBu5RekGwTDm09dKlSM/dQQ= +github.com/ThomasRooney/gexpect v0.0.0-20161231170123-5482f0350944 h1:CjexZrggt4RldpEUXFZf52vSO3cnmFaqW6B4wADj05Q= +github.com/ThomasRooney/gexpect v0.0.0-20161231170123-5482f0350944/go.mod h1:sPML5WwI6oxLRLPuuqbtoOKhtmpVDCYtwsps+I+vjIY= github.com/Xe/johaus v0.0.0-20181126154118-fe870a11f3b2 h1:UGyUwa0KVLJ8lA7A5wj9vreeQRDxnWCpTqyI6DRFM6s= github.com/Xe/johaus v0.0.0-20181126154118-fe870a11f3b2/go.mod h1:AxheHD7a8X/KIoOUFa2krQkHFIKqhoP+VTWqNJ+3Joo= github.com/Xe/ln v0.1.2 h1:VTF6Z95Kdd6S1RSjpnn0DFJV5Do9cfmHTHsE9OGI1dw= github.com/Xe/ln v0.1.2/go.mod h1:GWZDvjL0ZC/9SSjY8DJ2IOrID6Lejs7D8pgQyjqMYSk= github.com/aclements/go-moremath v0.0.0-20180329182055-b1aff36309c7 h1:/NWziSfuX4cu00adiPldD8sdCpKxu6BZtLoALSyElZQ= github.com/aclements/go-moremath v0.0.0-20180329182055-b1aff36309c7/go.mod h1:idZL3yvz4kzx1dsBOAC+oYv6L92P1oFEhUXUB1A/lwQ= +github.com/ailncode/gluaxmlpath v0.0.0-20161126153117-6ce478ecb4a6 h1:FM0WudTZ+xeiXPJcs+X1Zg8JXe4vlb9P2GZYqCYjZkk= +github.com/ailncode/gluaxmlpath v0.0.0-20161126153117-6ce478ecb4a6/go.mod h1:Ti1AvV2KUYtHEBX7eYbdAGEfFyKz9+lHrJPcr79Vkng= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/bearbin/mcgorcon v0.0.0-20141104170123-f611ad04551a h1:WS0mhgU8W7T5gN1WNrBXqJUAeQ9eyWOpZx1cSyJw/Ew= github.com/bearbin/mcgorcon v0.0.0-20141104170123-f611ad04551a/go.mod h1:Gt6oUa/biURD8wKBXC9vIlV/VQQSNHhSVRvUMHxPPzM= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= +github.com/brandur/simplebox v0.0.0-20150921201729-84e9865bb03a h1:EMG9wk3iGM7WBAohiKenvpfyh1L5jv3snIMj3ffAMY8= +github.com/brandur/simplebox v0.0.0-20150921201729-84e9865bb03a/go.mod h1:8hDWkKEpFQwZcugC69PxsoNQMh+0/A3FzLCppp/yJZM= github.com/bwmarrin/discordgo v0.18.0 h1:XopVQXCIFy7Cr2eT7NcYcm4k0l2PYX+AP5RUbIWX2/8= github.com/bwmarrin/discordgo v0.18.0/go.mod h1:5NIvFv5Z7HddYuXbuQegZ684DleQaCFqChP2iuBivJ8= github.com/caarlos0/env v3.4.0+incompatible h1:FRwBdvENjLHZoUbFnULnFss9wKtcapdaM35DfxiTjeM= github.com/caarlos0/env v3.4.0+incompatible/go.mod h1:tdCsowwCzMLdkqRYDlHpZCp2UooDD3MspDBjZ2AD02Y= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/cjoudrey/gluahttp v0.0.0-20180401075744-7065ce73b887 h1:ZArneCReic+EyZX8fEVDdgJbfw57dFx9Q9O4a3S/JrI= +github.com/cjoudrey/gluahttp v0.0.0-20180401075744-7065ce73b887/go.mod h1:X97UjDTXp+7bayQSFZk2hPvCTmTZIicUjZQRtkwgAKY= +github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199 h1:cJ1E8ZwZLfercTX3dywnCAQDilbbi+m2cw3+8tCFpRo= +github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199/go.mod h1:jC+zrjHA5CaxJzn+tojIoIOzSp/6BlkRWXnMlxNkB+g= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/go-systemd v0.0.0-20180705093442-88bfeed483d3/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -81,6 +92,8 @@ github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORR github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c h1:kQWxfPIHVLbgLzphqk3QUflDy9QdksZR4ygR807bpy0= +github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hullerob/go.farbfeld v0.0.0-20160317142651-b572f0728b69 h1:oVHYt/ne+aIKsvK4QhnDeCNz9PNn1FbXLtdsX8qZG34= github.com/hullerob/go.farbfeld v0.0.0-20160317142651-b572f0728b69/go.mod h1:mQEoc766DxPTAwQ54neWTK/lFqIeSO7OU6bqZsceglw= github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 h1:xqgexXAGQgY3HAjNPSaCqn5Aahbo5TKsmhp8VRfr1iQ= @@ -101,27 +114,55 @@ github.com/klauspost/crc32 v0.0.0-20170628072449-bab58d77464a h1:NLr4Iy1X81t+cfi github.com/klauspost/crc32 v0.0.0-20170628072449-bab58d77464a/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510 h1:9eOgsI7EIGhJWPMBvSY+x0SEpeGGWUSijOrwK0XhpIk= github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= +github.com/kohkimakimoto/gluaenv v0.0.0-20160815032729-2888db6bbe38 h1:biwbB8L9cu79c7DxV925AKHh0lg+cr3Gk6QNbv1pF0E= +github.com/kohkimakimoto/gluaenv v0.0.0-20160815032729-2888db6bbe38/go.mod h1:lkO/BmfZkRNgMaKcN5CvXaYM/UCM0W5HQdTJ4SXMLXc= +github.com/kohkimakimoto/gluafs v0.0.0-20160815050327-01391ed2d7ab h1:GgLRYIeDQ+bs9x0SqTzpFpqg6T1t3DdBD3fvCv8C+5M= +github.com/kohkimakimoto/gluafs v0.0.0-20160815050327-01391ed2d7ab/go.mod h1:75b63yPNyj5bw+igUVUTKevXzpZNb+sKROvhgD6tVu4= +github.com/kohkimakimoto/gluamarkdown v0.0.0-20160902030455-a1c413d7bbfb h1:dW5VXH4LSWYQHfBdM0CPBRyAy0dQ0C3HteUhke9gmuI= +github.com/kohkimakimoto/gluamarkdown v0.0.0-20160902030455-a1c413d7bbfb/go.mod h1:+e3AoL3e7q9K63TgnmIHLUajIA0JnhdOV2UME5dUsBs= +github.com/kohkimakimoto/gluaquestion v0.0.0-20160428074244-311437c29ba5 h1:EkBrgLWbCXOxjb+/PmAwdBd+YamWb1jJxeH+W5Px17Q= +github.com/kohkimakimoto/gluaquestion v0.0.0-20160428074244-311437c29ba5/go.mod h1:PRq7l9kMtPCitmVBSQpQWq9G92/hfDk+St55rx0YVD4= +github.com/kohkimakimoto/gluassh v0.0.0-20160112074309-2a7bd48d7568 h1:3VihxB2572V/UCw6ZEYeAWzG61Cf8IZ4HrMF48ZB2hw= +github.com/kohkimakimoto/gluassh v0.0.0-20160112074309-2a7bd48d7568/go.mod h1:i2F2+Y5U0pMkJdpzQjSpV/k5+JbvsTWRUNdMJ481aQs= +github.com/kohkimakimoto/gluatemplate v0.0.0-20160815033744-d9e2c9d6b00f h1:CXJzfe/zhkWjXLAZItKA4BPHo4d8Fh7Hc4gqcLVyrWQ= +github.com/kohkimakimoto/gluatemplate v0.0.0-20160815033744-d9e2c9d6b00f/go.mod h1:mepZlGlueX0FYzgC3KQMEuBBQuaAvdp8RUY+ZEe2fbI= +github.com/kohkimakimoto/gluayaml v0.0.0-20160815032708-6fe413d49d73 h1:e2UU76WBjv6W0QUuPHe2QfSAXLR1kouek1fcSUtnSrk= +github.com/kohkimakimoto/gluayaml v0.0.0-20160815032708-6fe413d49d73/go.mod h1:I+YgUp/uc0hF+H4RuQjR+uzDJNjUz7Sm21e63UCLWWQ= +github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.2 h1:Q7kfkJVHag8Gix8Z5+eTo09NFHV8MXL9K66sv9qDaVI= github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/layeh/gopher-luar v1.0.4 h1:Vq9z0s+2zldfnhZ8gMAEveURmDe19nlLsn/zIxKbIxQ= +github.com/layeh/gopher-luar v1. |
