├── .envrc ├── .gitignore ├── LICENSE ├── MAINTAINERS ├── Makefile ├── README.md ├── circle.yml ├── codecov.yml ├── default.nix ├── dockerfiles ├── Dockerfile.build └── Dockerfile.bundle ├── integration ├── instance.sh ├── instances.json └── simple │ └── instances.json ├── plugin └── instance │ ├── cmd │ └── main.go │ ├── fake_test.go │ ├── plugin.go │ ├── plugin_test.go │ └── types │ ├── types.go │ └── types_test.go ├── vendor.conf └── vendor ├── github.com ├── Masterminds │ └── sprig │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── functions.go │ │ ├── glide.lock │ │ └── glide.yaml ├── Sirupsen │ └── logrus │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_appengine.go │ │ ├── terminal_bsd.go │ │ ├── terminal_linux.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_solaris.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ └── writer.go ├── aokoli │ └── goutils │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── randomstringutils.go │ │ ├── stringutils.go │ │ └── wordutils.go ├── armon │ └── go-radix │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── radix.go ├── davecgh │ └── go-spew │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cov_report.sh │ │ ├── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go │ │ └── test_coverage.txt ├── digitalocean │ └── godo │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── account.go │ │ ├── action.go │ │ ├── certificates.go │ │ ├── doc.go │ │ ├── domains.go │ │ ├── droplet_actions.go │ │ ├── droplets.go │ │ ├── errors.go │ │ ├── floating_ips.go │ │ ├── floating_ips_actions.go │ │ ├── godo.go │ │ ├── image_actions.go │ │ ├── images.go │ │ ├── keys.go │ │ ├── links.go │ │ ├── load_balancers.go │ │ ├── regions.go │ │ ├── sizes.go │ │ ├── snapshots.go │ │ ├── storage.go │ │ ├── storage_actions.go │ │ ├── strings.go │ │ ├── tags.go │ │ └── timestamp.go ├── docker │ └── infrakit │ │ ├── .gitignore │ │ ├── .mailmap │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── MAINTAINERS │ │ ├── Makefile │ │ ├── README.md │ │ ├── circle.yml │ │ ├── pkg │ │ ├── broker │ │ │ └── server │ │ │ │ ├── interceptor.go │ │ │ │ ├── server.go │ │ │ │ └── sse.go │ │ ├── cli │ │ │ ├── cli.go │ │ │ ├── context.go │ │ │ ├── logging.go │ │ │ ├── serverutil.go │ │ │ ├── template.go │ │ │ ├── util.go │ │ │ └── version.go │ │ ├── discovery │ │ │ ├── discovery.go │ │ │ └── local │ │ │ │ ├── dir.go │ │ │ │ └── local.go │ │ ├── log │ │ │ └── log.go │ │ ├── plugin │ │ │ ├── metadata │ │ │ │ └── template │ │ │ │ │ └── template.go │ │ │ ├── name.go │ │ │ └── plugin.go │ │ ├── rpc │ │ │ ├── client │ │ │ │ ├── client.go │ │ │ │ ├── handshake.go │ │ │ │ ├── info.go │ │ │ │ └── rpc.go │ │ │ ├── group │ │ │ │ ├── client.go │ │ │ │ ├── service.go │ │ │ │ └── types.go │ │ │ ├── handshake.go │ │ │ ├── info.go │ │ │ ├── instance │ │ │ │ ├── client.go │ │ │ │ ├── service.go │ │ │ │ └── types.go │ │ │ ├── metadata │ │ │ │ ├── client.go │ │ │ │ ├── service.go │ │ │ │ ├── types.go │ │ │ │ └── updatable.go │ │ │ └── server │ │ │ │ ├── info.go │ │ │ │ ├── reflector.go │ │ │ │ └── server.go │ │ ├── spi │ │ │ ├── event │ │ │ │ ├── spi.go │ │ │ │ └── types.go │ │ │ ├── group │ │ │ │ └── spi.go │ │ │ ├── instance │ │ │ │ ├── spi.go │ │ │ │ └── types.go │ │ │ ├── metadata │ │ │ │ └── spi.go │ │ │ └── plugin.go │ │ ├── template │ │ │ ├── defaults.go │ │ │ ├── fetch.go │ │ │ ├── funcs.go │ │ │ ├── help.go │ │ │ ├── template.go │ │ │ └── util.go │ │ ├── types │ │ │ ├── any.go │ │ │ ├── error.go │ │ │ ├── hierarchy.go │ │ │ ├── link.go │ │ │ ├── object.go │ │ │ ├── path.go │ │ │ ├── pointer.go │ │ │ ├── reflect.go │ │ │ └── spec.go │ │ └── util │ │ │ └── exec │ │ │ └── exec.go │ │ └── vendor.conf ├── ghodss │ └── yaml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fields.go │ │ └── yaml.go ├── google │ └── go-querystring │ │ ├── .gitignore │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ └── query │ │ └── encode.go ├── gorilla │ ├── context │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ └── doc.go │ ├── mux │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context_gorilla.go │ │ ├── context_native.go │ │ ├── doc.go │ │ ├── mux.go │ │ ├── regexp.go │ │ └── route.go │ └── rpc │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── v2 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── compression_selector.go │ │ ├── doc.go │ │ ├── encoder_selector.go │ │ ├── json2 │ │ ├── client.go │ │ ├── error.go │ │ └── server.go │ │ ├── map.go │ │ └── server.go ├── hashicorp │ └── hcl │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── decoder.go │ │ ├── hcl.go │ │ ├── hcl │ │ ├── ast │ │ │ ├── ast.go │ │ │ └── walk.go │ │ ├── parser │ │ │ ├── error.go │ │ │ └── parser.go │ │ ├── scanner │ │ │ └── scanner.go │ │ ├── strconv │ │ │ └── quote.go │ │ └── token │ │ │ ├── position.go │ │ │ └── token.go │ │ ├── json │ │ ├── parser │ │ │ ├── flatten.go │ │ │ └── parser.go │ │ ├── scanner │ │ │ └── scanner.go │ │ └── token │ │ │ ├── position.go │ │ │ └── token.go │ │ ├── lex.go │ │ └── parse.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ ├── trap_windows.go │ │ └── trap_windows_1.4.go ├── jmespath │ └── go-jmespath │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── api.go │ │ ├── astnodetype_string.go │ │ ├── functions.go │ │ ├── interpreter.go │ │ ├── lexer.go │ │ ├── parser.go │ │ ├── toktype_string.go │ │ └── util.go ├── mattn │ ├── go-colorable │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ └── noncolorable.go │ └── go-isatty │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── isatty_appengine.go │ │ ├── isatty_bsd.go │ │ ├── isatty_linux.go │ │ ├── isatty_others.go │ │ ├── isatty_solaris.go │ │ └── isatty_windows.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── difflib │ │ └── difflib.go ├── satori │ └── go.uuid │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── uuid.go ├── spf13 │ ├── afero │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── afero.go │ │ ├── appveyor.yml │ │ ├── basepath.go │ │ ├── cacheOnReadFs.go │ │ ├── const_bsds.go │ │ ├── const_win_unix.go │ │ ├── copyOnWriteFs.go │ │ ├── httpFs.go │ │ ├── ioutil.go │ │ ├── mem │ │ │ ├── dir.go │ │ │ ├── dirmap.go │ │ │ └── file.go │ │ ├── memmap.go │ │ ├── memradix.go │ │ ├── os.go │ │ ├── path.go │ │ ├── readonlyfs.go │ │ ├── regexpfs.go │ │ ├── unionFile.go │ │ └── util.go │ ├── cobra │ │ ├── .gitignore │ │ ├── .mailmap │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── args.go │ │ ├── bash_completions.go │ │ ├── bash_completions.md │ │ ├── cobra.go │ │ ├── command.go │ │ ├── command_notwin.go │ │ └── command_win.go │ └── pflag │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bool.go │ │ ├── bool_slice.go │ │ ├── count.go │ │ ├── duration.go │ │ ├── flag.go │ │ ├── float32.go │ │ ├── float64.go │ │ ├── golangflag.go │ │ ├── int.go │ │ ├── int32.go │ │ ├── int64.go │ │ ├── int8.go │ │ ├── int_slice.go │ │ ├── ip.go │ │ ├── ip_slice.go │ │ ├── ipmask.go │ │ ├── ipnet.go │ │ ├── string.go │ │ ├── string_array.go │ │ ├── string_slice.go │ │ ├── uint.go │ │ ├── uint16.go │ │ ├── uint32.go │ │ ├── uint64.go │ │ ├── uint8.go │ │ └── uint_slice.go ├── stretchr │ └── testify │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENCE.txt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── assert │ │ ├── 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 ├── tent │ └── http-link-go │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── link.go └── vaughan0 │ └── go-ini │ ├── LICENSE │ ├── README.md │ ├── ini.go │ └── test.ini ├── golang.org └── x │ ├── crypto │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── pbkdf2 │ │ └── pbkdf2.go │ └── scrypt │ │ └── scrypt.go │ ├── net │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ └── context │ │ ├── context.go │ │ ├── go17.go │ │ └── pre_go17.go │ ├── oauth2 │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── client_appengine.go │ ├── internal │ │ ├── oauth2.go │ │ ├── token.go │ │ └── transport.go │ ├── oauth2.go │ ├── token.go │ └── transport.go │ └── text │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── internal │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── triegen │ │ ├── compact.go │ │ ├── print.go │ │ └── triegen.go │ └── ucd │ │ └── ucd.go │ ├── transform │ └── transform.go │ └── unicode │ ├── cldr │ ├── base.go │ ├── cldr.go │ ├── collate.go │ ├── decode.go │ ├── makexml.go │ ├── resolve.go │ ├── slice.go │ └── xml.go │ └── norm │ ├── composition.go │ ├── forminfo.go │ ├── input.go │ ├── iter.go │ ├── maketables.go │ ├── normalize.go │ ├── readwriter.go │ ├── tables.go │ ├── transform.go │ ├── trie.go │ └── triegen.go └── gopkg.in ├── inconshreveable └── log15.v2 │ ├── .travis.yml │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── RELEASING.md │ ├── doc.go │ ├── format.go │ ├── handler.go │ ├── handler_appengine.go │ ├── handler_other.go │ ├── logger.go │ ├── root.go │ ├── stack │ ├── stack.go │ ├── stack_pool.go │ └── stack_pool_chan.go │ ├── syslog.go │ └── term │ ├── LICENSE │ ├── terminal_appengine.go │ ├── terminal_darwin.go │ ├── terminal_freebsd.go │ ├── terminal_linux.go │ ├── terminal_notwindows.go │ ├── terminal_openbsd.go │ └── terminal_windows.go ├── tylerb └── graceful.v1 │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── graceful.go │ ├── keepalive_listener.go │ ├── limit_listen.go │ ├── signal.go │ └── signal_appengine.go └── yaml.v2 ├── .travis.yml ├── LICENSE ├── LICENSE.libyaml ├── README.md ├── apic.go ├── decode.go ├── emitterc.go ├── encode.go ├── parserc.go ├── readerc.go ├── resolve.go ├── scannerc.go ├── sorter.go ├── writerc.go ├── yaml.go ├── yamlh.go └── yamlprivateh.go /.envrc: -------------------------------------------------------------------------------- 1 | use_nix -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Editor/IDE files 4 | *~ 5 | .idea/ 6 | *.iml 7 | coverage.txt 8 | 9 | # Binaries from builds 10 | build/ 11 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # InfraKit.GCP maintainers file 2 | # 3 | # This file describes who runs the docker/infrakit.gcp project and how. 4 | # This is a living document - if you see something out of date or missing, speak up! 5 | # 6 | # It is structured to be consumable by both humans and programs. 7 | # To extract its contents programmatically, use any TOML-compliant parser. 8 | # 9 | # This file is compiled into the MAINTAINERS file in docker/opensource. 10 | # 11 | [Org] 12 | [Org."Core maintainers"] 13 | people = [ 14 | "vdemeester", 15 | ] 16 | 17 | [people] 18 | 19 | # A reference list of all people associated with the project. 20 | # All other sections should refer to people by their canonical key 21 | # in the people section. 22 | 23 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 24 | 25 | [people.vdemeester] 26 | Name = "Vincent Demeester" 27 | Email = "vincent@sbr.pm" 28 | GitHub = "vdemeester" 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED: It is now fully integrated with [`infrakit`](https://github.com/docker/infrakit) 2 | 3 | 4 | InfraKit.DigitalOcean 5 | ===================== 6 | 7 | [![CircleCI](https://circleci.com/gh/docker/infrakit.digitalocean.svg?style=svg&circle-token=df12ee3a96564afcccc29468bdb28f8931899581)](https://circleci.com/gh/docker/infrakit.digitalocean) 8 | [![codecov](https://codecov.io/gh/docker/infrakit.digitalocean/branch/master/graph/badge.svg?token=MUiFRcmQVF)](https://codecov.io/gh/docker/infrakit.digitalocean) 9 | 10 | [InfraKit](https://github.com/docker/infrakit) plugins for creating and managing resources in [DigitalOcean](https://www.digitalocean.com/). 11 | 12 | ## Instance plugin 13 | 14 | An InfraKit instance plugin which creates DigitalOcean droplets. 15 | 16 | ### Building 17 | 18 | To build the instance plugin, run `make binaries`. The plugin binary 19 | will be located at `./build/infrakit-instance-digitalocean`. 20 | 21 | ### Running 22 | 23 | ``` 24 | ${PATH_TO_INFRAKIT}/infrakit-flavor-vanilla 25 | ${PATH_TO_INFRAKIT}/infrakit-group-default 26 | ./build/infrakit-instance-digitalocean --config=[CONFIG_PATH] --region=[GCP_ZONE] 27 | 28 | ${PATH_TO_INFRAKIT}/infrakit group commit do-example-1.json 29 | ``` 30 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | pre: 3 | - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 4 | services: 5 | - docker 6 | environment: 7 | OS: "linux" 8 | ARCH: "amd64" 9 | GOVERSION: "1.8" 10 | GOPATH: "$HOME/.go_workspace" 11 | 12 | WORKDIR: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" 13 | 14 | dependencies: 15 | pre: 16 | # Wipe out the default go install. 17 | - sudo rm -rf /usr/local/go 18 | 19 | # Force the wipe out of GOPATH to make sure we're not relying on 20 | # external dependencies. 21 | - rm -rf "$GOPATH" 22 | 23 | override: 24 | # Install Go 25 | - wget "https://storage.googleapis.com/golang/go$GOVERSION.$OS-$ARCH.tar.gz" 26 | - sudo tar -C /usr/local -xzf "go$GOVERSION.$OS-$ARCH.tar.gz" 27 | 28 | # Setup the GOPATH 29 | - mkdir -p "$(dirname $WORKDIR)" 30 | - cp -R "$HOME/$CIRCLE_PROJECT_REPONAME" "$WORKDIR" 31 | 32 | # Install dependencies 33 | - cd $WORKDIR && go get github.com/axw/gocov/gocov github.com/golang/lint/golint 34 | 35 | test: 36 | override: 37 | - cd $WORKDIR && make ci # integration-tests # FIXME(vdemeester) make sure the work before enabling them :D 38 | 39 | post: 40 | # Report to codecov 41 | - cd $WORKDIR && bash <(curl -s https://codecov.io/bash) 42 | 43 | # FIXME(vdemeester) Handle this 44 | #deployment: 45 | # docker: 46 | # branch: master 47 | # commands: 48 | # - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWD 49 | # - DOCKER_PUSH=true DOCKER_TAG_LATEST=true DOCKER_TAG="master-$CIRCLE_BUILD_NUM" DOCKER_BUILD_FLAGS="--rm=false" make build-docker 50 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: header, changes, diff, sunburst 3 | coverage: 4 | status: 5 | patch: false 6 | project: 7 | default: 8 | enabled: yes 9 | target: 85 10 | changes: false 11 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | let 2 | _pkgs = import {}; 3 | in 4 | { pkgs ? import (_pkgs.fetchFromGitHub { owner = "NixOS"; 5 | repo = "nixpkgs-channels"; 6 | rev = "0afb6d789c8bf74825e8cdf6a5d3b9ab8bde4f2d"; 7 | sha256 = "147vhzrnwcy0v77kgbap31698qbda8rn09n5fnjp740svmkjpaiz"; 8 | }) {} 9 | }: 10 | 11 | pkgs.stdenv.mkDerivation rec { 12 | name = "docker-pipeline-dev"; 13 | env = pkgs.buildEnv { name = name; paths = buildInputs; }; 14 | buildInputs = [ 15 | pkgs.vndr 16 | pkgs.docker 17 | pkgs.gnumake 18 | pkgs.go_1_8 19 | pkgs.gcc 20 | pkgs.gotools 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /dockerfiles/Dockerfile.build: -------------------------------------------------------------------------------- 1 | FROM golang:1.8.0-alpine 2 | 3 | RUN apk add --update git make 4 | 5 | WORKDIR /go/src/github.com/docker/infrakit.digitalocean 6 | VOLUME ["/go/src/github.com/docker/infrakit.digitalocean/build"] 7 | CMD ["make", "build-binaries"] 8 | 9 | COPY . ./ 10 | -------------------------------------------------------------------------------- /dockerfiles/Dockerfile.bundle: -------------------------------------------------------------------------------- 1 | FROM alpine:3.5 2 | 3 | RUN apk add --update ca-certificates 4 | 5 | RUN mkdir -p /infrakit/plugins /infrakit/configs /infrakit/logs 6 | 7 | VOLUME /infrakit 8 | 9 | ENV INFRAKIT_HOME /infrakit 10 | ENV INFRAKIT_PLUGINS_DIR /infrakit/plugins 11 | 12 | ADD build/* /usr/local/bin/ 13 | 14 | # Make symbolic links to make standardized bin names. 15 | # This makes for shorter names when containers are already scoped by the platform (eg. infrakit/digitalocean) 16 | RUN ln -s /usr/local/bin/infrakit-instance-digitalocean /usr/bin/instance 17 | -------------------------------------------------------------------------------- /integration/instances.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "instances", 3 | "Properties": { 4 | "Allocation": { 5 | "Size": 2 6 | }, 7 | "Instance": { 8 | "Plugin": "instance-digitalocean", 9 | "Properties": { 10 | "NamePrefix": "test", 11 | "Description": "Test of DigitalOcean infrakit", 12 | "Tags": ["{{TAG}}"], 13 | "Size": "1gb", 14 | "Image": "debian-8-x64" 15 | } 16 | }, 17 | "Flavor": { 18 | "Plugin": "flavor-vanilla", 19 | "Properties": { 20 | "Init": [ 21 | "echo Hello, World" 22 | ] 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /integration/simple/instances.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/infrakit.digitalocean/3fabde0bd5b37222fe8fa217cadfd1c8c59cc46e/integration/simple/instances.json -------------------------------------------------------------------------------- /plugin/instance/types/types_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/digitalocean/godo" 7 | "github.com/docker/infrakit/pkg/spi/instance" 8 | "github.com/docker/infrakit/pkg/types" 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestParseProperties(t *testing.T) { 13 | properties := types.AnyString(`{ 14 | "NamePrefix": "foo", 15 | "Region": "nyc3", 16 | "Size": "512mb", 17 | "Image": { "Slug" : "ubuntu-14-04-x64"}, 18 | "Backups": false, 19 | "Ipv6": true, 20 | "Private_networking": null, 21 | "Tags": ["foo"] 22 | }`) 23 | 24 | p, err := ParseProperties(properties) 25 | assert.NoError(t, err) 26 | assert.Equal(t, p, Properties{ 27 | DropletCreateRequest: godo.DropletCreateRequest{ 28 | Region: "nyc3", 29 | Size: "512mb", 30 | Image: godo.DropletCreateImage{ 31 | Slug: "ubuntu-14-04-x64", 32 | }, 33 | Backups: false, 34 | IPv6: true, 35 | PrivateNetworking: false, 36 | Tags: []string{"foo"}, 37 | }, 38 | NamePrefix: "foo", 39 | }) 40 | } 41 | 42 | func TestParsePropertiesFail(t *testing.T) { 43 | properties := types.AnyString(`{ 44 | "NamePrefix": "bar", 45 | "tags": { 46 | "foo": "bar", 47 | } 48 | }`) 49 | 50 | _, err := ParseProperties(properties) 51 | assert.Error(t, err) 52 | } 53 | 54 | func TestParseTags(t *testing.T) { 55 | id := instance.LogicalID("foo") 56 | spec := instance.Spec{ 57 | Tags: map[string]string{ 58 | "foo": "bar", 59 | "banana": "", 60 | }, 61 | LogicalID: &id, 62 | } 63 | 64 | tags := ParseTags(spec) 65 | assert.Equal(t, map[string]string{ 66 | "foo": "bar", 67 | "banana": "", 68 | InfrakitLogicalID: string(id), 69 | InfrakitDOVersion: InfrakitDOCurrentVersion, 70 | }, tags) 71 | } 72 | -------------------------------------------------------------------------------- /vendor.conf: -------------------------------------------------------------------------------- 1 | # infrakit and deps 2 | github.com/docker/infrakit 0bda756 3 | gopkg.in/tylerb/graceful.v1 v1.2.15 4 | gopkg.in/inconshreveable/log15.v2 v2.11 5 | golang.org/x/text a263ba8 6 | github.com/vaughan0/go-ini a98ad7e 7 | github.com/mattn/go-colorable d228849 8 | github.com/jmespath/go-jmespath 0.2.2-14-gbd40a43 9 | github.com/gorilla/rpc 22c016f 10 | github.com/gorilla/mux v1.3.0-4-gad4ce0e 11 | github.com/gorilla/context v1.1-7-g08b5f42 12 | github.com/ghodss/yaml 73d445a93680fa1a78ae23a5839bad48f32ba1ee 13 | github.com/armon/go-radix 4239b77 14 | github.com/Masterminds/sprig 2.9.0 15 | gopkg.in/yaml.v2 a5b47d3 16 | golang.org/x/crypto 453249f 17 | github.com/satori/go.uuid v1.1.0-6-gb061729 18 | github.com/aokoli/goutils 1.0.0-1-g9c37978 19 | github.com/Sirupsen/logrus 1deb2db2a6fff8a35532079061b903c3a25eed52 20 | github.com/pkg/errors 839d9e913e063e28dfd0e6c7b7512793e0a48be9 21 | golang.org/x/net 906cda9 22 | github.com/hashicorp/hcl 630949a3c5fa3c613328e1b8256052cbc2327c9b 23 | github.com/spf13/afero 06b7e5f 24 | 25 | # Windows specific 26 | github.com/mattn/go-isatty fc9e8d8ef48496124e79ae0df75490096eccf6fe 27 | github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 28 | 29 | # digitalocean 30 | github.com/digitalocean/godo 4c04abe183f449bd9ede285f0e5c7ee575d0dbe4 31 | github.com/tent/http-link-go ac974c61c2f990f4115b119354b5e0b47550e888 32 | github.com/google/go-querystring 53e6ce116135b80d037921a7fdd5138cf32d7a8a 33 | golang.org/x/oauth2 810daf0 34 | 35 | # cli 36 | github.com/spf13/cobra v1.5.1 https://github.com/dnephin/cobra.git 37 | github.com/spf13/pflag 9ff6c6923cfffbcd502984b8e0c80539a94968b7 38 | 39 | # test 40 | github.com/stretchr/testify v1.1.4-27-g4d4bfba 41 | github.com/davecgh/go-spew v1.1.0 42 | github.com/pmezard/go-difflib v1.0.0 43 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | /.glide 3 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | - 1.7 6 | - tip 7 | 8 | # Setting sudo access to false will let Travis CI use containers rather than 9 | # VMs to run the tests. For more details see: 10 | # - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ 11 | # - http://docs.travis-ci.com/user/workers/standard-infrastructure/ 12 | sudo: false 13 | 14 | notifications: 15 | webhooks: 16 | urls: 17 | - https://webhooks.gitter.im/e/06e3328629952dabe3e0 18 | on_success: change # options: [always|never|change] default: always 19 | on_failure: always # options: [always|never|change] default: always 20 | on_start: never # options: [always|never|change] default: always 21 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Release 1.2.0 (2016-02-01) 2 | 3 | - Added quote and squote 4 | - Added b32enc and b32dec 5 | - add now takes varargs 6 | - biggest now takes varargs 7 | 8 | # Release 1.1.0 (2015-12-29) 9 | 10 | - Added #4: Added contains function. strings.Contains, but with the arguments 11 | switched to simplify common pipelines. (thanks krancour) 12 | - Added Travis-CI testing support 13 | 14 | # Release 1.0.0 (2015-12-23) 15 | 16 | - Initial release 17 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Sprig 2 | Copyright (C) 2013 Masterminds 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/glide.lock: -------------------------------------------------------------------------------- 1 | hash: 6e5af84de9810bc5784f56d5a321887db57b3454d45888153202b4b1e191018b 2 | updated: 2017-02-01T14:01:56.546297154+01:00 3 | imports: 4 | - name: github.com/aokoli/goutils 5 | version: 9c37978a95bd5c709a15883b6242714ea6709e64 6 | - name: github.com/satori/go.uuid 7 | version: 879c5887cd475cd7864858769793b2ceb0d44feb 8 | - name: golang.org/x/crypto 9 | version: dc137beb6cce2043eb6b5f223ab8bf51c32459f4 10 | subpackages: 11 | - pbkdf2 12 | - scrypt 13 | testImports: 14 | - name: github.com/davecgh/go-spew 15 | version: 04cdfd42973bb9c8589fd6a731800cf222fde1a9 16 | subpackages: 17 | - spew 18 | - name: github.com/pmezard/go-difflib 19 | version: d8ed2627bdf02c080bf22230dbb337003b7aba2d 20 | subpackages: 21 | - difflib 22 | - name: github.com/stretchr/testify 23 | version: 4d4bfba8f1d1027c4fdbe371823030df51419987 24 | subpackages: 25 | - assert 26 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/sprig/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/Masterminds/sprig 2 | import: 3 | - package: github.com/aokoli/goutils 4 | - package: github.com/satori/go.uuid 5 | version: ^1.1.0 6 | - package: golang.org/x/crypto 7 | subpackages: 8 | - scrypt 9 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6 4 | - 1.7 5 | - tip 6 | install: 7 | - go get -t ./... 8 | script: GOMAXPROCS=4 GORACE="halt_on_error=1" go test -race -v ./... 9 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import "time" 4 | 5 | const DefaultTimestampFormat = time.RFC3339 6 | 7 | // The Formatter interface is used to implement a custom Formatter. It takes an 8 | // `Entry`. It exposes all the fields, including the default ones: 9 | // 10 | // * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. 11 | // * `entry.Data["time"]`. The timestamp. 12 | // * `entry.Data["level"]. The level the entry was logged at. 13 | // 14 | // Any additional fields added with `WithField` or `WithFields` are also in 15 | // `entry.Data`. Format is expected to return an array of bytes which are then 16 | // logged to `logger.Out`. 17 | type Formatter interface { 18 | Format(*Entry) ([]byte, error) 19 | } 20 | 21 | // This is to not silently overwrite `time`, `msg` and `level` fields when 22 | // dumping it. If this code wasn't there doing: 23 | // 24 | // logrus.WithField("level", 1).Info("hello") 25 | // 26 | // Would just silently drop the user provided level. Instead with this code 27 | // it'll logged as: 28 | // 29 | // {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} 30 | // 31 | // It's not exported because it's still using Data in an opinionated way. It's to 32 | // avoid code duplication between the two default formatters. 33 | func prefixFieldClashes(data Fields) { 34 | if t, ok := data["time"]; ok { 35 | data["fields.time"] = t 36 | } 37 | 38 | if m, ok := data["msg"]; ok { 39 | data["fields.msg"] = m 40 | } 41 | 42 | if l, ok := data["level"]; ok { 43 | data["fields.level"] = l 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type fieldKey string 9 | type FieldMap map[fieldKey]string 10 | 11 | const ( 12 | FieldKeyMsg = "msg" 13 | FieldKeyLevel = "level" 14 | FieldKeyTime = "time" 15 | ) 16 | 17 | func (f FieldMap) resolve(key fieldKey) string { 18 | if k, ok := f[key]; ok { 19 | return k 20 | } 21 | 22 | return string(key) 23 | } 24 | 25 | type JSONFormatter struct { 26 | // TimestampFormat sets the format used for marshaling timestamps. 27 | TimestampFormat string 28 | 29 | // DisableTimestamp allows disabling automatic timestamps in output 30 | DisableTimestamp bool 31 | 32 | // FieldMap allows users to customize the names of keys for various fields. 33 | // As an example: 34 | // formatter := &JSONFormatter{ 35 | // FieldMap: FieldMap{ 36 | // FieldKeyTime: "@timestamp", 37 | // FieldKeyLevel: "@level", 38 | // FieldKeyLevel: "@message", 39 | // }, 40 | // } 41 | FieldMap FieldMap 42 | } 43 | 44 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 45 | data := make(Fields, len(entry.Data)+3) 46 | for k, v := range entry.Data { 47 | switch v := v.(type) { 48 | case error: 49 | // Otherwise errors are ignored by `encoding/json` 50 | // https://github.com/Sirupsen/logrus/issues/137 51 | data[k] = v.Error() 52 | default: 53 | data[k] = v 54 | } 55 | } 56 | prefixFieldClashes(data) 57 | 58 | timestampFormat := f.TimestampFormat 59 | if timestampFormat == "" { 60 | timestampFormat = DefaultTimestampFormat 61 | } 62 | 63 | if !f.DisableTimestamp { 64 | data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat) 65 | } 66 | data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message 67 | data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String() 68 | 69 | serialized, err := json.Marshal(data) 70 | if err != nil { 71 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 72 | } 73 | return append(serialized, '\n'), nil 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | // IsTerminal returns true if stderr's file descriptor is a terminal. 8 | func IsTerminal(f io.Writer) bool { 9 | return true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "io" 13 | "os" 14 | "syscall" 15 | "unsafe" 16 | ) 17 | 18 | // IsTerminal returns true if stderr's file descriptor is a terminal. 19 | func IsTerminal(f io.Writer) bool { 20 | var termios Termios 21 | switch v := f.(type) { 22 | case *os.File: 23 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(v.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 24 | return err == 0 25 | default: 26 | return false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | // IsTerminal returns true if the given file descriptor is a terminal. 13 | func IsTerminal(f io.Writer) bool { 14 | switch v := f.(type) { 15 | case *os.File: 16 | _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA) 17 | return err == nil 18 | default: 19 | return false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "io" 12 | "os" 13 | "syscall" 14 | "unsafe" 15 | ) 16 | 17 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 18 | 19 | var ( 20 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 21 | ) 22 | 23 | // IsTerminal returns true if stderr's file descriptor is a terminal. 24 | func IsTerminal(f io.Writer) bool { 25 | switch v := f.(type) { 26 | case *os.File: 27 | var st uint32 28 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(v.Fd()), uintptr(unsafe.Pointer(&st)), 0) 29 | return r != 0 && e == 0 30 | default: 31 | return false 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | return logger.WriterLevel(InfoLevel) 11 | } 12 | 13 | func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { 14 | return NewEntry(logger).WriterLevel(level) 15 | } 16 | 17 | func (entry *Entry) Writer() *io.PipeWriter { 18 | return entry.WriterLevel(InfoLevel) 19 | } 20 | 21 | func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { 22 | reader, writer := io.Pipe() 23 | 24 | var printFunc func(args ...interface{}) 25 | 26 | switch level { 27 | case DebugLevel: 28 | printFunc = entry.Debug 29 | case InfoLevel: 30 | printFunc = entry.Info 31 | case WarnLevel: 32 | printFunc = entry.Warn 33 | case ErrorLevel: 34 | printFunc = entry.Error 35 | case FatalLevel: 36 | printFunc = entry.Fatal 37 | case PanicLevel: 38 | printFunc = entry.Panic 39 | default: 40 | printFunc = entry.Print 41 | } 42 | 43 | go entry.writerScanner(reader, printFunc) 44 | runtime.SetFinalizer(writer, writerFinalizer) 45 | 46 | return writer 47 | } 48 | 49 | func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { 50 | scanner := bufio.NewScanner(reader) 51 | for scanner.Scan() { 52 | printFunc(scanner.Text()) 53 | } 54 | if err := scanner.Err(); err != nil { 55 | entry.Errorf("Error while reading from Writer: %s", err) 56 | } 57 | reader.Close() 58 | } 59 | 60 | func writerFinalizer(writer *io.PipeWriter) { 61 | writer.Close() 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/armon/go-radix/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/armon/go-radix/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | -------------------------------------------------------------------------------- /vendor/github.com/armon/go-radix/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Armon Dadgar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/armon/go-radix/README.md: -------------------------------------------------------------------------------- 1 | go-radix [![Build Status](https://travis-ci.org/armon/go-radix.png)](https://travis-ci.org/armon/go-radix) 2 | ========= 3 | 4 | Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree). 5 | The package only provides a single `Tree` implementation, optimized for sparse nodes. 6 | 7 | As a radix tree, it provides the following: 8 | * O(k) operations. In many cases, this can be faster than a hash table since 9 | the hash function is an O(k) operation, and hash tables have very poor cache locality. 10 | * Minimum / Maximum value lookups 11 | * Ordered iteration 12 | 13 | For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix). 14 | 15 | Documentation 16 | ============= 17 | 18 | The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix). 19 | 20 | Example 21 | ======= 22 | 23 | Below is a simple example of usage 24 | 25 | ```go 26 | // Create a tree 27 | r := radix.New() 28 | r.Insert("foo", 1) 29 | r.Insert("bar", 2) 30 | r.Insert("foobar", 2) 31 | 32 | // Find the longest prefix match 33 | m, _, _ := r.LongestPrefix("foozip") 34 | if m != "foo" { 35 | panic("should be foo") 36 | } 37 | ``` 38 | 39 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5.4 4 | - 1.6.3 5 | - 1.7 6 | install: 7 | - go get -v golang.org/x/tools/cmd/cover 8 | script: 9 | - go test -v -tags=safe ./spew 10 | - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov 11 | after_success: 12 | - go get -v github.com/mattn/goveralls 13 | - export PATH=$PATH:$HOME/gopath/bin 14 | - goveralls -coverprofile=profile.cov -service=travis-ci 15 | -------------------------------------------------------------------------------- /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/cov_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script uses gocov to generate a test coverage report. 4 | # The gocov tool my be obtained with the following command: 5 | # go get github.com/axw/gocov/gocov 6 | # 7 | # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. 8 | 9 | # Check for gocov. 10 | if ! type gocov >/dev/null 2>&1; then 11 | echo >&2 "This script requires the gocov tool." 12 | echo >&2 "You may obtain it with the following command:" 13 | echo >&2 "go get github.com/axw/gocov/gocov" 14 | exit 1 15 | fi 16 | 17 | # Only run the cgo tests if gcc is installed. 18 | if type gcc >/dev/null 2>&1; then 19 | (cd spew && gocov test -tags testcgo | gocov report) 20 | else 21 | (cd spew && gocov test | gocov report) 22 | fi 23 | -------------------------------------------------------------------------------- /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/digitalocean/godo/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.7 5 | - tip 6 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v1.0.0] - 2017-03-10 4 | 5 | ### Added 6 | - #130 Add Convert to ImageActionsService. - @xmudrii 7 | - #126 Add CertificatesService for managing certificates with the DigitalOcean API. - @viola 8 | - #125 Add LoadBalancersService for managing load balancers with the DigitalOcean API. - @viola 9 | - #122 Add GetVolumeByName to StorageService. - @protochron 10 | - #113 Add context.Context to all calls. - @aybabtme 11 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you submit a pull request, please keep the following guidelines in mind: 4 | 5 | 1. Code should be `go fmt` compliant. 6 | 2. Types, structs and funcs should be documented. 7 | 3. Tests pass. 8 | 9 | ## Getting set up 10 | 11 | Assuming your `$GOPATH` is set up according to your desires, run: 12 | 13 | ```sh 14 | go get github.com/digitalocean/godo 15 | ``` 16 | 17 | ## Running tests 18 | 19 | When working on code in this repository, tests can be run via: 20 | 21 | ```sh 22 | go test . 23 | ``` 24 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/account.go: -------------------------------------------------------------------------------- 1 | package godo 2 | 3 | import "context" 4 | 5 | // AccountService is an interface for interfacing with the Account 6 | // endpoints of the DigitalOcean API 7 | // See: https://developers.digitalocean.com/documentation/v2/#account 8 | type AccountService interface { 9 | Get(context.Context) (*Account, *Response, error) 10 | } 11 | 12 | // AccountServiceOp handles communication with the Account related methods of 13 | // the DigitalOcean API. 14 | type AccountServiceOp struct { 15 | client *Client 16 | } 17 | 18 | var _ AccountService = &AccountServiceOp{} 19 | 20 | // Account represents a DigitalOcean Account 21 | type Account struct { 22 | DropletLimit int `json:"droplet_limit,omitempty"` 23 | FloatingIPLimit int `json:"floating_ip_limit,omitempty"` 24 | Email string `json:"email,omitempty"` 25 | UUID string `json:"uuid,omitempty"` 26 | EmailVerified bool `json:"email_verified,omitempty"` 27 | Status string `json:"status,omitempty"` 28 | StatusMessage string `json:"status_message,omitempty"` 29 | } 30 | 31 | type accountRoot struct { 32 | Account *Account `json:"account"` 33 | } 34 | 35 | func (r Account) String() string { 36 | return Stringify(r) 37 | } 38 | 39 | // Get DigitalOcean account info 40 | func (s *AccountServiceOp) Get(ctx context.Context) (*Account, *Response, error) { 41 | 42 | path := "v2/account" 43 | 44 | req, err := s.client.NewRequest(ctx, "GET", path, nil) 45 | if err != nil { 46 | return nil, nil, err 47 | } 48 | 49 | root := new(accountRoot) 50 | resp, err := s.client.Do(req, root) 51 | if err != nil { 52 | return nil, resp, err 53 | } 54 | 55 | return root.Account, resp, err 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/doc.go: -------------------------------------------------------------------------------- 1 | // Package godo is the DigtalOcean API v2 client for Go 2 | package godo 3 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/errors.go: -------------------------------------------------------------------------------- 1 | package godo 2 | 3 | import "fmt" 4 | 5 | // ArgError is an error that represents an error with an input to godo. It 6 | // identifies the argument and the cause (if possible). 7 | type ArgError struct { 8 | arg string 9 | reason string 10 | } 11 | 12 | var _ error = &ArgError{} 13 | 14 | // NewArgError creates an InputError. 15 | func NewArgError(arg, reason string) *ArgError { 16 | return &ArgError{ 17 | arg: arg, 18 | reason: reason, 19 | } 20 | } 21 | 22 | func (e *ArgError) Error() string { 23 | return fmt.Sprintf("%s is invalid because %s", e.arg, e.reason) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/regions.go: -------------------------------------------------------------------------------- 1 | package godo 2 | 3 | import "context" 4 | 5 | // RegionsService is an interface for interfacing with the regions 6 | // endpoints of the DigitalOcean API 7 | // See: https://developers.digitalocean.com/documentation/v2#regions 8 | type RegionsService interface { 9 | List(context.Context, *ListOptions) ([]Region, *Response, error) 10 | } 11 | 12 | // RegionsServiceOp handles communication with the region related methods of the 13 | // DigitalOcean API. 14 | type RegionsServiceOp struct { 15 | client *Client 16 | } 17 | 18 | var _ RegionsService = &RegionsServiceOp{} 19 | 20 | // Region represents a DigitalOcean Region 21 | type Region struct { 22 | Slug string `json:"slug,omitempty"` 23 | Name string `json:"name,omitempty"` 24 | Sizes []string `json:"sizes,omitempty"` 25 | Available bool `json:"available,omitempty"` 26 | Features []string `json:"features,omitempty"` 27 | } 28 | 29 | type regionsRoot struct { 30 | Regions []Region 31 | Links *Links `json:"links"` 32 | } 33 | 34 | func (r Region) String() string { 35 | return Stringify(r) 36 | } 37 | 38 | // List all regions 39 | func (s *RegionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Region, *Response, error) { 40 | path := "v2/regions" 41 | path, err := addOptions(path, opt) 42 | if err != nil { 43 | return nil, nil, err 44 | } 45 | 46 | req, err := s.client.NewRequest(ctx, "GET", path, nil) 47 | if err != nil { 48 | return nil, nil, err 49 | } 50 | 51 | root := new(regionsRoot) 52 | resp, err := s.client.Do(req, root) 53 | if err != nil { 54 | return nil, resp, err 55 | } 56 | if l := root.Links; l != nil { 57 | resp.Links = l 58 | } 59 | 60 | return root.Regions, resp, err 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/sizes.go: -------------------------------------------------------------------------------- 1 | package godo 2 | 3 | import "context" 4 | 5 | // SizesService is an interface for interfacing with the size 6 | // endpoints of the DigitalOcean API 7 | // See: https://developers.digitalocean.com/documentation/v2#sizes 8 | type SizesService interface { 9 | List(context.Context, *ListOptions) ([]Size, *Response, error) 10 | } 11 | 12 | // SizesServiceOp handles communication with the size related methods of the 13 | // DigitalOcean API. 14 | type SizesServiceOp struct { 15 | client *Client 16 | } 17 | 18 | var _ SizesService = &SizesServiceOp{} 19 | 20 | // Size represents a DigitalOcean Size 21 | type Size struct { 22 | Slug string `json:"slug,omitempty"` 23 | Memory int `json:"memory,omitempty"` 24 | Vcpus int `json:"vcpus,omitempty"` 25 | Disk int `json:"disk,omitempty"` 26 | PriceMonthly float64 `json:"price_monthly,omitempty"` 27 | PriceHourly float64 `json:"price_hourly,omitempty"` 28 | Regions []string `json:"regions,omitempty"` 29 | Available bool `json:"available,omitempty"` 30 | Transfer float64 `json:"transfer,omitempty"` 31 | } 32 | 33 | func (s Size) String() string { 34 | return Stringify(s) 35 | } 36 | 37 | type sizesRoot struct { 38 | Sizes []Size 39 | Links *Links `json:"links"` 40 | } 41 | 42 | // List all images 43 | func (s *SizesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Size, *Response, error) { 44 | path := "v2/sizes" 45 | path, err := addOptions(path, opt) 46 | if err != nil { 47 | return nil, nil, err 48 | } 49 | 50 | req, err := s.client.NewRequest(ctx, "GET", path, nil) 51 | if err != nil { 52 | return nil, nil, err 53 | } 54 | 55 | root := new(sizesRoot) 56 | resp, err := s.client.Do(req, root) 57 | if err != nil { 58 | return nil, resp, err 59 | } 60 | if l := root.Links; l != nil { 61 | resp.Links = l 62 | } 63 | 64 | return root.Sizes, resp, err 65 | } 66 | -------------------------------------------------------------------------------- /vendor/github.com/digitalocean/godo/timestamp.go: -------------------------------------------------------------------------------- 1 | package godo 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | // Timestamp represents a time that can be unmarshalled from a JSON string 9 | // formatted as either an RFC3339 or Unix timestamp. All 10 | // exported methods of time.Time can be called on Timestamp. 11 | type Timestamp struct { 12 | time.Time 13 | } 14 | 15 | func (t Timestamp) String() string { 16 | return t.Time.String() 17 | } 18 | 19 | // UnmarshalJSON implements the json.Unmarshaler interface. 20 | // Time is expected in RFC3339 or Unix format. 21 | func (t *Timestamp) UnmarshalJSON(data []byte) error { 22 | str := string(data) 23 | i, err := strconv.ParseInt(str, 10, 64) 24 | if err == nil { 25 | t.Time = time.Unix(i, 0) 26 | } else { 27 | t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) 28 | } 29 | return err 30 | } 31 | 32 | // Equal reports whether t and u are equal based on time.Equal 33 | func (t Timestamp) Equal(u Timestamp) bool { 34 | return t.Time.Equal(u.Time) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Editor/IDE files 4 | *~ 5 | .idea/ 6 | *.iml 7 | coverage.txt 8 | .tags 9 | 10 | # Build binaries 11 | build/ 12 | 13 | # Vim temporary files. 14 | .*.swp 15 | 16 | # Test binary, build with `go test -c` 17 | *.test 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/.mailmap: -------------------------------------------------------------------------------- 1 | Bill Farner Bill Farner 2 | Olivier Gambier Olivier Gambier 3 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/MAINTAINERS: -------------------------------------------------------------------------------- 1 | # InfraKit maintainers file 2 | # 3 | # This file describes who runs the docker/infrakit project and how. 4 | # This is a living document - if you see something out of date or missing, speak up! 5 | # 6 | # It is structured to be consumable by both humans and programs. 7 | # To extract its contents programmatically, use any TOML-compliant parser. 8 | # 9 | # This file is compiled into the MAINTAINERS file in docker/opensource. 10 | # 11 | [Org] 12 | [Org."Core maintainers"] 13 | people = [ 14 | "chungers", 15 | "wfarner" 16 | ] 17 | 18 | [people] 19 | 20 | # A reference list of all people associated with the project. 21 | # All other sections should refer to people by their canonical key 22 | # in the people section. 23 | 24 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 25 | 26 | [people.chungers] 27 | Name = "David Chung" 28 | Email = "david.chung@docker.com" 29 | GitHub = "chungers" 30 | 31 | [people.wfarner] 32 | Name = "Bill Farner" 33 | Email = "bill.farner@docker.com" 34 | GitHub = "wfarner" 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/broker/server/server.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | ) 7 | 8 | // ListenAndServeOnSocket starts a minimal server (mostly for testing) listening at the given unix socket path. 9 | func ListenAndServeOnSocket(socketPath string, optionalURLPattern ...string) (*Broker, error) { 10 | urlPattern := "/" 11 | if len(optionalURLPattern) > 0 { 12 | urlPattern = optionalURLPattern[0] 13 | } 14 | listener, err := net.Listen("unix", socketPath) 15 | if err != nil { 16 | return nil, err 17 | } 18 | broker := NewBroker() 19 | mux := http.NewServeMux() 20 | mux.Handle(urlPattern, broker) 21 | httpServer := &http.Server{ 22 | Handler: mux, 23 | } 24 | go httpServer.Serve(listener) 25 | 26 | return broker, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/cli/cli.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | ) 6 | 7 | const ( 8 | // CliDirEnvVar is the environment variable that points to where the cli config folders are. 9 | CliDirEnvVar = "INFRAKIT_CLI_DIR" 10 | ) 11 | 12 | // Modules provides access to CLI module discovery 13 | type Modules interface { 14 | 15 | // List returns a list of preconfigured commands 16 | List() ([]*cobra.Command, error) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/cli/logging.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "github.com/spf13/pflag" 5 | 6 | "github.com/Sirupsen/logrus" 7 | logutil "github.com/docker/infrakit/pkg/log" 8 | ) 9 | 10 | // DefaultLogLevel is the default log level value. 11 | var DefaultLogLevel = len(logrus.AllLevels) - 2 12 | 13 | // SetLogLevel adjusts the logrus level. 14 | func SetLogLevel(level int) { 15 | if level > len(logrus.AllLevels)-1 { 16 | level = len(logrus.AllLevels) - 1 17 | } else if level < 0 { 18 | level = 0 19 | } 20 | logrus.SetLevel(logrus.AllLevels[level]) 21 | } 22 | 23 | // Flags returns the set of logging flags 24 | func Flags(o *logutil.Options) *pflag.FlagSet { 25 | f := pflag.NewFlagSet("logging", pflag.ExitOnError) 26 | f.IntVar(&o.Level, "log", o.Level, "log level") 27 | f.BoolVar(&o.Stdout, "log-stdout", o.Stdout, "log to stdout") 28 | f.BoolVar(&o.CallFunc, "log-caller", o.CallFunc, "include caller function") 29 | f.BoolVar(&o.CallStack, "log-stack", o.CallStack, "include caller stack") 30 | f.StringVar(&o.Format, "log-format", o.Format, "log format: logfmt|term|json") 31 | return f 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/cli/template.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/infrakit/pkg/discovery" 7 | metadata_template "github.com/docker/infrakit/pkg/plugin/metadata/template" 8 | "github.com/docker/infrakit/pkg/template" 9 | ) 10 | 11 | // ConfigureTemplate is a utility that helps setup template engines in a standardized way across all uses. 12 | func ConfigureTemplate(engine *template.Template, plugins func() discovery.Plugins) *template.Template { 13 | engine.WithFunctions(func() []template.Function { 14 | return []template.Function{ 15 | { 16 | Name: "metadata", 17 | Description: []string{ 18 | "Metadata function takes a path of the form \"plugin_name/path/to/data\"", 19 | "and calls GET on the plugin with the path \"path/to/data\".", 20 | "It's identical to the CLI command infrakit metadata cat ...", 21 | }, 22 | Func: metadata_template.MetadataFunc(plugins), 23 | }, 24 | { 25 | Name: "resource", 26 | Func: func(s string) string { 27 | return fmt.Sprintf("{{ resource `%s` }}", s) 28 | }, 29 | }, 30 | } 31 | }) 32 | return engine 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/cli/util.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "os" 5 | 6 | logutil "github.com/docker/infrakit/pkg/log" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | var log = logutil.New("module", "cli/core") 11 | 12 | // UpTree traverses up the command tree and starts executing the do function in the order from top 13 | // of the command tree to the bottom. Cobra commands executes only one level of PersistentPreRunE 14 | // in reverse order. This breaks our model of setting log levels at the very top and have the log level 15 | // set throughout the entire hierarchy of command execution. 16 | func UpTree(c *cobra.Command, do func(*cobra.Command, []string) error) error { 17 | if p := c.Parent(); p != nil { 18 | return UpTree(p, do) 19 | } 20 | return do(c, c.Flags().Args()) 21 | } 22 | 23 | // EnsurePersistentPreRunE works around a limit of COBRA where only the persistent runE is executed at the 24 | // parent of the leaf node. 25 | func EnsurePersistentPreRunE(c *cobra.Command) error { 26 | return UpTree(c, func(x *cobra.Command, argv []string) error { 27 | if x.PersistentPreRunE != nil { 28 | return x.PersistentPreRunE(x, argv) 29 | } 30 | return nil 31 | }) 32 | } 33 | 34 | // MustNotNil checks the object, if nil , exits and logs message 35 | func MustNotNil(object interface{}, message string, ctx ...string) { 36 | if object == nil { 37 | log.Crit(message, ctx) 38 | os.Exit(-1) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/cli/version.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | var ( 10 | // Version is the build release identifier. 11 | Version = "Unspecified" 12 | 13 | // Revision is the build source control revision. 14 | Revision = "Unspecified" 15 | ) 16 | 17 | var info = map[string]map[string]interface{}{} 18 | 19 | // RegisterInfo allows any packages that use this register additional information to be displayed by the command. 20 | // For example, a swarm flavor could register the docker api version. This allows us to selectively incorporate 21 | // only required dependencies based on package registration (in their init()) without explicitly pulling unused 22 | // dependencies. 23 | func RegisterInfo(key string, data map[string]interface{}) { 24 | info[key] = data 25 | } 26 | 27 | // VersionCommand creates a cobra Command that prints build version information. 28 | func VersionCommand() *cobra.Command { 29 | return &cobra.Command{ 30 | Use: "version", 31 | Short: "Print build version information", 32 | Run: func(cmd *cobra.Command, args []string) { 33 | fmt.Printf("\n%-24s: %v", "Version", Version) 34 | fmt.Printf("\n%-24s: %v", "Revision", Revision) 35 | for k, m := range info { 36 | fmt.Printf("\n\n%s", k) 37 | for kk, vv := range m { 38 | fmt.Printf("\n%-24s: %v", kk, vv) 39 | } 40 | fmt.Printf("\n") 41 | } 42 | fmt.Println() 43 | }, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/discovery/discovery.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/infrakit/pkg/plugin" 7 | ) 8 | 9 | // Plugins provides access to plugin discovery. 10 | type Plugins interface { 11 | // Find looks up the plugin by name. The name can be of the form $lookup[/$subtype]. See GetLookupAndType(). 12 | Find(name plugin.Name) (*plugin.Endpoint, error) 13 | List() (map[string]*plugin.Endpoint, error) 14 | } 15 | 16 | const ( 17 | // PluginDirEnvVar is the environment variable that may be used to customize the plugin discovery path. 18 | PluginDirEnvVar = "INFRAKIT_PLUGINS_DIR" 19 | ) 20 | 21 | // ErrNotUnixSocketOrListener is the error raised when the file is not a unix socket 22 | type ErrNotUnixSocketOrListener string 23 | 24 | func (e ErrNotUnixSocketOrListener) Error() string { 25 | return fmt.Sprintf("not a unix socket or listener:%s", string(e)) 26 | } 27 | 28 | // IsErrNotUnixSocketOrListener returns true if the error is due to the file not being a valid unix socket. 29 | func IsErrNotUnixSocketOrListener(e error) bool { 30 | _, is := e.(ErrNotUnixSocketOrListener) 31 | return is 32 | } 33 | 34 | // ErrNotFound is the error raised when the plugin is not found 35 | type ErrNotFound string 36 | 37 | func (e ErrNotFound) Error() string { 38 | return fmt.Sprintf("plugin not found:%s", string(e)) 39 | } 40 | 41 | // IsErrNotFound returns true if the error is due to a plugin not found. 42 | func IsErrNotFound(e error) bool { 43 | _, is := e.(ErrNotFound) 44 | return is 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/discovery/local/local.go: -------------------------------------------------------------------------------- 1 | package local 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/infrakit/pkg/discovery" 7 | logutil "github.com/docker/infrakit/pkg/log" 8 | "github.com/spf13/afero" 9 | ) 10 | 11 | // Setup sets up the necessary environment for running this module -- ie make sure 12 | // the CLI module directories are present, etc. 13 | func Setup() error { 14 | dir := Dir() 15 | if dir == "" { 16 | return fmt.Errorf("Env not set:%s", discovery.PluginDirEnvVar) 17 | } 18 | fs := afero.NewOsFs() 19 | exists, err := afero.Exists(fs, dir) 20 | if err != nil || !exists { 21 | log.Debug("Creating directory", "dir", dir) 22 | err = fs.MkdirAll(dir, 0755) 23 | if err != nil { 24 | return err 25 | } 26 | } 27 | // try again 28 | exists, err = afero.Exists(fs, dir) 29 | if !exists { 30 | return fmt.Errorf("Cannot set up directory %s: err=%v", dir, err) 31 | } 32 | return err 33 | } 34 | 35 | var log = logutil.New("module", "discovery/local") 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/plugin/metadata/template/template.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/infrakit/pkg/discovery" 7 | "github.com/docker/infrakit/pkg/rpc/client" 8 | metadata_rpc "github.com/docker/infrakit/pkg/rpc/metadata" 9 | "github.com/docker/infrakit/pkg/spi/metadata" 10 | "github.com/docker/infrakit/pkg/types" 11 | ) 12 | 13 | // MetadataFunc returns a template function to support metadata retrieval in templates. 14 | func MetadataFunc(discovery func() discovery.Plugins) func(string) (interface{}, error) { 15 | 16 | plugins := discovery 17 | 18 | return func(path string) (interface{}, error) { 19 | 20 | if plugins == nil { 21 | return nil, fmt.Errorf("no plugin discovery:%s", path) 22 | } 23 | 24 | mpath := types.PathFromString(path) 25 | first := mpath.Index(0) 26 | if first == nil { 27 | return nil, fmt.Errorf("unknown plugin from path: %s", path) 28 | } 29 | 30 | lookup, err := plugins().List() 31 | if err != nil { 32 | return nil, err 33 | } 34 | 35 | endpoint, has := lookup[*first] 36 | if !has { 37 | return false, nil // Don't return error. Just return false for non-existence 38 | } else if mpath.Len() == 1 { 39 | return true, nil // This is a test for availability of the plugin 40 | } 41 | 42 | rpcClient, err := client.New(endpoint.Address, metadata.InterfaceSpec) 43 | if err != nil { 44 | return nil, fmt.Errorf("cannot connect to plugin: %s", *first) 45 | } 46 | 47 | any, err := metadata_rpc.Adapt(rpcClient).Get(mpath.Shift(1)) 48 | if err != nil { 49 | return nil, err 50 | } 51 | var value interface{} 52 | err = any.Decode(&value) 53 | if err != nil { 54 | return any.String(), err 55 | } 56 | return value, nil 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/plugin/name.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // Name is a reference to the plugin. Places where it appears include JSON files as type of field `Plugin`. 9 | type Name string 10 | 11 | // GetLookupAndType returns the plugin name for lookup and sub-type supported by the plugin. 12 | // The name follows a microformat of $plugin[/$subtype] where $plugin is used for the discovery / lookup by name. 13 | // The $subtype is used for the Type parameter in the RPC requests. 14 | // Example: instance-file/json means lookup socket file 'instance-file' and the type is 'json'. 15 | func (r Name) GetLookupAndType() (string, string) { 16 | name := string(r) 17 | if first := strings.Index(name, "/"); first >= 0 { 18 | return name[0:first], name[first+1:] 19 | } 20 | return name, "" 21 | } 22 | 23 | // String returns the string representation 24 | func (r Name) String() string { 25 | return string(r) 26 | } 27 | 28 | // MarshalJSON implements the JSON marshaler interface 29 | func (r Name) MarshalJSON() ([]byte, error) { 30 | return []byte(fmt.Sprintf(`"%s"`, r.String())), nil 31 | } 32 | 33 | // UnmarshalJSON implements the JSON unmarshaler interface 34 | func (r *Name) UnmarshalJSON(data []byte) error { 35 | str := string(data) 36 | start := strings.Index(str, "\"") 37 | last := strings.LastIndex(str, "\"") 38 | if start == 0 && last == len(str)-1 { 39 | str = str[start+1 : last] 40 | } else { 41 | return fmt.Errorf("bad-format-for-name:%v", string(data)) 42 | } 43 | *r = Name(str) 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/client/info.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net" 6 | "net/http" 7 | 8 | "github.com/docker/infrakit/pkg/plugin" 9 | "github.com/docker/infrakit/pkg/rpc" 10 | "github.com/docker/infrakit/pkg/template" 11 | ) 12 | 13 | // NewPluginInfoClient returns a plugin informer that can give metadata about a plugin 14 | func NewPluginInfoClient(socketPath string) *InfoClient { 15 | dialUnix := func(proto, addr string) (conn net.Conn, err error) { 16 | return net.Dial("unix", socketPath) 17 | } 18 | return &InfoClient{client: &http.Client{Transport: &http.Transport{Dial: dialUnix}}} 19 | } 20 | 21 | // InfoClient is the client for retrieving plugin info 22 | type InfoClient struct { 23 | client *http.Client 24 | } 25 | 26 | // GetInfo implements the Info interface and returns the metadata about the plugin 27 | func (i *InfoClient) GetInfo() (plugin.Info, error) { 28 | meta := plugin.Info{} 29 | resp, err := i.client.Get("http://d" + rpc.URLAPI) 30 | if err != nil { 31 | return meta, err 32 | } 33 | defer resp.Body.Close() 34 | err = json.NewDecoder(resp.Body).Decode(&meta) 35 | return meta, err 36 | } 37 | 38 | // GetFunctions returns metadata about the plugin's template functions, if the plugin supports templating. 39 | func (i *InfoClient) GetFunctions() (map[string][]template.Function, error) { 40 | meta := map[string][]template.Function{} 41 | resp, err := i.client.Get("http://d" + rpc.URLFunctions) 42 | if err != nil { 43 | return meta, err 44 | } 45 | defer resp.Body.Close() 46 | err = json.NewDecoder(resp.Body).Decode(&meta) 47 | return meta, err 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/client/rpc.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | // Client allows execution of RPCs. 4 | type Client interface { 5 | 6 | // Addr returns the address -- e.g. unix socket path 7 | Addr() string 8 | 9 | // Call invokes an RPC method with an argument and a pointer to a result that will hold the return value. 10 | Call(method string, arg interface{}, result interface{}) error 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/group/types.go: -------------------------------------------------------------------------------- 1 | package group 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi/group" 5 | ) 6 | 7 | // CommitGroupRequest is the rpc wrapper for input to commit a group 8 | type CommitGroupRequest struct { 9 | Spec group.Spec 10 | Pretend bool 11 | } 12 | 13 | // CommitGroupResponse is the rpc wrapper for the results to commit a group 14 | type CommitGroupResponse struct { 15 | Details string 16 | } 17 | 18 | // FreeGroupRequest is the rpc wrapper for input to free a group 19 | type FreeGroupRequest struct { 20 | ID group.ID 21 | } 22 | 23 | // FreeGroupResponse is the rpc wrapper for the results to free a group 24 | type FreeGroupResponse struct { 25 | OK bool 26 | } 27 | 28 | // DescribeGroupRequest is the rpc wrapper for the input to inspect a group 29 | type DescribeGroupRequest struct { 30 | ID group.ID 31 | } 32 | 33 | // DescribeGroupResponse is the rpc wrapper for the results from inspecting a group 34 | type DescribeGroupResponse struct { 35 | Description group.Description 36 | } 37 | 38 | // DestroyGroupRequest is the rpc wrapper for the input to destroy a group 39 | type DestroyGroupRequest struct { 40 | ID group.ID 41 | } 42 | 43 | // DestroyGroupResponse is the rpc wrapper for the output from destroying a group 44 | type DestroyGroupResponse struct { 45 | OK bool 46 | } 47 | 48 | // InspectGroupsRequest is the rpc wrapper for the input to inspect groups 49 | type InspectGroupsRequest struct { 50 | } 51 | 52 | // InspectGroupsResponse is the rpc wrapper for the output from inspecting groups 53 | type InspectGroupsResponse struct { 54 | Groups []group.Spec 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/info.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | const ( 4 | // URLAPI is the well-known HTTP GET endpoint that retrieves description of the plugin's interfaces. 5 | URLAPI = "/info/api.json" 6 | 7 | // URLFunctions exposes the templates functions that are available via this plugin 8 | URLFunctions = "/info/functions.json" 9 | 10 | // URLEventsPrefix is the prefix of the events endpoint 11 | URLEventsPrefix = "/events" 12 | ) 13 | 14 | // InputExample is the interface implemented by the rpc implementations for 15 | // group, instance, and flavor to set example input using custom/ vendored data types. 16 | type InputExample interface { 17 | 18 | // SetExampleProperties updates the parameter with example properties. 19 | // The request param must be a pointer 20 | SetExampleProperties(request interface{}) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/instance/types.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi/instance" 5 | "github.com/docker/infrakit/pkg/types" 6 | ) 7 | 8 | // ValidateRequest is the rpc wrapper for the Validate method args 9 | type ValidateRequest struct { 10 | Type string 11 | Properties *types.Any 12 | } 13 | 14 | // ValidateResponse is the rpc wrapper for the Validate response values 15 | type ValidateResponse struct { 16 | Type string 17 | OK bool 18 | } 19 | 20 | // ProvisionRequest is the rpc wrapper for Provision request 21 | type ProvisionRequest struct { 22 | Type string 23 | Spec instance.Spec 24 | } 25 | 26 | // ProvisionResponse is the rpc wrapper for Provision response 27 | type ProvisionResponse struct { 28 | Type string 29 | ID *instance.ID 30 | } 31 | 32 | // LabelRequest is the rpc wrapper for Label request 33 | type LabelRequest struct { 34 | Type string 35 | Instance instance.ID 36 | Labels map[string]string 37 | } 38 | 39 | // LabelResponse is the rpc wrapper for Label response 40 | type LabelResponse struct { 41 | Type string 42 | OK bool 43 | } 44 | 45 | // DestroyRequest is the rpc wrapper for Destroy request 46 | type DestroyRequest struct { 47 | Type string 48 | Instance instance.ID 49 | } 50 | 51 | // DestroyResponse is the rpc wrapper for Destroy response 52 | type DestroyResponse struct { 53 | Type string 54 | OK bool 55 | } 56 | 57 | // DescribeInstancesRequest is the rpc wrapper for DescribeInstances request 58 | type DescribeInstancesRequest struct { 59 | Type string 60 | Tags map[string]string 61 | Properties bool 62 | } 63 | 64 | // DescribeInstancesResponse is the rpc wrapper for the DescribeInstances response 65 | type DescribeInstancesResponse struct { 66 | Type string 67 | Descriptions []instance.Description 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/metadata/client.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | import ( 4 | rpc_client "github.com/docker/infrakit/pkg/rpc/client" 5 | "github.com/docker/infrakit/pkg/spi/metadata" 6 | "github.com/docker/infrakit/pkg/types" 7 | ) 8 | 9 | // NewClient returns a plugin interface implementation connected to a remote plugin 10 | func NewClient(socketPath string) (metadata.Plugin, error) { 11 | rpcClient, err := rpc_client.New(socketPath, metadata.InterfaceSpec) 12 | if err != nil { 13 | return nil, err 14 | } 15 | return &client{client: rpcClient}, nil 16 | } 17 | 18 | // Adapt converts a rpc client to a Metadata plugin object 19 | func Adapt(rpcClient rpc_client.Client) metadata.Plugin { 20 | return &client{client: rpcClient} 21 | } 22 | 23 | type client struct { 24 | client rpc_client.Client 25 | } 26 | 27 | func (c client) list(method string, path types.Path) ([]string, error) { 28 | req := ListRequest{Path: path} 29 | resp := ListResponse{} 30 | err := c.client.Call(method, req, &resp) 31 | return resp.Nodes, err 32 | } 33 | 34 | // List returns a list of nodes under path. 35 | func (c client) List(path types.Path) ([]string, error) { 36 | return c.list("Metadata.List", path) 37 | } 38 | 39 | func (c client) get(method string, path types.Path) (*types.Any, error) { 40 | req := GetRequest{Path: path} 41 | resp := GetResponse{} 42 | err := c.client.Call(method, req, &resp) 43 | if err != nil { 44 | return nil, err 45 | } 46 | return resp.Value, err 47 | } 48 | 49 | // Get retrieves the metadata at path. 50 | func (c client) Get(path types.Path) (*types.Any, error) { 51 | return c.get("Metadata.Get", path) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/rpc/metadata/types.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi/metadata" 5 | "github.com/docker/infrakit/pkg/types" 6 | ) 7 | 8 | // ListRequest is the rpc wrapper for request parameters to List 9 | type ListRequest struct { 10 | Path types.Path 11 | } 12 | 13 | // ListResponse is the rpc wrapper for the results of List 14 | type ListResponse struct { 15 | Nodes []string 16 | } 17 | 18 | // GetRequest is the rpc wrapper of the params to Get 19 | type GetRequest struct { 20 | Path types.Path 21 | } 22 | 23 | // GetResponse is the rpc wrapper of the result of Get 24 | type GetResponse struct { 25 | Value *types.Any 26 | } 27 | 28 | // ChangesRequest is the rpc wrapper of the params to Changes 29 | type ChangesRequest struct { 30 | Changes []metadata.Change 31 | } 32 | 33 | // ChangesResponse is the rpc wrapper of the params to Changes 34 | type ChangesResponse struct { 35 | Original *types.Any 36 | Proposed *types.Any 37 | Cas string 38 | } 39 | 40 | // CommitRequest is the rpc wrapper of the params to Commit 41 | type CommitRequest struct { 42 | Proposed *types.Any 43 | Cas string 44 | } 45 | 46 | // CommitResponse is the rpc wrapper of the params to Commit 47 | type CommitResponse struct { 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/event/spi.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi" 5 | "github.com/docker/infrakit/pkg/types" 6 | ) 7 | 8 | // InterfaceSpec is the current name and version of the Flavor API. 9 | var InterfaceSpec = spi.InterfaceSpec{ 10 | Name: "Event", 11 | Version: "0.1.0", 12 | } 13 | 14 | // Plugin must be implemented for the object to be able to publish events. 15 | type Plugin interface { 16 | 17 | // List returns a list of *child nodes* given a path for a topic. 18 | // A topic of "." is the top level 19 | List(topic types.Path) (child []string, err error) 20 | } 21 | 22 | // Validator is the interface for validating the topic 23 | type Validator interface { 24 | 25 | // Validate validates the topic 26 | Validate(topic types.Path) error 27 | } 28 | 29 | // Publisher is the interface that event sources also implement to be assigned 30 | // a publish function. 31 | type Publisher interface { 32 | 33 | // PublishOn sets the channel to publish 34 | PublishOn(chan<- *Event) 35 | } 36 | 37 | // Subscriber is the interface given to clients interested in events 38 | type Subscriber interface { 39 | 40 | // SubscribeOn returns the channel for the topic 41 | SubscribeOn(topic types.Path) (<-chan *Event, chan<- struct{}, error) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/group/spi.go: -------------------------------------------------------------------------------- 1 | package group 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi" 5 | "github.com/docker/infrakit/pkg/spi/instance" 6 | "github.com/docker/infrakit/pkg/types" 7 | ) 8 | 9 | // InterfaceSpec is the current name and version of the Group API. 10 | var InterfaceSpec = spi.InterfaceSpec{ 11 | Name: "Group", 12 | Version: "0.1.0", 13 | } 14 | 15 | // Plugin defines the functions for a Group plugin. 16 | type Plugin interface { 17 | CommitGroup(grp Spec, pretend bool) (string, error) 18 | 19 | FreeGroup(id ID) error 20 | 21 | DescribeGroup(id ID) (Description, error) 22 | 23 | DestroyGroup(id ID) error 24 | 25 | InspectGroups() ([]Spec, error) 26 | } 27 | 28 | // ID is the unique identifier for a Group. 29 | type ID string 30 | 31 | // Spec is the specification for a Group. The full schema for a Group is defined by the plugin. 32 | // In general, a Spec of an entity is set as the raw JSON value of another object's Properties. 33 | type Spec struct { 34 | // ID is the unique identifier for the group. 35 | ID ID 36 | 37 | // Properties is the configuration for the group. 38 | // The schema for the raw Any can be found as the *.Spec of the plugin used. 39 | // For instance, if the default group plugin is used, the value here will be 40 | // an Any / encoded representation of github.com/docker/infrakit/plugin/group/types.Spec 41 | Properties *types.Any 42 | } 43 | 44 | // Description is a placeholder for the reported state of a Group. 45 | type Description struct { 46 | Instances []instance.Description 47 | Converged bool 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/instance/spi.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi" 5 | "github.com/docker/infrakit/pkg/types" 6 | ) 7 | 8 | // InterfaceSpec is the current name and version of the Instance API. 9 | var InterfaceSpec = spi.InterfaceSpec{ 10 | Name: "Instance", 11 | Version: "0.5.0", 12 | } 13 | 14 | // Plugin is a vendor-agnostic API used to create and manage resources with an infrastructure provider. 15 | type Plugin interface { 16 | // Validate performs local validation on a provision request. 17 | Validate(req *types.Any) error 18 | 19 | // Provision creates a new instance based on the spec. 20 | Provision(spec Spec) (*ID, error) 21 | 22 | // Label labels the instance 23 | Label(instance ID, labels map[string]string) error 24 | 25 | // Destroy terminates an existing instance. 26 | Destroy(instance ID) error 27 | 28 | // DescribeInstances returns descriptions of all instances matching all of the provided tags. 29 | // The properties flag indicates the client is interested in receiving details about each instance. 30 | DescribeInstances(labels map[string]string, properties bool) ([]Description, error) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/instance/types.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/types" 5 | ) 6 | 7 | // ID is the identifier for an instance. 8 | type ID string 9 | 10 | // Description contains details about an instance. 11 | type Description struct { 12 | ID ID 13 | LogicalID *LogicalID 14 | Tags map[string]string 15 | 16 | // Properties carry the opaque, platform specific blob about the resource. 17 | // It can represent the current state of the resource. 18 | Properties *types.Any `json:",omitempty" yaml:",omitempty"` 19 | } 20 | 21 | // LogicalID is the logical identifier to associate with an instance. 22 | type LogicalID string 23 | 24 | // Attachment is an identifier for a resource to attach to an instance. 25 | type Attachment struct { 26 | // ID is the unique identifier for the attachment. 27 | ID string 28 | 29 | // Type is the kind of attachment. This allows multiple attachments of different types, with the supported 30 | // types defined by the plugin. 31 | Type string 32 | } 33 | 34 | // Spec is a specification of an instance to be provisioned 35 | type Spec struct { 36 | // Properties is the opaque instance plugin configuration. 37 | Properties *types.Any 38 | 39 | // Tags are metadata that describes an instance. 40 | Tags map[string]string 41 | 42 | // Init is the boot script to execute when the instance is created. 43 | Init string 44 | 45 | // LogicalID is the logical identifier assigned to this instance, which may be absent. 46 | LogicalID *LogicalID 47 | 48 | // Attachments are instructions for external entities that should be attached to the instance. 49 | Attachments []Attachment 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/metadata/spi.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/spi" 5 | "github.com/docker/infrakit/pkg/types" 6 | ) 7 | 8 | var ( 9 | // InterfaceSpec is the current name and version of the Metadata API. 10 | InterfaceSpec = spi.InterfaceSpec{ 11 | Name: "Metadata", 12 | Version: "0.1.0", 13 | } 14 | 15 | // UpdatableInterfaceSpec is the current name and version of the Metadata API. 16 | UpdatableInterfaceSpec = spi.InterfaceSpec{ 17 | Name: "Updatable", 18 | Version: "0.1.0", 19 | } 20 | ) 21 | 22 | // Plugin is the interface for metadata-related operations. 23 | type Plugin interface { 24 | 25 | // List returns a list of *child nodes* given a path, which is specified as a slice 26 | List(path types.Path) (child []string, err error) 27 | 28 | // Get retrieves the value at path given. 29 | Get(path types.Path) (value *types.Any, err error) 30 | } 31 | 32 | // Change is an update to the metadata / config 33 | type Change struct { 34 | Path types.Path 35 | Value *types.Any 36 | } 37 | 38 | // Updatable is the interface for updating metadata 39 | type Updatable interface { 40 | 41 | // Plugin - embeds a readonly plugin interface 42 | Plugin 43 | 44 | // Changes sends a batch of changes and gets in return a proposed view of configuration and a cas hash. 45 | Changes(changes []Change) (original, proposed *types.Any, cas string, err error) 46 | 47 | // Commit asks the plugin to commit the proposed view with the cas. The cas is used for 48 | // optimistic concurrency control. 49 | Commit(proposed *types.Any, cas string) error 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/spi/plugin.go: -------------------------------------------------------------------------------- 1 | package spi 2 | 3 | import ( 4 | "github.com/docker/infrakit/pkg/types" 5 | ) 6 | 7 | // InterfaceSpec is metadata about an API. 8 | type InterfaceSpec struct { 9 | // Name of the interface. 10 | Name string 11 | 12 | // Version is the identifier for the API version. 13 | Version string 14 | } 15 | 16 | // VendorInfo provides vendor-specific information 17 | type VendorInfo struct { 18 | InterfaceSpec // vendor-defined name / version 19 | 20 | // URL is the informational url for the plugin. It can container help and docs, etc. 21 | URL string 22 | } 23 | 24 | // Vendor is an optional interface that has vendor-specific information methods 25 | type Vendor interface { 26 | // VendorInfo returns a vendor-defined interface spec 27 | VendorInfo() *VendorInfo 28 | } 29 | 30 | // InputExample interface is an optional interface implemented by the plugin that will provide 31 | // example input struct to document the vendor-specific api of the plugin. An example of this 32 | // is to provide a sample JSON for all the Properties field in the plugin API. 33 | type InputExample interface { 34 | 35 | // ExampleProperties returns an example JSON raw message that the vendor plugin understands. 36 | // This is an example of what the user will configure and what will be used as the opaque 37 | // blob in all the plugin methods where raw JSON messages are referenced. 38 | ExampleProperties() *types.Any 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/template/defaults.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | // defaultContextURL returns the default context URL if none is known. 8 | func defaultContextURL() string { 9 | pwd := "/" 10 | if wd, err := os.Getwd(); err == nil { 11 | pwd = wd 12 | } else { 13 | pwd = os.Getenv("PWD") 14 | } 15 | return "file://localhost" + pwd + "/" 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/template/fetch.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "net" 7 | "net/http" 8 | "net/url" 9 | "os" 10 | ) 11 | 12 | // Fetch fetchs content from the given URL string. Supported schemes are http:// https:// file:// unix:// 13 | func Fetch(s string, opt Options) ([]byte, error) { 14 | u, err := url.Parse(s) 15 | if err != nil { 16 | return nil, err 17 | } 18 | switch u.Scheme { 19 | case "file": 20 | return ioutil.ReadFile(u.Path) 21 | 22 | case "http", "https": 23 | return doHTTPGet(u, opt.CustomizeFetch, &http.Client{}) 24 | 25 | case "unix": 26 | // unix: will look for a socket that matches the host name at a 27 | // directory path set by environment variable. 28 | c, err := socketClient(u) 29 | if err != nil { 30 | return nil, err 31 | } 32 | u.Scheme = "http" 33 | return doHTTPGet(u, opt.CustomizeFetch, c) 34 | } 35 | 36 | return nil, fmt.Errorf("unsupported url:%s", s) 37 | } 38 | 39 | func doHTTPGet(u *url.URL, customize func(*http.Request), client *http.Client) ([]byte, error) { 40 | req, err := http.NewRequest(http.MethodGet, u.String(), nil) 41 | if err != nil { 42 | return nil, err 43 | } 44 | 45 | if customize != nil { 46 | customize(req) 47 | } 48 | 49 | resp, err := client.Do(req) 50 | if err != nil { 51 | return nil, err 52 | } 53 | defer resp.Body.Close() 54 | return ioutil.ReadAll(resp.Body) 55 | } 56 | 57 | func socketClient(u *url.URL) (*http.Client, error) { 58 | socketPath := u.Path 59 | if f, err := os.Stat(socketPath); err != nil { 60 | return nil, err 61 | } else if f.Mode()&os.ModeSocket == 0 { 62 | return nil, fmt.Errorf("not-a-socket:%v", socketPath) 63 | } 64 | return &http.Client{ 65 | Transport: &http.Transport{ 66 | Dial: func(proto, addr string) (conn net.Conn, err error) { 67 | return net.Dial("unix", socketPath) 68 | }, 69 | }, 70 | }, nil 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/template/util.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "net/url" 5 | "path/filepath" 6 | "strings" 7 | ) 8 | 9 | // GetURL returns a url string of the base and a relative path. 10 | // e.g. http://host/foo/bar/baz, ./boo.tpl gives http://host/foo/bar/boo.tpl 11 | func GetURL(root, rel string) (*url.URL, error) { 12 | 13 | // handle the case when rel is actually a full url 14 | if strings.Index(rel, "://") > 0 { 15 | u, err := url.Parse(rel) 16 | if err != nil { 17 | return nil, err 18 | } 19 | return u, nil 20 | } 21 | 22 | u, err := url.Parse(root) 23 | if err != nil { 24 | return nil, err 25 | } 26 | u.Path = filepath.Clean(filepath.Join(filepath.Dir(u.Path), rel)) 27 | return u, nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/types/error.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type errMissingAttribute string 8 | 9 | func (e errMissingAttribute) Error() string { 10 | return fmt.Sprintf("missing attribute: %s", string(e)) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/types/hierarchy.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Hierarchical is the interface for any hierarchical, tree-like structures 4 | type Hierarchical interface { 5 | 6 | // List returns a list of *child nodes* given a path, which is specified as a slice 7 | List(path Path) (child []string, err error) 8 | 9 | // Get retrieves the value at path given. 10 | Get(path Path) (value *Any, err error) 11 | } 12 | 13 | type hierarchical map[string]interface{} 14 | 15 | // HierarchicalFromMap adapts a map to the hierarchical interface 16 | func HierarchicalFromMap(m map[string]interface{}) Hierarchical { 17 | return hierarchical(m) 18 | } 19 | 20 | // List lists the children under a path 21 | func (h hierarchical) List(path Path) (child []string, err error) { 22 | return List([]string(path), h), nil 23 | } 24 | 25 | // Get gets the value at path 26 | func (h hierarchical) Get(path Path) (value *Any, err error) { 27 | v := Get([]string(path), h) 28 | return AnyValue(v) 29 | } 30 | 31 | // ListAll returns all the paths under the start path, unsorted 32 | func ListAll(h Hierarchical, start Path) ([]Path, error) { 33 | all := []Path{} 34 | children, err := h.List(start) 35 | if err != nil { 36 | return all, err 37 | } 38 | 39 | for _, c := range children { 40 | p := start.JoinString(c) 41 | all = append(all, p) 42 | 43 | subs, err := ListAll(h, p) 44 | if err != nil { 45 | return all, err 46 | } 47 | all = append(all, subs...) 48 | } 49 | return all, nil 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/types/object.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Object is an instance or realization of the Spec. It has Spec as the desired attributes, as well as, 4 | // the instance identifier (ID), and State, which represents the current snapshot of the object instance. 5 | type Object struct { 6 | 7 | // Spec is the specification / desired state of the object instance. 8 | Spec 9 | 10 | // State is the current snapshot / status of the object instance. 11 | State *Any `json:"state,omitempty" yaml:",omitempty"` 12 | } 13 | 14 | // Validate checks the object for validity 15 | func (o Object) Validate() error { 16 | err := o.Spec.Validate() 17 | if err != nil { 18 | return err 19 | } 20 | if o.Metadata.Identity == nil { 21 | return errMissingAttribute("metadata.identity") 22 | } 23 | if o.Metadata.Identity.UID == "" { 24 | return errMissingAttribute("metadata.identity.uid") 25 | } 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/infrakit/pkg/types/pointer.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // PointerFromPath creates a pointer from the path 8 | func PointerFromPath(p Path) *Pointer { 9 | return &Pointer{ 10 | path: p, 11 | } 12 | } 13 | 14 | // PointerFromString constructs a pointer from a string path. 15 | func PointerFromString(s string) *Pointer { 16 | return PointerFromPath(RFC6901ToPath(s).Clean()) 17 | } 18 | 19 | // Pointer is a JSON pointer where the path is specified per IETF RFC6901 -- see https://tools.ietf.org/html/rfc6901 20 | type Pointer struct { 21 | path Path 22 | } 23 | 24 | // Get retrieves the value at the given point path location 25 | func (p *Pointer) Get(v interface{}) interface{} { 26 | return Get(p.path, v) 27 | } 28 | 29 | // Set is a non-copy mutation on the input doc, setting the attribute at the pointer to v 30 | func (p *Pointer) Set(doc, v interface{}) (updated interface{}, err error) { 31 | return v, fmt.Errorf("not implemented") 32 | } 33 | 34 | // String returns the string representation 35 | func (p Pointer) String() string { 36 | return p.path.String() 37 | } 38 | 39 | // MarshalJSON returns the json representation 40 | func (p Pointer) MarshalJSON() ([]byte, error) { 41 | return p.path.MarshalJSON() 42 | } 43 | 44 | // UnmarshalJSON unmarshals the buffer to this struct 45 | func (p *Pointer) UnmarshalJSON(buff []byte) error { 46 | return (&p.path).UnmarshalJSON(buff) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX leaves these everywhere on SMB shares 2 | ._* 3 | 4 | # Eclipse files 5 | .classpath 6 | .project 7 | .settings/** 8 | 9 | # Emacs save files 10 | *~ 11 | 12 | # Vim-related files 13 | [._]*.s[a-w][a-z] 14 | [._]s[a-w][a-z] 15 | *.un~ 16 | Session.vim 17 | .netrwhist 18 | 19 | # Go test binaries 20 | *.test 21 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | script: 6 | - go test 7 | - go build 8 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-querystring/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-querystring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Google. 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/github.com/google/go-querystring/README.md: -------------------------------------------------------------------------------- 1 | # go-querystring # 2 | 3 | go-querystring is Go library for encoding structs into URL query parameters. 4 | 5 | 6 | **Documentation:** 7 | **Build Status:** [![Build Status](https://drone.io/github.com/google/go-querystring/status.png)](https://drone.io/github.com/google/go-querystring/latest) 8 | 9 | ## Usage ## 10 | 11 | ```go 12 | import "github.com/google/go-querystring/query" 13 | ``` 14 | 15 | go-querystring is designed to assist in scenarios where you want to construct a 16 | URL using a struct that represents the URL query parameters. You might do this 17 | to enforce the type safety of your parameters, for example, as is done in the 18 | [go-github][] library. 19 | 20 | The query package exports a single `Values()` function. A simple example: 21 | 22 | ```go 23 | type Options struct { 24 | Query string `url:"q"` 25 | ShowAll bool `url:"all"` 26 | Page int `url:"page"` 27 | } 28 | 29 | opt := Options{ "foo", true, 2 } 30 | v, _ := query.Values(opt) 31 | fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" 32 | ``` 33 | 34 | [go-github]: https://github.com/google/go-github/commit/994f6f8405f052a117d2d0b500054341048fbb08 35 | 36 | ## License ## 37 | 38 | This library is distributed under the BSD-style license found in the [LICENSE](./LICENSE) 39 | file. 40 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | matrix: 5 | include: 6 | - go: 1.3 7 | - go: 1.4 8 | - go: 1.5 9 | - go: 1.6 10 | - go: 1.7 11 | - go: tip 12 | allow_failures: 13 | - go: tip 14 | 15 | script: 16 | - go get -t -v ./... 17 | - diff -u <(echo -n) <(gofmt -d .) 18 | - go vet $(go list ./... | grep -v /vendor/) 19 | - go test -v -race ./... 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. 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/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | > Note: gorilla/context, having been born well before `context.Context` existed, does not play well 8 | > with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`. 9 | 10 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 11 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | matrix: 5 | include: 6 | - go: 1.2 7 | - go: 1.3 8 | - go: 1.4 9 | - go: 1.5 10 | - go: 1.6 11 | - go: 1.7 12 | - go: 1.8 13 | - go: tip 14 | 15 | install: 16 | - # Skip 17 | 18 | script: 19 | - go get -t -v ./... 20 | - diff -u <(echo -n) <(gofmt -d .) 21 | - go tool vet . 22 | - go test -v -race ./... 23 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. 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/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | matrix: 5 | include: 6 | - go: 1.3 7 | - go: 1.4 8 | - go: 1.5 9 | - go: 1.6 10 | - go: 1.7 11 | - go: tip 12 | allow_failures: 13 | - go: tip 14 | 15 | script: 16 | - go get -t -v ./... 17 | - diff -u <(echo -n) <(gofmt -d .) 18 | - go vet $(go list ./... | grep -v /vendor/) 19 | - go test -v -race ./... 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. 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/github.com/gorilla/rpc/README.md: -------------------------------------------------------------------------------- 1 | rpc 2 | === 3 | [![Build Status](https://travis-ci.org/gorilla/rpc.png?branch=master)](https://travis-ci.org/gorilla/rpc) 4 | 5 | gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/rpc 8 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. 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/github.com/gorilla/rpc/v2/README.md: -------------------------------------------------------------------------------- 1 | rpc 2 | === 3 | 4 | gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests. 5 | 6 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/rpc 7 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/v2/encoder_selector.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Copyright 2012 The Gorilla Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package rpc 7 | 8 | import ( 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | // Encoder interface contains the encoder for http response. 14 | // Eg. gzip, flate compressions. 15 | type Encoder interface { 16 | Encode(w http.ResponseWriter) io.Writer 17 | } 18 | 19 | type encoder struct { 20 | } 21 | 22 | func (_ *encoder) Encode(w http.ResponseWriter) io.Writer { 23 | return w 24 | } 25 | 26 | var DefaultEncoder = &encoder{} 27 | 28 | // EncoderSelector interface provides a way to select encoder using the http 29 | // request. Typically people can use this to check HEADER of the request and 30 | // figure out client capabilities. 31 | // Eg. "Accept-Encoding" tells about supported compressions. 32 | type EncoderSelector interface { 33 | Select(r *http.Request) Encoder 34 | } 35 | 36 | type encoderSelector struct { 37 | } 38 | 39 | func (_ *encoderSelector) Select(_ *http.Request) Encoder { 40 | return DefaultEncoder 41 | } 42 | 43 | var DefaultEncoderSelector = &encoderSelector{} 44 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/rpc/v2/json2/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Copyright 2012 The Gorilla Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package json2 7 | 8 | import ( 9 | "errors" 10 | ) 11 | 12 | type ErrorCode int 13 | 14 | const ( 15 | E_PARSE ErrorCode = -32700 16 | E_INVALID_REQ ErrorCode = -32600 17 | E_NO_METHOD ErrorCode = -32601 18 | E_BAD_PARAMS ErrorCode = -32602 19 | E_INTERNAL ErrorCode = -32603 20 | E_SERVER ErrorCode = -32000 21 | ) 22 | 23 | var ErrNullResult = errors.New("result is null") 24 | 25 | type Error struct { 26 | // A Number that indicates the error type that occurred. 27 | Code ErrorCode `json:"code"` /* required */ 28 | 29 | // A String providing a short description of the error. 30 | // The message SHOULD be limited to a concise single sentence. 31 | Message string `json:"message"` /* required */ 32 | 33 | // A Primitive or Structured value that contains additional information about the error. 34 | Data interface{} `json:"data"` /* optional */ 35 | } 36 | 37 | func (e *Error) Error() string { 38 | return e.Message 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/.gitignore: -------------------------------------------------------------------------------- 1 | y.output 2 | 3 | # ignore intellij files 4 | .idea 5 | *.iml 6 | *.ipr 7 | *.iws 8 | 9 | *.test 10 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.8 7 | 8 | branches: 9 | only: 10 | - master 11 | 12 | script: make test 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/Makefile: -------------------------------------------------------------------------------- 1 | TEST?=./... 2 | 3 | default: test 4 | 5 | fmt: generate 6 | go fmt ./... 7 | 8 | test: generate 9 | go get -t ./... 10 | go test $(TEST) $(TESTARGS) 11 | 12 | generate: 13 | go generate ./... 14 | 15 | updatedeps: 16 | go get -u golang.org/x/tools/cmd/stringer 17 | 18 | .PHONY: default generate test updatedeps 19 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "build-{branch}-{build}" 2 | image: Visual Studio 2015 3 | clone_folder: c:\gopath\src\github.com\hashicorp\hcl 4 | environment: 5 | GOPATH: c:\gopath 6 | init: 7 | - git config --global core.autocrlf true 8 | install: 9 | - cmd: >- 10 | echo %Path% 11 | 12 | go version 13 | 14 | go env 15 | 16 | go get -t ./... 17 | 18 | build_script: 19 | - cmd: go test -v ./... 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl.go: -------------------------------------------------------------------------------- 1 | // Package hcl decodes HCL into usable Go structures. 2 | // 3 | // hcl input can come in either pure HCL format or JSON format. 4 | // It can be parsed into an AST, and then decoded into a structure, 5 | // or it can be decoded directly from a string into a structure. 6 | // 7 | // If you choose to parse HCL into a raw AST, the benefit is that you 8 | // can write custom visitor implementations to implement custom 9 | // semantic checks. By default, HCL does not perform any semantic 10 | // checks. 11 | package hcl 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/ast/walk.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "fmt" 4 | 5 | // WalkFunc describes a function to be called for each node during a Walk. The 6 | // returned node can be used to rewrite the AST. Walking stops the returned 7 | // bool is false. 8 | type WalkFunc func(Node) (Node, bool) 9 | 10 | // Walk traverses an AST in depth-first order: It starts by calling fn(node); 11 | // node must not be nil. If fn returns true, Walk invokes fn recursively for 12 | // each of the non-nil children of node, followed by a call of fn(nil). The 13 | // returned node of fn can be used to rewrite the passed node to fn. 14 | func Walk(node Node, fn WalkFunc) Node { 15 | rewritten, ok := fn(node) 16 | if !ok { 17 | return rewritten 18 | } 19 | 20 | switch n := node.(type) { 21 | case *File: 22 | n.Node = Walk(n.Node, fn) 23 | case *ObjectList: 24 | for i, item := range n.Items { 25 | n.Items[i] = Walk(item, fn).(*ObjectItem) 26 | } 27 | case *ObjectKey: 28 | // nothing to do 29 | case *ObjectItem: 30 | for i, k := range n.Keys { 31 | n.Keys[i] = Walk(k, fn).(*ObjectKey) 32 | } 33 | 34 | if n.Val != nil { 35 | n.Val = Walk(n.Val, fn) 36 | } 37 | case *LiteralType: 38 | // nothing to do 39 | case *ListType: 40 | for i, l := range n.List { 41 | n.List[i] = Walk(l, fn) 42 | } 43 | case *ObjectType: 44 | n.List = Walk(n.List, fn).(*ObjectList) 45 | default: 46 | // should we panic here? 47 | fmt.Printf("unknown type: %T\n", n) 48 | } 49 | 50 | fn(nil) 51 | return rewritten 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/parser/error.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/token" 7 | ) 8 | 9 | // PosError is a parse error that contains a position. 10 | type PosError struct { 11 | Pos token.Pos 12 | Err error 13 | } 14 | 15 | func (e *PosError) Error() string { 16 | return fmt.Sprintf("At %s: %s", e.Pos, e.Err) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/json/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/lex.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "unicode" 5 | "unicode/utf8" 6 | ) 7 | 8 | type lexModeValue byte 9 | 10 | const ( 11 | lexModeUnknown lexModeValue = iota 12 | lexModeHcl 13 | lexModeJson 14 | ) 15 | 16 | // lexMode returns whether we're going to be parsing in JSON 17 | // mode or HCL mode. 18 | func lexMode(v []byte) lexModeValue { 19 | var ( 20 | r rune 21 | w int 22 | offset int 23 | ) 24 | 25 | for { 26 | r, w = utf8.DecodeRune(v[offset:]) 27 | offset += w 28 | if unicode.IsSpace(r) { 29 | continue 30 | } 31 | if r == '{' { 32 | return lexModeJson 33 | } 34 | break 35 | } 36 | 37 | return lexModeHcl 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/parse.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/ast" 7 | hclParser "github.com/hashicorp/hcl/hcl/parser" 8 | jsonParser "github.com/hashicorp/hcl/json/parser" 9 | ) 10 | 11 | // ParseBytes accepts as input byte slice and returns ast tree. 12 | // 13 | // Input can be either JSON or HCL 14 | func ParseBytes(in []byte) (*ast.File, error) { 15 | return parse(in) 16 | } 17 | 18 | // ParseString accepts input as a string and returns ast tree. 19 | func ParseString(input string) (*ast.File, error) { 20 | return parse([]byte(input)) 21 | } 22 | 23 | func parse(in []byte) (*ast.File, error) { 24 | switch lexMode(in) { 25 | case lexModeHcl: 26 | return hclParser.Parse(in) 27 | case lexModeJson: 28 | return jsonParser.Parse(in) 29 | } 30 | 31 | return nil, fmt.Errorf("unknown config format") 32 | } 33 | 34 | // Parse parses the given input and returns the root object. 35 | // 36 | // The input format can be either HCL or JSON. 37 | func Parse(input string) (*ast.File, error) { 38 | return parse([]byte(input)) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 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 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build go1.4 3 | 4 | package mousetrap 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { 13 | snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) 14 | if err != nil { 15 | return nil, err 16 | } 17 | defer syscall.CloseHandle(snapshot) 18 | var procEntry syscall.ProcessEntry32 19 | procEntry.Size = uint32(unsafe.Sizeof(procEntry)) 20 | if err = syscall.Process32First(snapshot, &procEntry); err != nil { 21 | return nil, err 22 | } 23 | for { 24 | if procEntry.ProcessID == uint32(pid) { 25 | return &procEntry, nil 26 | } 27 | err = syscall.Process32Next(snapshot, &procEntry) 28 | if err != nil { 29 | return nil, err 30 | } 31 | } 32 | } 33 | 34 | // StartedByExplorer returns true if the program was invoked by the user double-clicking 35 | // on the executable from explorer.exe 36 | // 37 | // It is conservative and returns false if any of the internal calls fail. 38 | // It does not guarantee that the program was run from a terminal. It only can tell you 39 | // whether it was launched from explorer.exe 40 | func StartedByExplorer() bool { 41 | pe, err := getProcessEntry(os.Getppid()) 42 | if err != nil { 43 | return false 44 | } 45 | return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.gitignore: -------------------------------------------------------------------------------- 1 | /jpgo 2 | jmespath-fuzz.zip 3 | cpu.out 4 | go-jmespath.test 5 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.4 7 | 8 | install: go get -v -t ./... 9 | script: make test 10 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 James Saryerwinnie 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 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CMD = jpgo 3 | 4 | help: 5 | @echo "Please use \`make ' where is one of" 6 | @echo " test to run all the tests" 7 | @echo " build to build the library and jp executable" 8 | @echo " generate to run codegen" 9 | 10 | 11 | generate: 12 | go generate ./... 13 | 14 | build: 15 | rm -f $(CMD) 16 | go build ./... 17 | rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./... 18 | mv cmd/$(CMD)/$(CMD) . 19 | 20 | test: 21 | go test -v ./... 22 | 23 | check: 24 | go vet ./... 25 | @echo "golint ./..." 26 | @lint=`golint ./...`; \ 27 | lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \ 28 | echo "$$lint"; \ 29 | if [ "$$lint" != "" ]; then exit 1; fi 30 | 31 | htmlc: 32 | go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov 33 | 34 | buildfuzz: 35 | go-fuzz-build github.com/jmespath/go-jmespath/fuzz 36 | 37 | fuzz: buildfuzz 38 | go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata 39 | 40 | bench: 41 | go test -bench . -cpuprofile cpu.out 42 | 43 | pprof-cpu: 44 | go tool pprof ./go-jmespath.test ./cpu.out 45 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/README.md: -------------------------------------------------------------------------------- 1 | # go-jmespath - A JMESPath implementation in Go 2 | 3 | [![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath) 4 | 5 | 6 | 7 | See http://jmespath.org for more info. 8 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/api.go: -------------------------------------------------------------------------------- 1 | package jmespath 2 | 3 | import "strconv" 4 | 5 | // JmesPath is the epresentation of a compiled JMES path query. A JmesPath is 6 | // safe for concurrent use by multiple goroutines. 7 | type JMESPath struct { 8 | ast ASTNode 9 | intr *treeInterpreter 10 | } 11 | 12 | // Compile parses a JMESPath expression and returns, if successful, a JMESPath 13 | // object that can be used to match against data. 14 | func Compile(expression string) (*JMESPath, error) { 15 | parser := NewParser() 16 | ast, err := parser.Parse(expression) 17 | if err != nil { 18 | return nil, err 19 | } 20 | jmespath := &JMESPath{ast: ast, intr: newInterpreter()} 21 | return jmespath, nil 22 | } 23 | 24 | // MustCompile is like Compile but panics if the expression cannot be parsed. 25 | // It simplifies safe initialization of global variables holding compiled 26 | // JMESPaths. 27 | func MustCompile(expression string) *JMESPath { 28 | jmespath, err := Compile(expression) 29 | if err != nil { 30 | panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error()) 31 | } 32 | return jmespath 33 | } 34 | 35 | // Search evaluates a JMESPath expression against input data and returns the result. 36 | func (jp *JMESPath) Search(data interface{}) (interface{}, error) { 37 | return jp.intr.Execute(jp.ast, data) 38 | } 39 | 40 | // Search evaluates a JMESPath expression against input data and returns the result. 41 | func Search(expression string, data interface{}) (interface{}, error) { 42 | intr := newInterpreter() 43 | parser := NewParser() 44 | ast, err := parser.Parse(expression) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return intr.Execute(ast, data) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | 5 | sudo: false 6 | 7 | script: 8 | - go test -v 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 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 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | Colorable writer for windows. 4 | 5 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 6 | This package is possible to handle escape sequence for ansi color on windows. 7 | 8 | ## Too Bad! 9 | 10 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 11 | 12 | 13 | ## So Good! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 16 | 17 | ## Usage 18 | 19 | ```go 20 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 21 | logrus.SetOutput(colorable.NewColorableStdout()) 22 | 23 | logrus.Info("succeeded") 24 | logrus.Warn("not correct") 25 | logrus.Error("something error") 26 | logrus.Fatal("panic") 27 | ``` 28 | 29 | You can compile above code on non-windows OSs. 30 | 31 | ## Installation 32 | 33 | ``` 34 | $ go get github.com/mattn/go-colorable 35 | ``` 36 | 37 | # License 38 | 39 | MIT 40 | 41 | # Author 42 | 43 | Yasuhiro Matsumoto (a.k.a mattn) 44 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // NewColorable return new instance of Writer which handle escape sequence. 11 | func NewColorable(file *os.File) io.Writer { 12 | if file == nil { 13 | panic("nil passed instead of *os.File to NewColorable()") 14 | } 15 | 16 | return file 17 | } 18 | 19 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 20 | func NewColorableStdout() io.Writer { 21 | return os.Stdout 22 | } 23 | 24 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 25 | func NewColorableStderr() io.Writer { 26 | return os.Stderr 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable hold writer but remove escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | lastbuf bytes.Buffer 12 | } 13 | 14 | // NewNonColorable return new instance of Writer which remove escape sequence from Writer. 15 | func NewNonColorable(w io.Writer) io.Writer { 16 | return &NonColorable{out: w} 17 | } 18 | 19 | // Write write data on console 20 | func (w *NonColorable) Write(data []byte) (n int, err error) { 21 | er := bytes.NewReader(data) 22 | var bw [1]byte 23 | loop: 24 | for { 25 | c1, err := er.ReadByte() 26 | if err != nil { 27 | break loop 28 | } 29 | if c1 != 0x1b { 30 | bw[0] = c1 31 | w.out.Write(bw[:]) 32 | continue 33 | } 34 | c2, err := er.ReadByte() 35 | if err != nil { 36 | w.lastbuf.WriteByte(c1) 37 | break loop 38 | } 39 | if c2 != 0x5b { 40 | w.lastbuf.WriteByte(c1) 41 | w.lastbuf.WriteByte(c2) 42 | continue 43 | } 44 | 45 | var buf bytes.Buffer 46 | for { 47 | c, err := er.ReadByte() 48 | if err != nil { 49 | w.lastbuf.WriteByte(c1) 50 | w.lastbuf.WriteByte(c2) 51 | w.lastbuf.Write(buf.Bytes()) 52 | break loop 53 | } 54 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 55 | break 56 | } 57 | buf.Write([]byte(string(c))) 58 | } 59 | } 60 | return len(data) - w.lastbuf.Len(), nil 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | 5 | before_install: 6 | - go get github.com/mattn/goveralls 7 | - go get golang.org/x/tools/cmd/cover 8 | script: 9 | - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 7 | // terminal. This is also always false on this environment. 8 | func IsCygwinTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.3 5 | - 1.5.4 6 | - 1.6.2 7 | - 1.7.1 8 | - tip 9 | 10 | script: 11 | - go test -v ./... 12 | -------------------------------------------------------------------------------- /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/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | - tip 5 | 6 | -------------------------------------------------------------------------------- /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/pmezard/go-difflib/README.md: -------------------------------------------------------------------------------- 1 | go-difflib 2 | ========== 3 | 4 | [![Build Status](https://travis-ci.org/pmezard/go-difflib.png?branch=master)](https://travis-ci.org/pmezard/go-difflib) 5 | [![GoDoc](https://godoc.org/github.com/pmezard/go-difflib/difflib?status.svg)](https://godoc.org/github.com/pmezard/go-difflib/difflib) 6 | 7 | Go-difflib is a partial port of python 3 difflib package. Its main goal 8 | was to make unified and context diff available in pure Go, mostly for 9 | testing purposes. 10 | 11 | The following class and functions (and related tests) have be ported: 12 | 13 | * `SequenceMatcher` 14 | * `unified_diff()` 15 | * `context_diff()` 16 | 17 | ## Installation 18 | 19 | ```bash 20 | $ go get github.com/pmezard/go-difflib/difflib 21 | ``` 22 | 23 | ### Quick Start 24 | 25 | Diffs are configured with Unified (or ContextDiff) structures, and can 26 | be output to an io.Writer or returned as a string. 27 | 28 | ```Go 29 | diff := UnifiedDiff{ 30 | A: difflib.SplitLines("foo\nbar\n"), 31 | B: difflib.SplitLines("foo\nbaz\n"), 32 | FromFile: "Original", 33 | ToFile: "Current", 34 | Context: 3, 35 | } 36 | text, _ := GetUnifiedDiffString(diff) 37 | fmt.Printf(text) 38 | ``` 39 | 40 | would output: 41 | 42 | ``` 43 | --- Original 44 | +++ Current 45 | @@ -1,3 +1,3 @@ 46 | foo 47 | -bar 48 | +baz 49 | ``` 50 | 51 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - tip 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | fast_finish: true 15 | before_install: 16 | - go get github.com/mattn/goveralls 17 | - go get golang.org/x/tools/cmd/cover 18 | script: 19 | - $HOME/gopath/bin/goveralls -service=travis-ci 20 | notifications: 21 | email: false 22 | -------------------------------------------------------------------------------- /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/spf13/afero/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - 1.5.4 6 | - 1.6.3 7 | - 1.7 8 | - tip 9 | 10 | os: 11 | - linux 12 | - osx 13 | 14 | matrix: 15 | allow_failures: 16 | - go: tip 17 | fast_finish: true 18 | 19 | script: 20 | - go test -v ./... 21 | - go build 22 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | clone_folder: C:\gopath\src\github.com\spf13\afero 3 | environment: 4 | GOPATH: C:\gopath 5 | build_script: 6 | - cmd: >- 7 | go version 8 | 9 | go env 10 | 11 | go get -v github.com/spf13/afero/... 12 | 13 | go build github.com/spf13/afero 14 | test_script: 15 | - cmd: go test -v github.com/spf13/afero 16 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/const_bsds.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2016 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build darwin openbsd freebsd netbsd dragonfly 15 | 16 | package afero 17 | 18 | import ( 19 | "syscall" 20 | ) 21 | 22 | const BADFD = syscall.EBADF 23 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/const_win_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2016 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | // +build !darwin 14 | // +build !openbsd 15 | // +build !freebsd 16 | // +build !dragonfly 17 | // +build !netbsd 18 | 19 | package afero 20 | 21 | import ( 22 | "syscall" 23 | ) 24 | 25 | const BADFD = syscall.EBADFD 26 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/mem/dir.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2014 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package mem 15 | 16 | type Dir interface { 17 | Len() int 18 | Names() []string 19 | Files() []*FileData 20 | Add(*FileData) 21 | Remove(*FileData) 22 | } 23 | 24 | func RemoveFromMemDir(dir *FileData, f *FileData) { 25 | dir.memDir.Remove(f) 26 | } 27 | 28 | func AddToMemDir(dir *FileData, f *FileData) { 29 | dir.memDir.Add(f) 30 | } 31 | 32 | func InitializeDir(d *FileData) { 33 | if d.memDir == nil { 34 | d.dir = true 35 | d.memDir = &DirMap{} 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/mem/dirmap.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package mem 15 | 16 | import "sort" 17 | 18 | type DirMap map[string]*FileData 19 | 20 | func (m DirMap) Len() int { return len(m) } 21 | func (m DirMap) Add(f *FileData) { m[f.name] = f } 22 | func (m DirMap) Remove(f *FileData) { delete(m, f.name) } 23 | func (m DirMap) Files() (files []*FileData) { 24 | for _, f := range m { 25 | files = append(files, f) 26 | } 27 | sort.Sort(filesSorter(files)) 28 | return files 29 | } 30 | 31 | // implement sort.Interface for []*FileData 32 | type filesSorter []*FileData 33 | 34 | func (s filesSorter) Len() int { return len(s) } 35 | func (s filesSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } 36 | func (s filesSorter) Less(i, j int) bool { return s[i].name < s[j].name } 37 | 38 | func (m DirMap) Names() (names []string) { 39 | for x := range m { 40 | names = append(names, x) 41 | } 42 | return names 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/memradix.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2014 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package afero 15 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/readonlyfs.go: -------------------------------------------------------------------------------- 1 | package afero 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | "time" 7 | ) 8 | 9 | type ReadOnlyFs struct { 10 | source Fs 11 | } 12 | 13 | func NewReadOnlyFs(source Fs) Fs { 14 | return &ReadOnlyFs{source: source} 15 | } 16 | 17 | func (r *ReadOnlyFs) ReadDir(name string) ([]os.FileInfo, error) { 18 | return ReadDir(r.source, name) 19 | } 20 | 21 | func (r *ReadOnlyFs) Chtimes(n string, a, m time.Time) error { 22 | return syscall.EPERM 23 | } 24 | 25 | func (r *ReadOnlyFs) Chmod(n string, m os.FileMode) error { 26 | return syscall.EPERM 27 | } 28 | 29 | func (r *ReadOnlyFs) Name() string { 30 | return "ReadOnlyFilter" 31 | } 32 | 33 | func (r *ReadOnlyFs) Stat(name string) (os.FileInfo, error) { 34 | return r.source.Stat(name) 35 | } 36 | 37 | func (r *ReadOnlyFs) Rename(o, n string) error { 38 | return syscall.EPERM 39 | } 40 | 41 | func (r *ReadOnlyFs) RemoveAll(p string) error { 42 | return syscall.EPERM 43 | } 44 | 45 | func (r *ReadOnlyFs) Remove(n string) error { 46 | return syscall.EPERM 47 | } 48 | 49 | func (r *ReadOnlyFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { 50 | if flag&(os.O_WRONLY|syscall.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { 51 | return nil, syscall.EPERM 52 | } 53 | return r.source.OpenFile(name, flag, perm) 54 | } 55 | 56 | func (r *ReadOnlyFs) Open(n string) (File, error) { 57 | return r.source.Open(n) 58 | } 59 | 60 | func (r *ReadOnlyFs) Mkdir(n string, p os.FileMode) error { 61 | return syscall.EPERM 62 | } 63 | 64 | func (r *ReadOnlyFs) MkdirAll(n string, p os.FileMode) error { 65 | return syscall.EPERM 66 | } 67 | 68 | func (r *ReadOnlyFs) Create(n string) (File, error) { 69 | return nil, syscall.EPERM 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | 36 | cobra.test 37 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.4.3 4 | - 1.5.4 5 | - 1.6.2 6 | - tip 7 | 8 | matrix: 9 | allow_failures: 10 | - go: tip 11 | 12 | before_install: 13 | - mkdir -p bin 14 | - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.3/shellcheck 15 | - chmod +x bin/shellcheck 16 | script: 17 | - PATH=$PATH:$PWD/bin go test -v ./... 18 | - go build 19 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "os" 7 | "time" 8 | 9 | "github.com/inconshreveable/mousetrap" 10 | ) 11 | 12 | var preExecHookFn = preExecHook 13 | 14 | // enables an information splash screen on Windows if the CLI is started from explorer.exe. 15 | var MousetrapHelpText string = `This is a command line tool 16 | 17 | You need to open cmd.exe and run it from there. 18 | ` 19 | 20 | func preExecHook(c *Command) { 21 | if mousetrap.StartedByExplorer() { 22 | c.Print(MousetrapHelpText) 23 | time.Sleep(5 * time.Second) 24 | os.Exit(1) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.6.3 7 | - 1.7.3 8 | - tip 9 | 10 | matrix: 11 | allow_failures: 12 | - go: tip 13 | install: 14 | - go get github.com/golang/lint/golint 15 | - export PATH=$GOPATH/bin:$PATH 16 | - go install ./... 17 | 18 | script: 19 | - verify/all.sh -v 20 | - go test ./... 21 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Alex Ogier. All rights reserved. 2 | Copyright (c) 2012 The Go Authors. 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 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.1 7 | - 1.2 8 | - 1.3 9 | - 1.4 10 | - 1.5 11 | - 1.6 12 | - 1.7 13 | - tip 14 | 15 | script: 16 | - go test -v ./... 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENCE.txt: -------------------------------------------------------------------------------- 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/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_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /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 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 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /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 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl 10 | -------------------------------------------------------------------------------- /vendor/github.com/tent/http-link-go/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/tent/http-link-go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.1 4 | - tip 5 | before_install: 6 | - go get launchpad.net/gocheck 7 | -------------------------------------------------------------------------------- /vendor/github.com/tent/http-link-go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Tent.is, LLC. 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 Tent.is, LLC 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/github.com/tent/http-link-go/README.md: -------------------------------------------------------------------------------- 1 | # http-link-go [![Build Status](https://travis-ci.org/tent/http-link-go.png?branch=master)](https://travis-ci.org/tent/http-link-go) 2 | 3 | http-link-go implements parsing and serialization of Link header values as 4 | defined in [RFC 5988](https://tools.ietf.org/html/rfc5988). 5 | 6 | [**Documentation**](http://godoc.org/github.com/tent/http-link-go) 7 | 8 | ## Installation 9 | 10 | ```text 11 | go get github.com/tent/http-link-go 12 | ``` 13 | -------------------------------------------------------------------------------- /vendor/github.com/vaughan0/go-ini/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Vaughan Newton 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 6 | persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /vendor/github.com/vaughan0/go-ini/README.md: -------------------------------------------------------------------------------- 1 | go-ini 2 | ====== 3 | 4 | INI parsing library for Go (golang). 5 | 6 | View the API documentation [here](http://godoc.org/github.com/vaughan0/go-ini). 7 | 8 | Usage 9 | ----- 10 | 11 | Parse an INI file: 12 | 13 | ```go 14 | import "github.com/vaughan0/go-ini" 15 | 16 | file, err := ini.LoadFile("myfile.ini") 17 | ``` 18 | 19 | Get data from the parsed file: 20 | 21 | ```go 22 | name, ok := file.Get("person", "name") 23 | if !ok { 24 | panic("'name' variable missing from 'person' section") 25 | } 26 | ``` 27 | 28 | Iterate through values in a section: 29 | 30 | ```go 31 | for key, value := range file["mysection"] { 32 | fmt.Printf("%s => %s\n", key, value) 33 | } 34 | ``` 35 | 36 | Iterate through sections in a file: 37 | 38 | ```go 39 | for name, section := range file { 40 | fmt.Printf("Section name: %s\n", name) 41 | } 42 | ``` 43 | 44 | File Format 45 | ----------- 46 | 47 | INI files are parsed by go-ini line-by-line. Each line may be one of the following: 48 | 49 | * A section definition: [section-name] 50 | * A property: key = value 51 | * A comment: #blahblah _or_ ;blahblah 52 | * Blank. The line will be ignored. 53 | 54 | Properties defined before any section headers are placed in the default section, which has 55 | the empty string as it's key. 56 | 57 | Example: 58 | 59 | ```ini 60 | # I am a comment 61 | ; So am I! 62 | 63 | [apples] 64 | colour = red or green 65 | shape = applish 66 | 67 | [oranges] 68 | shape = square 69 | colour = blue 70 | ``` 71 | -------------------------------------------------------------------------------- /vendor/github.com/vaughan0/go-ini/test.ini: -------------------------------------------------------------------------------- 1 | [default] 2 | stuff = things 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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/crypto/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/crypto/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go cryptography libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /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/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | 6 | install: 7 | - export GOPATH="$HOME/gopath" 8 | - mkdir -p "$GOPATH/src/golang.org/x" 9 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 10 | - go get -v -t -d golang.org/x/oauth2/... 11 | 12 | script: 13 | - go test -v golang.org/x/oauth2/... 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The oauth2 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/oauth2/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 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 appengine 6 | 7 | // App Engine hooks. 8 | 9 | package oauth2 10 | 11 | import ( 12 | "net/http" 13 | 14 | "golang.org/x/net/context" 15 | "golang.org/x/oauth2/internal" 16 | "google.golang.org/appengine/urlfetch" 17 | ) 18 | 19 | func init() { 20 | internal.RegisterContextClientFunc(contextClientAppEngine) 21 | } 22 | 23 | func contextClientAppEngine(ctx context.Context) (*http.Client, error) { 24 | return urlfetch.Client(ctx), nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .gitignore except for files generated by the build. 2 | last-change 3 | /DATA 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/text/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/text/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go libraries for text processing, many involving Unicode. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | 5 | To generate the tables in this repository (except for the encoding tables), 6 | run go generate from this directory. By default tables are generated for the 7 | Unicode version in core and the CLDR version defined in 8 | golang.org/x/text/unicode/cldr. 9 | 10 | Running go generate will as a side effect create a DATA subdirectory in this 11 | directory which holds all files that are used as a source for generating the 12 | tables. This directory will also serve as a cache. 13 | 14 | Run 15 | 16 | go test ./... 17 | 18 | from this directory to run all tests. Add the "-tags icu" flag to also run 19 | ICU conformance tests (if available). This requires that you have the correct 20 | ICU version installed on your system. 21 | 22 | TODO: 23 | - updating unversioned source files. -------------------------------------------------------------------------------- /vendor/golang.org/x/text/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.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 norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - 1.3 8 | - release 9 | - tip 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Contributors to log15: 2 | 3 | - Aaron L 4 | - Alan Shreve 5 | - Chris Hines 6 | - Ciaran Downey 7 | - Dmitry Chestnykh 8 | - Evan Shaw 9 | - Péter Szilágyi 10 | - Trevor Gattis 11 | - Vincent Vanackere 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 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 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/RELEASING.md: -------------------------------------------------------------------------------- 1 | # log15's release strategy 2 | 3 | log15 uses gopkg.in to manage versioning releases so that consumers who don't vendor dependencies can rely upon a stable API. 4 | 5 | ## Master 6 | 7 | Master is considered to have no API stability guarantee, so merging new code that passes tests into master is always okay. 8 | 9 | ## Releasing a new API-compatible version 10 | 11 | The process to release a new API-compatible version is described below. For the purposes of this example, we'll assume you're trying to release a new version of v2 12 | 13 | 1. `git checkout v2` 14 | 1. `git merge master` 15 | 1. Audit the code for any imports of sub-packages. Modify any import references from `github.com/inconshrevealbe/log15/` -> `gopkg.in/inconshreveable/log15.v2/` 16 | 1. `git commit` 17 | 1. `git tag`, find the latest tag of the style v2.X. 18 | 1. `git tag v2.X+1` If the last version was v2.6, you would run `git tag v2.7` 19 | 1. `git push --tags git@github.com:inconshreveable/log15.git v2` 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/handler_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package log15 4 | 5 | import "sync" 6 | 7 | // swapHandler wraps another handler that may be swapped out 8 | // dynamically at runtime in a thread-safe fashion. 9 | type swapHandler struct { 10 | handler interface{} 11 | lock sync.RWMutex 12 | } 13 | 14 | func (h *swapHandler) Log(r *Record) error { 15 | h.lock.RLock() 16 | defer h.lock.RUnlock() 17 | 18 | return h.handler.(Handler).Log(r) 19 | } 20 | 21 | func (h *swapHandler) Swap(newHandler Handler) { 22 | h.lock.Lock() 23 | defer h.lock.Unlock() 24 | 25 | h.handler = newHandler 26 | } 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/handler_other.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package log15 4 | 5 | import ( 6 | "sync/atomic" 7 | "unsafe" 8 | ) 9 | 10 | // swapHandler wraps another handler that may be swapped out 11 | // dynamically at runtime in a thread-safe fashion. 12 | type swapHandler struct { 13 | handler unsafe.Pointer 14 | } 15 | 16 | func (h *swapHandler) Log(r *Record) error { 17 | return (*(*Handler)(atomic.LoadPointer(&h.handler))).Log(r) 18 | } 19 | 20 | func (h *swapHandler) Swap(newHandler Handler) { 21 | atomic.StorePointer(&h.handler, unsafe.Pointer(&newHandler)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/root.go: -------------------------------------------------------------------------------- 1 | package log15 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/mattn/go-colorable" 7 | "gopkg.in/inconshreveable/log15.v2/term" 8 | ) 9 | 10 | var ( 11 | root *logger 12 | StdoutHandler = StreamHandler(os.Stdout, LogfmtFormat()) 13 | StderrHandler = StreamHandler(os.Stderr, LogfmtFormat()) 14 | ) 15 | 16 | func init() { 17 | if term.IsTty(os.Stdout.Fd()) { 18 | StdoutHandler = StreamHandler(colorable.NewColorableStdout(), TerminalFormat()) 19 | } 20 | 21 | if term.IsTty(os.Stderr.Fd()) { 22 | StderrHandler = StreamHandler(colorable.NewColorableStderr(), TerminalFormat()) 23 | } 24 | 25 | root = &logger{[]interface{}{}, new(swapHandler)} 26 | root.SetHandler(StdoutHandler) 27 | } 28 | 29 | // New returns a new logger with the given context. 30 | // New is a convenient alias for Root().New 31 | func New(ctx ...interface{}) Logger { 32 | return root.New(ctx...) 33 | } 34 | 35 | // Root returns the root logger 36 | func Root() Logger { 37 | return root 38 | } 39 | 40 | // The following functions bypass the exported logger methods (logger.Debug, 41 | // etc.) to keep the call depth the same for all paths to logger.write so 42 | // runtime.Caller(2) always refers to the call site in client code. 43 | 44 | // Debug is a convenient alias for Root().Debug 45 | func Debug(msg string, ctx ...interface{}) { 46 | root.write(msg, LvlDebug, ctx) 47 | } 48 | 49 | // Info is a convenient alias for Root().Info 50 | func Info(msg string, ctx ...interface{}) { 51 | root.write(msg, LvlInfo, ctx) 52 | } 53 | 54 | // Warn is a convenient alias for Root().Warn 55 | func Warn(msg string, ctx ...interface{}) { 56 | root.write(msg, LvlWarn, ctx) 57 | } 58 | 59 | // Error is a convenient alias for Root().Error 60 | func Error(msg string, ctx ...interface{}) { 61 | root.write(msg, LvlError, ctx) 62 | } 63 | 64 | // Crit is a convenient alias for Root().Crit 65 | func Crit(msg string, ctx ...interface{}) { 66 | root.write(msg, LvlCrit, ctx) 67 | } 68 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/stack/stack_pool.go: -------------------------------------------------------------------------------- 1 | // +build go1.3 2 | 3 | package stack 4 | 5 | import ( 6 | "sync" 7 | ) 8 | 9 | var pcStackPool = sync.Pool{ 10 | New: func() interface{} { return make([]uintptr, 1000) }, 11 | } 12 | 13 | func poolBuf() []uintptr { 14 | return pcStackPool.Get().([]uintptr) 15 | } 16 | 17 | func putPoolBuf(p []uintptr) { 18 | pcStackPool.Put(p) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/stack/stack_pool_chan.go: -------------------------------------------------------------------------------- 1 | // +build !go1.3 appengine 2 | 3 | package stack 4 | 5 | const ( 6 | stackPoolSize = 64 7 | ) 8 | 9 | var ( 10 | pcStackPool = make(chan []uintptr, stackPoolSize) 11 | ) 12 | 13 | func poolBuf() []uintptr { 14 | select { 15 | case p := <-pcStackPool: 16 | return p 17 | default: 18 | return make([]uintptr, 1000) 19 | } 20 | } 21 | 22 | func putPoolBuf(p []uintptr) { 23 | select { 24 | case pcStackPool <- p: 25 | default: 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/syslog.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9 2 | 3 | package log15 4 | 5 | import ( 6 | "log/syslog" 7 | "strings" 8 | ) 9 | 10 | // SyslogHandler opens a connection to the system syslog daemon by calling 11 | // syslog.New and writes all records to it. 12 | func SyslogHandler(tag string, fmtr Format) (Handler, error) { 13 | wr, err := syslog.New(syslog.LOG_INFO, tag) 14 | return sharedSyslog(fmtr, wr, err) 15 | } 16 | 17 | // SyslogHandler opens a connection to a log daemon over the network and writes 18 | // all log records to it. 19 | func SyslogNetHandler(net, addr string, tag string, fmtr Format) (Handler, error) { 20 | wr, err := syslog.Dial(net, addr, syslog.LOG_INFO, tag) 21 | return sharedSyslog(fmtr, wr, err) 22 | } 23 | 24 | func sharedSyslog(fmtr Format, sysWr *syslog.Writer, err error) (Handler, error) { 25 | if err != nil { 26 | return nil, err 27 | } 28 | h := FuncHandler(func(r *Record) error { 29 | var syslogFn = sysWr.Info 30 | switch r.Lvl { 31 | case LvlCrit: 32 | syslogFn = sysWr.Crit 33 | case LvlError: 34 | syslogFn = sysWr.Err 35 | case LvlWarn: 36 | syslogFn = sysWr.Warning 37 | case LvlInfo: 38 | syslogFn = sysWr.Info 39 | case LvlDebug: 40 | syslogFn = sysWr.Debug 41 | } 42 | 43 | s := strings.TrimSpace(string(fmtr.Format(r))) 44 | return syslogFn(s) 45 | }) 46 | return LazyHandler(&closingHandler{sysWr, h}), nil 47 | } 48 | 49 | func (m muster) SyslogHandler(tag string, fmtr Format) Handler { 50 | return must(SyslogHandler(tag, fmtr)) 51 | } 52 | 53 | func (m muster) SyslogNetHandler(net, addr string, tag string, fmtr Format) Handler { 54 | return must(SyslogNetHandler(net, addr, tag, fmtr)) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build appengine 7 | 8 | package term 9 | 10 | // IsTty always returns false on AppEngine. 11 | func IsTty(fd uintptr) bool { 12 | return false 13 | } 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_darwin.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package term 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ioctlReadTermios = syscall.TIOCGETA 8 | 9 | // Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. 10 | type Termios struct { 11 | Iflag uint32 12 | Oflag uint32 13 | Cflag uint32 14 | Lflag uint32 15 | Cc [20]uint8 16 | Ispeed uint32 17 | Ospeed uint32 18 | } 19 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package term 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux,!appengine darwin freebsd openbsd 7 | 8 | package term 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTty returns true if the given file descriptor is a terminal. 16 | func IsTty(fd uintptr) bool { 17 | var termios Termios 18 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 19 | return err == 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_openbsd.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import "syscall" 4 | 5 | const ioctlReadTermios = syscall.TIOCGETA 6 | 7 | type Termios syscall.Termios 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/inconshreveable/log15.v2/term/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package term 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTty returns true if the given file descriptor is a terminal. 22 | func IsTty(fd uintptr) bool { 23 | var st uint32 24 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 25 | return r != 0 && e == 0 26 | } 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.7 5 | - 1.6.2 6 | - 1.5.4 7 | - 1.4.3 8 | - 1.3.3 9 | before_install: 10 | - go get github.com/mattn/goveralls 11 | - go get golang.org/x/tools/cmd/cover 12 | script: 13 | - $HOME/gopath/bin/goveralls -service=travis-ci 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Tyler Bunnell 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 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/keepalive_listener.go: -------------------------------------------------------------------------------- 1 | package graceful 2 | 3 | import ( 4 | "net" 5 | "time" 6 | ) 7 | 8 | type keepAliveConn interface { 9 | SetKeepAlive(bool) error 10 | SetKeepAlivePeriod(d time.Duration) error 11 | } 12 | 13 | // keepAliveListener sets TCP keep-alive timeouts on accepted 14 | // connections. It's used by ListenAndServe and ListenAndServeTLS so 15 | // dead TCP connections (e.g. closing laptop mid-download) eventually 16 | // go away. 17 | type keepAliveListener struct { 18 | net.Listener 19 | keepAlivePeriod time.Duration 20 | } 21 | 22 | func (ln keepAliveListener) Accept() (net.Conn, error) { 23 | c, err := ln.Listener.Accept() 24 | if err != nil { 25 | return nil, err 26 | } 27 | 28 | kac := c.(keepAliveConn) 29 | kac.SetKeepAlive(true) 30 | kac.SetKeepAlivePeriod(ln.keepAlivePeriod) 31 | return c, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/signal.go: -------------------------------------------------------------------------------- 1 | //+build !appengine 2 | 3 | package graceful 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | ) 10 | 11 | func signalNotify(interrupt chan<- os.Signal) { 12 | signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) 13 | } 14 | 15 | func sendSignalInt(interrupt chan<- os.Signal) { 16 | interrupt <- syscall.SIGINT 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tylerb/graceful.v1/signal_appengine.go: -------------------------------------------------------------------------------- 1 | //+build appengine 2 | 3 | package graceful 4 | 5 | import "os" 6 | 7 | func signalNotify(interrupt chan<- os.Signal) { 8 | // Does not notify in the case of AppEngine. 9 | } 10 | 11 | func sendSignalInt(interrupt chan<- os.Signal) { 12 | // Does not send in the case of AppEngine. 13 | } 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - tip 8 | 9 | go_import_path: gopkg.in/yaml.v2 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 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 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | --------------------------------------------------------------------------------