├── .gitignore ├── .gitmessage ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.md ├── assets ├── dockerlang.gif └── dockerlang_glitch.gif ├── compterpreter.go ├── compterpreter_test.go ├── docdocdoc └── main.go ├── errors.go ├── evil.go ├── examples ├── functions.doc └── hello.doc ├── execution.go ├── execution_test.go ├── forest.go ├── install.sh ├── lexer.go ├── lexer_test.go ├── main_test.go ├── memorycell ├── main.go └── memorycell ├── parser.go ├── parser_test.go ├── symbols.go ├── test ├── addition.doc ├── division.doc ├── identifiers.doc ├── modulo.doc ├── multiplication.doc ├── nested_arithmetic.doc ├── subtraction.doc ├── test-operators.doc ├── test.doc ├── test_function.doc ├── test_identifiers.doc ├── test_identifiers_keyword.doc ├── test_tokenize.doc └── variable.doc ├── token.go └── vendor ├── github.com ├── Microsoft │ └── go-winio │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── ea.go │ │ ├── file.go │ │ ├── fileinfo.go │ │ ├── pipe.go │ │ ├── privilege.go │ │ ├── reparse.go │ │ ├── sd.go │ │ ├── syscall.go │ │ └── zsyscall_windows.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── docker │ ├── distribution │ │ ├── LICENSE │ │ ├── digestset │ │ │ └── set.go │ │ └── reference │ │ │ ├── helpers.go │ │ │ ├── normalize.go │ │ │ ├── reference.go │ │ │ └── regexp.go │ ├── docker │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── api │ │ │ ├── README.md │ │ │ ├── common.go │ │ │ ├── common_unix.go │ │ │ ├── common_windows.go │ │ │ ├── swagger-gen.yaml │ │ │ ├── swagger.yaml │ │ │ └── types │ │ │ │ ├── auth.go │ │ │ │ ├── blkiodev │ │ │ │ └── blkio.go │ │ │ │ ├── client.go │ │ │ │ ├── configs.go │ │ │ │ ├── container │ │ │ │ ├── config.go │ │ │ │ ├── container_changes.go │ │ │ │ ├── container_create.go │ │ │ │ ├── container_top.go │ │ │ │ ├── container_update.go │ │ │ │ ├── container_wait.go │ │ │ │ ├── host_config.go │ │ │ │ ├── hostconfig_unix.go │ │ │ │ ├── hostconfig_windows.go │ │ │ │ └── waitcondition.go │ │ │ │ ├── error_response.go │ │ │ │ ├── events │ │ │ │ └── events.go │ │ │ │ ├── filters │ │ │ │ └── parse.go │ │ │ │ ├── graph_driver_data.go │ │ │ │ ├── id_response.go │ │ │ │ ├── image │ │ │ │ └── image_history.go │ │ │ │ ├── image_delete_response_item.go │ │ │ │ ├── image_summary.go │ │ │ │ ├── mount │ │ │ │ └── mount.go │ │ │ │ ├── network │ │ │ │ └── network.go │ │ │ │ ├── plugin.go │ │ │ │ ├── plugin_device.go │ │ │ │ ├── plugin_env.go │ │ │ │ ├── plugin_interface_type.go │ │ │ │ ├── plugin_mount.go │ │ │ │ ├── plugin_responses.go │ │ │ │ ├── port.go │ │ │ │ ├── registry │ │ │ │ ├── authenticate.go │ │ │ │ └── registry.go │ │ │ │ ├── seccomp.go │ │ │ │ ├── service_update_response.go │ │ │ │ ├── stats.go │ │ │ │ ├── strslice │ │ │ │ └── strslice.go │ │ │ │ ├── swarm │ │ │ │ ├── common.go │ │ │ │ ├── config.go │ │ │ │ ├── container.go │ │ │ │ ├── network.go │ │ │ │ ├── node.go │ │ │ │ ├── runtime.go │ │ │ │ ├── runtime │ │ │ │ │ ├── gen.go │ │ │ │ │ ├── plugin.pb.go │ │ │ │ │ └── plugin.proto │ │ │ │ ├── secret.go │ │ │ │ ├── service.go │ │ │ │ ├── swarm.go │ │ │ │ └── task.go │ │ │ │ ├── time │ │ │ │ ├── duration_convert.go │ │ │ │ └── timestamp.go │ │ │ │ ├── types.go │ │ │ │ ├── versions │ │ │ │ ├── README.md │ │ │ │ └── compare.go │ │ │ │ ├── volume.go │ │ │ │ └── volume │ │ │ │ ├── volumes_create.go │ │ │ │ └── volumes_list.go │ │ └── client │ │ │ ├── README.md │ │ │ ├── build_prune.go │ │ │ ├── checkpoint_create.go │ │ │ ├── checkpoint_delete.go │ │ │ ├── checkpoint_list.go │ │ │ ├── client.go │ │ │ ├── client_unix.go │ │ │ ├── client_windows.go │ │ │ ├── config_create.go │ │ │ ├── config_inspect.go │ │ │ ├── config_list.go │ │ │ ├── config_remove.go │ │ │ ├── config_update.go │ │ │ ├── container_attach.go │ │ │ ├── container_commit.go │ │ │ ├── container_copy.go │ │ │ ├── container_create.go │ │ │ ├── container_diff.go │ │ │ ├── container_exec.go │ │ │ ├── container_export.go │ │ │ ├── container_inspect.go │ │ │ ├── container_kill.go │ │ │ ├── container_list.go │ │ │ ├── container_logs.go │ │ │ ├── container_pause.go │ │ │ ├── container_prune.go │ │ │ ├── container_remove.go │ │ │ ├── container_rename.go │ │ │ ├── container_resize.go │ │ │ ├── container_restart.go │ │ │ ├── container_start.go │ │ │ ├── container_stats.go │ │ │ ├── container_stop.go │ │ │ ├── container_top.go │ │ │ ├── container_unpause.go │ │ │ ├── container_update.go │ │ │ ├── container_wait.go │ │ │ ├── disk_usage.go │ │ │ ├── distribution_inspect.go │ │ │ ├── errors.go │ │ │ ├── events.go │ │ │ ├── hijack.go │ │ │ ├── image_build.go │ │ │ ├── image_create.go │ │ │ ├── image_history.go │ │ │ ├── image_import.go │ │ │ ├── image_inspect.go │ │ │ ├── image_list.go │ │ │ ├── image_load.go │ │ │ ├── image_prune.go │ │ │ ├── image_pull.go │ │ │ ├── image_push.go │ │ │ ├── image_remove.go │ │ │ ├── image_save.go │ │ │ ├── image_search.go │ │ │ ├── image_tag.go │ │ │ ├── info.go │ │ │ ├── interface.go │ │ │ ├── interface_experimental.go │ │ │ ├── interface_stable.go │ │ │ ├── login.go │ │ │ ├── network_connect.go │ │ │ ├── network_create.go │ │ │ ├── network_disconnect.go │ │ │ ├── network_inspect.go │ │ │ ├── network_list.go │ │ │ ├── network_prune.go │ │ │ ├── network_remove.go │ │ │ ├── node_inspect.go │ │ │ ├── node_list.go │ │ │ ├── node_remove.go │ │ │ ├── node_update.go │ │ │ ├── ping.go │ │ │ ├── plugin_create.go │ │ │ ├── plugin_disable.go │ │ │ ├── plugin_enable.go │ │ │ ├── plugin_inspect.go │ │ │ ├── plugin_install.go │ │ │ ├── plugin_list.go │ │ │ ├── plugin_push.go │ │ │ ├── plugin_remove.go │ │ │ ├── plugin_set.go │ │ │ ├── plugin_upgrade.go │ │ │ ├── request.go │ │ │ ├── secret_create.go │ │ │ ├── secret_inspect.go │ │ │ ├── secret_list.go │ │ │ ├── secret_remove.go │ │ │ ├── secret_update.go │ │ │ ├── service_create.go │ │ │ ├── service_inspect.go │ │ │ ├── service_list.go │ │ │ ├── service_logs.go │ │ │ ├── service_remove.go │ │ │ ├── service_update.go │ │ │ ├── session.go │ │ │ ├── swarm_get_unlock_key.go │ │ │ ├── swarm_init.go │ │ │ ├── swarm_inspect.go │ │ │ ├── swarm_join.go │ │ │ ├── swarm_leave.go │ │ │ ├── swarm_unlock.go │ │ │ ├── swarm_update.go │ │ │ ├── task_inspect.go │ │ │ ├── task_list.go │ │ │ ├── task_logs.go │ │ │ ├── tlsconfig_clone.go │ │ │ ├── tlsconfig_clone_go17.go │ │ │ ├── transport.go │ │ │ ├── utils.go │ │ │ ├── version.go │ │ │ ├── volume_create.go │ │ │ ├── volume_inspect.go │ │ │ ├── volume_list.go │ │ │ ├── volume_prune.go │ │ │ └── volume_remove.go │ ├── go-connections │ │ ├── LICENSE │ │ ├── nat │ │ │ ├── nat.go │ │ │ ├── parse.go │ │ │ └── sort.go │ │ ├── sockets │ │ │ ├── README.md │ │ │ ├── inmem_socket.go │ │ │ ├── proxy.go │ │ │ ├── sockets.go │ │ │ ├── sockets_unix.go │ │ │ ├── sockets_windows.go │ │ │ ├── tcp_socket.go │ │ │ └── unix_socket.go │ │ └── tlsconfig │ │ │ ├── certpool_go17.go │ │ │ ├── certpool_other.go │ │ │ ├── config.go │ │ │ ├── config_client_ciphers.go │ │ │ └── config_legacy_client_ciphers.go │ └── go-units │ │ ├── LICENSE │ │ ├── README.md │ │ ├── duration.go │ │ ├── size.go │ │ └── ulimit.go ├── gogo │ └── protobuf │ │ ├── LICENSE │ │ └── proto │ │ ├── clone.go │ │ ├── decode.go │ │ ├── decode_gogo.go │ │ ├── duration.go │ │ ├── duration_gogo.go │ │ ├── encode.go │ │ ├── encode_gogo.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── extensions_gogo.go │ │ ├── lib.go │ │ ├── lib_gogo.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_reflect_gogo.go │ │ ├── pointer_unsafe.go │ │ ├── pointer_unsafe_gogo.go │ │ ├── properties.go │ │ ├── properties_gogo.go │ │ ├── skip_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go ├── opencontainers │ ├── go-digest │ │ ├── LICENSE.code │ │ ├── LICENSE.docs │ │ ├── README.md │ │ ├── algorithm.go │ │ ├── digest.go │ │ ├── digester.go │ │ ├── doc.go │ │ └── verifiers.go │ └── image-spec │ │ ├── LICENSE │ │ └── specs-go │ │ ├── v1 │ │ ├── annotations.go │ │ ├── config.go │ │ ├── descriptor.go │ │ ├── index.go │ │ ├── layout.go │ │ ├── manifest.go │ │ └── mediatype.go │ │ ├── version.go │ │ └── versioned.go ├── pkg │ └── errors │ │ ├── LICENSE │ │ ├── README.md │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── satori │ └── go.uuid │ │ ├── LICENSE │ │ ├── README.md │ │ └── uuid.go └── stretchr │ └── testify │ ├── LICENSE │ ├── assert │ ├── assertion_format.go │ ├── assertion_format.go.tmpl │ ├── assertion_forward.go │ ├── assertion_forward.go.tmpl │ ├── assertions.go │ ├── doc.go │ ├── errors.go │ ├── forward_assertions.go │ └── http_assertions.go │ ├── require │ ├── doc.go │ ├── forward_requirements.go │ ├── require.go │ ├── require.go.tmpl │ ├── require_forward.go │ ├── require_forward.go.tmpl │ └── requirements.go │ └── suite │ ├── doc.go │ ├── interfaces.go │ └── suite.go ├── golang.org └── x │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── ctxhttp │ │ │ ├── ctxhttp.go │ │ │ └── ctxhttp_pre17.go │ │ ├── go17.go │ │ └── pre_go17.go │ └── proxy │ │ ├── direct.go │ │ ├── per_host.go │ │ ├── proxy.go │ │ └── socks5.go │ └── sys │ ├── LICENSE │ ├── PATENTS │ └── windows │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── dll_windows.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ └── zsyscall_windows.go └── vendor.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /.gitmessage: -------------------------------------------------------------------------------- 1 | 2 | 3 | Git issue references: 4 | 5 | Gamelan music currently playing: 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | services: 4 | - docker 5 | 6 | language: go 7 | go: 8 | - "1.9" 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.9-alpine as memorycell 2 | 3 | WORKDIR /go/src/github.com/connorwalsh/dockerlang 4 | COPY . . 5 | # no need to go get since we are vendoring all our deps 6 | RUN cd ./memorycell && ls && go build 7 | 8 | FROM alpine 9 | 10 | WORKDIR /usr/bin 11 | COPY --from=memorycell /go/src/github.com/connorwalsh/dockerlang/memorycell/memorycell . 12 | 13 | CMD ["/usr/bin/memorycell"] 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 c 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/dockerlang.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asmr-hex/dockerlang/d2c799f067d17e9f2e05a5eaa728933b97fbf529/assets/dockerlang.gif -------------------------------------------------------------------------------- /assets/dockerlang_glitch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asmr-hex/dockerlang/d2c799f067d17e9f2e05a5eaa728933b97fbf529/assets/dockerlang_glitch.gif -------------------------------------------------------------------------------- /compterpreter_test.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import ( 4 | "github.com/stretchr/testify/suite" 5 | ) 6 | 7 | type CompterpreterSuite struct { 8 | suite.Suite 9 | } 10 | 11 | func (s *CompterpreterSuite) AfterTest(suiteName, testName string) { 12 | ShutdownExecutionEngine() 13 | } 14 | 15 | func (s *CompterpreterSuite) TestLoadSourceCode_NoSuchFile() { 16 | conf := &Config{SrcFileName: "nonexistent_test_src.doc"} 17 | compt := NewCompterpreter(conf) 18 | 19 | err := compt.LoadSourceCode() 20 | s.Error(err) 21 | } 22 | 23 | func (s *CompterpreterSuite) TestLoadSourceCode() { 24 | conf := &Config{SrcFileName: "test/test.doc"} 25 | compt := NewCompterpreter(conf) 26 | 27 | err := compt.LoadSourceCode() 28 | s.NoError(err) 29 | } 30 | -------------------------------------------------------------------------------- /docdocdoc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | "github.com/connorwalsh/dockerlang" 8 | ) 9 | 10 | // docdocdoc is the dockerlang official compiler. 11 | // 12 | // usage 13 | 14 | const ( 15 | UsageStr = ` 16 | docdocdoc- the official dockerlang compiler. its really the best. 17 | 18 | usage: 19 | 20 | docdocdoc [flags] soucefile 21 | ` 22 | ) 23 | 24 | func main() { 25 | var ( 26 | err error 27 | ) 28 | 29 | conf := &dockerlang.Config{} 30 | 31 | err = ParseArgs(conf) 32 | if err != nil { 33 | fmt.Println(err.Error()) 34 | 35 | fmt.Println(UsageStr) 36 | 37 | return 38 | } 39 | 40 | compterpreter := dockerlang.NewCompterpreter(conf) 41 | err = compterpreter.Compterpret() 42 | if err != nil { 43 | fmt.Println(err.Error()) 44 | 45 | return 46 | } 47 | } 48 | 49 | func ParseArgs(c *dockerlang.Config) error { 50 | // define flags 51 | flag.BoolVar(&c.ShowUsage, "help", false, UsageStr) 52 | 53 | // parse from cmd line 54 | flag.Parse() 55 | 56 | // get src filename 57 | args := flag.Args() 58 | 59 | // ensure that a source file has been provided 60 | if len(args) == 0 { 61 | return fmt.Errorf("no source file has been provided :(") 62 | } 63 | 64 | // assume the first arg is the source file 65 | c.SrcFileName = args[0] 66 | 67 | // validate flags 68 | if c.ShowUsage { 69 | fmt.Println(UsageStr) 70 | 71 | return nil 72 | } 73 | 74 | return nil 75 | } 76 | -------------------------------------------------------------------------------- /errors.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import ( 4 | "errors" 5 | "strings" 6 | ) 7 | 8 | var ( 9 | TrivialWhitespaceError = errors.New("encountered a non-linebreak whitespace") 10 | UnbalancedParenError = errors.New("unbalanced paren") 11 | //DockerlangSyntaxError = errors.New("what that's not how you write dockerlang come on homie") 12 | ) 13 | 14 | type DockerlangSyntaxError struct { 15 | s string 16 | } 17 | 18 | func (e DockerlangSyntaxError) Error() string { 19 | return e.s 20 | } 21 | 22 | func SyntaxError(msgs ...string) error { 23 | message := "Dockerlang syntex error " 24 | 25 | return DockerlangSyntaxError{message + strings.Join(msgs, " ")} 26 | } 27 | -------------------------------------------------------------------------------- /evil.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "fmt" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | ) 10 | 11 | // receive a stack tree that only has a body AST set 12 | // Evaluation: 13 | // traverse the Body AST like a beautiful red sailboat, maintain reference to parent StackTree for lookups in scope 14 | // switch node: 15 | // ≡ -> assign name to locals, create docker image 16 | // = -> lookup in Locals/Args/Globals and reassign value to Docker image 17 | // ... 18 | 19 | // Precedence for variable lookup is: 20 | // Local, Args, Global 21 | 22 | func (c *Compterpreter) Evaluate() error { 23 | b, _ := json.MarshalIndent(c.StackTree, " ", " ") 24 | fmt.Println(string(b)) 25 | 26 | /* 27 | for _, operand := range c.StackTree.Operands { 28 | b, _ := json.MarshalIndent(operand, " ", " ") 29 | fmt.Println(string(b)) 30 | } 31 | */ 32 | r, err := c.StackTree.Operands[0].Eval() 33 | 34 | wait, errChan := executer.Docker.ContainerWait( 35 | context.Background(), 36 | r, 37 | container.WaitConditionNotRunning, 38 | ) 39 | 40 | select { 41 | case <-wait: 42 | // execution complete! 43 | case err = <-errChan: 44 | // uo oh 45 | } 46 | 47 | return err 48 | } 49 | -------------------------------------------------------------------------------- /examples/functions.doc: -------------------------------------------------------------------------------- 1 | slashslash functions.doc is a basic outline of how to define and call functions in dockerlang 2 | 3 | slashslash define a function called myGreatFunction which takes no parameters and prints something 4 | (❦ myGreatFunction () ( 5 | (#! "we are in a gr8 function") 6 | )) 7 | 8 | (myGreatFunction) slashslash executes myGreatFunction with no arguments 9 | slashslash output: "we are in a gr8 function" 10 | 11 | slashslash note that the floural heart, ❦, is the keyword for defining functions 12 | 13 | slashslash define a function called anotherGreatFunctionByMe which takes one parameter 14 | (❦ anotherGreatFunctionByMe (aCoolParameter) ( 15 | (#! (#"the cool argument is %d" aCoolParameter)) 16 | )) 17 | 18 | (anotherGreatFunctionByMe 999) 19 | slashslash output: "the cool parameter is 999" 20 | 21 | slashslash define a function which declares an internal variable and prints the sum 22 | (❦ possiblyTheBestFunctionIEverWrote (myInt1 myInt2) ( 23 | (variable anotherInt 9) 24 | (#! (#"the cool result is %d' (myInt1 + myInt2 + anotherInt))) 25 | )) 26 | 27 | (possiblyTheBestFunctionIEverWrote 2 3) 28 | slashslash output: "the cool result is 14" 29 | 30 | -------------------------------------------------------------------------------- /examples/hello.doc: -------------------------------------------------------------------------------- 1 | slashslash hello.doc is a basic hellow world program written in dockerlang 2 | slashslash this is a comment (sorry no multiline ¯\_(ツ)_/¯) 3 | 4 | slashslash print to stdout nothing fancy 5 | (#! "hell wurld") 6 | 7 | slashslash print to stdout with string formatting 8 | (#! (#"hello %s" "connor")) 9 | -------------------------------------------------------------------------------- /execution_test.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import ( 4 | "github.com/stretchr/testify/suite" 5 | ) 6 | 7 | type ExecutionSuite struct { 8 | suite.Suite 9 | } 10 | 11 | func (s *ExecutionSuite) AfterTest(suiteName, testName string) { 12 | ShutdownExecutionEngine() 13 | } 14 | 15 | // NOTE: for these tests to run, we need to ensure that docker is running on the 16 | // host machine! 17 | func (s *ExecutionSuite) TestNewExecutionEngine() { 18 | err := NewExecutionEngine() 19 | s.NoError(err) 20 | } 21 | 22 | func (s *ExecutionSuite) TestShutdownExecutionEngine() { 23 | err := NewExecutionEngine() 24 | s.NoError(err) 25 | 26 | err = ShutdownExecutionEngine() 27 | s.NoError(err) 28 | } 29 | 30 | func (s *ExecutionSuite) TestShutdownExecutionEngine_NonExistent() { 31 | executer.Network = "non-existent network" 32 | 33 | err := ShutdownExecutionEngine() 34 | s.NoError(err) 35 | } 36 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | YELLOW='\033[1;33m' 4 | GREEN='\033[0;32m' 5 | NOCOLOR='\033[0m' 6 | 7 | # install the golang binary (for the moment you need golang to install) 8 | printf "${YELLOW}Building Dockerlang Compterpreter..." 9 | cd docdocdoc && go install && cd .. 10 | printf "${GREEN}ok! ${NOCOLOR} \n" 11 | 12 | # build the dockerlang memorycell image 13 | printf "${YELLOW}Building Dockerlang memory cells..." 14 | docker build . -t "dockerlang" >/dev/null 15 | printf "${GREEN}ok! ${NOCOLOR} \n" 16 | -------------------------------------------------------------------------------- /main_test.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/suite" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | retcode := m.Run() 12 | 13 | os.Exit(retcode) 14 | } 15 | 16 | func TestCompterpreterSuite(t *testing.T) { 17 | suite.Run(t, new(CompterpreterSuite)) 18 | } 19 | 20 | func TestLexerSuite(t *testing.T) { 21 | suite.Run(t, new(LexerSuite)) 22 | } 23 | 24 | func TestParserSuite(t *testing.T) { 25 | suite.Run(t, new(ParserSuite)) 26 | } 27 | 28 | func TestExecutionSuite(t *testing.T) { 29 | suite.Run(t, new(ExecutionSuite)) 30 | } 31 | -------------------------------------------------------------------------------- /memorycell/memorycell: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asmr-hex/dockerlang/d2c799f067d17e9f2e05a5eaa728933b97fbf529/memorycell/memorycell -------------------------------------------------------------------------------- /symbols.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | import "regexp" 4 | 5 | const ( 6 | ADDITION_OPERATOR = "+" 7 | SUBTRACTION_OPERATOR = "†" 8 | MULTIPLICATION_OPERATOR = "*" 9 | DIVISION_OPERATOR = "‡" 10 | MODULO_OPERATOR = "%" 11 | VARIABLE_INITIALIZATION = "≡" 12 | VARIABLE_ASSIGNMENT = "=" 13 | EXIT_OPERATOR = "ꙮ" 14 | IMPLICIT_LIST_OPERATOR = "…" 15 | NOOP = "NOOP" 16 | 17 | R_PAREN_PUNCTION = "(" 18 | L_PAREN_PUNCUTATION = ")" 19 | 20 | VARIABLE_IDENTIFIER = "VARIABLE_IDENTIFIER" 21 | FUNCTION_IDENTIFIER = "FUNCTION_IDENTIFIER" 22 | 23 | IF_KEYWORD = "if" 24 | FUNCTION_KEYWORD = "❦" 25 | ) 26 | 27 | var ( 28 | OP_TO_ARITY = map[string]int{ 29 | ADDITION_OPERATOR: 2, 30 | SUBTRACTION_OPERATOR: 2, 31 | MULTIPLICATION_OPERATOR: 2, 32 | DIVISION_OPERATOR: 2, 33 | MODULO_OPERATOR: 2, 34 | VARIABLE_INITIALIZATION: 2, 35 | VARIABLE_ASSIGNMENT: 2, 36 | EXIT_OPERATOR: 1, 37 | NOOP: 1, 38 | } 39 | 40 | VALID_IDENTIFIER_FIRST_SYMBOL = regexp.MustCompile("[a-zA-Z_]") 41 | VALID_IDENTIFIER_SYMBOL = regexp.MustCompile("[a-zA-Z_\\d]") 42 | ) 43 | 44 | // all the language-defined tokens in dockerlang 45 | type Symbols struct { 46 | Operators []string 47 | Keywords []string 48 | Punctuation []string 49 | } 50 | 51 | func PopulateSymbols() *Symbols { 52 | return &Symbols{ 53 | Operators: []string{ 54 | ADDITION_OPERATOR, 55 | SUBTRACTION_OPERATOR, 56 | MULTIPLICATION_OPERATOR, 57 | DIVISION_OPERATOR, 58 | MODULO_OPERATOR, 59 | VARIABLE_INITIALIZATION, 60 | VARIABLE_ASSIGNMENT, 61 | EXIT_OPERATOR, 62 | IMPLICIT_LIST_OPERATOR, 63 | NOOP, 64 | }, 65 | Keywords: []string{ 66 | IF_KEYWORD, 67 | FUNCTION_KEYWORD, 68 | }, 69 | Punctuation: []string{ 70 | R_PAREN_PUNCTION, 71 | L_PAREN_PUNCUTATION, 72 | }, 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /test/addition.doc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (ꙮ (+ 1 2)) 5 | -------------------------------------------------------------------------------- /test/division.doc: -------------------------------------------------------------------------------- 1 | (ꙮ (‡ 99 3)) 2 | -------------------------------------------------------------------------------- /test/identifiers.doc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/modulo.doc: -------------------------------------------------------------------------------- 1 | (ꙮ (% 11 2)) 2 | -------------------------------------------------------------------------------- /test/multiplication.doc: -------------------------------------------------------------------------------- 1 | (ꙮ (* 3 5)) 2 | -------------------------------------------------------------------------------- /test/nested_arithmetic.doc: -------------------------------------------------------------------------------- 1 | (ꙮ (+ († (‡ 99 3) 31) (% (* 4 11) 2))) 2 | -------------------------------------------------------------------------------- /test/subtraction.doc: -------------------------------------------------------------------------------- 1 | 2 | (ꙮ († 5 3)) 3 | -------------------------------------------------------------------------------- /test/test-operators.doc: -------------------------------------------------------------------------------- 1 | ‡*+%† 2 | -------------------------------------------------------------------------------- /test/test.doc: -------------------------------------------------------------------------------- 1 | 1234 5678 2 | -------------------------------------------------------------------------------- /test/test_function.doc: -------------------------------------------------------------------------------- 1 | 2 | 3 | (❦ add (arg1 arg2) ( 4 | (≡ x arg1) 5 | (≡ y arg2) 6 | (+ x (+ y 1)) 7 | )) 8 | 9 | -------------------------------------------------------------------------------- /test/test_identifiers.doc: -------------------------------------------------------------------------------- 1 | myVariable 2 | -------------------------------------------------------------------------------- /test/test_identifiers_keyword.doc: -------------------------------------------------------------------------------- 1 | if 2 | -------------------------------------------------------------------------------- /test/test_tokenize.doc: -------------------------------------------------------------------------------- 1 | 2 | 123 † 3* 2 ‡45787894357893 3 | 4 | 0 + 00 +1 5 | 6 | -------------------------------------------------------------------------------- /test/variable.doc: -------------------------------------------------------------------------------- 1 | (≡ aVariable 0) 2 | (= aVariable 23) 3 | (ꙮ (+ aVariable 2)) 4 | -------------------------------------------------------------------------------- /token.go: -------------------------------------------------------------------------------- 1 | package dockerlang 2 | 3 | const ( 4 | OPERATOR = "OPERATOR" 5 | IDENTIFIER = "IDENTIFIER" 6 | KEYWORD = "KEYWORD" 7 | INT = "INTEGER" 8 | PUNCTUATION = "PUNCTUATION" // parens 9 | ) 10 | 11 | type Token struct { 12 | Type string 13 | Value string 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/README.md: -------------------------------------------------------------------------------- 1 | # go-winio 2 | 3 | This repository contains utilities for efficiently performing Win32 IO operations in 4 | Go. Currently, this is focused on accessing named pipes and other file handles, and 5 | for using named pipes as a net transport. 6 | 7 | This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go 8 | to reuse the thread to schedule another goroutine. This limits support to Windows Vista and 9 | newer operating systems. This is similar to the implementation of network sockets in Go's net 10 | package. 11 | 12 | Please see the LICENSE file for licensing information. 13 | 14 | This project has adopted the [Microsoft Open Source Code of 15 | Conduct](https://opensource.microsoft.com/codeofconduct/). For more information 16 | see the [Code of Conduct 17 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact 18 | [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional 19 | questions or comments. 20 | 21 | Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe 22 | for another named pipe implementation. 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/bypasssafe.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when the code is running on Google App Engine, compiled by GopherJS, or 17 | // "-tags safe" is added to the go build command line. The "disableunsafe" 18 | // tag is deprecated and thus should not be used. 19 | // +build js appengine safe disableunsafe 20 | 21 | package spew 22 | 23 | import "reflect" 24 | 25 | const ( 26 | // UnsafeDisabled is a build-time constant which specifies whether or 27 | // not access to the unsafe package is available. 28 | UnsafeDisabled = true 29 | ) 30 | 31 | // unsafeReflectValue typically converts the passed reflect.Value into a one 32 | // that bypasses the typical safety restrictions preventing access to 33 | // unaddressable and unexported data. However, doing this relies on access to 34 | // the unsafe package. This is a stub version which simply returns the passed 35 | // reflect.Value when the unsafe package is not available. 36 | func unsafeReflectValue(v reflect.Value) reflect.Value { 37 | return v 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/reference/helpers.go: -------------------------------------------------------------------------------- 1 | package reference 2 | 3 | import "path" 4 | 5 | // IsNameOnly returns true if reference only contains a repo name. 6 | func IsNameOnly(ref Named) bool { 7 | if _, ok := ref.(NamedTagged); ok { 8 | return false 9 | } 10 | if _, ok := ref.(Canonical); ok { 11 | return false 12 | } 13 | return true 14 | } 15 | 16 | // FamiliarName returns the familiar name string 17 | // for the given named, familiarizing if needed. 18 | func FamiliarName(ref Named) string { 19 | if nn, ok := ref.(normalizedNamed); ok { 20 | return nn.Familiar().Name() 21 | } 22 | return ref.Name() 23 | } 24 | 25 | // FamiliarString returns the familiar string representation 26 | // for the given reference, familiarizing if needed. 27 | func FamiliarString(ref Reference) string { 28 | if nn, ok := ref.(normalizedNamed); ok { 29 | return nn.Familiar().String() 30 | } 31 | return ref.String() 32 | } 33 | 34 | // FamiliarMatch reports whether ref matches the specified pattern. 35 | // See https://godoc.org/path#Match for supported patterns. 36 | func FamiliarMatch(pattern string, ref Reference) (bool, error) { 37 | matched, err := path.Match(pattern, FamiliarString(ref)) 38 | if namedRef, isNamed := ref.(Named); isNamed && !matched { 39 | matched, _ = path.Match(pattern, FamiliarName(namedRef)) 40 | } 41 | return matched, err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2017 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common.go: -------------------------------------------------------------------------------- 1 | package api // import "github.com/docker/docker/api" 2 | 3 | // Common constants for daemon and client. 4 | const ( 5 | // DefaultVersion of Current REST API 6 | DefaultVersion string = "1.37" 7 | 8 | // NoBaseImageSpecifier is the symbol used by the FROM 9 | // command to specify that no base image is to be used. 10 | NoBaseImageSpecifier string = "scratch" 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package api // import "github.com/docker/docker/api" 4 | 5 | // MinVersion represents Minimum REST API version supported 6 | const MinVersion string = "1.12" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_windows.go: -------------------------------------------------------------------------------- 1 | package api // import "github.com/docker/docker/api" 2 | 3 | // MinVersion represents Minimum REST API version supported 4 | // Technically the first daemon API version released on Windows is v1.25 in 5 | // engine version 1.13. However, some clients are explicitly using downlevel 6 | // APIs (e.g. docker-compose v2.1 file format) and that is just too restrictive. 7 | // Hence also allowing 1.24 on Windows. 8 | const MinVersion string = "1.24" 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/swagger-gen.yaml: -------------------------------------------------------------------------------- 1 | 2 | layout: 3 | models: 4 | - name: definition 5 | source: asset:model 6 | target: "{{ joinFilePath .Target .ModelPackage }}" 7 | file_name: "{{ (snakize (pascalize .Name)) }}.go" 8 | operations: 9 | - name: handler 10 | source: asset:serverOperation 11 | target: "{{ joinFilePath .Target .APIPackage .Package }}" 12 | file_name: "{{ (snakize (pascalize .Name)) }}.go" 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/auth.go: -------------------------------------------------------------------------------- 1 | package types // import "github.com/docker/docker/api/types" 2 | 3 | // AuthConfig contains authorization information for connecting to a Registry 4 | type AuthConfig struct { 5 | Username string `json:"username,omitempty"` 6 | Password string `json:"password,omitempty"` 7 | Auth string `json:"auth,omitempty"` 8 | 9 | // Email is an optional value associated with the username. 10 | // This field is deprecated and will be removed in a later 11 | // version of docker. 12 | Email string `json:"email,omitempty"` 13 | 14 | ServerAddress string `json:"serveraddress,omitempty"` 15 | 16 | // IdentityToken is used to authenticate the user and get 17 | // an access token for the registry. 18 | IdentityToken string `json:"identitytoken,omitempty"` 19 | 20 | // RegistryToken is a bearer token to be sent to a registry 21 | RegistryToken string `json:"registrytoken,omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/blkiodev/blkio.go: -------------------------------------------------------------------------------- 1 | package blkiodev // import "github.com/docker/docker/api/types/blkiodev" 2 | 3 | import "fmt" 4 | 5 | // WeightDevice is a structure that holds device:weight pair 6 | type WeightDevice struct { 7 | Path string 8 | Weight uint16 9 | } 10 | 11 | func (w *WeightDevice) String() string { 12 | return fmt.Sprintf("%s:%d", w.Path, w.Weight) 13 | } 14 | 15 | // ThrottleDevice is a structure that holds device:rate_per_second pair 16 | type ThrottleDevice struct { 17 | Path string 18 | Rate uint64 19 | } 20 | 21 | func (t *ThrottleDevice) String() string { 22 | return fmt.Sprintf("%s:%d", t.Path, t.Rate) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_changes.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerChangeResponseItem change item in response to ContainerChanges operation 11 | // swagger:model ContainerChangeResponseItem 12 | type ContainerChangeResponseItem struct { 13 | 14 | // Kind of change 15 | // Required: true 16 | Kind uint8 `json:"Kind"` 17 | 18 | // Path to file that has changed 19 | // Required: true 20 | Path string `json:"Path"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_create.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerCreateCreatedBody OK response to ContainerCreate operation 11 | // swagger:model ContainerCreateCreatedBody 12 | type ContainerCreateCreatedBody struct { 13 | 14 | // The ID of the created container 15 | // Required: true 16 | ID string `json:"Id"` 17 | 18 | // Warnings encountered when creating the container 19 | // Required: true 20 | Warnings []string `json:"Warnings"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_top.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerTopOKBody OK response to ContainerTop operation 11 | // swagger:model ContainerTopOKBody 12 | type ContainerTopOKBody struct { 13 | 14 | // Each process running in the container, where each is process is an array of values corresponding to the titles 15 | // Required: true 16 | Processes [][]string `json:"Processes"` 17 | 18 | // The ps column titles 19 | // Required: true 20 | Titles []string `json:"Titles"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_update.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerUpdateOKBody OK response to ContainerUpdate operation 11 | // swagger:model ContainerUpdateOKBody 12 | type ContainerUpdateOKBody struct { 13 | 14 | // warnings 15 | // Required: true 16 | Warnings []string `json:"Warnings"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_wait.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerWaitOKBodyError container waiting error, if any 11 | // swagger:model ContainerWaitOKBodyError 12 | type ContainerWaitOKBodyError struct { 13 | 14 | // Details of an error 15 | Message string `json:"Message,omitempty"` 16 | } 17 | 18 | // ContainerWaitOKBody OK response to ContainerWait operation 19 | // swagger:model ContainerWaitOKBody 20 | type ContainerWaitOKBody struct { 21 | 22 | // error 23 | // Required: true 24 | Error *ContainerWaitOKBodyError `json:"Error"` 25 | 26 | // Exit code of the container 27 | // Required: true 28 | StatusCode int64 `json:"StatusCode"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package container // import "github.com/docker/docker/api/types/container" 4 | 5 | // IsValid indicates if an isolation technology is valid 6 | func (i Isolation) IsValid() bool { 7 | return i.IsDefault() 8 | } 9 | 10 | // NetworkName returns the name of the network stack. 11 | func (n NetworkMode) NetworkName() string { 12 | if n.IsBridge() { 13 | return "bridge" 14 | } else if n.IsHost() { 15 | return "host" 16 | } else if n.IsContainer() { 17 | return "container" 18 | } else if n.IsNone() { 19 | return "none" 20 | } else if n.IsDefault() { 21 | return "default" 22 | } else if n.IsUserDefined() { 23 | return n.UserDefined() 24 | } 25 | return "" 26 | } 27 | 28 | // IsBridge indicates whether container uses the bridge network stack 29 | func (n NetworkMode) IsBridge() bool { 30 | return n == "bridge" 31 | } 32 | 33 | // IsHost indicates whether container uses the host network stack. 34 | func (n NetworkMode) IsHost() bool { 35 | return n == "host" 36 | } 37 | 38 | // IsUserDefined indicates user-created network 39 | func (n NetworkMode) IsUserDefined() bool { 40 | return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go: -------------------------------------------------------------------------------- 1 | package container // import "github.com/docker/docker/api/types/container" 2 | 3 | // IsBridge indicates whether container uses the bridge network stack 4 | // in windows it is given the name NAT 5 | func (n NetworkMode) IsBridge() bool { 6 | return n == "nat" 7 | } 8 | 9 | // IsHost indicates whether container uses the host network stack. 10 | // returns false as this is not supported by windows 11 | func (n NetworkMode) IsHost() bool { 12 | return false 13 | } 14 | 15 | // IsUserDefined indicates user-created network 16 | func (n NetworkMode) IsUserDefined() bool { 17 | return !n.IsDefault() && !n.IsNone() && !n.IsBridge() && !n.IsContainer() 18 | } 19 | 20 | // IsValid indicates if an isolation technology is valid 21 | func (i Isolation) IsValid() bool { 22 | return i.IsDefault() || i.IsHyperV() || i.IsProcess() 23 | } 24 | 25 | // NetworkName returns the name of the network stack. 26 | func (n NetworkMode) NetworkName() string { 27 | if n.IsDefault() { 28 | return "default" 29 | } else if n.IsBridge() { 30 | return "nat" 31 | } else if n.IsNone() { 32 | return "none" 33 | } else if n.IsContainer() { 34 | return "container" 35 | } else if n.IsUserDefined() { 36 | return n.UserDefined() 37 | } 38 | 39 | return "" 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/waitcondition.go: -------------------------------------------------------------------------------- 1 | package container // import "github.com/docker/docker/api/types/container" 2 | 3 | // WaitCondition is a type used to specify a container state for which 4 | // to wait. 5 | type WaitCondition string 6 | 7 | // Possible WaitCondition Values. 8 | // 9 | // WaitConditionNotRunning (default) is used to wait for any of the non-running 10 | // states: "created", "exited", "dead", "removing", or "removed". 11 | // 12 | // WaitConditionNextExit is used to wait for the next time the state changes 13 | // to a non-running state. If the state is currently "created" or "exited", 14 | // this would cause Wait() to block until either the container runs and exits 15 | // or is removed. 16 | // 17 | // WaitConditionRemoved is used to wait for the container to be removed. 18 | const ( 19 | WaitConditionNotRunning WaitCondition = "not-running" 20 | WaitConditionNextExit WaitCondition = "next-exit" 21 | WaitConditionRemoved WaitCondition = "removed" 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/error_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ErrorResponse Represents an error. 7 | // swagger:model ErrorResponse 8 | type ErrorResponse struct { 9 | 10 | // The error message. 11 | // Required: true 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/events/events.go: -------------------------------------------------------------------------------- 1 | package events // import "github.com/docker/docker/api/types/events" 2 | 3 | const ( 4 | // ContainerEventType is the event type that containers generate 5 | ContainerEventType = "container" 6 | // DaemonEventType is the event type that daemon generate 7 | DaemonEventType = "daemon" 8 | // ImageEventType is the event type that images generate 9 | ImageEventType = "image" 10 | // NetworkEventType is the event type that networks generate 11 | NetworkEventType = "network" 12 | // PluginEventType is the event type that plugins generate 13 | PluginEventType = "plugin" 14 | // VolumeEventType is the event type that volumes generate 15 | VolumeEventType = "volume" 16 | // ServiceEventType is the event type that services generate 17 | ServiceEventType = "service" 18 | // NodeEventType is the event type that nodes generate 19 | NodeEventType = "node" 20 | // SecretEventType is the event type that secrets generate 21 | SecretEventType = "secret" 22 | // ConfigEventType is the event type that configs generate 23 | ConfigEventType = "config" 24 | ) 25 | 26 | // Actor describes something that generates events, 27 | // like a container, or a network, or a volume. 28 | // It has a defined name and a set or attributes. 29 | // The container attributes are its labels, other actors 30 | // can generate these attributes from other properties. 31 | type Actor struct { 32 | ID string 33 | Attributes map[string]string 34 | } 35 | 36 | // Message represents the information an event contains 37 | type Message struct { 38 | // Deprecated information from JSONMessage. 39 | // With data only in container events. 40 | Status string `json:"status,omitempty"` 41 | ID string `json:"id,omitempty"` 42 | From string `json:"from,omitempty"` 43 | 44 | Type string 45 | Action string 46 | Actor Actor 47 | // Engine events are local scope. Cluster events are swarm scope. 48 | Scope string `json:"scope,omitempty"` 49 | 50 | Time int64 `json:"time,omitempty"` 51 | TimeNano int64 `json:"timeNano,omitempty"` 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/graph_driver_data.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // GraphDriverData Information about a container's graph driver. 7 | // swagger:model GraphDriverData 8 | type GraphDriverData struct { 9 | 10 | // data 11 | // Required: true 12 | Data map[string]string `json:"Data"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/id_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // IDResponse Response to an API call that returns just an Id 7 | // swagger:model IdResponse 8 | type IDResponse struct { 9 | 10 | // The id of the newly created object. 11 | // Required: true 12 | ID string `json:"Id"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image/image_history.go: -------------------------------------------------------------------------------- 1 | package image 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // HistoryResponseItem individual image layer information in response to ImageHistory operation 11 | // swagger:model HistoryResponseItem 12 | type HistoryResponseItem struct { 13 | 14 | // comment 15 | // Required: true 16 | Comment string `json:"Comment"` 17 | 18 | // created 19 | // Required: true 20 | Created int64 `json:"Created"` 21 | 22 | // created by 23 | // Required: true 24 | CreatedBy string `json:"CreatedBy"` 25 | 26 | // Id 27 | // Required: true 28 | ID string `json:"Id"` 29 | 30 | // size 31 | // Required: true 32 | Size int64 `json:"Size"` 33 | 34 | // tags 35 | // Required: true 36 | Tags []string `json:"Tags"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_delete_response_item.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageDeleteResponseItem image delete response item 7 | // swagger:model ImageDeleteResponseItem 8 | type ImageDeleteResponseItem struct { 9 | 10 | // The image ID of an image that was deleted 11 | Deleted string `json:"Deleted,omitempty"` 12 | 13 | // The image ID of an image that was untagged 14 | Untagged string `json:"Untagged,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_summary.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageSummary image summary 7 | // swagger:model ImageSummary 8 | type ImageSummary struct { 9 | 10 | // containers 11 | // Required: true 12 | Containers int64 `json:"Containers"` 13 | 14 | // created 15 | // Required: true 16 | Created int64 `json:"Created"` 17 | 18 | // Id 19 | // Required: true 20 | ID string `json:"Id"` 21 | 22 | // labels 23 | // Required: true 24 | Labels map[string]string `json:"Labels"` 25 | 26 | // parent Id 27 | // Required: true 28 | ParentID string `json:"ParentId"` 29 | 30 | // repo digests 31 | // Required: true 32 | RepoDigests []string `json:"RepoDigests"` 33 | 34 | // repo tags 35 | // Required: true 36 | RepoTags []string `json:"RepoTags"` 37 | 38 | // shared size 39 | // Required: true 40 | SharedSize int64 `json:"SharedSize"` 41 | 42 | // size 43 | // Required: true 44 | Size int64 `json:"Size"` 45 | 46 | // virtual size 47 | // Required: true 48 | VirtualSize int64 `json:"VirtualSize"` 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_device.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginDevice plugin device 7 | // swagger:model PluginDevice 8 | type PluginDevice struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // path 19 | // Required: true 20 | Path *string `json:"Path"` 21 | 22 | // settable 23 | // Required: true 24 | Settable []string `json:"Settable"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_env.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginEnv plugin env 7 | // swagger:model PluginEnv 8 | type PluginEnv struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // settable 19 | // Required: true 20 | Settable []string `json:"Settable"` 21 | 22 | // value 23 | // Required: true 24 | Value *string `json:"Value"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_interface_type.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginInterfaceType plugin interface type 7 | // swagger:model PluginInterfaceType 8 | type PluginInterfaceType struct { 9 | 10 | // capability 11 | // Required: true 12 | Capability string `json:"Capability"` 13 | 14 | // prefix 15 | // Required: true 16 | Prefix string `json:"Prefix"` 17 | 18 | // version 19 | // Required: true 20 | Version string `json:"Version"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_mount.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginMount plugin mount 7 | // swagger:model PluginMount 8 | type PluginMount struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // destination 15 | // Required: true 16 | Destination string `json:"Destination"` 17 | 18 | // name 19 | // Required: true 20 | Name string `json:"Name"` 21 | 22 | // options 23 | // Required: true 24 | Options []string `json:"Options"` 25 | 26 | // settable 27 | // Required: true 28 | Settable []string `json:"Settable"` 29 | 30 | // source 31 | // Required: true 32 | Source *string `json:"Source"` 33 | 34 | // type 35 | // Required: true 36 | Type string `json:"Type"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_responses.go: -------------------------------------------------------------------------------- 1 | package types // import "github.com/docker/docker/api/types" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "sort" 7 | ) 8 | 9 | // PluginsListResponse contains the response for the Engine API 10 | type PluginsListResponse []*Plugin 11 | 12 | // UnmarshalJSON implements json.Unmarshaler for PluginInterfaceType 13 | func (t *PluginInterfaceType) UnmarshalJSON(p []byte) error { 14 | versionIndex := len(p) 15 | prefixIndex := 0 16 | if len(p) < 2 || p[0] != '"' || p[len(p)-1] != '"' { 17 | return fmt.Errorf("%q is not a plugin interface type", p) 18 | } 19 | p = p[1 : len(p)-1] 20 | loop: 21 | for i, b := range p { 22 | switch b { 23 | case '.': 24 | prefixIndex = i 25 | case '/': 26 | versionIndex = i 27 | break loop 28 | } 29 | } 30 | t.Prefix = string(p[:prefixIndex]) 31 | t.Capability = string(p[prefixIndex+1 : versionIndex]) 32 | if versionIndex < len(p) { 33 | t.Version = string(p[versionIndex+1:]) 34 | } 35 | return nil 36 | } 37 | 38 | // MarshalJSON implements json.Marshaler for PluginInterfaceType 39 | func (t *PluginInterfaceType) MarshalJSON() ([]byte, error) { 40 | return json.Marshal(t.String()) 41 | } 42 | 43 | // String implements fmt.Stringer for PluginInterfaceType 44 | func (t PluginInterfaceType) String() string { 45 | return fmt.Sprintf("%s.%s/%s", t.Prefix, t.Capability, t.Version) 46 | } 47 | 48 | // PluginPrivilege describes a permission the user has to accept 49 | // upon installing a plugin. 50 | type PluginPrivilege struct { 51 | Name string 52 | Description string 53 | Value []string 54 | } 55 | 56 | // PluginPrivileges is a list of PluginPrivilege 57 | type PluginPrivileges []PluginPrivilege 58 | 59 | func (s PluginPrivileges) Len() int { 60 | return len(s) 61 | } 62 | 63 | func (s PluginPrivileges) Less(i, j int) bool { 64 | return s[i].Name < s[j].Name 65 | } 66 | 67 | func (s PluginPrivileges) Swap(i, j int) { 68 | sort.Strings(s[i].Value) 69 | sort.Strings(s[j].Value) 70 | s[i], s[j] = s[j], s[i] 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/port.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // Port An open port on a container 7 | // swagger:model Port 8 | type Port struct { 9 | 10 | // IP 11 | IP string `json:"IP,omitempty"` 12 | 13 | // Port on the container 14 | // Required: true 15 | PrivatePort uint16 `json:"PrivatePort"` 16 | 17 | // Port exposed on the host 18 | PublicPort uint16 `json:"PublicPort,omitempty"` 19 | 20 | // type 21 | // Required: true 22 | Type string `json:"Type"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/registry/authenticate.go: -------------------------------------------------------------------------------- 1 | package registry // import "github.com/docker/docker/api/types/registry" 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // AuthenticateOKBody authenticate o k body 11 | // swagger:model AuthenticateOKBody 12 | type AuthenticateOKBody struct { 13 | 14 | // An opaque token used to authenticate a user after a successful login 15 | // Required: true 16 | IdentityToken string `json:"IdentityToken"` 17 | 18 | // The status of the authentication 19 | // Required: true 20 | Status string `json:"Status"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/service_update_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ServiceUpdateResponse service update response 7 | // swagger:model ServiceUpdateResponse 8 | type ServiceUpdateResponse struct { 9 | 10 | // Optional warning messages 11 | Warnings []string `json:"Warnings"` 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/strslice/strslice.go: -------------------------------------------------------------------------------- 1 | package strslice // import "github.com/docker/docker/api/types/strslice" 2 | 3 | import "encoding/json" 4 | 5 | // StrSlice represents a string or an array of strings. 6 | // We need to override the json decoder to accept both options. 7 | type StrSlice []string 8 | 9 | // UnmarshalJSON decodes the byte slice whether it's a string or an array of 10 | // strings. This method is needed to implement json.Unmarshaler. 11 | func (e *StrSlice) UnmarshalJSON(b []byte) error { 12 | if len(b) == 0 { 13 | // With no input, we preserve the existing value by returning nil and 14 | // leaving the target alone. This allows defining default values for 15 | // the type. 16 | return nil 17 | } 18 | 19 | p := make([]string, 0, 1) 20 | if err := json.Unmarshal(b, &p); err != nil { 21 | var s string 22 | if err := json.Unmarshal(b, &s); err != nil { 23 | return err 24 | } 25 | p = append(p, s) 26 | } 27 | 28 | *e = p 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/common.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | import "time" 4 | 5 | // Version represents the internal object version. 6 | type Version struct { 7 | Index uint64 `json:",omitempty"` 8 | } 9 | 10 | // Meta is a base object inherited by most of the other once. 11 | type Meta struct { 12 | Version Version `json:",omitempty"` 13 | CreatedAt time.Time `json:",omitempty"` 14 | UpdatedAt time.Time `json:",omitempty"` 15 | } 16 | 17 | // Annotations represents how to describe an object. 18 | type Annotations struct { 19 | Name string `json:",omitempty"` 20 | Labels map[string]string `json:"Labels"` 21 | } 22 | 23 | // Driver represents a driver (network, logging, secrets backend). 24 | type Driver struct { 25 | Name string `json:",omitempty"` 26 | Options map[string]string `json:",omitempty"` 27 | } 28 | 29 | // TLSInfo represents the TLS information about what CA certificate is trusted, 30 | // and who the issuer for a TLS certificate is 31 | type TLSInfo struct { 32 | // TrustRoot is the trusted CA root certificate in PEM format 33 | TrustRoot string `json:",omitempty"` 34 | 35 | // CertIssuer is the raw subject bytes of the issuer 36 | CertIssuerSubject []byte `json:",omitempty"` 37 | 38 | // CertIssuerPublicKey is the raw public key bytes of the issuer 39 | CertIssuerPublicKey []byte `json:",omitempty"` 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/config.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | import "os" 4 | 5 | // Config represents a config. 6 | type Config struct { 7 | ID string 8 | Meta 9 | Spec ConfigSpec 10 | } 11 | 12 | // ConfigSpec represents a config specification from a config in swarm 13 | type ConfigSpec struct { 14 | Annotations 15 | Data []byte `json:",omitempty"` 16 | 17 | // Templating controls whether and how to evaluate the config payload as 18 | // a template. If it is not set, no templating is used. 19 | Templating *Driver `json:",omitempty"` 20 | } 21 | 22 | // ConfigReferenceFileTarget is a file target in a config reference 23 | type ConfigReferenceFileTarget struct { 24 | Name string 25 | UID string 26 | GID string 27 | Mode os.FileMode 28 | } 29 | 30 | // ConfigReference is a reference to a config in swarm 31 | type ConfigReference struct { 32 | File *ConfigReferenceFileTarget 33 | ConfigID string 34 | ConfigName string 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | // RuntimeType is the type of runtime used for the TaskSpec 4 | type RuntimeType string 5 | 6 | // RuntimeURL is the proto type url 7 | type RuntimeURL string 8 | 9 | const ( 10 | // RuntimeContainer is the container based runtime 11 | RuntimeContainer RuntimeType = "container" 12 | // RuntimePlugin is the plugin based runtime 13 | RuntimePlugin RuntimeType = "plugin" 14 | 15 | // RuntimeURLContainer is the proto url for the container type 16 | RuntimeURLContainer RuntimeURL = "types.docker.com/RuntimeContainer" 17 | // RuntimeURLPlugin is the proto url for the plugin type 18 | RuntimeURLPlugin RuntimeURL = "types.docker.com/RuntimePlugin" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/gen.go: -------------------------------------------------------------------------------- 1 | //go:generate protoc -I . --gogofast_out=import_path=github.com/docker/docker/api/types/swarm/runtime:. plugin.proto 2 | 3 | package runtime // import "github.com/docker/docker/api/types/swarm/runtime" 4 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option go_package = "github.com/docker/docker/api/types/swarm/runtime;runtime"; 4 | 5 | // PluginSpec defines the base payload which clients can specify for creating 6 | // a service with the plugin runtime. 7 | message PluginSpec { 8 | string name = 1; 9 | string remote = 2; 10 | repeated PluginPrivilege privileges = 3; 11 | bool disabled = 4; 12 | } 13 | 14 | // PluginPrivilege describes a permission the user has to accept 15 | // upon installing a plugin. 16 | message PluginPrivilege { 17 | string name = 1; 18 | string description = 2; 19 | repeated string value = 3; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/secret.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | import "os" 4 | 5 | // Secret represents a secret. 6 | type Secret struct { 7 | ID string 8 | Meta 9 | Spec SecretSpec 10 | } 11 | 12 | // SecretSpec represents a secret specification from a secret in swarm 13 | type SecretSpec struct { 14 | Annotations 15 | Data []byte `json:",omitempty"` 16 | Driver *Driver `json:",omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store 17 | 18 | // Templating controls whether and how to evaluate the secret payload as 19 | // a template. If it is not set, no templating is used. 20 | Templating *Driver `json:",omitempty"` 21 | } 22 | 23 | // SecretReferenceFileTarget is a file target in a secret reference 24 | type SecretReferenceFileTarget struct { 25 | Name string 26 | UID string 27 | GID string 28 | Mode os.FileMode 29 | } 30 | 31 | // SecretReference is a reference to a secret in swarm 32 | type SecretReference struct { 33 | File *SecretReferenceFileTarget 34 | SecretID string 35 | SecretName string 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/time/duration_convert.go: -------------------------------------------------------------------------------- 1 | package time // import "github.com/docker/docker/api/types/time" 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | // DurationToSecondsString converts the specified duration to the number 9 | // seconds it represents, formatted as a string. 10 | func DurationToSecondsString(duration time.Duration) string { 11 | return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/versions/README.md: -------------------------------------------------------------------------------- 1 | # Legacy API type versions 2 | 3 | This package includes types for legacy API versions. The stable version of the API types live in `api/types/*.go`. 4 | 5 | Consider moving a type here when you need to keep backwards compatibility in the API. This legacy types are organized by the latest API version they appear in. For instance, types in the `v1p19` package are valid for API versions below or equal `1.19`. Types in the `v1p20` package are valid for the API version `1.20`, since the versions below that will use the legacy types in `v1p19`. 6 | 7 | ## Package name conventions 8 | 9 | The package name convention is to use `v` as a prefix for the version number and `p`(patch) as a separator. We use this nomenclature due to a few restrictions in the Go package name convention: 10 | 11 | 1. We cannot use `.` because it's interpreted by the language, think of `v1.20.CallFunction`. 12 | 2. We cannot use `_` because golint complains about it. The code is actually valid, but it looks probably more weird: `v1_20.CallFunction`. 13 | 14 | For instance, if you want to modify a type that was available in the version `1.21` of the API but it will have different fields in the version `1.22`, you want to create a new package under `api/types/versions/v1p21`. 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/versions/compare.go: -------------------------------------------------------------------------------- 1 | package versions // import "github.com/docker/docker/api/types/versions" 2 | 3 | import ( 4 | "strconv" 5 | "strings" 6 | ) 7 | 8 | // compare compares two version strings 9 | // returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise. 10 | func compare(v1, v2 string) int { 11 | var ( 12 | currTab = strings.Split(v1, ".") 13 | otherTab = strings.Split(v2, ".") 14 | ) 15 | 16 | max := len(currTab) 17 | if len(otherTab) > max { 18 | max = len(otherTab) 19 | } 20 | for i := 0; i < max; i++ { 21 | var currInt, otherInt int 22 | 23 | if len(currTab) > i { 24 | currInt, _ = strconv.Atoi(currTab[i]) 25 | } 26 | if len(otherTab) > i { 27 | otherInt, _ = strconv.Atoi(otherTab[i]) 28 | } 29 | if currInt > otherInt { 30 | return 1 31 | } 32 | if otherInt > currInt { 33 | return -1 34 | } 35 | } 36 | return 0 37 | } 38 | 39 | // LessThan checks if a version is less than another 40 | func LessThan(v, other string) bool { 41 | return compare(v, other) == -1 42 | } 43 | 44 | // LessThanOrEqualTo checks if a version is less than or equal to another 45 | func LessThanOrEqualTo(v, other string) bool { 46 | return compare(v, other) <= 0 47 | } 48 | 49 | // GreaterThan checks if a version is greater than another 50 | func GreaterThan(v, other string) bool { 51 | return compare(v, other) == 1 52 | } 53 | 54 | // GreaterThanOrEqualTo checks if a version is greater than or equal to another 55 | func GreaterThanOrEqualTo(v, other string) bool { 56 | return compare(v, other) >= 0 57 | } 58 | 59 | // Equal checks if a version is equal to another 60 | func Equal(v, other string) bool { 61 | return compare(v, other) == 0 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/volume/volumes_create.go: -------------------------------------------------------------------------------- 1 | package volume // import "github.com/docker/docker/api/types/volume" 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // VolumesCreateBody volumes create body 11 | // swagger:model VolumesCreateBody 12 | type VolumesCreateBody struct { 13 | 14 | // Name of the volume driver to use. 15 | // Required: true 16 | Driver string `json:"Driver"` 17 | 18 | // A mapping of driver options and values. These options are passed directly to the driver and are driver specific. 19 | // Required: true 20 | DriverOpts map[string]string `json:"DriverOpts"` 21 | 22 | // User-defined key/value metadata. 23 | // Required: true 24 | Labels map[string]string `json:"Labels"` 25 | 26 | // The new volume's name. If not specified, Docker generates a name. 27 | // Required: true 28 | Name string `json:"Name"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/volume/volumes_list.go: -------------------------------------------------------------------------------- 1 | package volume // import "github.com/docker/docker/api/types/volume" 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | import "github.com/docker/docker/api/types" 11 | 12 | // VolumesListOKBody volumes list o k body 13 | // swagger:model VolumesListOKBody 14 | type VolumesListOKBody struct { 15 | 16 | // List of volumes 17 | // Required: true 18 | Volumes []*types.Volume `json:"Volumes"` 19 | 20 | // Warnings that occurred when fetching the list of volumes 21 | // Required: true 22 | Warnings []string `json:"Warnings"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/README.md: -------------------------------------------------------------------------------- 1 | # Go client for the Docker Engine API 2 | 3 | The `docker` command uses this package to communicate with the daemon. It can also be used by your own Go applications to do anything the command-line interface does – running containers, pulling images, managing swarms, etc. 4 | 5 | For example, to list running containers (the equivalent of `docker ps`): 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "context" 12 | "fmt" 13 | 14 | "github.com/docker/docker/api/types" 15 | "github.com/docker/docker/client" 16 | ) 17 | 18 | func main() { 19 | cli, err := client.NewEnvClient() 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{}) 25 | if err != nil { 26 | panic(err) 27 | } 28 | 29 | for _, container := range containers { 30 | fmt.Printf("%s %s\n", container.ID[:10], container.Image) 31 | } 32 | } 33 | ``` 34 | 35 | [Full documentation is available on GoDoc.](https://godoc.org/github.com/docker/docker/client) 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/build_prune.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // BuildCachePrune requests the daemon to delete unused cache data 12 | func (cli *Client) BuildCachePrune(ctx context.Context) (*types.BuildCachePruneReport, error) { 13 | if err := cli.NewVersionError("1.31", "build prune"); err != nil { 14 | return nil, err 15 | } 16 | 17 | report := types.BuildCachePruneReport{} 18 | 19 | serverResp, err := cli.post(ctx, "/build/prune", nil, nil, nil) 20 | if err != nil { 21 | return nil, err 22 | } 23 | defer ensureReaderClosed(serverResp) 24 | 25 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 26 | return nil, fmt.Errorf("Error retrieving disk usage: %v", err) 27 | } 28 | 29 | return &report, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // CheckpointCreate creates a checkpoint from the given container with the given name 9 | func (cli *Client) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error { 10 | resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_delete.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // CheckpointDelete deletes the checkpoint with the given name from the given container 11 | func (cli *Client) CheckpointDelete(ctx context.Context, containerID string, options types.CheckpointDeleteOptions) error { 12 | query := url.Values{} 13 | if options.CheckpointDir != "" { 14 | query.Set("dir", options.CheckpointDir) 15 | } 16 | 17 | resp, err := cli.delete(ctx, "/containers/"+containerID+"/checkpoints/"+options.CheckpointID, query, nil) 18 | ensureReaderClosed(resp) 19 | return err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // CheckpointList returns the checkpoints of the given container in the docker host 12 | func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) { 13 | var checkpoints []types.Checkpoint 14 | 15 | query := url.Values{} 16 | if options.CheckpointDir != "" { 17 | query.Set("dir", options.CheckpointDir) 18 | } 19 | 20 | resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil) 21 | if err != nil { 22 | return checkpoints, wrapResponseError(err, resp, "container", container) 23 | } 24 | 25 | err = json.NewDecoder(resp.body).Decode(&checkpoints) 26 | ensureReaderClosed(resp) 27 | return checkpoints, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/client_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd openbsd darwin 2 | 3 | package client // import "github.com/docker/docker/client" 4 | 5 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 6 | const DefaultDockerHost = "unix:///var/run/docker.sock" 7 | 8 | const defaultProto = "unix" 9 | const defaultAddr = "/var/run/docker.sock" 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/client_windows.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 4 | const DefaultDockerHost = "npipe:////./pipe/docker_engine" 5 | 6 | const defaultProto = "npipe" 7 | const defaultAddr = "//./pipe/docker_engine" 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ConfigCreate creates a new Config. 12 | func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { 13 | var response types.ConfigCreateResponse 14 | if err := cli.NewVersionError("1.30", "config create"); err != nil { 15 | return response, err 16 | } 17 | resp, err := cli.post(ctx, "/configs/create", nil, config, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | err = json.NewDecoder(resp.body).Decode(&response) 23 | ensureReaderClosed(resp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ConfigInspectWithRaw returns the config information with raw data 13 | func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) { 14 | if id == "" { 15 | return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id} 16 | } 17 | if err := cli.NewVersionError("1.30", "config inspect"); err != nil { 18 | return swarm.Config{}, nil, err 19 | } 20 | resp, err := cli.get(ctx, "/configs/"+id, nil, nil) 21 | if err != nil { 22 | return swarm.Config{}, nil, wrapResponseError(err, resp, "config", id) 23 | } 24 | defer ensureReaderClosed(resp) 25 | 26 | body, err := ioutil.ReadAll(resp.body) 27 | if err != nil { 28 | return swarm.Config{}, nil, err 29 | } 30 | 31 | var config swarm.Config 32 | rdr := bytes.NewReader(body) 33 | err = json.NewDecoder(rdr).Decode(&config) 34 | 35 | return config, body, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ConfigList returns the list of configs. 14 | func (cli *Client) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { 15 | if err := cli.NewVersionError("1.30", "config list"); err != nil { 16 | return nil, err 17 | } 18 | query := url.Values{} 19 | 20 | if options.Filters.Len() > 0 { 21 | filterJSON, err := filters.ToJSON(options.Filters) 22 | if err != nil { 23 | return nil, err 24 | } 25 | 26 | query.Set("filters", filterJSON) 27 | } 28 | 29 | resp, err := cli.get(ctx, "/configs", query, nil) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | var configs []swarm.Config 35 | err = json.NewDecoder(resp.body).Decode(&configs) 36 | ensureReaderClosed(resp) 37 | return configs, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ConfigRemove removes a Config. 6 | func (cli *Client) ConfigRemove(ctx context.Context, id string) error { 7 | if err := cli.NewVersionError("1.30", "config remove"); err != nil { 8 | return err 9 | } 10 | resp, err := cli.delete(ctx, "/configs/"+id, nil, nil) 11 | ensureReaderClosed(resp) 12 | return wrapResponseError(err, resp, "config", id) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ConfigUpdate attempts to update a Config 12 | func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { 13 | if err := cli.NewVersionError("1.30", "config update"); err != nil { 14 | return err 15 | } 16 | query := url.Values{} 17 | query.Set("version", strconv.FormatUint(version.Index, 10)) 18 | resp, err := cli.post(ctx, "/configs/"+id+"/update", query, config, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_commit.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | "net/url" 7 | 8 | "github.com/docker/distribution/reference" 9 | "github.com/docker/docker/api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ContainerCommit applies changes into a container and creates a new tagged image. 14 | func (cli *Client) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) { 15 | var repository, tag string 16 | if options.Reference != "" { 17 | ref, err := reference.ParseNormalizedNamed(options.Reference) 18 | if err != nil { 19 | return types.IDResponse{}, err 20 | } 21 | 22 | if _, isCanonical := ref.(reference.Canonical); isCanonical { 23 | return types.IDResponse{}, errors.New("refusing to create a tag with a digest reference") 24 | } 25 | ref = reference.TagNameOnly(ref) 26 | 27 | if tagged, ok := ref.(reference.Tagged); ok { 28 | tag = tagged.Tag() 29 | } 30 | repository = reference.FamiliarName(ref) 31 | } 32 | 33 | query := url.Values{} 34 | query.Set("container", container) 35 | query.Set("repo", repository) 36 | query.Set("tag", tag) 37 | query.Set("comment", options.Comment) 38 | query.Set("author", options.Author) 39 | for _, change := range options.Changes { 40 | query.Add("changes", change) 41 | } 42 | if !options.Pause { 43 | query.Set("pause", "0") 44 | } 45 | 46 | var response types.IDResponse 47 | resp, err := cli.post(ctx, "/commit", query, options.Config, nil) 48 | if err != nil { 49 | return response, err 50 | } 51 | 52 | err = json.NewDecoder(resp.body).Decode(&response) 53 | ensureReaderClosed(resp) 54 | return response, err 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | "strings" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | "github.com/docker/docker/api/types/network" 10 | "github.com/docker/docker/api/types/versions" 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | type configWrapper struct { 15 | *container.Config 16 | HostConfig *container.HostConfig 17 | NetworkingConfig *network.NetworkingConfig 18 | } 19 | 20 | // ContainerCreate creates a new container based in the given configuration. 21 | // It can be associated with a name, but it's not mandatory. 22 | func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) { 23 | var response container.ContainerCreateCreatedBody 24 | 25 | if err := cli.NewVersionError("1.25", "stop timeout"); config != nil && config.StopTimeout != nil && err != nil { 26 | return response, err 27 | } 28 | 29 | // When using API 1.24 and under, the client is responsible for removing the container 30 | if hostConfig != nil && versions.LessThan(cli.ClientVersion(), "1.25") { 31 | hostConfig.AutoRemove = false 32 | } 33 | 34 | query := url.Values{} 35 | if containerName != "" { 36 | query.Set("name", containerName) 37 | } 38 | 39 | body := configWrapper{ 40 | Config: config, 41 | HostConfig: hostConfig, 42 | NetworkingConfig: networkingConfig, 43 | } 44 | 45 | serverResp, err := cli.post(ctx, "/containers/create", query, body, nil) 46 | if err != nil { 47 | if serverResp.statusCode == 404 && strings.Contains(err.Error(), "No such image") { 48 | return response, objectNotFoundError{object: "image", id: config.Image} 49 | } 50 | return response, err 51 | } 52 | 53 | err = json.NewDecoder(serverResp.body).Decode(&response) 54 | ensureReaderClosed(serverResp) 55 | return response, err 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_diff.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/container" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerDiff shows differences in a container filesystem since it was started. 12 | func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]container.ContainerChangeResponseItem, error) { 13 | var changes []container.ContainerChangeResponseItem 14 | 15 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil) 16 | if err != nil { 17 | return changes, err 18 | } 19 | 20 | err = json.NewDecoder(serverResp.body).Decode(&changes) 21 | ensureReaderClosed(serverResp) 22 | return changes, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_export.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerExport retrieves the raw contents of a container 11 | // and returns them as an io.ReadCloser. It's up to the caller 12 | // to close the stream. 13 | func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) { 14 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return serverResp.body, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ContainerInspect returns the container information. 14 | func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) { 15 | if containerID == "" { 16 | return types.ContainerJSON{}, objectNotFoundError{object: "container", id: containerID} 17 | } 18 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", nil, nil) 19 | if err != nil { 20 | return types.ContainerJSON{}, wrapResponseError(err, serverResp, "container", containerID) 21 | } 22 | 23 | var response types.ContainerJSON 24 | err = json.NewDecoder(serverResp.body).Decode(&response) 25 | ensureReaderClosed(serverResp) 26 | return response, err 27 | } 28 | 29 | // ContainerInspectWithRaw returns the container information and its raw representation. 30 | func (cli *Client) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) { 31 | if containerID == "" { 32 | return types.ContainerJSON{}, nil, objectNotFoundError{object: "container", id: containerID} 33 | } 34 | query := url.Values{} 35 | if getSize { 36 | query.Set("size", "1") 37 | } 38 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", query, nil) 39 | if err != nil { 40 | return types.ContainerJSON{}, nil, wrapResponseError(err, serverResp, "container", containerID) 41 | } 42 | defer ensureReaderClosed(serverResp) 43 | 44 | body, err := ioutil.ReadAll(serverResp.body) 45 | if err != nil { 46 | return types.ContainerJSON{}, nil, err 47 | } 48 | 49 | var response types.ContainerJSON 50 | rdr := bytes.NewReader(body) 51 | err = json.NewDecoder(rdr).Decode(&response) 52 | return response, body, err 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_kill.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerKill terminates the container process but does not remove the container from the docker host. 10 | func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { 11 | query := url.Values{} 12 | query.Set("signal", signal) 13 | 14 | resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) 15 | ensureReaderClosed(resp) 16 | return err 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/filters" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ContainerList returns the list of containers in the docker host. 14 | func (cli *Client) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { 15 | query := url.Values{} 16 | 17 | if options.All { 18 | query.Set("all", "1") 19 | } 20 | 21 | if options.Limit != -1 { 22 | query.Set("limit", strconv.Itoa(options.Limit)) 23 | } 24 | 25 | if options.Since != "" { 26 | query.Set("since", options.Since) 27 | } 28 | 29 | if options.Before != "" { 30 | query.Set("before", options.Before) 31 | } 32 | 33 | if options.Size { 34 | query.Set("size", "1") 35 | } 36 | 37 | if options.Filters.Len() > 0 { 38 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 39 | 40 | if err != nil { 41 | return nil, err 42 | } 43 | 44 | query.Set("filters", filterJSON) 45 | } 46 | 47 | resp, err := cli.get(ctx, "/containers/json", query, nil) 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | var containers []types.Container 53 | err = json.NewDecoder(resp.body).Decode(&containers) 54 | ensureReaderClosed(resp) 55 | return containers, err 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_pause.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ContainerPause pauses the main process of a given container without terminating it. 6 | func (cli *Client) ContainerPause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_prune.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ContainersPrune requests the daemon to delete unused data 13 | func (cli *Client) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) { 14 | var report types.ContainersPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "container prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/containers/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving disk usage: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerRemove kills and removes a container from the docker host. 11 | func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error { 12 | query := url.Values{} 13 | if options.RemoveVolumes { 14 | query.Set("v", "1") 15 | } 16 | if options.RemoveLinks { 17 | query.Set("link", "1") 18 | } 19 | 20 | if options.Force { 21 | query.Set("force", "1") 22 | } 23 | 24 | resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil) 25 | ensureReaderClosed(resp) 26 | return wrapResponseError(err, resp, "container", containerID) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_rename.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerRename changes the name of a given container. 10 | func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error { 11 | query := url.Values{} 12 | query.Set("name", newContainerName) 13 | resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil) 14 | ensureReaderClosed(resp) 15 | return err 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_resize.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerResize changes the size of the tty for a container. 12 | func (cli *Client) ContainerResize(ctx context.Context, containerID string, options types.ResizeOptions) error { 13 | return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width) 14 | } 15 | 16 | // ContainerExecResize changes the size of the tty for an exec process running inside a container. 17 | func (cli *Client) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { 18 | return cli.resize(ctx, "/exec/"+execID, options.Height, options.Width) 19 | } 20 | 21 | func (cli *Client) resize(ctx context.Context, basePath string, height, width uint) error { 22 | query := url.Values{} 23 | query.Set("h", strconv.Itoa(int(height))) 24 | query.Set("w", strconv.Itoa(int(width))) 25 | 26 | resp, err := cli.post(ctx, basePath+"/resize", query, nil, nil) 27 | ensureReaderClosed(resp) 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_restart.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/docker/api/types/time" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerRestart stops and starts a container again. 12 | // It makes the daemon to wait for the container to be up again for 13 | // a specific amount of time, given the timeout. 14 | func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error { 15 | query := url.Values{} 16 | if timeout != nil { 17 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 18 | } 19 | resp, err := cli.post(ctx, "/containers/"+containerID+"/restart", query, nil, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_start.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // ContainerStart sends a request to the docker daemon to start a container. 12 | func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { 13 | query := url.Values{} 14 | if len(options.CheckpointID) != 0 { 15 | query.Set("checkpoint", options.CheckpointID) 16 | } 17 | if len(options.CheckpointDir) != 0 { 18 | query.Set("checkpoint-dir", options.CheckpointDir) 19 | } 20 | 21 | resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) 22 | ensureReaderClosed(resp) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_stats.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerStats returns near realtime stats for a given container. 11 | // It's up to the caller to close the io.ReadCloser returned. 12 | func (cli *Client) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error) { 13 | query := url.Values{} 14 | query.Set("stream", "0") 15 | if stream { 16 | query.Set("stream", "1") 17 | } 18 | 19 | resp, err := cli.get(ctx, "/containers/"+containerID+"/stats", query, nil) 20 | if err != nil { 21 | return types.ContainerStats{}, err 22 | } 23 | 24 | osType := getDockerOS(resp.header.Get("Server")) 25 | return types.ContainerStats{Body: resp.body, OSType: osType}, err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_stop.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/docker/api/types/time" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerStop stops a container without terminating the process. 12 | // The process is blocked until the container stops or the timeout expires. 13 | func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error { 14 | query := url.Values{} 15 | if timeout != nil { 16 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 17 | } 18 | resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_top.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | "strings" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ContainerTop shows process information from within a container. 13 | func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (container.ContainerTopOKBody, error) { 14 | var response container.ContainerTopOKBody 15 | query := url.Values{} 16 | if len(arguments) > 0 { 17 | query.Set("ps_args", strings.Join(arguments, " ")) 18 | } 19 | 20 | resp, err := cli.get(ctx, "/containers/"+containerID+"/top", query, nil) 21 | if err != nil { 22 | return response, err 23 | } 24 | 25 | err = json.NewDecoder(resp.body).Decode(&response) 26 | ensureReaderClosed(resp) 27 | return response, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_unpause.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ContainerUnpause resumes the process execution within a container 6 | func (cli *Client) ContainerUnpause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/container" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerUpdate updates resources of a container 11 | func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { 12 | var response container.ContainerUpdateOKBody 13 | serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil) 14 | if err != nil { 15 | return response, err 16 | } 17 | 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | 20 | ensureReaderClosed(serverResp) 21 | return response, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/disk_usage.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // DiskUsage requests the current data usage from the daemon 12 | func (cli *Client) DiskUsage(ctx context.Context) (types.DiskUsage, error) { 13 | var du types.DiskUsage 14 | 15 | serverResp, err := cli.get(ctx, "/system/df", nil, nil) 16 | if err != nil { 17 | return du, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&du); err != nil { 22 | return du, fmt.Errorf("Error retrieving disk usage: %v", err) 23 | } 24 | 25 | return du, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/distribution_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | registrytypes "github.com/docker/docker/api/types/registry" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // DistributionInspect returns the image digest with full Manifest 12 | func (cli *Client) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registrytypes.DistributionInspect, error) { 13 | // Contact the registry to retrieve digest and platform information 14 | var distributionInspect registrytypes.DistributionInspect 15 | if image == "" { 16 | return distributionInspect, objectNotFoundError{object: "distribution", id: image} 17 | } 18 | 19 | if err := cli.NewVersionError("1.30", "distribution inspect"); err != nil { 20 | return distributionInspect, err 21 | } 22 | var headers map[string][]string 23 | 24 | if encodedRegistryAuth != "" { 25 | headers = map[string][]string{ 26 | "X-Registry-Auth": {encodedRegistryAuth}, 27 | } 28 | } 29 | 30 | resp, err := cli.get(ctx, "/distribution/"+image+"/json", url.Values{}, headers) 31 | if err != nil { 32 | return distributionInspect, err 33 | } 34 | 35 | err = json.NewDecoder(resp.body).Decode(&distributionInspect) 36 | ensureReaderClosed(resp) 37 | return distributionInspect, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "strings" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/distribution/reference" 11 | "github.com/docker/docker/api/types" 12 | ) 13 | 14 | // ImageCreate creates a new image based in the parent options. 15 | // It returns the JSON content in the response body. 16 | func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { 17 | ref, err := reference.ParseNormalizedNamed(parentReference) 18 | if err != nil { 19 | return nil, err 20 | } 21 | 22 | query := url.Values{} 23 | query.Set("fromImage", reference.FamiliarName(ref)) 24 | query.Set("tag", getAPITagFromNamedRef(ref)) 25 | if options.Platform != "" { 26 | query.Set("platform", strings.ToLower(options.Platform)) 27 | } 28 | resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) 29 | if err != nil { 30 | return nil, err 31 | } 32 | return resp.body, nil 33 | } 34 | 35 | func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { 36 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 37 | return cli.post(ctx, "/images/create", query, nil, headers) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_history.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/image" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageHistory returns the changes in an image in history format. 12 | func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) { 13 | var history []image.HistoryResponseItem 14 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil) 15 | if err != nil { 16 | return history, err 17 | } 18 | 19 | err = json.NewDecoder(serverResp.body).Decode(&history) 20 | ensureReaderClosed(serverResp) 21 | return history, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_import.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "strings" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/distribution/reference" 11 | "github.com/docker/docker/api/types" 12 | ) 13 | 14 | // ImageImport creates a new image based in the source options. 15 | // It returns the JSON content in the response body. 16 | func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { 17 | if ref != "" { 18 | //Check if the given image name can be resolved 19 | if _, err := reference.ParseNormalizedNamed(ref); err != nil { 20 | return nil, err 21 | } 22 | } 23 | 24 | query := url.Values{} 25 | query.Set("fromSrc", source.SourceName) 26 | query.Set("repo", ref) 27 | query.Set("tag", options.Tag) 28 | query.Set("message", options.Message) 29 | if options.Platform != "" { 30 | query.Set("platform", strings.ToLower(options.Platform)) 31 | } 32 | for _, change := range options.Changes { 33 | query.Add("changes", change) 34 | } 35 | 36 | resp, err := cli.postRaw(ctx, "/images/create", query, source.Source, nil) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return resp.body, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ImageInspectWithRaw returns the image information and its raw representation. 13 | func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) { 14 | if imageID == "" { 15 | return types.ImageInspect{}, nil, objectNotFoundError{object: "image", id: imageID} 16 | } 17 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil) 18 | if err != nil { 19 | return types.ImageInspect{}, nil, wrapResponseError(err, serverResp, "image", imageID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return types.ImageInspect{}, nil, err 26 | } 27 | 28 | var response types.ImageInspect 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/versions" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ImageList returns a list of images in the docker host. 14 | func (cli *Client) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { 15 | var images []types.ImageSummary 16 | query := url.Values{} 17 | 18 | optionFilters := options.Filters 19 | referenceFilters := optionFilters.Get("reference") 20 | if versions.LessThan(cli.version, "1.25") && len(referenceFilters) > 0 { 21 | query.Set("filter", referenceFilters[0]) 22 | for _, filterValue := range referenceFilters { 23 | optionFilters.Del("reference", filterValue) 24 | } 25 | } 26 | if optionFilters.Len() > 0 { 27 | filterJSON, err := filters.ToParamWithVersion(cli.version, optionFilters) 28 | if err != nil { 29 | return images, err 30 | } 31 | query.Set("filters", filterJSON) 32 | } 33 | if options.All { 34 | query.Set("all", "1") 35 | } 36 | 37 | serverResp, err := cli.get(ctx, "/images/json", query, nil) 38 | if err != nil { 39 | return images, err 40 | } 41 | 42 | err = json.NewDecoder(serverResp.body).Decode(&images) 43 | ensureReaderClosed(serverResp) 44 | return images, err 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_load.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "github.com/docker/docker/api/types" 10 | ) 11 | 12 | // ImageLoad loads an image in the docker host from the client host. 13 | // It's up to the caller to close the io.ReadCloser in the 14 | // ImageLoadResponse returned by this function. 15 | func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { 16 | v := url.Values{} 17 | v.Set("quiet", "0") 18 | if quiet { 19 | v.Set("quiet", "1") 20 | } 21 | headers := map[string][]string{"Content-Type": {"application/x-tar"}} 22 | resp, err := cli.postRaw(ctx, "/images/load", v, input, headers) 23 | if err != nil { 24 | return types.ImageLoadResponse{}, err 25 | } 26 | return types.ImageLoadResponse{ 27 | Body: resp.body, 28 | JSON: resp.header.Get("Content-Type") == "application/json", 29 | }, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_prune.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ImagesPrune requests the daemon to delete unused data 13 | func (cli *Client) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (types.ImagesPruneReport, error) { 14 | var report types.ImagesPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "image prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/images/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving disk usage: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_push.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | "net/http" 7 | "net/url" 8 | 9 | "golang.org/x/net/context" 10 | 11 | "github.com/docker/distribution/reference" 12 | "github.com/docker/docker/api/types" 13 | ) 14 | 15 | // ImagePush requests the docker host to push an image to a remote registry. 16 | // It executes the privileged function if the operation is unauthorized 17 | // and it tries one more time. 18 | // It's up to the caller to handle the io.ReadCloser and close it properly. 19 | func (cli *Client) ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error) { 20 | ref, err := reference.ParseNormalizedNamed(image) 21 | if err != nil { 22 | return nil, err 23 | } 24 | 25 | if _, isCanonical := ref.(reference.Canonical); isCanonical { 26 | return nil, errors.New("cannot push a digest reference") 27 | } 28 | 29 | tag := "" 30 | name := reference.FamiliarName(ref) 31 | 32 | if nameTaggedRef, isNamedTagged := ref.(reference.NamedTagged); isNamedTagged { 33 | tag = nameTaggedRef.Tag() 34 | } 35 | 36 | query := url.Values{} 37 | query.Set("tag", tag) 38 | 39 | resp, err := cli.tryImagePush(ctx, name, query, options.RegistryAuth) 40 | if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { 41 | newAuthHeader, privilegeErr := options.PrivilegeFunc() 42 | if privilegeErr != nil { 43 | return nil, privilegeErr 44 | } 45 | resp, err = cli.tryImagePush(ctx, name, query, newAuthHeader) 46 | } 47 | if err != nil { 48 | return nil, err 49 | } 50 | return resp.body, nil 51 | } 52 | 53 | func (cli *Client) tryImagePush(ctx context.Context, imageID string, query url.Values, registryAuth string) (serverResponse, error) { 54 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 55 | return cli.post(ctx, "/images/"+imageID+"/push", query, nil, headers) 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageRemove removes an image from the docker host. 12 | func (cli *Client) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) { 13 | query := url.Values{} 14 | 15 | if options.Force { 16 | query.Set("force", "1") 17 | } 18 | if !options.PruneChildren { 19 | query.Set("noprune", "1") 20 | } 21 | 22 | var dels []types.ImageDeleteResponseItem 23 | resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) 24 | if err != nil { 25 | return dels, wrapResponseError(err, resp, "image", imageID) 26 | } 27 | 28 | err = json.NewDecoder(resp.body).Decode(&dels) 29 | ensureReaderClosed(resp) 30 | return dels, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_save.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ImageSave retrieves one or more images from the docker host as an io.ReadCloser. 11 | // It's up to the caller to store the images and close the stream. 12 | func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) { 13 | query := url.Values{ 14 | "names": imageIDs, 15 | } 16 | 17 | resp, err := cli.get(ctx, "/images/get", query, nil) 18 | if err != nil { 19 | return nil, err 20 | } 21 | return resp.body, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_search.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | "github.com/docker/docker/api/types/filters" 11 | "github.com/docker/docker/api/types/registry" 12 | "golang.org/x/net/context" 13 | ) 14 | 15 | // ImageSearch makes the docker host to search by a term in a remote registry. 16 | // The list of results is not sorted in any fashion. 17 | func (cli *Client) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) { 18 | var results []registry.SearchResult 19 | query := url.Values{} 20 | query.Set("term", term) 21 | query.Set("limit", fmt.Sprintf("%d", options.Limit)) 22 | 23 | if options.Filters.Len() > 0 { 24 | filterJSON, err := filters.ToJSON(options.Filters) 25 | if err != nil { 26 | return results, err 27 | } 28 | query.Set("filters", filterJSON) 29 | } 30 | 31 | resp, err := cli.tryImageSearch(ctx, query, options.RegistryAuth) 32 | if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { 33 | newAuthHeader, privilegeErr := options.PrivilegeFunc() 34 | if privilegeErr != nil { 35 | return results, privilegeErr 36 | } 37 | resp, err = cli.tryImageSearch(ctx, query, newAuthHeader) 38 | } 39 | if err != nil { 40 | return results, err 41 | } 42 | 43 | err = json.NewDecoder(resp.body).Decode(&results) 44 | ensureReaderClosed(resp) 45 | return results, err 46 | } 47 | 48 | func (cli *Client) tryImageSearch(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { 49 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 50 | return cli.get(ctx, "/images/search", query, headers) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_tag.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/distribution/reference" 7 | "github.com/pkg/errors" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageTag tags an image in the docker host 12 | func (cli *Client) ImageTag(ctx context.Context, source, target string) error { 13 | if _, err := reference.ParseAnyReference(source); err != nil { 14 | return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", source) 15 | } 16 | 17 | ref, err := reference.ParseNormalizedNamed(target) 18 | if err != nil { 19 | return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", target) 20 | } 21 | 22 | if _, isCanonical := ref.(reference.Canonical); isCanonical { 23 | return errors.New("refusing to create a tag with a digest reference") 24 | } 25 | 26 | ref = reference.TagNameOnly(ref) 27 | 28 | query := url.Values{} 29 | query.Set("repo", reference.FamiliarName(ref)) 30 | if tagged, ok := ref.(reference.Tagged); ok { 31 | query.Set("tag", tagged.Tag()) 32 | } 33 | 34 | resp, err := cli.post(ctx, "/images/"+source+"/tag", query, nil, nil) 35 | ensureReaderClosed(resp) 36 | return err 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/info.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // Info returns information about the docker server. 13 | func (cli *Client) Info(ctx context.Context) (types.Info, error) { 14 | var info types.Info 15 | serverResp, err := cli.get(ctx, "/info", url.Values{}, nil) 16 | if err != nil { 17 | return info, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&info); err != nil { 22 | return info, fmt.Errorf("Error reading remote info: %v", err) 23 | } 24 | 25 | return info, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/interface_experimental.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | type apiClientExperimental interface { 9 | CheckpointAPIClient 10 | } 11 | 12 | // CheckpointAPIClient defines API client methods for the checkpoints 13 | type CheckpointAPIClient interface { 14 | CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error 15 | CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error 16 | CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/interface_stable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | // APIClient is an interface that clients that talk with a docker server must implement. 4 | type APIClient interface { 5 | CommonAPIClient 6 | apiClientExperimental 7 | } 8 | 9 | // Ensure that Client always implements APIClient. 10 | var _ APIClient = &Client{} 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/login.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/registry" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // RegistryLogin authenticates the docker server with a given docker registry. 14 | // It returns unauthorizedError when the authentication fails. 15 | func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { 16 | resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil) 17 | 18 | if resp.statusCode == http.StatusUnauthorized { 19 | return registry.AuthenticateOKBody{}, unauthorizedError{err} 20 | } 21 | if err != nil { 22 | return registry.AuthenticateOKBody{}, err 23 | } 24 | 25 | var response registry.AuthenticateOKBody 26 | err = json.NewDecoder(resp.body).Decode(&response) 27 | ensureReaderClosed(resp) 28 | return response, err 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_connect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "github.com/docker/docker/api/types/network" 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // NetworkConnect connects a container to an existent network in the docker host. 10 | func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error { 11 | nc := types.NetworkConnect{ 12 | Container: containerID, 13 | EndpointConfig: config, 14 | } 15 | resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // NetworkCreate creates a new network in the docker host. 11 | func (cli *Client) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { 12 | networkCreateRequest := types.NetworkCreateRequest{ 13 | NetworkCreate: options, 14 | Name: name, 15 | } 16 | var response types.NetworkCreateResponse 17 | serverResp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | json.NewDecoder(serverResp.body).Decode(&response) 23 | ensureReaderClosed(serverResp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_disconnect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // NetworkDisconnect disconnects a container from an existent network in the docker host. 9 | func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error { 10 | nd := types.NetworkDisconnect{Container: containerID, Force: force} 11 | resp, err := cli.post(ctx, "/networks/"+networkID+"/disconnect", nil, nd, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // NetworkInspect returns the information for a specific network configured in the docker host. 14 | func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error) { 15 | networkResource, _, err := cli.NetworkInspectWithRaw(ctx, networkID, options) 16 | return networkResource, err 17 | } 18 | 19 | // NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation. 20 | func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) { 21 | if networkID == "" { 22 | return types.NetworkResource{}, nil, objectNotFoundError{object: "network", id: networkID} 23 | } 24 | var ( 25 | networkResource types.NetworkResource 26 | resp serverResponse 27 | err error 28 | ) 29 | query := url.Values{} 30 | if options.Verbose { 31 | query.Set("verbose", "true") 32 | } 33 | if options.Scope != "" { 34 | query.Set("scope", options.Scope) 35 | } 36 | resp, err = cli.get(ctx, "/networks/"+networkID, query, nil) 37 | if err != nil { 38 | return networkResource, nil, wrapResponseError(err, resp, "network", networkID) 39 | } 40 | defer ensureReaderClosed(resp) 41 | 42 | body, err := ioutil.ReadAll(resp.body) 43 | if err != nil { 44 | return networkResource, nil, err 45 | } 46 | rdr := bytes.NewReader(body) 47 | err = json.NewDecoder(rdr).Decode(&networkResource) 48 | return networkResource, body, err 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // NetworkList returns the list of networks configured in the docker host. 13 | func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { 14 | query := url.Values{} 15 | if options.Filters.Len() > 0 { 16 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | query.Set("filters", filterJSON) 22 | } 23 | var networkResources []types.NetworkResource 24 | resp, err := cli.get(ctx, "/networks", query, nil) 25 | if err != nil { 26 | return networkResources, err 27 | } 28 | err = json.NewDecoder(resp.body).Decode(&networkResources) 29 | ensureReaderClosed(resp) 30 | return networkResources, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_prune.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // NetworksPrune requests the daemon to delete unused networks 13 | func (cli *Client) NetworksPrune(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error) { 14 | var report types.NetworksPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "network prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/networks/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving network prune report: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // NetworkRemove removes an existent network from the docker host. 6 | func (cli *Client) NetworkRemove(ctx context.Context, networkID string) error { 7 | resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return wrapResponseError(err, resp, "network", networkID) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // NodeInspectWithRaw returns the node information. 13 | func (cli *Client) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { 14 | if nodeID == "" { 15 | return swarm.Node{}, nil, objectNotFoundError{object: "node", id: nodeID} 16 | } 17 | serverResp, err := cli.get(ctx, "/nodes/"+nodeID, nil, nil) 18 | if err != nil { 19 | return swarm.Node{}, nil, wrapResponseError(err, serverResp, "node", nodeID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return swarm.Node{}, nil, err 26 | } 27 | 28 | var response swarm.Node 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // NodeList returns the list of nodes. 14 | func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | query.Set("filters", filterJSON) 25 | } 26 | 27 | resp, err := cli.get(ctx, "/nodes", query, nil) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | var nodes []swarm.Node 33 | err = json.NewDecoder(resp.body).Decode(&nodes) 34 | ensureReaderClosed(resp) 35 | return nodes, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // NodeRemove removes a Node. 12 | func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { 13 | query := url.Values{} 14 | if options.Force { 15 | query.Set("force", "1") 16 | } 17 | 18 | resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) 19 | ensureReaderClosed(resp) 20 | return wrapResponseError(err, resp, "node", nodeID) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // NodeUpdate updates a Node. 12 | func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { 13 | query := url.Values{} 14 | query.Set("version", strconv.FormatUint(version.Index, 10)) 15 | resp, err := cli.post(ctx, "/nodes/"+nodeID+"/update", query, node, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/ping.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "path" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // Ping pings the server and returns the value of the "Docker-Experimental", "OS-Type" & "API-Version" headers 11 | func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { 12 | var ping types.Ping 13 | req, err := cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil) 14 | if err != nil { 15 | return ping, err 16 | } 17 | serverResp, err := cli.doRequest(ctx, req) 18 | if err != nil { 19 | return ping, err 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | if serverResp.header != nil { 24 | ping.APIVersion = serverResp.header.Get("API-Version") 25 | 26 | if serverResp.header.Get("Docker-Experimental") == "true" { 27 | ping.Experimental = true 28 | } 29 | ping.OSType = serverResp.header.Get("OSType") 30 | } 31 | return ping, cli.checkResponseErr(serverResp) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // PluginCreate creates a plugin 13 | func (cli *Client) PluginCreate(ctx context.Context, createContext io.Reader, createOptions types.PluginCreateOptions) error { 14 | headers := http.Header(make(map[string][]string)) 15 | headers.Set("Content-Type", "application/x-tar") 16 | 17 | query := url.Values{} 18 | query.Set("name", createOptions.RepoName) 19 | 20 | resp, err := cli.postRaw(ctx, "/plugins/create", query, createContext, headers) 21 | if err != nil { 22 | return err 23 | } 24 | ensureReaderClosed(resp) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_disable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // PluginDisable disables a plugin 11 | func (cli *Client) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { 12 | query := url.Values{} 13 | if options.Force { 14 | query.Set("force", "1") 15 | } 16 | resp, err := cli.post(ctx, "/plugins/"+name+"/disable", query, nil, nil) 17 | ensureReaderClosed(resp) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_enable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // PluginEnable enables a plugin 12 | func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { 13 | query := url.Values{} 14 | query.Set("timeout", strconv.Itoa(options.Timeout)) 15 | 16 | resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil) 17 | ensureReaderClosed(resp) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // PluginInspectWithRaw inspects an existing plugin 13 | func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { 14 | if name == "" { 15 | return nil, nil, objectNotFoundError{object: "plugin", id: name} 16 | } 17 | resp, err := cli.get(ctx, "/plugins/"+name+"/json", nil, nil) 18 | if err != nil { 19 | return nil, nil, wrapResponseError(err, resp, "plugin", name) 20 | } 21 | 22 | defer ensureReaderClosed(resp) 23 | body, err := ioutil.ReadAll(resp.body) 24 | if err != nil { 25 | return nil, nil, err 26 | } 27 | var p types.Plugin 28 | rdr := bytes.NewReader(body) 29 | err = json.NewDecoder(rdr).Decode(&p) 30 | return &p, body, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // PluginList returns the installed plugins 13 | func (cli *Client) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) { 14 | var plugins types.PluginsListResponse 15 | query := url.Values{} 16 | 17 | if filter.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, filter) 19 | if err != nil { 20 | return plugins, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | resp, err := cli.get(ctx, "/plugins", query, nil) 25 | if err != nil { 26 | return plugins, wrapResponseError(err, resp, "plugin", "") 27 | } 28 | 29 | err = json.NewDecoder(resp.body).Decode(&plugins) 30 | ensureReaderClosed(resp) 31 | return plugins, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_push.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginPush pushes a plugin to a registry 10 | func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { 11 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 12 | resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers) 13 | if err != nil { 14 | return nil, err 15 | } 16 | return resp.body, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // PluginRemove removes a plugin 11 | func (cli *Client) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { 12 | query := url.Values{} 13 | if options.Force { 14 | query.Set("force", "1") 15 | } 16 | 17 | resp, err := cli.delete(ctx, "/plugins/"+name, query, nil) 18 | ensureReaderClosed(resp) 19 | return wrapResponseError(err, resp, "plugin", name) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_set.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "golang.org/x/net/context" 5 | ) 6 | 7 | // PluginSet modifies settings for an existing plugin 8 | func (cli *Client) PluginSet(ctx context.Context, name string, args []string) error { 9 | resp, err := cli.post(ctx, "/plugins/"+name+"/set", nil, args, nil) 10 | ensureReaderClosed(resp) 11 | return err 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_upgrade.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "github.com/docker/distribution/reference" 8 | "github.com/docker/docker/api/types" 9 | "github.com/pkg/errors" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // PluginUpgrade upgrades a plugin 14 | func (cli *Client) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (rc io.ReadCloser, err error) { 15 | if err := cli.NewVersionError("1.26", "plugin upgrade"); err != nil { 16 | return nil, err 17 | } 18 | query := url.Values{} 19 | if _, err := reference.ParseNormalizedNamed(options.RemoteRef); err != nil { 20 | return nil, errors.Wrap(err, "invalid remote reference") 21 | } 22 | query.Set("remote", options.RemoteRef) 23 | 24 | privileges, err := cli.checkPluginPermissions(ctx, query, options) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | resp, err := cli.tryPluginUpgrade(ctx, query, privileges, name, options.RegistryAuth) 30 | if err != nil { 31 | return nil, err 32 | } 33 | return resp.body, nil 34 | } 35 | 36 | func (cli *Client) tryPluginUpgrade(ctx context.Context, query url.Values, privileges types.PluginPrivileges, name, registryAuth string) (serverResponse, error) { 37 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 38 | return cli.post(ctx, "/plugins/"+name+"/upgrade", query, privileges, headers) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // SecretCreate creates a new Secret. 12 | func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { 13 | var response types.SecretCreateResponse 14 | if err := cli.NewVersionError("1.25", "secret create"); err != nil { 15 | return response, err 16 | } 17 | resp, err := cli.post(ctx, "/secrets/create", nil, secret, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | err = json.NewDecoder(resp.body).Decode(&response) 23 | ensureReaderClosed(resp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // SecretInspectWithRaw returns the secret information with raw data 13 | func (cli *Client) SecretInspectWithRaw(ctx context.Context, id string) (swarm.Secret, []byte, error) { 14 | if err := cli.NewVersionError("1.25", "secret inspect"); err != nil { 15 | return swarm.Secret{}, nil, err 16 | } 17 | if id == "" { 18 | return swarm.Secret{}, nil, objectNotFoundError{object: "secret", id: id} 19 | } 20 | resp, err := cli.get(ctx, "/secrets/"+id, nil, nil) 21 | if err != nil { 22 | return swarm.Secret{}, nil, wrapResponseError(err, resp, "secret", id) 23 | } 24 | defer ensureReaderClosed(resp) 25 | 26 | body, err := ioutil.ReadAll(resp.body) 27 | if err != nil { 28 | return swarm.Secret{}, nil, err 29 | } 30 | 31 | var secret swarm.Secret 32 | rdr := bytes.NewReader(body) 33 | err = json.NewDecoder(rdr).Decode(&secret) 34 | 35 | return secret, body, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // SecretList returns the list of secrets. 14 | func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { 15 | if err := cli.NewVersionError("1.25", "secret list"); err != nil { 16 | return nil, err 17 | } 18 | query := url.Values{} 19 | 20 | if options.Filters.Len() > 0 { 21 | filterJSON, err := filters.ToJSON(options.Filters) 22 | if err != nil { 23 | return nil, err 24 | } 25 | 26 | query.Set("filters", filterJSON) 27 | } 28 | 29 | resp, err := cli.get(ctx, "/secrets", query, nil) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | var secrets []swarm.Secret 35 | err = json.NewDecoder(resp.body).Decode(&secrets) 36 | ensureReaderClosed(resp) 37 | return secrets, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // SecretRemove removes a Secret. 6 | func (cli *Client) SecretRemove(ctx context.Context, id string) error { 7 | if err := cli.NewVersionError("1.25", "secret remove"); err != nil { 8 | return err 9 | } 10 | resp, err := cli.delete(ctx, "/secrets/"+id, nil, nil) 11 | ensureReaderClosed(resp) 12 | return wrapResponseError(err, resp, "secret", id) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // SecretUpdate attempts to update a Secret 12 | func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { 13 | if err := cli.NewVersionError("1.25", "secret update"); err != nil { 14 | return err 15 | } 16 | query := url.Values{} 17 | query.Set("version", strconv.FormatUint(version.Index, 10)) 18 | resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "io/ioutil" 8 | "net/url" 9 | 10 | "github.com/docker/docker/api/types" 11 | "github.com/docker/docker/api/types/swarm" 12 | "golang.org/x/net/context" 13 | ) 14 | 15 | // ServiceInspectWithRaw returns the service information and the raw data. 16 | func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error) { 17 | if serviceID == "" { 18 | return swarm.Service{}, nil, objectNotFoundError{object: "service", id: serviceID} 19 | } 20 | query := url.Values{} 21 | query.Set("insertDefaults", fmt.Sprintf("%v", opts.InsertDefaults)) 22 | serverResp, err := cli.get(ctx, "/services/"+serviceID, query, nil) 23 | if err != nil { 24 | return swarm.Service{}, nil, wrapResponseError(err, serverResp, "service", serviceID) 25 | } 26 | defer ensureReaderClosed(serverResp) 27 | 28 | body, err := ioutil.ReadAll(serverResp.body) 29 | if err != nil { 30 | return swarm.Service{}, nil, err 31 | } 32 | 33 | var response swarm.Service 34 | rdr := bytes.NewReader(body) 35 | err = json.NewDecoder(rdr).Decode(&response) 36 | return response, body, err 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ServiceList returns the list of services. 14 | func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/services", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var services []swarm.Service 32 | err = json.NewDecoder(resp.body).Decode(&services) 33 | ensureReaderClosed(resp) 34 | return services, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_logs.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "time" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/docker/api/types" 11 | timetypes "github.com/docker/docker/api/types/time" 12 | ) 13 | 14 | // ServiceLogs returns the logs generated by a service in an io.ReadCloser. 15 | // It's up to the caller to close the stream. 16 | func (cli *Client) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { 17 | query := url.Values{} 18 | if options.ShowStdout { 19 | query.Set("stdout", "1") 20 | } 21 | 22 | if options.ShowStderr { 23 | query.Set("stderr", "1") 24 | } 25 | 26 | if options.Since != "" { 27 | ts, err := timetypes.GetTimestamp(options.Since, time.Now()) 28 | if err != nil { 29 | return nil, err 30 | } 31 | query.Set("since", ts) 32 | } 33 | 34 | if options.Timestamps { 35 | query.Set("timestamps", "1") 36 | } 37 | 38 | if options.Details { 39 | query.Set("details", "1") 40 | } 41 | 42 | if options.Follow { 43 | query.Set("follow", "1") 44 | } 45 | query.Set("tail", options.Tail) 46 | 47 | resp, err := cli.get(ctx, "/services/"+serviceID+"/logs", query, nil) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return resp.body, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ServiceRemove kills and removes a service. 6 | func (cli *Client) ServiceRemove(ctx context.Context, serviceID string) error { 7 | resp, err := cli.delete(ctx, "/services/"+serviceID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return wrapResponseError(err, resp, "service", serviceID) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/session.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // DialSession returns a connection that can be used communication with daemon 11 | func (cli *Client) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) { 12 | req, err := http.NewRequest("POST", "/session", nil) 13 | if err != nil { 14 | return nil, err 15 | } 16 | req = cli.addHeaders(req, meta) 17 | 18 | return cli.setupHijackConn(req, proto) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_get_unlock_key.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // SwarmGetUnlockKey retrieves the swarm's unlock key. 11 | func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { 12 | serverResp, err := cli.get(ctx, "/swarm/unlockkey", nil, nil) 13 | if err != nil { 14 | return types.SwarmUnlockKeyResponse{}, err 15 | } 16 | 17 | var response types.SwarmUnlockKeyResponse 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_init.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // SwarmInit initializes the swarm. 11 | func (cli *Client) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { 12 | serverResp, err := cli.post(ctx, "/swarm/init", nil, req, nil) 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | var response string 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // SwarmInspect inspects the swarm. 11 | func (cli *Client) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { 12 | serverResp, err := cli.get(ctx, "/swarm", nil, nil) 13 | if err != nil { 14 | return swarm.Swarm{}, err 15 | } 16 | 17 | var response swarm.Swarm 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_join.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types/swarm" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // SwarmJoin joins the swarm. 9 | func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { 10 | resp, err := cli.post(ctx, "/swarm/join", nil, req, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_leave.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // SwarmLeave leaves the swarm. 10 | func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 11 | query := url.Values{} 12 | if force { 13 | query.Set("force", "1") 14 | } 15 | resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_unlock.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "github.com/docker/docker/api/types/swarm" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // SwarmUnlock unlocks locked swarm. 9 | func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { 10 | serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil) 11 | ensureReaderClosed(serverResp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // SwarmUpdate updates the swarm. 13 | func (cli *Client) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { 14 | query := url.Values{} 15 | query.Set("version", strconv.FormatUint(version.Index, 10)) 16 | query.Set("rotateWorkerToken", fmt.Sprintf("%v", flags.RotateWorkerToken)) 17 | query.Set("rotateManagerToken", fmt.Sprintf("%v", flags.RotateManagerToken)) 18 | query.Set("rotateManagerUnlockKey", fmt.Sprintf("%v", flags.RotateManagerUnlockKey)) 19 | resp, err := cli.post(ctx, "/swarm/update", query, swarm, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/task_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // TaskInspectWithRaw returns the task information and its raw representation.. 13 | func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { 14 | if taskID == "" { 15 | return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID} 16 | } 17 | serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil) 18 | if err != nil { 19 | return swarm.Task{}, nil, wrapResponseError(err, serverResp, "task", taskID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return swarm.Task{}, nil, err 26 | } 27 | 28 | var response swarm.Task 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/task_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // TaskList returns the list of tasks. 14 | func (cli *Client) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/tasks", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var tasks []swarm.Task 32 | err = json.NewDecoder(resp.body).Decode(&tasks) 33 | ensureReaderClosed(resp) 34 | return tasks, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/task_logs.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "time" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/docker/api/types" 11 | timetypes "github.com/docker/docker/api/types/time" 12 | ) 13 | 14 | // TaskLogs returns the logs generated by a task in an io.ReadCloser. 15 | // It's up to the caller to close the stream. 16 | func (cli *Client) TaskLogs(ctx context.Context, taskID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { 17 | query := url.Values{} 18 | if options.ShowStdout { 19 | query.Set("stdout", "1") 20 | } 21 | 22 | if options.ShowStderr { 23 | query.Set("stderr", "1") 24 | } 25 | 26 | if options.Since != "" { 27 | ts, err := timetypes.GetTimestamp(options.Since, time.Now()) 28 | if err != nil { 29 | return nil, err 30 | } 31 | query.Set("since", ts) 32 | } 33 | 34 | if options.Timestamps { 35 | query.Set("timestamps", "1") 36 | } 37 | 38 | if options.Details { 39 | query.Set("details", "1") 40 | } 41 | 42 | if options.Follow { 43 | query.Set("follow", "1") 44 | } 45 | query.Set("tail", options.Tail) 46 | 47 | resp, err := cli.get(ctx, "/tasks/"+taskID+"/logs", query, nil) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return resp.body, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/tlsconfig_clone.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package client // import "github.com/docker/docker/client" 4 | 5 | import "crypto/tls" 6 | 7 | // tlsConfigClone returns a clone of tls.Config. This function is provided for 8 | // compatibility for go1.7 that doesn't include this method in stdlib. 9 | func tlsConfigClone(c *tls.Config) *tls.Config { 10 | return c.Clone() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/tlsconfig_clone_go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7,!go1.8 2 | 3 | package client // import "github.com/docker/docker/client" 4 | 5 | import "crypto/tls" 6 | 7 | // tlsConfigClone returns a clone of tls.Config. This function is provided for 8 | // compatibility for go1.7 that doesn't include this method in stdlib. 9 | func tlsConfigClone(c *tls.Config) *tls.Config { 10 | return &tls.Config{ 11 | Rand: c.Rand, 12 | Time: c.Time, 13 | Certificates: c.Certificates, 14 | NameToCertificate: c.NameToCertificate, 15 | GetCertificate: c.GetCertificate, 16 | RootCAs: c.RootCAs, 17 | NextProtos: c.NextProtos, 18 | ServerName: c.ServerName, 19 | ClientAuth: c.ClientAuth, 20 | ClientCAs: c.ClientCAs, 21 | InsecureSkipVerify: c.InsecureSkipVerify, 22 | CipherSuites: c.CipherSuites, 23 | PreferServerCipherSuites: c.PreferServerCipherSuites, 24 | SessionTicketsDisabled: c.SessionTicketsDisabled, 25 | SessionTicketKey: c.SessionTicketKey, 26 | ClientSessionCache: c.ClientSessionCache, 27 | MinVersion: c.MinVersion, 28 | MaxVersion: c.MaxVersion, 29 | CurvePreferences: c.CurvePreferences, 30 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 31 | Renegotiation: c.Renegotiation, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/transport.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "crypto/tls" 5 | "net/http" 6 | ) 7 | 8 | // resolveTLSConfig attempts to resolve the TLS configuration from the 9 | // RoundTripper. 10 | func resolveTLSConfig(transport http.RoundTripper) *tls.Config { 11 | switch tr := transport.(type) { 12 | case *http.Transport: 13 | return tr.TLSClientConfig 14 | default: 15 | return nil 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/utils.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "regexp" 6 | 7 | "github.com/docker/docker/api/types/filters" 8 | ) 9 | 10 | var headerRegexp = regexp.MustCompile(`\ADocker/.+\s\((.+)\)\z`) 11 | 12 | // getDockerOS returns the operating system based on the server header from the daemon. 13 | func getDockerOS(serverHeader string) string { 14 | var osType string 15 | matches := headerRegexp.FindStringSubmatch(serverHeader) 16 | if len(matches) > 0 { 17 | osType = matches[1] 18 | } 19 | return osType 20 | } 21 | 22 | // getFiltersQuery returns a url query with "filters" query term, based on the 23 | // filters provided. 24 | func getFiltersQuery(f filters.Args) (url.Values, error) { 25 | query := url.Values{} 26 | if f.Len() > 0 { 27 | filterJSON, err := filters.ToJSON(f) 28 | if err != nil { 29 | return query, err 30 | } 31 | query.Set("filters", filterJSON) 32 | } 33 | return query, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/version.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ServerVersion returns information of the docker client and server host. 11 | func (cli *Client) ServerVersion(ctx context.Context) (types.Version, error) { 12 | resp, err := cli.get(ctx, "/version", nil, nil) 13 | if err != nil { 14 | return types.Version{}, err 15 | } 16 | 17 | var server types.Version 18 | err = json.NewDecoder(resp.body).Decode(&server) 19 | ensureReaderClosed(resp) 20 | return server, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | volumetypes "github.com/docker/docker/api/types/volume" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // VolumeCreate creates a volume in the docker host. 12 | func (cli *Client) VolumeCreate(ctx context.Context, options volumetypes.VolumesCreateBody) (types.Volume, error) { 13 | var volume types.Volume 14 | resp, err := cli.post(ctx, "/volumes/create", nil, options, nil) 15 | if err != nil { 16 | return volume, err 17 | } 18 | err = json.NewDecoder(resp.body).Decode(&volume) 19 | ensureReaderClosed(resp) 20 | return volume, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // VolumeInspect returns the information about a specific volume in the docker host. 13 | func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { 14 | volume, _, err := cli.VolumeInspectWithRaw(ctx, volumeID) 15 | return volume, err 16 | } 17 | 18 | // VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation 19 | func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { 20 | if volumeID == "" { 21 | return types.Volume{}, nil, objectNotFoundError{object: "volume", id: volumeID} 22 | } 23 | 24 | var volume types.Volume 25 | resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil) 26 | if err != nil { 27 | return volume, nil, wrapResponseError(err, resp, "volume", volumeID) 28 | } 29 | defer ensureReaderClosed(resp) 30 | 31 | body, err := ioutil.ReadAll(resp.body) 32 | if err != nil { 33 | return volume, nil, err 34 | } 35 | rdr := bytes.NewReader(body) 36 | err = json.NewDecoder(rdr).Decode(&volume) 37 | return volume, body, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/filters" 8 | volumetypes "github.com/docker/docker/api/types/volume" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // VolumeList returns the volumes configured in the docker host. 13 | func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumesListOKBody, error) { 14 | var volumes volumetypes.VolumesListOKBody 15 | query := url.Values{} 16 | 17 | if filter.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, filter) 19 | if err != nil { 20 | return volumes, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | resp, err := cli.get(ctx, "/volumes", query, nil) 25 | if err != nil { 26 | return volumes, err 27 | } 28 | 29 | err = json.NewDecoder(resp.body).Decode(&volumes) 30 | ensureReaderClosed(resp) 31 | return volumes, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_prune.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // VolumesPrune requests the daemon to delete unused data 13 | func (cli *Client) VolumesPrune(ctx context.Context, pruneFilters filters.Args) (types.VolumesPruneReport, error) { 14 | var report types.VolumesPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "volume prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/volumes/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving volume prune report: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types/versions" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // VolumeRemove removes a volume from the docker host. 11 | func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error { 12 | query := url.Values{} 13 | if versions.GreaterThanOrEqualTo(cli.version, "1.25") { 14 | if force { 15 | query.Set("force", "1") 16 | } 17 | } 18 | resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil) 19 | ensureReaderClosed(resp) 20 | return wrapResponseError(err, resp, "volume", volumeID) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/nat/parse.go: -------------------------------------------------------------------------------- 1 | package nat 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | // PartParser parses and validates the specified string (data) using the specified template 10 | // e.g. ip:public:private -> 192.168.0.1:80:8000 11 | // DEPRECATED: do not use, this function may be removed in a future version 12 | func PartParser(template, data string) (map[string]string, error) { 13 | // ip:public:private 14 | var ( 15 | templateParts = strings.Split(template, ":") 16 | parts = strings.Split(data, ":") 17 | out = make(map[string]string, len(templateParts)) 18 | ) 19 | if len(parts) != len(templateParts) { 20 | return nil, fmt.Errorf("Invalid format to parse. %s should match template %s", data, template) 21 | } 22 | 23 | for i, t := range templateParts { 24 | value := "" 25 | if len(parts) > i { 26 | value = parts[i] 27 | } 28 | out[t] = value 29 | } 30 | return out, nil 31 | } 32 | 33 | // ParsePortRange parses and validates the specified string as a port-range (8000-9000) 34 | func ParsePortRange(ports string) (uint64, uint64, error) { 35 | if ports == "" { 36 | return 0, 0, fmt.Errorf("Empty string specified for ports.") 37 | } 38 | if !strings.Contains(ports, "-") { 39 | start, err := strconv.ParseUint(ports, 10, 16) 40 | end := start 41 | return start, end, err 42 | } 43 | 44 | parts := strings.Split(ports, "-") 45 | start, err := strconv.ParseUint(parts[0], 10, 16) 46 | if err != nil { 47 | return 0, 0, err 48 | } 49 | end, err := strconv.ParseUint(parts[1], 10, 16) 50 | if err != nil { 51 | return 0, 0, err 52 | } 53 | if end < start { 54 | return 0, 0, fmt.Errorf("Invalid range specified for the Port: %s", ports) 55 | } 56 | return start, end, nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asmr-hex/dockerlang/d2c799f067d17e9f2e05a5eaa728933b97fbf529/vendor/github.com/docker/go-connections/sockets/README.md -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/proxy.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "net/url" 6 | "os" 7 | "strings" 8 | 9 | "golang.org/x/net/proxy" 10 | ) 11 | 12 | // GetProxyEnv allows access to the uppercase and the lowercase forms of 13 | // proxy-related variables. See the Go specification for details on these 14 | // variables. https://golang.org/pkg/net/http/ 15 | func GetProxyEnv(key string) string { 16 | proxyValue := os.Getenv(strings.ToUpper(key)) 17 | if proxyValue == "" { 18 | return os.Getenv(strings.ToLower(key)) 19 | } 20 | return proxyValue 21 | } 22 | 23 | // DialerFromEnvironment takes in a "direct" *net.Dialer and returns a 24 | // proxy.Dialer which will route the connections through the proxy using the 25 | // given dialer. 26 | func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error) { 27 | allProxy := GetProxyEnv("all_proxy") 28 | if len(allProxy) == 0 { 29 | return direct, nil 30 | } 31 | 32 | proxyURL, err := url.Parse(allProxy) 33 | if err != nil { 34 | return direct, err 35 | } 36 | 37 | proxyFromURL, err := proxy.FromURL(proxyURL, direct) 38 | if err != nil { 39 | return direct, err 40 | } 41 | 42 | noProxy := GetProxyEnv("no_proxy") 43 | if len(noProxy) == 0 { 44 | return proxyFromURL, nil 45 | } 46 | 47 | perHost := proxy.NewPerHost(proxyFromURL, direct) 48 | perHost.AddFromString(noProxy) 49 | 50 | return perHost, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "errors" 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | // Why 32? See https://github.com/docker/docker/pull/8035. 12 | const defaultTimeout = 32 * time.Second 13 | 14 | // ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system. 15 | var ErrProtocolNotAvailable = errors.New("protocol not available") 16 | 17 | // ConfigureTransport configures the specified Transport according to the 18 | // specified proto and addr. 19 | // If the proto is unix (using a unix socket to communicate) or npipe the 20 | // compression is disabled. 21 | func ConfigureTransport(tr *http.Transport, proto, addr string) error { 22 | switch proto { 23 | case "unix": 24 | return configureUnixTransport(tr, proto, addr) 25 | case "npipe": 26 | return configureNpipeTransport(tr, proto, addr) 27 | default: 28 | tr.Proxy = http.ProxyFromEnvironment 29 | dialer, err := DialerFromEnvironment(&net.Dialer{ 30 | Timeout: defaultTimeout, 31 | }) 32 | if err != nil { 33 | return err 34 | } 35 | tr.Dial = dialer.Dial 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "fmt" 7 | "net" 8 | "net/http" 9 | "syscall" 10 | "time" 11 | ) 12 | 13 | const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) 14 | 15 | func configureUnixTransport(tr *http.Transport, proto, addr string) error { 16 | if len(addr) > maxUnixSocketPathSize { 17 | return fmt.Errorf("Unix socket path %q is too long", addr) 18 | } 19 | // No need for compression in local communications. 20 | tr.DisableCompression = true 21 | tr.Dial = func(_, _ string) (net.Conn, error) { 22 | return net.DialTimeout(proto, addr, defaultTimeout) 23 | } 24 | return nil 25 | } 26 | 27 | func configureNpipeTransport(tr *http.Transport, proto, addr string) error { 28 | return ErrProtocolNotAvailable 29 | } 30 | 31 | // DialPipe connects to a Windows named pipe. 32 | // This is not supported on other OSes. 33 | func DialPipe(_ string, _ time.Duration) (net.Conn, error) { 34 | return nil, syscall.EAFNOSUPPORT 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets_windows.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "time" 7 | 8 | "github.com/Microsoft/go-winio" 9 | ) 10 | 11 | func configureUnixTransport(tr *http.Transport, proto, addr string) error { 12 | return ErrProtocolNotAvailable 13 | } 14 | 15 | func configureNpipeTransport(tr *http.Transport, proto, addr string) error { 16 | // No need for compression in local communications. 17 | tr.DisableCompression = true 18 | tr.Dial = func(_, _ string) (net.Conn, error) { 19 | return DialPipe(addr, defaultTimeout) 20 | } 21 | return nil 22 | } 23 | 24 | // DialPipe connects to a Windows named pipe. 25 | func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { 26 | return winio.DialPipe(addr, &timeout) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/tcp_socket.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "crypto/tls" 6 | "net" 7 | ) 8 | 9 | // NewTCPSocket creates a TCP socket listener with the specified address and 10 | // the specified tls configuration. If TLSConfig is set, will encapsulate the 11 | // TCP listener inside a TLS one. 12 | func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { 13 | l, err := net.Listen("tcp", addr) 14 | if err != nil { 15 | return nil, err 16 | } 17 | if tlsConfig != nil { 18 | tlsConfig.NextProtos = []string{"http/1.1"} 19 | l = tls.NewListener(l, tlsConfig) 20 | } 21 | return l, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/unix_socket.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // NewUnixSocket creates a unix socket with the specified path and group. 12 | func NewUnixSocket(path string, gid int) (net.Listener, error) { 13 | if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { 14 | return nil, err 15 | } 16 | mask := syscall.Umask(0777) 17 | defer syscall.Umask(mask) 18 | 19 | l, err := net.Listen("unix", path) 20 | if err != nil { 21 | return nil, err 22 | } 23 | if err := os.Chown(path, 0, gid); err != nil { 24 | l.Close() 25 | return nil, err 26 | } 27 | if err := os.Chmod(path, 0660); err != nil { 28 | l.Close() 29 | return nil, err 30 | } 31 | return l, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package tlsconfig 4 | 5 | import ( 6 | "crypto/x509" 7 | "runtime" 8 | ) 9 | 10 | // SystemCertPool returns a copy of the system cert pool, 11 | // returns an error if failed to load or empty pool on windows. 12 | func SystemCertPool() (*x509.CertPool, error) { 13 | certpool, err := x509.SystemCertPool() 14 | if err != nil && runtime.GOOS == "windows" { 15 | return x509.NewCertPool(), nil 16 | } 17 | return certpool, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package tlsconfig 4 | 5 | import ( 6 | "crypto/x509" 7 | ) 8 | 9 | // SystemCertPool returns an new empty cert pool, 10 | // accessing system cert pool is supported in go 1.7 11 | func SystemCertPool() (*x509.CertPool, error) { 12 | return x509.NewCertPool(), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 14 | tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 15 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 14 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 46 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours() + 0.5); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*2 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Protocol Buffers for Go with Gadgets 2 | 3 | Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | http://github.com/gogo/protobuf 5 | 6 | Go support for Protocol Buffers - Google's data interchange format 7 | 8 | Copyright 2010 The Go Authors. All rights reserved. 9 | https://github.com/golang/protobuf 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are 13 | met: 14 | 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the following disclaimer 19 | in the documentation and/or other materials provided with the 20 | distribution. 21 | * Neither the name of Google Inc. nor the names of its 22 | contributors may be used to endorse or promote products derived from 23 | this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | 37 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/lib_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "encoding/json" 33 | "strconv" 34 | ) 35 | 36 | func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) { 37 | s, ok := m[value] 38 | if !ok { 39 | s = strconv.Itoa(int(value)) 40 | } 41 | return json.Marshal(s) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import "hash" 4 | 5 | // Digester calculates the digest of written data. Writes should go directly 6 | // to the return value of Hash, while calling Digest will return the current 7 | // value of the digest. 8 | type Digester interface { 9 | Hash() hash.Hash // provides direct access to underlying hash instance. 10 | Digest() Digest 11 | } 12 | 13 | // digester provides a simple digester definition that embeds a hasher. 14 | type digester struct { 15 | alg Algorithm 16 | hash hash.Hash 17 | } 18 | 19 | func (d *digester) Hash() hash.Hash { 20 | return d.hash 21 | } 22 | 23 | func (d *digester) Digest() Digest { 24 | return NewDigest(d.alg, d.hash) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/doc.go: -------------------------------------------------------------------------------- 1 | // Package digest provides a generalized type to opaquely represent message 2 | // digests and their operations within the registry. The Digest type is 3 | // designed to serve as a flexible identifier in a content-addressable system. 4 | // More importantly, it provides tools and wrappers to work with 5 | // hash.Hash-based digests with little effort. 6 | // 7 | // Basics 8 | // 9 | // The format of a digest is simply a string with two parts, dubbed the 10 | // "algorithm" and the "digest", separated by a colon: 11 | // 12 | // : 13 | // 14 | // An example of a sha256 digest representation follows: 15 | // 16 | // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc 17 | // 18 | // In this case, the string "sha256" is the algorithm and the hex bytes are 19 | // the "digest". 20 | // 21 | // Because the Digest type is simply a string, once a valid Digest is 22 | // obtained, comparisons are cheap, quick and simple to express with the 23 | // standard equality operator. 24 | // 25 | // Verification 26 | // 27 | // The main benefit of using the Digest type is simple verification against a 28 | // given digest. The Verifier interface, modeled after the stdlib hash.Hash 29 | // interface, provides a common write sink for digest verification. After 30 | // writing is complete, calling the Verifier.Verified method will indicate 31 | // whether or not the stream of bytes matches the target digest. 32 | // 33 | // Missing Features 34 | // 35 | // In addition to the above, we intend to add the following features to this 36 | // package: 37 | // 38 | // 1. A Digester type that supports write sink digest calculation. 39 | // 40 | // 2. Suspend and resume of ongoing digest calculations to support efficient digest verification in the registry. 41 | // 42 | package digest 43 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/verifiers.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import ( 4 | "hash" 5 | "io" 6 | ) 7 | 8 | // Verifier presents a general verification interface to be used with message 9 | // digests and other byte stream verifications. Users instantiate a Verifier 10 | // from one of the various methods, write the data under test to it then check 11 | // the result with the Verified method. 12 | type Verifier interface { 13 | io.Writer 14 | 15 | // Verified will return true if the content written to Verifier matches 16 | // the digest. 17 | Verified() bool 18 | } 19 | 20 | type hashVerifier struct { 21 | digest Digest 22 | hash hash.Hash 23 | } 24 | 25 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 26 | return hv.hash.Write(p) 27 | } 28 | 29 | func (hv hashVerifier) Verified() bool { 30 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Index references manifests for various platforms. 20 | // This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. 21 | type Index struct { 22 | specs.Versioned 23 | 24 | // Manifests references platform specific manifests. 25 | Manifests []Descriptor `json:"manifests"` 26 | 27 | // Annotations contains arbitrary metadata for the image index. 28 | Annotations map[string]string `json:"annotations,omitempty"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | const ( 18 | // ImageLayoutFile is the file name of oci image layout file 19 | ImageLayoutFile = "oci-layout" 20 | // ImageLayoutVersion is the version of ImageLayout 21 | ImageLayoutVersion = "1.0.0" 22 | ) 23 | 24 | // ImageLayout is the structure in the "oci-layout" file, found in the root 25 | // of an OCI Image-layout directory. 26 | type ImageLayout struct { 27 | Version string `json:"imageLayoutVersion"` 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Manifest provides `application/vnd.oci.image.manifest.v1+json` mediatype structure when marshalled to JSON. 20 | type Manifest struct { 21 | specs.Versioned 22 | 23 | // Config references a configuration object for a container, by digest. 24 | // The referenced configuration object is a JSON blob that the runtime uses to set up the container. 25 | Config Descriptor `json:"config"` 26 | 27 | // Layers is an indexed list of layers referenced by the manifest. 28 | Layers []Descriptor `json:"layers"` 29 | 30 | // Annotations contains arbitrary metadata for the image manifest. 31 | Annotations map[string]string `json:"annotations,omitempty"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | import "fmt" 18 | 19 | const ( 20 | // VersionMajor is for an API incompatible changes 21 | VersionMajor = 1 22 | // VersionMinor is for functionality in a backwards-compatible manner 23 | VersionMinor = 0 24 | // VersionPatch is for backwards-compatible bug fixes 25 | VersionPatch = 1 26 | 27 | // VersionDev indicates development branch. Releases will be empty string. 28 | VersionDev = "" 29 | ) 30 | 31 | // Version is the specification version that the package types support. 32 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/versioned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | // Versioned provides a struct with the manifest schemaVersion and mediaType. 18 | // Incoming content with unknown schema version can be decoded against this 19 | // struct to check the version. 20 | type Versioned struct { 21 | // SchemaVersion is the image manifest schema that this image follows 22 | SchemaVersion int `json:"schemaVersion"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 5 | t.FailNow() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/suite/interfaces.go: -------------------------------------------------------------------------------- 1 | package suite 2 | 3 | import "testing" 4 | 5 | // TestingSuite can store and return the current *testing.T context 6 | // generated by 'go test'. 7 | type TestingSuite interface { 8 | T() *testing.T 9 | SetT(*testing.T) 10 | } 11 | 12 | // SetupAllSuite has a SetupSuite method, which will run before the 13 | // tests in the suite are run. 14 | type SetupAllSuite interface { 15 | SetupSuite() 16 | } 17 | 18 | // SetupTestSuite has a SetupTest method, which will run before each 19 | // test in the suite. 20 | type SetupTestSuite interface { 21 | SetupTest() 22 | } 23 | 24 | // TearDownAllSuite has a TearDownSuite method, which will run after 25 | // all the tests in the suite have been run. 26 | type TearDownAllSuite interface { 27 | TearDownSuite() 28 | } 29 | 30 | // TearDownTestSuite has a TearDownTest method, which will run after 31 | // each test in the suite. 32 | type TearDownTestSuite interface { 33 | TearDownTest() 34 | } 35 | 36 | // BeforeTest has a function to be executed right before the test 37 | // starts and receives the suite and test names as input 38 | type BeforeTest interface { 39 | BeforeTest(suiteName, testName string) 40 | } 41 | 42 | // AfterTest has a function to be executed right after the test 43 | // finishes and receives the suite and test names as input 44 | type AfterTest interface { 45 | AfterTest(suiteName, testName string) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "net" 9 | ) 10 | 11 | type direct struct{} 12 | 13 | // Direct is a direct proxy: one that makes network connections directly. 14 | var Direct = direct{} 15 | 16 | func (direct) Dial(network, addr string) (net.Conn, error) { 17 | return net.Dial(network, addr) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | --------------------------------------------------------------------------------