mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-19 12:36:38 +00:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc859e595f | |||
4e9b6070c1 | |||
1862c0e1f5 | |||
ae909c8df4 | |||
6f76a05bdf | |||
8f022cfb21 | |||
ff9225d45e | |||
1da2763a96 | |||
666d6c4871 | |||
2248a8a071 | |||
908bbfda9f | |||
b40a7cbe58 | |||
a66f65c2b9 | |||
ac1cc16f0c | |||
716ef6f51c | |||
92523c496b | |||
5561c5cc67 | |||
6c48911412 | |||
3ce724512b | |||
8d91895c79 | |||
7ca531a8b5 | |||
94210cc7f1 | |||
9e5eb84236 |
36
.github/workflows/build.yaml
vendored
Normal file
36
.github/workflows/build.yaml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
env:
|
||||||
|
GO111MODULE: off
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.13.x]
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: make test
|
||||||
|
- name: dist
|
||||||
|
run: make dist
|
||||||
|
- name: prepare-test
|
||||||
|
run: make prepare-test
|
||||||
|
- name: test e2e
|
||||||
|
run: make test-e2e
|
||||||
|
|
||||||
|
|
30
.github/workflows/publish.yaml
vendored
Normal file
30
.github/workflows/publish.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [ 1.13.x ]
|
||||||
|
os: [ ubuntu-latest ]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
- name: Make publish
|
||||||
|
run: make publish
|
||||||
|
- name: Upload release binaries
|
||||||
|
uses: alexellis/upload-assets@0.2.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
asset_paths: '["./bin/faasd*"]'
|
31
.travis.yml
31
.travis.yml
@ -1,31 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
language: go
|
|
||||||
|
|
||||||
go:
|
|
||||||
- '1.13'
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- runc
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make test
|
|
||||||
- make dist
|
|
||||||
- make prepare-test
|
|
||||||
- make test-e2e
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
provider: releases
|
|
||||||
api_key:
|
|
||||||
secure: bccOSB+Mbk5ZJHyJfX82Xg/3/7mxiAYHx7P5m5KS1ncDuRpJBFjDV8Nx2PWYg341b5SMlCwsS3IJ9NkoGvRSKK+3YqeNfTeMabVNdKC2oL1i+4pdxGlbl57QXkzT4smqE8AykZEo4Ujk42rEr3e0gSHT2rXkV+Xt0xnoRVXn2tSRUDwsmwANnaBj6KpH2SjJ/lsfTifxrRB65uwcePaSjkqwR6htFraQtpONC9xYDdek6EoVQmoft/ONZJqi7HR+OcA1yhSt93XU6Vaf3678uLlPX9c/DxgIU9UnXRaOd0UUEiTHaMMWDe/bJSrKmgL7qY05WwbGMsXO/RdswwO1+zwrasrwf86SjdGX/P9AwobTW3eTEiBqw2J77UVbvLzDDoyJ5KrkbHRfPX8aIPO4OG9eHy/e7C3XVx4qv9bJBXQ3qD9YJtei9jmm8F/MCdPWuVYC0hEvHtuhP/xMm4esNUjFM5JUfDucvAuLL34NBYHBDP2XNuV4DkgQQPakfnlvYBd7OqyXCU6pzyWSasXpD1Rz8mD/x8aTUl2Ya4bnXQ8qAa5cnxfPqN2ADRlTw1qS7hl6LsXzNQ6r1mbuh/uFi67ybElIjBTfuMEeJOyYHkkLUHIBpooKrPyr0luAbf0By2D2N/eQQnM/RpixHNfZG/mvXx8ZCrs+wxgvG1Rm7rM=
|
|
||||||
file:
|
|
||||||
- ./bin/faasd
|
|
||||||
- ./bin/faasd-armhf
|
|
||||||
- ./bin/faasd-arm64
|
|
||||||
skip_cleanup: true
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
|
|
||||||
env: GO111MODULE=off
|
|
||||||
|
|
691
Gopkg.lock
generated
691
Gopkg.lock
generated
@ -1,691 +0,0 @@
|
|||||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
|
||||||
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:d5e752c67b445baa5b6cb6f8aa706775c2aa8e41aca95a0c651520ff2c80361a"
|
|
||||||
name = "github.com/Microsoft/go-winio"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"pkg/guid",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "6c72808b55902eae4c5943626030429ff20f3b63"
|
|
||||||
version = "v0.4.14"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:f06a14a8b60a7a9cdbf14ed52272faf4ff5de4ed7c784ff55b64995be98ac59f"
|
|
||||||
name = "github.com/Microsoft/hcsshim"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"internal/cow",
|
|
||||||
"internal/hcs",
|
|
||||||
"internal/hcserror",
|
|
||||||
"internal/hns",
|
|
||||||
"internal/interop",
|
|
||||||
"internal/log",
|
|
||||||
"internal/logfields",
|
|
||||||
"internal/longpath",
|
|
||||||
"internal/mergemaps",
|
|
||||||
"internal/oc",
|
|
||||||
"internal/safefile",
|
|
||||||
"internal/schema1",
|
|
||||||
"internal/schema2",
|
|
||||||
"internal/timeout",
|
|
||||||
"internal/vmcompute",
|
|
||||||
"internal/wclayer",
|
|
||||||
"osversion",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "9e921883ac929bbe515b39793ece99ce3a9d7706"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:d7086e6a64a9e4fa54aaf56ce42ead0be1300b0285604c4d306438880db946ad"
|
|
||||||
name = "github.com/alexellis/go-execute"
|
|
||||||
packages = ["pkg/v1"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "8697e4e28c5e3ce441ff8b2b6073035606af2fe9"
|
|
||||||
version = "0.4.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:345f6fa182d72edfa3abc493881c3fa338a464d93b1e2169cda9c822fde31655"
|
|
||||||
name = "github.com/alexellis/k3sup"
|
|
||||||
packages = ["pkg/env"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "629c0bc6b50f71ab93a1fbc8971a5bd05dc581eb"
|
|
||||||
version = "0.9.3"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:cda177c07c87c648b1aaa37290717064a86d337a5dc6b317540426872d12de52"
|
|
||||||
name = "github.com/compose-spec/compose-go"
|
|
||||||
packages = [
|
|
||||||
"envfile",
|
|
||||||
"interpolation",
|
|
||||||
"loader",
|
|
||||||
"schema",
|
|
||||||
"template",
|
|
||||||
"types",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "36d8ce368e05d2ae83c86b2987f20f7c20d534a6"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:cf83a14c8042951b0dcd74758fc32258111ecc7838cbdf5007717172cab9ca9b"
|
|
||||||
name = "github.com/containerd/containerd"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"api/services/containers/v1",
|
|
||||||
"api/services/content/v1",
|
|
||||||
"api/services/diff/v1",
|
|
||||||
"api/services/events/v1",
|
|
||||||
"api/services/images/v1",
|
|
||||||
"api/services/introspection/v1",
|
|
||||||
"api/services/leases/v1",
|
|
||||||
"api/services/namespaces/v1",
|
|
||||||
"api/services/snapshots/v1",
|
|
||||||
"api/services/tasks/v1",
|
|
||||||
"api/services/version/v1",
|
|
||||||
"api/types",
|
|
||||||
"api/types/task",
|
|
||||||
"archive",
|
|
||||||
"archive/compression",
|
|
||||||
"cio",
|
|
||||||
"containers",
|
|
||||||
"content",
|
|
||||||
"content/proxy",
|
|
||||||
"defaults",
|
|
||||||
"diff",
|
|
||||||
"errdefs",
|
|
||||||
"events",
|
|
||||||
"events/exchange",
|
|
||||||
"filters",
|
|
||||||
"identifiers",
|
|
||||||
"images",
|
|
||||||
"images/archive",
|
|
||||||
"labels",
|
|
||||||
"leases",
|
|
||||||
"leases/proxy",
|
|
||||||
"log",
|
|
||||||
"mount",
|
|
||||||
"namespaces",
|
|
||||||
"oci",
|
|
||||||
"pkg/dialer",
|
|
||||||
"platforms",
|
|
||||||
"plugin",
|
|
||||||
"reference",
|
|
||||||
"remotes",
|
|
||||||
"remotes/docker",
|
|
||||||
"remotes/docker/schema1",
|
|
||||||
"rootfs",
|
|
||||||
"runtime/linux/runctypes",
|
|
||||||
"runtime/v2/logging",
|
|
||||||
"runtime/v2/runc/options",
|
|
||||||
"snapshots",
|
|
||||||
"snapshots/proxy",
|
|
||||||
"sys",
|
|
||||||
"version",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "ff48f57fc83a8c44cf4ad5d672424a98ba37ded6"
|
|
||||||
version = "v1.3.2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:e4414857969cfbe45c7dab0a012aad4855bf7167c25d672a182cb18676424a0c"
|
|
||||||
name = "github.com/containerd/continuity"
|
|
||||||
packages = [
|
|
||||||
"fs",
|
|
||||||
"pathdriver",
|
|
||||||
"syscallx",
|
|
||||||
"sysx",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "f2a389ac0a02ce21c09edd7344677a601970f41c"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:1b9a7426259b5333d575785e21e1bd0decf18208f5bfb6424d24a50d5ddf83d0"
|
|
||||||
name = "github.com/containerd/fifo"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:2301a9a859e3b0946e2ddd6961ba6faf6857e6e68bc9293db758dbe3b17cc35e"
|
|
||||||
name = "github.com/containerd/go-cni"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "c154a49e2c754b83ebfb12ebf1362213b94d23e6"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:6d66a41dbbc6819902f1589d0550bc01c18032c0a598a7cd656731e6df73861b"
|
|
||||||
name = "github.com/containerd/ttrpc"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "92c8520ef9f86600c650dd540266a007bf03670f"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:7b4683388adabc709dbb082c13ba35967f072379c85b4acde997c1ca75af5981"
|
|
||||||
name = "github.com/containerd/typeurl"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "a93fcdb778cd272c6e9b3028b2f42d813e785d40"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:1a07bbfee1d0534e8dda4773948e6dcd3a061ea7ab047ce04619476946226483"
|
|
||||||
name = "github.com/containernetworking/cni"
|
|
||||||
packages = [
|
|
||||||
"libcni",
|
|
||||||
"pkg/invoke",
|
|
||||||
"pkg/types",
|
|
||||||
"pkg/types/020",
|
|
||||||
"pkg/types/current",
|
|
||||||
"pkg/version",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "4cfb7b568922a3c79a23e438dc52fe537fc9687e"
|
|
||||||
version = "v0.7.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:bcf36df8d43860bfde913d008301aef27c6e9a303582118a837c4a34c0d18167"
|
|
||||||
name = "github.com/coreos/go-systemd"
|
|
||||||
packages = ["journal"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "d3cd4ed1dbcf5835feba465b180436db54f20228"
|
|
||||||
version = "v21"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:92ebc9c068ab8e3fff03a58694ee33830964f6febd0130069aadce328802de14"
|
|
||||||
name = "github.com/docker/cli"
|
|
||||||
packages = [
|
|
||||||
"cli/config",
|
|
||||||
"cli/config/configfile",
|
|
||||||
"cli/config/credentials",
|
|
||||||
"cli/config/types",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "99c5edceb48d64c1aa5d09b8c9c499d431d98bb9"
|
|
||||||
version = "v19.03.5"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:e495f9f1fb2bae55daeb76e099292054fe1f734947274b3cfc403ccda595d55a"
|
|
||||||
name = "github.com/docker/distribution"
|
|
||||||
packages = [
|
|
||||||
"digestset",
|
|
||||||
"reference",
|
|
||||||
"registry/api/errcode",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "0d3efadf0154c2b8a4e7b6621fff9809655cc580"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:10f9c98f627e9697ec23b7973a683324f1d901dd9bace4a71405c0b2ec554303"
|
|
||||||
name = "github.com/docker/docker"
|
|
||||||
packages = [
|
|
||||||
"pkg/homedir",
|
|
||||||
"pkg/idtools",
|
|
||||||
"pkg/mount",
|
|
||||||
"pkg/system",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "ea84732a77251e0d7af278e2b7df1d6a59fca46b"
|
|
||||||
version = "v19.03.5"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:9f3f49b4e32d3da2dd6ed07cc568627b53cc80205c0dcf69f4091f027416cb60"
|
|
||||||
name = "github.com/docker/docker-credential-helpers"
|
|
||||||
packages = [
|
|
||||||
"client",
|
|
||||||
"credentials",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "54f0238b6bf101fc3ad3b34114cb5520beb562f5"
|
|
||||||
version = "v0.6.3"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:ade935c55cd6d0367c843b109b09c9d748b1982952031414740750fdf94747eb"
|
|
||||||
name = "github.com/docker/go-connections"
|
|
||||||
packages = ["nat"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "7395e3f8aa162843a74ed6d48e79627d9792ac55"
|
|
||||||
version = "v0.4.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:0938aba6e09d72d48db029d44dcfa304851f52e2d67cda920436794248e92793"
|
|
||||||
name = "github.com/docker/go-events"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "9461782956ad83b30282bf90e31fa6a70c255ba9"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:e95ef557dc3120984bb66b385ae01b4bb8ff56bcde28e7b0d1beed0cccc4d69f"
|
|
||||||
name = "github.com/docker/go-units"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "519db1ee28dcc9fd2474ae59fca29a810482bfb1"
|
|
||||||
version = "v0.4.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:fa6faf4a2977dc7643de38ae599a95424d82f8ffc184045510737010a82c4ecd"
|
|
||||||
name = "github.com/gogo/googleapis"
|
|
||||||
packages = ["google/rpc"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "d31c731455cb061f42baff3bda55bad0118b126b"
|
|
||||||
version = "v1.2.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:4107f4e81e8fd2e80386b4ed56b05e3a1fe26ecc7275fe80bb9c3a80a7344ff4"
|
|
||||||
name = "github.com/gogo/protobuf"
|
|
||||||
packages = [
|
|
||||||
"proto",
|
|
||||||
"sortkeys",
|
|
||||||
"types",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c"
|
|
||||||
version = "v1.2.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8"
|
|
||||||
name = "github.com/golang/groupcache"
|
|
||||||
packages = ["lru"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "611e8accdfc92c4187d399e95ce826046d4c8d73"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:f5ce1529abc1204444ec73779f44f94e2fa8fcdb7aca3c355b0c95947e4005c6"
|
|
||||||
name = "github.com/golang/protobuf"
|
|
||||||
packages = [
|
|
||||||
"proto",
|
|
||||||
"ptypes",
|
|
||||||
"ptypes/any",
|
|
||||||
"ptypes/duration",
|
|
||||||
"ptypes/timestamp",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
|
|
||||||
version = "v1.3.2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:cbec35fe4d5a4fba369a656a8cd65e244ea2c743007d8f6c1ccb132acf9d1296"
|
|
||||||
name = "github.com/gorilla/mux"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "00bdffe0f3c77e27d2cf6f5c70232a2d3e4d9c15"
|
|
||||||
version = "v1.7.3"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:1a7059d684f8972987e4b6f0703083f207d63f63da0ea19610ef2e6bb73db059"
|
|
||||||
name = "github.com/imdario/mergo"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "66f88b4ae75f5edcc556623b96ff32c06360fbb7"
|
|
||||||
version = "v0.3.9"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be"
|
|
||||||
name = "github.com/inconshreveable/mousetrap"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
|
|
||||||
version = "v1.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de"
|
|
||||||
name = "github.com/konsorten/go-windows-terminal-sequences"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e"
|
|
||||||
version = "v1.0.2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:528e84b49342ec33c96022f8d7dd4c8bd36881798afbb44e2744bda0ec72299c"
|
|
||||||
name = "github.com/mattn/go-shellwords"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "28e4fdf351f0744b1249317edb45e4c2aa7a5e43"
|
|
||||||
version = "v1.0.10"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:dd34285411cd7599f1fe588ef9451d5237095963ecc85c1212016c6769866306"
|
|
||||||
name = "github.com/mitchellh/mapstructure"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "20e21c67c4d0e1b4244f83449b7cdd10435ee998"
|
|
||||||
version = "v1.3.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:906eb1ca3c8455e447b99a45237b2b9615b665608fd07ad12cce847dd9a1ec43"
|
|
||||||
name = "github.com/morikuni/aec"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "39771216ff4c63d11f5e604076f9c45e8be1067b"
|
|
||||||
version = "v1.0.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:bc62c2c038cc8ae51b68f6d52570501a763bb71e78736a9f65d60762429864a9"
|
|
||||||
name = "github.com/opencontainers/go-digest"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "c9281466c8b2f606084ac71339773efd177436e7"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:70711188c19c53147099d106169d6a81941ed5c2658651432de564a7d60fd288"
|
|
||||||
name = "github.com/opencontainers/image-spec"
|
|
||||||
packages = [
|
|
||||||
"identity",
|
|
||||||
"specs-go",
|
|
||||||
"specs-go/v1",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "d60099175f88c47cd379c4738d158884749ed235"
|
|
||||||
version = "v1.0.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:18d6ebfbabffccba7318a4e26028b0d41f23ff359df3dc07a53b37a9f3a4a994"
|
|
||||||
name = "github.com/opencontainers/runc"
|
|
||||||
packages = [
|
|
||||||
"libcontainer/system",
|
|
||||||
"libcontainer/user",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "d736ef14f0288d6993a1845745d6756cfc9ddd5a"
|
|
||||||
version = "v1.0.0-rc9"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:7a58202c5cdf3d2c1eb0621fe369315561cea7f036ad10f0f0479ac36bcc95eb"
|
|
||||||
name = "github.com/opencontainers/runtime-spec"
|
|
||||||
packages = ["specs-go"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "29686dbc5559d93fb1ef402eeda3e35c38d75af4"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:cdf3df431e70077f94e14a99305808e3d13e96262b4686154970f448f7248842"
|
|
||||||
name = "github.com/openfaas/faas"
|
|
||||||
packages = ["gateway/requests"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "80b6976c106370a7081b2f8e9099a6ea9638e1f3"
|
|
||||||
version = "0.18.10"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:4d972c6728f8cbaded7d2ee6349fbe5f9278cabcd51d1ecad97b2e79c72bea9d"
|
|
||||||
name = "github.com/openfaas/faas-provider"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"auth",
|
|
||||||
"httputil",
|
|
||||||
"logs",
|
|
||||||
"proxy",
|
|
||||||
"types",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "db19209aa27f42a9cf6a23448fc2b8c9cc4fbb5d"
|
|
||||||
version = "v0.15.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
|
||||||
name = "github.com/pkg/errors"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
|
|
||||||
version = "v0.8.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:044c51736e2688a3e4f28f72537f8a7b3f9c188fab4477d5334d92dfe2c07ed5"
|
|
||||||
name = "github.com/sethvargo/go-password"
|
|
||||||
packages = ["password"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "07c3d521e892540e71469bb0312866130714c038"
|
|
||||||
version = "v0.1.3"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:fd61cf4ae1953d55df708acb6b91492d538f49c305b364a014049914495db426"
|
|
||||||
name = "github.com/sirupsen/logrus"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f"
|
|
||||||
version = "v1.4.1"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:e096613fb7cf34743d49af87d197663cfccd61876e2219853005a57baedfa562"
|
|
||||||
name = "github.com/spf13/cobra"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "f2b07da1e2c38d5f12845a4f607e2e1018cbb1f5"
|
|
||||||
version = "v0.0.5"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd"
|
|
||||||
name = "github.com/spf13/pflag"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab"
|
|
||||||
version = "v1.0.5"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:e14e467ed00ab98665623c5060fa17e3d7079be560ffc33cabafd05d35894f05"
|
|
||||||
name = "github.com/syndtr/gocapability"
|
|
||||||
packages = ["capability"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "d98352740cb2c55f81556b63d4a1ec64c5a319c2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:1314b5ef1c0b25257ea02e454291bf042478a48407cfe3ffea7e20323bbf5fdf"
|
|
||||||
name = "github.com/vishvananda/netlink"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"nl",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "f049be6f391489d3f374498fe0c8df8449258372"
|
|
||||||
version = "v1.1.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:975cb0c04431bf92e60b636a15897c4a3faba9f7dc04da505646630ac91d29d3"
|
|
||||||
name = "github.com/vishvananda/netns"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "0a2b9b5464df8343199164a0321edf3313202f7e"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:87fe9bca786484cef53d52adeec7d1c52bc2bfbee75734eddeb75fc5c7023871"
|
|
||||||
name = "github.com/xeipuuv/gojsonpointer"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "02993c407bfbf5f6dae44c4f4b1cf6a39b5fc5bb"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:dc6a6c28ca45d38cfce9f7cb61681ee38c5b99ec1425339bfc1e1a7ba769c807"
|
|
||||||
name = "github.com/xeipuuv/gojsonreference"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "bd5ef7bd5415a7ac448318e64f11a24cd21e594b"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:a8a0ed98532819a3b0dc5cf3264a14e30aba5284b793ba2850d6f381ada5f987"
|
|
||||||
name = "github.com/xeipuuv/gojsonschema"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "82fcdeb203eb6ab2a67d0a623d9c19e5e5a64927"
|
|
||||||
version = "v1.2.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:aed53a5fa03c1270457e331cf8b7e210e3088a2278fec552c5c5d29c1664e161"
|
|
||||||
name = "go.opencensus.io"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"internal",
|
|
||||||
"trace",
|
|
||||||
"trace/internal",
|
|
||||||
"trace/tracestate",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "aad2c527c5defcf89b5afab7f37274304195a6b2"
|
|
||||||
version = "v0.22.2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:676f320d34ccfa88bfa6d04bdf388ed7062af175355c805ef57ccda1a3f13432"
|
|
||||||
name = "golang.org/x/net"
|
|
||||||
packages = [
|
|
||||||
"context",
|
|
||||||
"context/ctxhttp",
|
|
||||||
"http/httpguts",
|
|
||||||
"http2",
|
|
||||||
"http2/hpack",
|
|
||||||
"idna",
|
|
||||||
"internal/timeseries",
|
|
||||||
"trace",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "c0dbc17a35534bf2e581d7a942408dc936316da4"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:d6b0cfc5ae30841c4b116ac589629f56f8add0955a39f11d8c0d06ca67f5b3d5"
|
|
||||||
name = "golang.org/x/sync"
|
|
||||||
packages = [
|
|
||||||
"errgroup",
|
|
||||||
"semaphore",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "42b317875d0fa942474b76e1b46a6060d720ae6e"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:a76bac71eb452a046b47f82336ba792d8de988688a912f3fd0e8ec8e57fe1bb4"
|
|
||||||
name = "golang.org/x/sys"
|
|
||||||
packages = [
|
|
||||||
"unix",
|
|
||||||
"windows",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "af0d71d358abe0ba3594483a5d519f429dbae3e9"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405"
|
|
||||||
name = "golang.org/x/text"
|
|
||||||
packages = [
|
|
||||||
"collate",
|
|
||||||
"collate/build",
|
|
||||||
"internal/colltab",
|
|
||||||
"internal/gen",
|
|
||||||
"internal/language",
|
|
||||||
"internal/language/compact",
|
|
||||||
"internal/tag",
|
|
||||||
"internal/triegen",
|
|
||||||
"internal/ucd",
|
|
||||||
"language",
|
|
||||||
"secure/bidirule",
|
|
||||||
"transform",
|
|
||||||
"unicode/bidi",
|
|
||||||
"unicode/cldr",
|
|
||||||
"unicode/norm",
|
|
||||||
"unicode/rangetable",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"
|
|
||||||
version = "v0.3.2"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:583a0c80f5e3a9343d33aea4aead1e1afcc0043db66fdf961ddd1fe8cd3a4faf"
|
|
||||||
name = "google.golang.org/genproto"
|
|
||||||
packages = ["googleapis/rpc/status"]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "b31c10ee225f87dbb9f5f878ead9d64f34f5cbbb"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:48eafc052e46b4ebbc7882553873cf6198203e528627cefc94dcaf8553addd19"
|
|
||||||
name = "google.golang.org/grpc"
|
|
||||||
packages = [
|
|
||||||
".",
|
|
||||||
"balancer",
|
|
||||||
"balancer/base",
|
|
||||||
"balancer/roundrobin",
|
|
||||||
"binarylog/grpc_binarylog_v1",
|
|
||||||
"codes",
|
|
||||||
"connectivity",
|
|
||||||
"credentials",
|
|
||||||
"credentials/internal",
|
|
||||||
"encoding",
|
|
||||||
"encoding/proto",
|
|
||||||
"grpclog",
|
|
||||||
"health/grpc_health_v1",
|
|
||||||
"internal",
|
|
||||||
"internal/backoff",
|
|
||||||
"internal/balancerload",
|
|
||||||
"internal/binarylog",
|
|
||||||
"internal/channelz",
|
|
||||||
"internal/envconfig",
|
|
||||||
"internal/grpcrand",
|
|
||||||
"internal/grpcsync",
|
|
||||||
"internal/syscall",
|
|
||||||
"internal/transport",
|
|
||||||
"keepalive",
|
|
||||||
"metadata",
|
|
||||||
"naming",
|
|
||||||
"peer",
|
|
||||||
"resolver",
|
|
||||||
"resolver/dns",
|
|
||||||
"resolver/passthrough",
|
|
||||||
"serviceconfig",
|
|
||||||
"stats",
|
|
||||||
"status",
|
|
||||||
"tap",
|
|
||||||
]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "6eaf6f47437a6b4e2153a190160ef39a92c7eceb"
|
|
||||||
version = "v1.23.0"
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:d7f1bd887dc650737a421b872ca883059580e9f8314d601f88025df4f4802dce"
|
|
||||||
name = "gopkg.in/yaml.v2"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "0b1645d91e851e735d3e23330303ce81f70adbe3"
|
|
||||||
version = "v2.3.0"
|
|
||||||
|
|
||||||
[solve-meta]
|
|
||||||
analyzer-name = "dep"
|
|
||||||
analyzer-version = 1
|
|
||||||
input-imports = [
|
|
||||||
"github.com/alexellis/go-execute/pkg/v1",
|
|
||||||
"github.com/alexellis/k3sup/pkg/env",
|
|
||||||
"github.com/compose-spec/compose-go/loader",
|
|
||||||
"github.com/compose-spec/compose-go/types",
|
|
||||||
"github.com/containerd/containerd",
|
|
||||||
"github.com/containerd/containerd/cio",
|
|
||||||
"github.com/containerd/containerd/containers",
|
|
||||||
"github.com/containerd/containerd/errdefs",
|
|
||||||
"github.com/containerd/containerd/namespaces",
|
|
||||||
"github.com/containerd/containerd/oci",
|
|
||||||
"github.com/containerd/containerd/remotes",
|
|
||||||
"github.com/containerd/containerd/remotes/docker",
|
|
||||||
"github.com/containerd/containerd/runtime/v2/logging",
|
|
||||||
"github.com/containerd/go-cni",
|
|
||||||
"github.com/coreos/go-systemd/journal",
|
|
||||||
"github.com/docker/cli/cli/config",
|
|
||||||
"github.com/docker/cli/cli/config/configfile",
|
|
||||||
"github.com/docker/distribution/reference",
|
|
||||||
"github.com/gorilla/mux",
|
|
||||||
"github.com/morikuni/aec",
|
|
||||||
"github.com/opencontainers/runtime-spec/specs-go",
|
|
||||||
"github.com/openfaas/faas-provider",
|
|
||||||
"github.com/openfaas/faas-provider/logs",
|
|
||||||
"github.com/openfaas/faas-provider/proxy",
|
|
||||||
"github.com/openfaas/faas-provider/types",
|
|
||||||
"github.com/openfaas/faas/gateway/requests",
|
|
||||||
"github.com/pkg/errors",
|
|
||||||
"github.com/sethvargo/go-password/password",
|
|
||||||
"github.com/spf13/cobra",
|
|
||||||
"github.com/spf13/pflag",
|
|
||||||
"github.com/vishvananda/netlink",
|
|
||||||
"github.com/vishvananda/netns",
|
|
||||||
"golang.org/x/sys/unix",
|
|
||||||
]
|
|
||||||
solver-name = "gps-cdcl"
|
|
||||||
solver-version = 1
|
|
47
Gopkg.toml
47
Gopkg.toml
@ -1,47 +0,0 @@
|
|||||||
[prune]
|
|
||||||
go-tests = true
|
|
||||||
unused-packages = true
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/containerd/containerd"
|
|
||||||
version = "1.3.2"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/morikuni/aec"
|
|
||||||
version = "1.0.0"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/spf13/cobra"
|
|
||||||
version = "0.0.5"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/alexellis/k3sup"
|
|
||||||
version = "0.9.3"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/alexellis/go-execute"
|
|
||||||
version = "0.4.0"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/gorilla/mux"
|
|
||||||
version = "1.7.3"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/openfaas/faas"
|
|
||||||
version = "0.18.7"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/sethvargo/go-password"
|
|
||||||
version = "0.1.3"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
branch = "master"
|
|
||||||
name = "github.com/containerd/go-cni"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/openfaas/faas-provider"
|
|
||||||
version = "v0.15.1"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/docker/cli"
|
|
||||||
version = "19.3.5"
|
|
27
Makefile
27
Makefile
@ -5,21 +5,30 @@ CONTAINERD_VER := 1.3.4
|
|||||||
CNI_VERSION := v0.8.6
|
CNI_VERSION := v0.8.6
|
||||||
ARCH := amd64
|
ARCH := amd64
|
||||||
|
|
||||||
|
export GO111MODULE=on
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: local
|
all: test dist hashgen
|
||||||
|
|
||||||
|
.PHONY: publish
|
||||||
|
all: dist hashgen
|
||||||
|
|
||||||
local:
|
local:
|
||||||
CGO_ENABLED=0 GOOS=linux go build -o bin/faasd
|
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o bin/faasd
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
CGO_ENABLED=0 GOOS=linux go test -ldflags $(LDFLAGS) ./...
|
CGO_ENABLED=0 GOOS=linux go test -mod=vendor -ldflags $(LDFLAGS) ./...
|
||||||
|
|
||||||
.PHONY: dist
|
.PHONY: dist
|
||||||
dist:
|
dist:
|
||||||
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd
|
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd-armhf
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -mod=vendor -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd-armhf
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd-arm64
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/faasd-arm64
|
||||||
|
|
||||||
|
.PHONY: hashgen
|
||||||
|
hashgen:
|
||||||
|
for f in bin/faasd*; do shasum -a 256 $$f > $$f.sha256; done
|
||||||
|
|
||||||
.PHONY: prepare-test
|
.PHONY: prepare-test
|
||||||
prepare-test:
|
prepare-test:
|
||||||
@ -29,8 +38,8 @@ prepare-test:
|
|||||||
sudo /sbin/sysctl -w net.ipv4.conf.all.forwarding=1
|
sudo /sbin/sysctl -w net.ipv4.conf.all.forwarding=1
|
||||||
sudo mkdir -p /opt/cni/bin
|
sudo mkdir -p /opt/cni/bin
|
||||||
curl -sSL https://github.com/containernetworking/plugins/releases/download/$(CNI_VERSION)/cni-plugins-linux-$(ARCH)-$(CNI_VERSION).tgz | sudo tar -xz -C /opt/cni/bin
|
curl -sSL https://github.com/containernetworking/plugins/releases/download/$(CNI_VERSION)/cni-plugins-linux-$(ARCH)-$(CNI_VERSION).tgz | sudo tar -xz -C /opt/cni/bin
|
||||||
sudo cp $(GOPATH)/src/github.com/openfaas/faasd/bin/faasd /usr/local/bin/
|
sudo cp bin/faasd /usr/local/bin/
|
||||||
cd $(GOPATH)/src/github.com/openfaas/faasd/ && sudo /usr/local/bin/faasd install
|
sudo /usr/local/bin/faasd install
|
||||||
sudo systemctl status -l containerd --no-pager
|
sudo systemctl status -l containerd --no-pager
|
||||||
sudo journalctl -u faasd-provider --no-pager
|
sudo journalctl -u faasd-provider --no-pager
|
||||||
sudo systemctl status -l faasd-provider --no-pager
|
sudo systemctl status -l faasd-provider --no-pager
|
||||||
@ -52,5 +61,5 @@ test-e2e:
|
|||||||
/usr/local/bin/faas-cli remove figlet
|
/usr/local/bin/faas-cli remove figlet
|
||||||
sleep 3
|
sleep 3
|
||||||
/usr/local/bin/faas-cli list
|
/usr/local/bin/faas-cli list
|
||||||
sleep 1
|
sleep 3
|
||||||
/usr/local/bin/faas-cli logs figlet --follow=false | grep Forking
|
/usr/local/bin/faas-cli logs figlet --follow=false | grep Forking
|
||||||
|
37
README.md
37
README.md
@ -1,8 +1,6 @@
|
|||||||
# faasd - Serverless for everyone else
|
# faasd - a lightweight & portable faas engine
|
||||||
|
|
||||||
faasd is built for everyone else, for those who have no desire to manage expensive infrastructure.
|
[](https://github.com/openfaas/faasd/actions)
|
||||||
|
|
||||||
[](https://travis-ci.com/openfaas/faasd)
|
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://www.openfaas.com)
|
[](https://www.openfaas.com)
|
||||||

|

|
||||||
@ -52,7 +50,7 @@ You can run this tutorial on your Raspberry Pi, or adapt the steps for a regular
|
|||||||
|
|
||||||
Automate everything within < 60 seconds and get a public URL and IP address back. Customise as required, or adapt to your preferred cloud such as AWS EC2.
|
Automate everything within < 60 seconds and get a public URL and IP address back. Customise as required, or adapt to your preferred cloud such as AWS EC2.
|
||||||
|
|
||||||
* [Provision faasd 0.8.1 on DigitalOcean with Terraform 0.12.0](docs/bootstrap/README.md)
|
* [Provision faasd 0.9.5 on DigitalOcean with Terraform 0.12.0](docs/bootstrap/README.md)
|
||||||
|
|
||||||
* [Provision faasd on DigitalOcean with built-in TLS support](docs/bootstrap/digitalocean-terraform/README.md)
|
* [Provision faasd on DigitalOcean with built-in TLS support](docs/bootstrap/digitalocean-terraform/README.md)
|
||||||
|
|
||||||
@ -76,6 +74,8 @@ ofc-bootstrap registry-login --username <your-registry-username> --password-stdi
|
|||||||
```
|
```
|
||||||
The file will be created in `./credentials/`
|
The file will be created in `./credentials/`
|
||||||
|
|
||||||
|
> Note for the GitHub container registry, you should use `ghcr.io` Container Registry and not the previous generation of "Docker Package Registry". [See notes on migrating](https://docs.github.com/en/free-pro-team@latest/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images)
|
||||||
|
|
||||||
### Logs for functions
|
### Logs for functions
|
||||||
|
|
||||||
You can view the logs of functions using `journalctl`:
|
You can view the logs of functions using `journalctl`:
|
||||||
@ -148,6 +148,21 @@ You could also perform this task over SSH, or use a configuration management too
|
|||||||
|
|
||||||
> Note: if you are using Caddy or Let's Encrypt for free SSL certificates, that you may hit rate-limits for generating new certificates if you do this too often within a given week.
|
> Note: if you are using Caddy or Let's Encrypt for free SSL certificates, that you may hit rate-limits for generating new certificates if you do this too often within a given week.
|
||||||
|
|
||||||
|
### Memory limits for functions
|
||||||
|
|
||||||
|
Memory limits for functions are supported. When the limit is exceeded the function will be killed.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
functions:
|
||||||
|
figlet:
|
||||||
|
skip_build: true
|
||||||
|
image: functions/figlet:latest
|
||||||
|
limits:
|
||||||
|
memory: 20Mi
|
||||||
|
```
|
||||||
|
|
||||||
## What does faasd deploy?
|
## What does faasd deploy?
|
||||||
|
|
||||||
* faasd - itself, and its [faas-provider](https://github.com/openfaas/faas-provider) for containerd - CRUD for functions and services, implements the OpenFaaS REST API
|
* faasd - itself, and its [faas-provider](https://github.com/openfaas/faas-provider) for containerd - CRUD for functions and services, implements the OpenFaaS REST API
|
||||||
@ -229,12 +244,10 @@ Other operations are pending development in the provider such as:
|
|||||||
* [ ] An installer for faasd and dependencies - runc, containerd
|
* [ ] An installer for faasd and dependencies - runc, containerd
|
||||||
* [ ] Monitor and restart any of the core components at runtime if the container stops
|
* [ ] Monitor and restart any of the core components at runtime if the container stops
|
||||||
* [ ] Provide ufw rules / example for blocking access to everything but a reverse proxy to the gateway container
|
* [ ] Provide ufw rules / example for blocking access to everything but a reverse proxy to the gateway container
|
||||||
* [ ] Provide [simple Caddyfile example](https://blog.alexellis.io/https-inlets-local-endpoints/) in the README showing how to expose the faasd proxy on port 80/443 with TLS
|
* [ ] Multiple replicas per function
|
||||||
|
|
||||||
### Known-issues
|
### Known-issues
|
||||||
|
|
||||||
* [ ] [containerd can't pull image from Github Docker Package Registry](https://github.com/containerd/containerd/issues/3291)
|
|
||||||
|
|
||||||
### Completed
|
### Completed
|
||||||
|
|
||||||
* [x] Provide a cloud-init configuration for faasd bootstrap
|
* [x] Provide a cloud-init configuration for faasd bootstrap
|
||||||
@ -254,8 +267,12 @@ Other operations are pending development in the provider such as:
|
|||||||
* [x] Setup custom working directory for faasd `/var/lib/faasd/`
|
* [x] Setup custom working directory for faasd `/var/lib/faasd/`
|
||||||
* [x] Use CNI to create network namespaces and adapters
|
* [x] Use CNI to create network namespaces and adapters
|
||||||
* [x] Optionally expose core services from the docker-compose.yaml file, locally or to all adapters.
|
* [x] Optionally expose core services from the docker-compose.yaml file, locally or to all adapters.
|
||||||
|
* [x] ~~[containerd can't pull image from Github Docker Package Registry](https://github.com/containerd/containerd/issues/3291)~~ ghcr.io support
|
||||||
|
* [x] Provide [simple Caddyfile example](https://blog.alexellis.io/https-inlets-local-endpoints/) in the README showing how to expose the faasd proxy on port 80/443 with TLS
|
||||||
|
* [x] Annotation support
|
||||||
|
* [x] Hard memory limits for functions
|
||||||
|
* [ ] Terraform for DigitalOcean
|
||||||
|
|
||||||
WIP:
|
WIP:
|
||||||
|
|
||||||
* [ ] Annotation support (PR ready)
|
* [ ] Terraform for AWS
|
||||||
* [ ] Hard memory limits for functions (PR ready)
|
|
||||||
|
@ -17,8 +17,8 @@ runcmd:
|
|||||||
- mkdir -p /opt/cni/bin
|
- mkdir -p /opt/cni/bin
|
||||||
- curl -sSL https://github.com/containernetworking/plugins/releases/download/v0.8.5/cni-plugins-linux-amd64-v0.8.5.tgz | tar -xz -C /opt/cni/bin
|
- curl -sSL https://github.com/containernetworking/plugins/releases/download/v0.8.5/cni-plugins-linux-amd64-v0.8.5.tgz | tar -xz -C /opt/cni/bin
|
||||||
- mkdir -p /go/src/github.com/openfaas/
|
- mkdir -p /go/src/github.com/openfaas/
|
||||||
- cd /go/src/github.com/openfaas/ && git clone https://github.com/openfaas/faasd && git checkout 0.9.2
|
- cd /go/src/github.com/openfaas/ && git clone --depth 1 --branch 0.9.5 https://github.com/openfaas/faasd
|
||||||
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.2/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.5/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
||||||
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
||||||
- systemctl status -l containerd --no-pager
|
- systemctl status -l containerd --no-pager
|
||||||
- journalctl -u faasd-provider --no-pager
|
- journalctl -u faasd-provider --no-pager
|
||||||
|
@ -41,7 +41,7 @@ services:
|
|||||||
- "127.0.0.1:9090:9090"
|
- "127.0.0.1:9090:9090"
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
image: "docker.io/openfaas/gateway:0.18.18${ARCH_SUFFIX}"
|
image: "docker.io/openfaas/gateway:0.19.1${ARCH_SUFFIX}"
|
||||||
environment:
|
environment:
|
||||||
- basic_auth=true
|
- basic_auth=true
|
||||||
- functions_provider_url=http://faasd-provider:8081/
|
- functions_provider_url=http://faasd-provider:8081/
|
||||||
|
@ -231,7 +231,7 @@ export SUFFIX="-armhf"
|
|||||||
export SUFFIX="-arm64"
|
export SUFFIX="-arm64"
|
||||||
|
|
||||||
# Then download
|
# Then download
|
||||||
curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.8.2/faasd$SUFFIX" \
|
curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.5/faasd$SUFFIX" \
|
||||||
-o "/tmp/faasd" \
|
-o "/tmp/faasd" \
|
||||||
&& chmod +x "/tmp/faasd"
|
&& chmod +x "/tmp/faasd"
|
||||||
sudo mv /tmp/faasd /usr/local/bin/
|
sudo mv /tmp/faasd /usr/local/bin/
|
||||||
|
@ -83,7 +83,7 @@ Log out once you know it works.
|
|||||||
* Let's capture the authentication password into a file for use with `faas-cli`
|
* Let's capture the authentication password into a file for use with `faas-cli`
|
||||||
|
|
||||||
```
|
```
|
||||||
ssh ubuntu@192.168.64.14 "sudo cat /var/lib/faasd/secrets/basic-auth-password" > basic-auth-password
|
ssh ubuntu@$IP "sudo cat /var/lib/faasd/secrets/basic-auth-password" > basic-auth-password
|
||||||
```
|
```
|
||||||
|
|
||||||
## Try faasd (OpenFaaS)
|
## Try faasd (OpenFaaS)
|
||||||
|
@ -19,8 +19,8 @@ runcmd:
|
|||||||
- mkdir -p /var/lib/faasd/secrets/
|
- mkdir -p /var/lib/faasd/secrets/
|
||||||
- echo ${gw_password} > /var/lib/faasd/secrets/basic-auth-password
|
- echo ${gw_password} > /var/lib/faasd/secrets/basic-auth-password
|
||||||
- echo admin > /var/lib/faasd/secrets/basic-auth-user
|
- echo admin > /var/lib/faasd/secrets/basic-auth-user
|
||||||
- cd /go/src/github.com/openfaas/ && git clone https://github.com/openfaas/faasd && cd faasd && git checkout 0.9.2
|
- cd /go/src/github.com/openfaas/ && git clone --depth 1 --branch 0.9.5 https://github.com/openfaas/faasd
|
||||||
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.2/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.5/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
||||||
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
||||||
- systemctl status -l containerd --no-pager
|
- systemctl status -l containerd --no-pager
|
||||||
- journalctl -u faasd-provider --no-pager
|
- journalctl -u faasd-provider --no-pager
|
||||||
|
@ -41,8 +41,8 @@ runcmd:
|
|||||||
- mkdir -p /var/lib/faasd/secrets/
|
- mkdir -p /var/lib/faasd/secrets/
|
||||||
- echo ${gw_password} > /var/lib/faasd/secrets/basic-auth-password
|
- echo ${gw_password} > /var/lib/faasd/secrets/basic-auth-password
|
||||||
- echo admin > /var/lib/faasd/secrets/basic-auth-user
|
- echo admin > /var/lib/faasd/secrets/basic-auth-user
|
||||||
- cd /go/src/github.com/openfaas/ && git clone https://github.com/openfaas/faasd && cd faasd && git checkout 0.9.2
|
- cd /go/src/github.com/openfaas/ && git clone --depth 1 --branch 0.9.5 https://github.com/openfaas/faasd
|
||||||
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.2/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
- curl -fSLs "https://github.com/openfaas/faasd/releases/download/0.9.5/faasd" --output "/usr/local/bin/faasd" && chmod a+x "/usr/local/bin/faasd"
|
||||||
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
- cd /go/src/github.com/openfaas/faasd/ && /usr/local/bin/faasd install
|
||||||
- systemctl status -l containerd --no-pager
|
- systemctl status -l containerd --no-pager
|
||||||
- journalctl -u faasd-provider --no-pager
|
- journalctl -u faasd-provider --no-pager
|
||||||
|
47
go.mod
Normal file
47
go.mod
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
module github.com/openfaas/faasd
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/Microsoft/hcsshim v0.8.7-0.20190820203702-9e921883ac92 // indirect
|
||||||
|
github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e
|
||||||
|
github.com/alexellis/k3sup v0.0.0-20200607084134-629c0bc6b50f
|
||||||
|
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05
|
||||||
|
github.com/containerd/containerd v1.3.2
|
||||||
|
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 // indirect
|
||||||
|
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c // indirect
|
||||||
|
github.com/containerd/go-cni v0.0.0-20200107172653-c154a49e2c75
|
||||||
|
github.com/containerd/ttrpc v1.0.0 // indirect
|
||||||
|
github.com/containerd/typeurl v1.0.0 // indirect
|
||||||
|
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
|
||||||
|
github.com/docker/cli v0.0.0-20191105005515-99c5edceb48d
|
||||||
|
github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
|
||||||
|
github.com/docker/docker v17.12.0-ce-rc1.0.20191113042239-ea84732a7725+incompatible // indirect
|
||||||
|
github.com/docker/docker-credential-helpers v0.6.3 // indirect
|
||||||
|
github.com/docker/go-events v0.0.0-20170721190031-9461782956ad // indirect
|
||||||
|
github.com/gogo/googleapis v1.2.0 // indirect
|
||||||
|
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
|
||||||
|
github.com/gorilla/mux v1.7.3
|
||||||
|
github.com/imdario/mergo v0.3.9 // indirect
|
||||||
|
github.com/morikuni/aec v1.0.0
|
||||||
|
github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2 // indirect
|
||||||
|
github.com/opencontainers/image-spec v1.0.1 // indirect
|
||||||
|
github.com/opencontainers/runc v1.0.0-rc9 // indirect
|
||||||
|
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559
|
||||||
|
github.com/openfaas/faas v0.0.0-20191227175319-80b6976c1063
|
||||||
|
github.com/openfaas/faas-provider v0.15.1
|
||||||
|
github.com/pkg/errors v0.9.1
|
||||||
|
github.com/sethvargo/go-password v0.1.3
|
||||||
|
github.com/spf13/cobra v0.0.5
|
||||||
|
github.com/spf13/pflag v1.0.5
|
||||||
|
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect
|
||||||
|
github.com/vishvananda/netlink v1.1.0
|
||||||
|
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
|
go.opencensus.io v0.22.2 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20191219235734-af0d71d358ab
|
||||||
|
google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f // indirect
|
||||||
|
google.golang.org/grpc v1.23.0 // indirect
|
||||||
|
k8s.io/apimachinery v0.18.9
|
||||||
|
)
|
314
go.sum
Normal file
314
go.sum
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
|
||||||
|
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
|
||||||
|
github.com/Microsoft/hcsshim v0.8.7-0.20190820203702-9e921883ac92 h1:LbNLS5KKzW/L4K2scH5rzTA5MvRWiUfcWv4Qh/6D3wY=
|
||||||
|
github.com/Microsoft/hcsshim v0.8.7-0.20190820203702-9e921883ac92/go.mod h1:nvUXb1s75kCTKHWZ1FGlut+PBI9D9EoQHCKcil2Cyps=
|
||||||
|
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||||
|
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||||
|
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||||
|
github.com/alexellis/go-execute v0.0.0-20191207085904-961405ea7544/go.mod h1:zfRbgnPVxXCSpiKrg1CE72hNUWInqxExiaz2D9ppTts=
|
||||||
|
github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e h1:0cv4CUENL7e67/ZlNrvExWqa6oKH/9iv0KQn0/+hYaY=
|
||||||
|
github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e/go.mod h1:zfRbgnPVxXCSpiKrg1CE72hNUWInqxExiaz2D9ppTts=
|
||||||
|
github.com/alexellis/k3sup v0.0.0-20200607084134-629c0bc6b50f h1:GYVsHjM9/lyu0QBfNp1RThZNDrmRJncpSYtaektq9t0=
|
||||||
|
github.com/alexellis/k3sup v0.0.0-20200607084134-629c0bc6b50f/go.mod h1:slULyLX94hIIP3/eVeZqQAqOwpLYK9Pljr8SfaR2nWI=
|
||||||
|
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||||
|
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
|
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05 h1:3CoRXflT4IAdIpsFTqZBlLuHOkHYhBvW0iijkQKm4QY=
|
||||||
|
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05/go.mod h1:y75QUr1jcR5aFNf3Tj3dhwnujABGz6UaRrZ5qZwF1cc=
|
||||||
|
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
|
||||||
|
github.com/containerd/containerd v0.0.0-20190214164719-faec567304bb/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
|
||||||
|
github.com/containerd/containerd v1.3.2 h1:ForxmXkA6tPIvffbrDAcPUIB32QgXkt2XFj+F0UxetA=
|
||||||
|
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
|
||||||
|
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
|
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 h1:tN9D97v5A5QuKdcKHKt+UMKrkQ5YXUnD8iM7IAAjEfI=
|
||||||
|
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
|
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
||||||
|
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c h1:KFbqHhDeaHM7IfFtXHfUHMDaUStpM2YwBR+iJCIOsKk=
|
||||||
|
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
||||||
|
github.com/containerd/go-cni v0.0.0-20200107172653-c154a49e2c75 h1:5Q5C6jDObSVpjeX8CuZ5yac8d/KIYuPzUHbUzdL+NFw=
|
||||||
|
github.com/containerd/go-cni v0.0.0-20200107172653-c154a49e2c75/go.mod h1:0mg8r6FCdbxvLDqCXwAx2rO+KA37QICjKL8+wHOG5OE=
|
||||||
|
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
|
||||||
|
github.com/containerd/ttrpc v0.0.0-20180920185216-2a805f718635/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
|
||||||
|
github.com/containerd/ttrpc v1.0.0 h1:NY8Zk2i7TpkLxrkOASo+KTFq9iNCEmMH2/ZG9OuOw6k=
|
||||||
|
github.com/containerd/ttrpc v1.0.0/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
|
||||||
|
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
||||||
|
github.com/containerd/typeurl v1.0.0 h1:7LMH7LfEmpWeCkGcIputvd4P0Rnd0LrIv1Jk2s5oobs=
|
||||||
|
github.com/containerd/typeurl v1.0.0/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
||||||
|
github.com/containernetworking/cni v0.7.1 h1:fE3r16wpSEyaqY4Z4oFrLMmIGfBYIKpPrHK31EJ9FzE=
|
||||||
|
github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
|
||||||
|
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
|
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||||
|
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
|
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
|
||||||
|
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
|
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/docker/cli v0.0.0-20191105005515-99c5edceb48d h1:SknEFm9d070Wn2GeX8dyl7bMrX07cp3UMXuZ2Ct02Kw=
|
||||||
|
github.com/docker/cli v0.0.0-20191105005515-99c5edceb48d/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
|
github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible h1:dvc1KSkIYTVjZgHf/CTC2diTYC8PzhaA5sFISRfNVrE=
|
||||||
|
github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
|
github.com/docker/docker v17.12.0-ce-rc1.0.20191113042239-ea84732a7725+incompatible h1:m+SEbBCq0i1e399zUpu70L8AYiTT5UiF7O0IO+5AorM=
|
||||||
|
github.com/docker/docker v17.12.0-ce-rc1.0.20191113042239-ea84732a7725+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
|
github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ=
|
||||||
|
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
|
||||||
|
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
|
||||||
|
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||||
|
github.com/docker/go-events v0.0.0-20170721190031-9461782956ad h1:VXIse57M5C6ezDuCPyq6QmMvEJ2xclYKZ35SfkXdm3E=
|
||||||
|
github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
|
||||||
|
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
|
||||||
|
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||||
|
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
|
||||||
|
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
||||||
|
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||||
|
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
|
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
||||||
|
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
|
||||||
|
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
|
||||||
|
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
|
||||||
|
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
|
||||||
|
github.com/gogo/googleapis v1.2.0 h1:Z0v3OJDotX9ZBpdz2V+AI7F4fITSZhVE5mg6GQppwMM=
|
||||||
|
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
|
||||||
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
|
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
|
||||||
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE=
|
||||||
|
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||||
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
|
||||||
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
|
||||||
|
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||||
|
github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||||
|
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||||
|
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||||
|
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
||||||
|
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||||
|
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
|
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
|
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||||
|
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
|
||||||
|
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||||
|
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||||
|
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||||
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
|
github.com/mattn/go-shellwords v1.0.10 h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvOrs2Gw=
|
||||||
|
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
|
github.com/mitchellh/mapstructure v1.3.1 h1:cCBH2gTD2K0OtLlv/Y5H01VQCqmlDxz30kS5Y5bqfLA=
|
||||||
|
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
||||||
|
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||||
|
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
|
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||||
|
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||||
|
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||||
|
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||||
|
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||||
|
github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2 h1:2C93eP55foV5f0eNmXbidhKzwUZbs/Gk4PRp1zfeffs=
|
||||||
|
github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||||
|
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
|
||||||
|
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||||
|
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
|
||||||
|
github.com/opencontainers/runc v1.0.0-rc9 h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU4LguQVtc=
|
||||||
|
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
|
||||||
|
github.com/opencontainers/runtime-spec v0.0.0-20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||||
|
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559 h1:Cef96rKLuXxeGzERI/0ve9yAzIeTpx0qz9JKFDZALYw=
|
||||||
|
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||||
|
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
|
||||||
|
github.com/openfaas/faas v0.0.0-20191227175319-80b6976c1063 h1:9dxY2GyAGl6j3+g4RN0gHsDIk3dEHuKmqlB2mkGlJ7c=
|
||||||
|
github.com/openfaas/faas v0.0.0-20191227175319-80b6976c1063/go.mod h1:E0m2rLup0Vvxg53BKxGgaYAGcZa3Xl+vvL7vSi5yQ14=
|
||||||
|
github.com/openfaas/faas-provider v0.15.1 h1:5M+DrGbuKlZxhN3/otFgLgBUnPQcYm6XosQDSbKXh30=
|
||||||
|
github.com/openfaas/faas-provider v0.15.1/go.mod h1:ChVioeB3snmfYxBTu7SrWGYLoYN9fZkQlnuEQ86a6l0=
|
||||||
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||||
|
github.com/sethvargo/go-password v0.1.2/go.mod h1:qKHfdSjT26DpHQWHWWR5+X4BI45jT31dg6j4RI2TEb0=
|
||||||
|
github.com/sethvargo/go-password v0.1.3 h1:18KkbGDkw8SuzeohAbWqBLNSfRQblVwEHOLbPa0PvWM=
|
||||||
|
github.com/sethvargo/go-password v0.1.3/go.mod h1:2tyaaoHK/AlXwh5WWQDYjqQbHcq4cjPj5qb/ciYvu/Q=
|
||||||
|
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||||
|
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
|
||||||
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
|
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
|
||||||
|
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||||
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
|
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||||
|
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||||
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||||
|
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 h1:b6uOv7YOFK0TYG7HtkIgExQo+2RdLuwRft63jn2HWj8=
|
||||||
|
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||||
|
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||||
|
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||||
|
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
|
||||||
|
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
||||||
|
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=
|
||||||
|
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||||
|
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
|
go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs=
|
||||||
|
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI=
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8=
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191219235734-af0d71d358ab h1:j8r8g0V3tVdbo274kyTmC+yEsChru2GfvdiV84wm5T8=
|
||||||
|
golang.org/x/sys v0.0.0-20191219235734-af0d71d358ab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f h1:0RYv5T9ZdroAqqfM2taEB0nJrArv0X1JpIdgUmY4xg8=
|
||||||
|
google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
|
||||||
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||||
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||||
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
|
||||||
|
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||||
|
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
|
||||||
|
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
|
||||||
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY=
|
||||||
|
k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk=
|
||||||
|
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||||
|
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||||
|
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
||||||
|
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
|
||||||
|
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
|
||||||
|
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
|
||||||
|
sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
|
||||||
|
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
|
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
141
hack/install.sh
Normal file
141
hack/install.sh
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright OpenFaaS Author(s) 2020
|
||||||
|
|
||||||
|
#########################
|
||||||
|
# Repo specific content #
|
||||||
|
#########################
|
||||||
|
|
||||||
|
export OWNER="openfaas"
|
||||||
|
export REPO="faasd"
|
||||||
|
|
||||||
|
version=""
|
||||||
|
|
||||||
|
echo "Finding latest version from GitHub"
|
||||||
|
version=$(curl -sI https://github.com/$OWNER/$REPO/releases/latest | grep -i location | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r')
|
||||||
|
echo "$version"
|
||||||
|
|
||||||
|
if [ ! $version ]; then
|
||||||
|
echo "Failed while attempting to get latest version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SUDO=sudo
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
SUDO=
|
||||||
|
fi
|
||||||
|
|
||||||
|
verify_system() {
|
||||||
|
if ! [ -d /run/systemd ]; then
|
||||||
|
fatal 'Can not find systemd to use as a process supervisor for faasd'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
has_yum() {
|
||||||
|
[ -n "$(command -v yum)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
has_apt_get() {
|
||||||
|
[ -n "$(command -v apt-get)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
install_required_packages() {
|
||||||
|
if $(has_apt_get); then
|
||||||
|
$SUDO apt-get update -y
|
||||||
|
$SUDO apt-get install -y curl runc bridge-utils
|
||||||
|
elif $(has_yum); then
|
||||||
|
$SUDO yum check-update -y
|
||||||
|
$SUDO yum install -y curl runc
|
||||||
|
else
|
||||||
|
fatal "Could not find apt-get or yum. Cannot install dependencies on this OS."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_cni_plugins() {
|
||||||
|
cni_version=v0.8.5
|
||||||
|
suffix=""
|
||||||
|
arch=$(uname -m)
|
||||||
|
case $arch in
|
||||||
|
x86_64 | amd64)
|
||||||
|
suffix=amd64
|
||||||
|
;;
|
||||||
|
arm*)
|
||||||
|
suffix=arm
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fatal "Unsupported architecture $arch"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$SUDO mkdir -p /opt/cni/bin
|
||||||
|
curl -sSL https://github.com/containernetworking/plugins/releases/download/${cni_version}/cni-plugins-linux-${suffix}-${cni_version}.tgz | $SUDO tar -xvz -C /opt/cni/bin
|
||||||
|
}
|
||||||
|
|
||||||
|
install_containerd() {
|
||||||
|
arch=$(uname -m)
|
||||||
|
case $arch in
|
||||||
|
x86_64 | amd64)
|
||||||
|
curl -sLSf https://github.com/containerd/containerd/releases/download/v1.3.7/containerd-1.3.7-linux-amd64.tar.gz | $SUDO tar -xvz --strip-components=1 -C /usr/local/bin/
|
||||||
|
;;
|
||||||
|
armv7l)
|
||||||
|
curl -sSL https://github.com/alexellis/containerd-arm/releases/download/v1.3.5/containerd-1.3.5-linux-armhf.tar.gz | $SUDO tar -xvz --strip-components=1 -C /usr/local/bin/
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
curl -sSL https://github.com/alexellis/containerd-arm/releases/download/v1.3.5/containerd-1.3.5-linux-arm64.tar.gz | $SUDO tar -xvz --strip-components=1 -C /usr/local/bin/
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fatal "Unsupported architecture $arch"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$SUDO curl -SLfs https://raw.githubusercontent.com/containerd/containerd/v1.3.5/containerd.service --output /etc/systemd/system/containerd.service
|
||||||
|
|
||||||
|
$SUDO systemctl enable containerd
|
||||||
|
$SUDO systemctl start containerd
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
}
|
||||||
|
|
||||||
|
install_faasd() {
|
||||||
|
arch=$(uname -m)
|
||||||
|
case $arch in
|
||||||
|
x86_64 | amd64)
|
||||||
|
suffix=""
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
suffix=-arm64
|
||||||
|
;;
|
||||||
|
armv7l)
|
||||||
|
suffix=-armhf
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported architecture $arch"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$SUDO curl -fSLs "https://github.com/openfaas/faasd/releases/download/${version}/faasd${suffix}" --output "/usr/local/bin/faasd"
|
||||||
|
$SUDO chmod a+x "/usr/local/bin/faasd"
|
||||||
|
|
||||||
|
mkdir -p /tmp/faasd-${version}-installation/hack
|
||||||
|
cd /tmp/faasd-${version}-installation
|
||||||
|
$SUDO curl -fSLs "https://raw.githubusercontent.com/openfaas/faasd/${version}/docker-compose.yaml" --output "docker-compose.yaml"
|
||||||
|
$SUDO curl -fSLs "https://raw.githubusercontent.com/openfaas/faasd/${version}/prometheus.yml" --output "prometheus.yml"
|
||||||
|
$SUDO curl -fSLs "https://raw.githubusercontent.com/openfaas/faasd/${version}/resolv.conf" --output "resolv.conf"
|
||||||
|
$SUDO curl -fSLs "https://raw.githubusercontent.com/openfaas/faasd/${version}/hack/faasd-provider.service" --output "hack/faasd-provider.service"
|
||||||
|
$SUDO curl -fSLs "https://raw.githubusercontent.com/openfaas/faasd/${version}/hack/faasd.service" --output "hack/faasd.service"
|
||||||
|
$SUDO /usr/local/bin/faasd install
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_system
|
||||||
|
install_required_packages
|
||||||
|
|
||||||
|
/sbin/sysctl -w net.ipv4.conf.all.forwarding=1
|
||||||
|
echo "net.ipv4.conf.all.forwarding=1" | $SUDO tee -a /etc/sysctl.conf
|
||||||
|
|
||||||
|
install_cni_plugins
|
||||||
|
install_containerd
|
||||||
|
install_faasd
|
@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
"github.com/containerd/containerd/cio"
|
"github.com/containerd/containerd/cio"
|
||||||
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
gocni "github.com/containerd/go-cni"
|
gocni "github.com/containerd/go-cni"
|
||||||
@ -22,8 +23,11 @@ import (
|
|||||||
cninetwork "github.com/openfaas/faasd/pkg/cninetwork"
|
cninetwork "github.com/openfaas/faasd/pkg/cninetwork"
|
||||||
"github.com/openfaas/faasd/pkg/service"
|
"github.com/openfaas/faasd/pkg/service"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const annotationLabelPrefix = "com.openfaas.annotations."
|
||||||
|
|
||||||
func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath string, alwaysPull bool) func(w http.ResponseWriter, r *http.Request) {
|
func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath string, alwaysPull bool) func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -99,9 +103,21 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
|||||||
|
|
||||||
name := req.Service
|
name := req.Service
|
||||||
|
|
||||||
labels := map[string]string{}
|
labels, err := buildLabels(&req)
|
||||||
if req.Labels != nil {
|
if err != nil {
|
||||||
labels = *req.Labels
|
return fmt.Errorf("Unable to apply labels to conatiner: %s, error: %s", name, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var memory *specs.LinuxMemory
|
||||||
|
if req.Limits != nil && len(req.Limits.Memory) > 0 {
|
||||||
|
memory = &specs.LinuxMemory{}
|
||||||
|
|
||||||
|
qty, err := resource.ParseQuantity(req.Limits.Memory)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error parsing (%q) as quantity: %s", req.Limits.Memory, err.Error())
|
||||||
|
}
|
||||||
|
v := qty.Value()
|
||||||
|
memory.Limit = &v
|
||||||
}
|
}
|
||||||
|
|
||||||
container, err := client.NewContainer(
|
container, err := client.NewContainer(
|
||||||
@ -113,7 +129,8 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
|||||||
containerd.WithNewSpec(oci.WithImageConfig(image),
|
containerd.WithNewSpec(oci.WithImageConfig(image),
|
||||||
oci.WithCapabilities([]string{"CAP_NET_RAW"}),
|
oci.WithCapabilities([]string{"CAP_NET_RAW"}),
|
||||||
oci.WithMounts(mounts),
|
oci.WithMounts(mounts),
|
||||||
oci.WithEnv(envs)),
|
oci.WithEnv(envs),
|
||||||
|
withMemory(memory)),
|
||||||
containerd.WithContainerLabels(labels),
|
containerd.WithContainerLabels(labels),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -125,6 +142,30 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func buildLabels(request *types.FunctionDeployment) (map[string]string, error) {
|
||||||
|
// Adapted from faas-swarm/handlers/deploy.go:buildLabels
|
||||||
|
labels := map[string]string{}
|
||||||
|
|
||||||
|
if request.Labels != nil {
|
||||||
|
for k, v := range *request.Labels {
|
||||||
|
labels[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if request.Annotations != nil {
|
||||||
|
for k, v := range *request.Annotations {
|
||||||
|
key := fmt.Sprintf("%s%s", annotationLabelPrefix, k)
|
||||||
|
if _, ok := labels[key]; !ok {
|
||||||
|
labels[key] = v
|
||||||
|
} else {
|
||||||
|
return nil, errors.New(fmt.Sprintf("Key %s cannot be used as a label due to a conflict with annotation prefix %s", k, annotationLabelPrefix))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return labels, nil
|
||||||
|
}
|
||||||
|
|
||||||
func createTask(ctx context.Context, client *containerd.Client, container containerd.Container, cni gocni.CNI) error {
|
func createTask(ctx context.Context, client *containerd.Client, container containerd.Container, cni gocni.CNI) error {
|
||||||
|
|
||||||
name := container.ID()
|
name := container.ID()
|
||||||
@ -210,3 +251,21 @@ func validateSecrets(secretMountPath string, secrets []string) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func withMemory(mem *specs.LinuxMemory) oci.SpecOpts {
|
||||||
|
return func(ctx context.Context, _ oci.Client, c *containers.Container, s *oci.Spec) error {
|
||||||
|
if mem != nil {
|
||||||
|
if s.Linux == nil {
|
||||||
|
s.Linux = &specs.Linux{}
|
||||||
|
}
|
||||||
|
if s.Linux.Resources == nil {
|
||||||
|
s.Linux.Resources = &specs.LinuxResources{}
|
||||||
|
}
|
||||||
|
if s.Linux.Resources.Memory == nil {
|
||||||
|
s.Linux.Resources.Memory = &specs.LinuxMemory{}
|
||||||
|
}
|
||||||
|
s.Linux.Resources.Memory.Limit = mem.Limit
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
77
pkg/provider/handlers/deploy_test.go
Normal file
77
pkg/provider/handlers/deploy_test.go
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/openfaas/faas-provider/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_BuildLabels_WithAnnotations(t *testing.T) {
|
||||||
|
// Test each combination of nil/non-nil annotation + label
|
||||||
|
tables := []struct {
|
||||||
|
name string
|
||||||
|
label map[string]string
|
||||||
|
annotation map[string]string
|
||||||
|
result map[string]string
|
||||||
|
}{
|
||||||
|
{"Empty label and annotations returns empty table map", nil, nil, map[string]string{}},
|
||||||
|
{
|
||||||
|
"Label with empty annotation returns valid map",
|
||||||
|
map[string]string{"L1": "V1"},
|
||||||
|
nil,
|
||||||
|
map[string]string{"L1": "V1"}},
|
||||||
|
{
|
||||||
|
"Annotation with empty label returns valid map",
|
||||||
|
nil,
|
||||||
|
map[string]string{"A1": "V2"},
|
||||||
|
map[string]string{fmt.Sprintf("%sA1", annotationLabelPrefix): "V2"}},
|
||||||
|
{
|
||||||
|
"Label and annotation provided returns valid combined map",
|
||||||
|
map[string]string{"L1": "V1"},
|
||||||
|
map[string]string{"A1": "V2"},
|
||||||
|
map[string]string{
|
||||||
|
"L1": "V1",
|
||||||
|
fmt.Sprintf("%sA1", annotationLabelPrefix): "V2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range tables {
|
||||||
|
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
request := &types.FunctionDeployment{
|
||||||
|
Labels: &tc.label,
|
||||||
|
Annotations: &tc.annotation,
|
||||||
|
}
|
||||||
|
|
||||||
|
val, err := buildLabels(request)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("want: no error got: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(val, tc.result) {
|
||||||
|
t.Errorf("Got: %s, expected %s", val, tc.result)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test_BuildLabels_WithAnnotationCollision(t *testing.T) {
|
||||||
|
request := &types.FunctionDeployment{
|
||||||
|
Labels: &map[string]string{
|
||||||
|
"function_name": "echo",
|
||||||
|
fmt.Sprintf("%scurrent-time", annotationLabelPrefix): "Wed 25 Jul 06:41:43 BST 2018",
|
||||||
|
},
|
||||||
|
Annotations: &map[string]string{"current-time": "Wed 25 Jul 06:41:43 BST 2018"},
|
||||||
|
}
|
||||||
|
|
||||||
|
val, err := buildLabels(request)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("Expected an error, got %d values", len(val))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
@ -13,13 +14,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Function struct {
|
type Function struct {
|
||||||
name string
|
name string
|
||||||
namespace string
|
namespace string
|
||||||
image string
|
image string
|
||||||
pid uint32
|
pid uint32
|
||||||
replicas int
|
replicas int
|
||||||
IP string
|
IP string
|
||||||
labels map[string]string
|
labels map[string]string
|
||||||
|
annotations map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListFunctions returns a map of all functions with running tasks on namespace
|
// ListFunctions returns a map of all functions with running tasks on namespace
|
||||||
@ -48,16 +50,20 @@ func GetFunction(client *containerd.Client, name string) (Function, error) {
|
|||||||
image, _ := c.Image(ctx)
|
image, _ := c.Image(ctx)
|
||||||
|
|
||||||
containerName := c.ID()
|
containerName := c.ID()
|
||||||
labels, labelErr := c.Labels(ctx)
|
allLabels, labelErr := c.Labels(ctx)
|
||||||
|
|
||||||
if labelErr != nil {
|
if labelErr != nil {
|
||||||
log.Printf("cannot list container %s labels: %s", containerName, labelErr.Error())
|
log.Printf("cannot list container %s labels: %s", containerName, labelErr.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
labels, annotations := buildLabelsAndAnnotations(allLabels)
|
||||||
|
|
||||||
f := Function{
|
f := Function{
|
||||||
name: containerName,
|
name: containerName,
|
||||||
namespace: faasd.FunctionNamespace,
|
namespace: faasd.FunctionNamespace,
|
||||||
image: image.Name(),
|
image: image.Name(),
|
||||||
labels: labels,
|
labels: labels,
|
||||||
|
annotations: annotations,
|
||||||
}
|
}
|
||||||
|
|
||||||
replicas := 0
|
replicas := 0
|
||||||
@ -90,3 +96,23 @@ func GetFunction(client *containerd.Client, name string) (Function, error) {
|
|||||||
|
|
||||||
return Function{}, fmt.Errorf("unable to find function: %s, error %s", name, err)
|
return Function{}, fmt.Errorf("unable to find function: %s, error %s", name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func buildLabelsAndAnnotations(ctrLabels map[string]string) (labels map[string]string, annotations map[string]string) {
|
||||||
|
for k, v := range ctrLabels {
|
||||||
|
if strings.HasPrefix(k, annotationLabelPrefix) {
|
||||||
|
if annotations == nil {
|
||||||
|
annotations = make(map[string]string)
|
||||||
|
}
|
||||||
|
|
||||||
|
annotations[strings.TrimPrefix(k, annotationLabelPrefix)] = v
|
||||||
|
} else {
|
||||||
|
if labels == nil {
|
||||||
|
labels = make(map[string]string)
|
||||||
|
}
|
||||||
|
|
||||||
|
labels[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return labels, annotations
|
||||||
|
}
|
||||||
|
29
pkg/provider/handlers/functions_test.go
Normal file
29
pkg/provider/handlers/functions_test.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_BuildLabelsAndAnnotationsFromServiceSpec_Annotations(t *testing.T) {
|
||||||
|
container := map[string]string{
|
||||||
|
"qwer": "ty",
|
||||||
|
"dvor": "ak",
|
||||||
|
fmt.Sprintf("%scurrent-time", annotationLabelPrefix): "5 Nov 20:10:20 PST 1955",
|
||||||
|
fmt.Sprintf("%sfuture-time", annotationLabelPrefix): "21 Oct 20:10:20 PST 2015",
|
||||||
|
}
|
||||||
|
|
||||||
|
labels, annotation := buildLabelsAndAnnotations(container)
|
||||||
|
|
||||||
|
if len(labels) != 2 {
|
||||||
|
t.Errorf("want: %d labels got: %d", 2, len(labels))
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(annotation) != 2 {
|
||||||
|
t.Errorf("want: %d annotation got: %d", 1, len(annotation))
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, ok := annotation["current-time"]; !ok {
|
||||||
|
t.Errorf("want: '%s' entry in annotation map got: key not found", "current-time")
|
||||||
|
}
|
||||||
|
}
|
@ -21,12 +21,14 @@ func MakeReadHandler(client *containerd.Client) func(w http.ResponseWriter, r *h
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, function := range funcs {
|
for _, function := range funcs {
|
||||||
|
|
||||||
res = append(res, types.FunctionStatus{
|
res = append(res, types.FunctionStatus{
|
||||||
Name: function.name,
|
Name: function.name,
|
||||||
Image: function.image,
|
Image: function.image,
|
||||||
Replicas: uint64(function.replicas),
|
Replicas: uint64(function.replicas),
|
||||||
Namespace: function.namespace,
|
Namespace: function.namespace,
|
||||||
Labels: &function.labels,
|
Labels: &function.labels,
|
||||||
|
Annotations: &function.annotations,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ func MakeReplicaReaderHandler(client *containerd.Client) func(w http.ResponseWri
|
|||||||
Replicas: uint64(f.replicas),
|
Replicas: uint64(f.replicas),
|
||||||
Namespace: f.namespace,
|
Namespace: f.namespace,
|
||||||
Labels: &f.labels,
|
Labels: &f.labels,
|
||||||
|
Annotations: &f.annotations,
|
||||||
}
|
}
|
||||||
|
|
||||||
functionBytes, _ := json.Marshal(found)
|
functionBytes, _ := json.Marshal(found)
|
||||||
|
191
vendor/github.com/Microsoft/hcsshim/cmd/runhcs/LICENSE
generated
vendored
191
vendor/github.com/Microsoft/hcsshim/cmd/runhcs/LICENSE
generated
vendored
@ -1,191 +0,0 @@
|
|||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
Copyright 2014 Docker, Inc.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
22
vendor/github.com/Microsoft/hcsshim/cmd/runhcs/NOTICE
generated
vendored
22
vendor/github.com/Microsoft/hcsshim/cmd/runhcs/NOTICE
generated
vendored
@ -1,22 +0,0 @@
|
|||||||
runhcs is a fork of runc.
|
|
||||||
|
|
||||||
The following is runc's legal notice.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
runc
|
|
||||||
|
|
||||||
Copyright 2012-2015 Docker, Inc.
|
|
||||||
|
|
||||||
This product includes software developed at Docker, Inc. (http://www.docker.com).
|
|
||||||
|
|
||||||
The following is courtesy of our legal counsel:
|
|
||||||
|
|
||||||
Use and transfer of Docker may be subject to certain restrictions by the
|
|
||||||
United States and other governments.
|
|
||||||
It is your responsibility to ensure that your use and/or transfer does not
|
|
||||||
violate applicable laws.
|
|
||||||
|
|
||||||
For more information, please see http://www.bis.doc.gov
|
|
||||||
|
|
||||||
See also http://www.apache.org/dev/crypto.html and/or seek legal counsel.
|
|
943
vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
generated
vendored
943
vendor/github.com/Microsoft/hcsshim/mksyscall_windows.go
generated
vendored
@ -1,943 +0,0 @@
|
|||||||
// Copyright 2013 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
/*
|
|
||||||
mksyscall_windows generates windows system call bodies
|
|
||||||
|
|
||||||
It parses all files specified on command line containing function
|
|
||||||
prototypes (like syscall_windows.go) and prints system call bodies
|
|
||||||
to standard output.
|
|
||||||
|
|
||||||
The prototypes are marked by lines beginning with "//sys" and read
|
|
||||||
like func declarations if //sys is replaced by func, but:
|
|
||||||
|
|
||||||
* The parameter lists must give a name for each argument. This
|
|
||||||
includes return parameters.
|
|
||||||
|
|
||||||
* The parameter lists must give a type for each argument:
|
|
||||||
the (x, y, z int) shorthand is not allowed.
|
|
||||||
|
|
||||||
* If the return parameter is an error number, it must be named err.
|
|
||||||
|
|
||||||
* If go func name needs to be different from it's winapi dll name,
|
|
||||||
the winapi name could be specified at the end, after "=" sign, like
|
|
||||||
//sys LoadLibrary(libname string) (handle uint32, err error) = LoadLibraryA
|
|
||||||
|
|
||||||
* Each function that returns err needs to supply a condition, that
|
|
||||||
return value of winapi will be tested against to detect failure.
|
|
||||||
This would set err to windows "last-error", otherwise it will be nil.
|
|
||||||
The value can be provided at end of //sys declaration, like
|
|
||||||
//sys LoadLibrary(libname string) (handle uint32, err error) [failretval==-1] = LoadLibraryA
|
|
||||||
and is [failretval==0] by default.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
mksyscall_windows [flags] [path ...]
|
|
||||||
|
|
||||||
The flags are:
|
|
||||||
-output
|
|
||||||
Specify output file name (outputs to console if blank).
|
|
||||||
-trace
|
|
||||||
Generate print statement after every syscall.
|
|
||||||
*/
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"bytes"
|
|
||||||
"errors"
|
|
||||||
"flag"
|
|
||||||
"fmt"
|
|
||||||
"go/format"
|
|
||||||
"go/parser"
|
|
||||||
"go/token"
|
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"runtime"
|
|
||||||
"sort"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"text/template"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
filename = flag.String("output", "", "output file name (standard output if omitted)")
|
|
||||||
printTraceFlag = flag.Bool("trace", false, "generate print statement after every syscall")
|
|
||||||
systemDLL = flag.Bool("systemdll", true, "whether all DLLs should be loaded from the Windows system directory")
|
|
||||||
winio = flag.Bool("winio", false, "import go-winio")
|
|
||||||
)
|
|
||||||
|
|
||||||
func trim(s string) string {
|
|
||||||
return strings.Trim(s, " \t")
|
|
||||||
}
|
|
||||||
|
|
||||||
var packageName string
|
|
||||||
|
|
||||||
func packagename() string {
|
|
||||||
return packageName
|
|
||||||
}
|
|
||||||
|
|
||||||
func syscalldot() string {
|
|
||||||
if packageName == "syscall" {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return "syscall."
|
|
||||||
}
|
|
||||||
|
|
||||||
// Param is function parameter
|
|
||||||
type Param struct {
|
|
||||||
Name string
|
|
||||||
Type string
|
|
||||||
fn *Fn
|
|
||||||
tmpVarIdx int
|
|
||||||
}
|
|
||||||
|
|
||||||
// tmpVar returns temp variable name that will be used to represent p during syscall.
|
|
||||||
func (p *Param) tmpVar() string {
|
|
||||||
if p.tmpVarIdx < 0 {
|
|
||||||
p.tmpVarIdx = p.fn.curTmpVarIdx
|
|
||||||
p.fn.curTmpVarIdx++
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("_p%d", p.tmpVarIdx)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BoolTmpVarCode returns source code for bool temp variable.
|
|
||||||
func (p *Param) BoolTmpVarCode() string {
|
|
||||||
const code = `var %s uint32
|
|
||||||
if %s {
|
|
||||||
%s = 1
|
|
||||||
} else {
|
|
||||||
%s = 0
|
|
||||||
}`
|
|
||||||
tmp := p.tmpVar()
|
|
||||||
return fmt.Sprintf(code, tmp, p.Name, tmp, tmp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SliceTmpVarCode returns source code for slice temp variable.
|
|
||||||
func (p *Param) SliceTmpVarCode() string {
|
|
||||||
const code = `var %s *%s
|
|
||||||
if len(%s) > 0 {
|
|
||||||
%s = &%s[0]
|
|
||||||
}`
|
|
||||||
tmp := p.tmpVar()
|
|
||||||
return fmt.Sprintf(code, tmp, p.Type[2:], p.Name, tmp, p.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// StringTmpVarCode returns source code for string temp variable.
|
|
||||||
func (p *Param) StringTmpVarCode() string {
|
|
||||||
errvar := p.fn.Rets.ErrorVarName()
|
|
||||||
if errvar == "" {
|
|
||||||
errvar = "_"
|
|
||||||
}
|
|
||||||
tmp := p.tmpVar()
|
|
||||||
const code = `var %s %s
|
|
||||||
%s, %s = %s(%s)`
|
|
||||||
s := fmt.Sprintf(code, tmp, p.fn.StrconvType(), tmp, errvar, p.fn.StrconvFunc(), p.Name)
|
|
||||||
if errvar == "-" {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
const morecode = `
|
|
||||||
if %s != nil {
|
|
||||||
return
|
|
||||||
}`
|
|
||||||
return s + fmt.Sprintf(morecode, errvar)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TmpVarCode returns source code for temp variable.
|
|
||||||
func (p *Param) TmpVarCode() string {
|
|
||||||
switch {
|
|
||||||
case p.Type == "bool":
|
|
||||||
return p.BoolTmpVarCode()
|
|
||||||
case strings.HasPrefix(p.Type, "[]"):
|
|
||||||
return p.SliceTmpVarCode()
|
|
||||||
default:
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TmpVarHelperCode returns source code for helper's temp variable.
|
|
||||||
func (p *Param) TmpVarHelperCode() string {
|
|
||||||
if p.Type != "string" {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return p.StringTmpVarCode()
|
|
||||||
}
|
|
||||||
|
|
||||||
// SyscallArgList returns source code fragments representing p parameter
|
|
||||||
// in syscall. Slices are translated into 2 syscall parameters: pointer to
|
|
||||||
// the first element and length.
|
|
||||||
func (p *Param) SyscallArgList() []string {
|
|
||||||
t := p.HelperType()
|
|
||||||
var s string
|
|
||||||
switch {
|
|
||||||
case t[0] == '*':
|
|
||||||
s = fmt.Sprintf("unsafe.Pointer(%s)", p.Name)
|
|
||||||
case t == "bool":
|
|
||||||
s = p.tmpVar()
|
|
||||||
case strings.HasPrefix(t, "[]"):
|
|
||||||
return []string{
|
|
||||||
fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.tmpVar()),
|
|
||||||
fmt.Sprintf("uintptr(len(%s))", p.Name),
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
s = p.Name
|
|
||||||
}
|
|
||||||
return []string{fmt.Sprintf("uintptr(%s)", s)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsError determines if p parameter is used to return error.
|
|
||||||
func (p *Param) IsError() bool {
|
|
||||||
return p.Name == "err" && p.Type == "error"
|
|
||||||
}
|
|
||||||
|
|
||||||
// HelperType returns type of parameter p used in helper function.
|
|
||||||
func (p *Param) HelperType() string {
|
|
||||||
if p.Type == "string" {
|
|
||||||
return p.fn.StrconvType()
|
|
||||||
}
|
|
||||||
return p.Type
|
|
||||||
}
|
|
||||||
|
|
||||||
// join concatenates parameters ps into a string with sep separator.
|
|
||||||
// Each parameter is converted into string by applying fn to it
|
|
||||||
// before conversion.
|
|
||||||
func join(ps []*Param, fn func(*Param) string, sep string) string {
|
|
||||||
if len(ps) == 0 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
a := make([]string, 0)
|
|
||||||
for _, p := range ps {
|
|
||||||
a = append(a, fn(p))
|
|
||||||
}
|
|
||||||
return strings.Join(a, sep)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rets describes function return parameters.
|
|
||||||
type Rets struct {
|
|
||||||
Name string
|
|
||||||
Type string
|
|
||||||
ReturnsError bool
|
|
||||||
FailCond string
|
|
||||||
}
|
|
||||||
|
|
||||||
// ErrorVarName returns error variable name for r.
|
|
||||||
func (r *Rets) ErrorVarName() string {
|
|
||||||
if r.ReturnsError {
|
|
||||||
return "err"
|
|
||||||
}
|
|
||||||
if r.Type == "error" {
|
|
||||||
return r.Name
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// ToParams converts r into slice of *Param.
|
|
||||||
func (r *Rets) ToParams() []*Param {
|
|
||||||
ps := make([]*Param, 0)
|
|
||||||
if len(r.Name) > 0 {
|
|
||||||
ps = append(ps, &Param{Name: r.Name, Type: r.Type})
|
|
||||||
}
|
|
||||||
if r.ReturnsError {
|
|
||||||
ps = append(ps, &Param{Name: "err", Type: "error"})
|
|
||||||
}
|
|
||||||
return ps
|
|
||||||
}
|
|
||||||
|
|
||||||
// List returns source code of syscall return parameters.
|
|
||||||
func (r *Rets) List() string {
|
|
||||||
s := join(r.ToParams(), func(p *Param) string { return p.Name + " " + p.Type }, ", ")
|
|
||||||
if len(s) > 0 {
|
|
||||||
s = "(" + s + ")"
|
|
||||||
}
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// PrintList returns source code of trace printing part correspondent
|
|
||||||
// to syscall return values.
|
|
||||||
func (r *Rets) PrintList() string {
|
|
||||||
return join(r.ToParams(), func(p *Param) string { return fmt.Sprintf(`"%s=", %s, `, p.Name, p.Name) }, `", ", `)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetReturnValuesCode returns source code that accepts syscall return values.
|
|
||||||
func (r *Rets) SetReturnValuesCode() string {
|
|
||||||
if r.Name == "" && !r.ReturnsError {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
retvar := "r0"
|
|
||||||
if r.Name == "" {
|
|
||||||
retvar = "r1"
|
|
||||||
}
|
|
||||||
errvar := "_"
|
|
||||||
if r.ReturnsError {
|
|
||||||
errvar = "e1"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%s, _, %s := ", retvar, errvar)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Rets) useLongHandleErrorCode(retvar string) string {
|
|
||||||
const code = `if %s {
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
} else {
|
|
||||||
err = %sEINVAL
|
|
||||||
}
|
|
||||||
}`
|
|
||||||
cond := retvar + " == 0"
|
|
||||||
if r.FailCond != "" {
|
|
||||||
cond = strings.Replace(r.FailCond, "failretval", retvar, 1)
|
|
||||||
}
|
|
||||||
return fmt.Sprintf(code, cond, syscalldot())
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetErrorCode returns source code that sets return parameters.
|
|
||||||
func (r *Rets) SetErrorCode() string {
|
|
||||||
const code = `if r0 != 0 {
|
|
||||||
%s = %sErrno(r0)
|
|
||||||
}`
|
|
||||||
const hrCode = `if int32(r0) < 0 {
|
|
||||||
if r0&0x1fff0000 == 0x00070000 {
|
|
||||||
r0 &= 0xffff
|
|
||||||
}
|
|
||||||
%s = %sErrno(r0)
|
|
||||||
}`
|
|
||||||
if r.Name == "" && !r.ReturnsError {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
if r.Name == "" {
|
|
||||||
return r.useLongHandleErrorCode("r1")
|
|
||||||
}
|
|
||||||
if r.Type == "error" {
|
|
||||||
if r.Name == "hr" {
|
|
||||||
return fmt.Sprintf(hrCode, r.Name, syscalldot())
|
|
||||||
} else {
|
|
||||||
return fmt.Sprintf(code, r.Name, syscalldot())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s := ""
|
|
||||||
switch {
|
|
||||||
case r.Type[0] == '*':
|
|
||||||
s = fmt.Sprintf("%s = (%s)(unsafe.Pointer(r0))", r.Name, r.Type)
|
|
||||||
case r.Type == "bool":
|
|
||||||
s = fmt.Sprintf("%s = r0 != 0", r.Name)
|
|
||||||
default:
|
|
||||||
s = fmt.Sprintf("%s = %s(r0)", r.Name, r.Type)
|
|
||||||
}
|
|
||||||
if !r.ReturnsError {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
return s + "\n\t" + r.useLongHandleErrorCode(r.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fn describes syscall function.
|
|
||||||
type Fn struct {
|
|
||||||
Name string
|
|
||||||
Params []*Param
|
|
||||||
Rets *Rets
|
|
||||||
PrintTrace bool
|
|
||||||
confirmproc bool
|
|
||||||
dllname string
|
|
||||||
dllfuncname string
|
|
||||||
src string
|
|
||||||
// TODO: get rid of this field and just use parameter index instead
|
|
||||||
curTmpVarIdx int // insure tmp variables have uniq names
|
|
||||||
}
|
|
||||||
|
|
||||||
// extractParams parses s to extract function parameters.
|
|
||||||
func extractParams(s string, f *Fn) ([]*Param, error) {
|
|
||||||
s = trim(s)
|
|
||||||
if s == "" {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
a := strings.Split(s, ",")
|
|
||||||
ps := make([]*Param, len(a))
|
|
||||||
for i := range ps {
|
|
||||||
s2 := trim(a[i])
|
|
||||||
b := strings.Split(s2, " ")
|
|
||||||
if len(b) != 2 {
|
|
||||||
b = strings.Split(s2, "\t")
|
|
||||||
if len(b) != 2 {
|
|
||||||
return nil, errors.New("Could not extract function parameter from \"" + s2 + "\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ps[i] = &Param{
|
|
||||||
Name: trim(b[0]),
|
|
||||||
Type: trim(b[1]),
|
|
||||||
fn: f,
|
|
||||||
tmpVarIdx: -1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ps, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// extractSection extracts text out of string s starting after start
|
|
||||||
// and ending just before end. found return value will indicate success,
|
|
||||||
// and prefix, body and suffix will contain correspondent parts of string s.
|
|
||||||
func extractSection(s string, start, end rune) (prefix, body, suffix string, found bool) {
|
|
||||||
s = trim(s)
|
|
||||||
if strings.HasPrefix(s, string(start)) {
|
|
||||||
// no prefix
|
|
||||||
body = s[1:]
|
|
||||||
} else {
|
|
||||||
a := strings.SplitN(s, string(start), 2)
|
|
||||||
if len(a) != 2 {
|
|
||||||
return "", "", s, false
|
|
||||||
}
|
|
||||||
prefix = a[0]
|
|
||||||
body = a[1]
|
|
||||||
}
|
|
||||||
a := strings.SplitN(body, string(end), 2)
|
|
||||||
if len(a) != 2 {
|
|
||||||
return "", "", "", false
|
|
||||||
}
|
|
||||||
return prefix, a[0], a[1], true
|
|
||||||
}
|
|
||||||
|
|
||||||
// newFn parses string s and return created function Fn.
|
|
||||||
func newFn(s string) (*Fn, error) {
|
|
||||||
s = trim(s)
|
|
||||||
f := &Fn{
|
|
||||||
Rets: &Rets{},
|
|
||||||
src: s,
|
|
||||||
PrintTrace: *printTraceFlag,
|
|
||||||
}
|
|
||||||
// function name and args
|
|
||||||
prefix, body, s, found := extractSection(s, '(', ')')
|
|
||||||
if !found || prefix == "" {
|
|
||||||
return nil, errors.New("Could not extract function name and parameters from \"" + f.src + "\"")
|
|
||||||
}
|
|
||||||
f.Name = prefix
|
|
||||||
var err error
|
|
||||||
f.Params, err = extractParams(body, f)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
// return values
|
|
||||||
_, body, s, found = extractSection(s, '(', ')')
|
|
||||||
if found {
|
|
||||||
r, err := extractParams(body, f)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
switch len(r) {
|
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
if r[0].IsError() {
|
|
||||||
f.Rets.ReturnsError = true
|
|
||||||
} else {
|
|
||||||
f.Rets.Name = r[0].Name
|
|
||||||
f.Rets.Type = r[0].Type
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if !r[1].IsError() {
|
|
||||||
return nil, errors.New("Only last windows error is allowed as second return value in \"" + f.src + "\"")
|
|
||||||
}
|
|
||||||
f.Rets.ReturnsError = true
|
|
||||||
f.Rets.Name = r[0].Name
|
|
||||||
f.Rets.Type = r[0].Type
|
|
||||||
default:
|
|
||||||
return nil, errors.New("Too many return values in \"" + f.src + "\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fail condition
|
|
||||||
_, body, s, found = extractSection(s, '[', ']')
|
|
||||||
if found {
|
|
||||||
f.Rets.FailCond = body
|
|
||||||
}
|
|
||||||
// dll and dll function names
|
|
||||||
s = trim(s)
|
|
||||||
if s == "" {
|
|
||||||
return f, nil
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(s, "=") {
|
|
||||||
return nil, errors.New("Could not extract dll name from \"" + f.src + "\"")
|
|
||||||
}
|
|
||||||
s = trim(s[1:])
|
|
||||||
a := strings.Split(s, ".")
|
|
||||||
switch len(a) {
|
|
||||||
case 1:
|
|
||||||
f.dllfuncname = a[0]
|
|
||||||
case 2:
|
|
||||||
f.dllname = a[0]
|
|
||||||
f.dllfuncname = a[1]
|
|
||||||
default:
|
|
||||||
return nil, errors.New("Could not extract dll name from \"" + f.src + "\"")
|
|
||||||
}
|
|
||||||
if f.dllfuncname[len(f.dllfuncname)-1] == '?' {
|
|
||||||
f.confirmproc = true
|
|
||||||
f.dllfuncname = f.dllfuncname[0 : len(f.dllfuncname)-1]
|
|
||||||
}
|
|
||||||
return f, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DLLName returns DLL name for function f.
|
|
||||||
func (f *Fn) DLLName() string {
|
|
||||||
if f.dllname == "" {
|
|
||||||
return "kernel32"
|
|
||||||
}
|
|
||||||
return f.dllname
|
|
||||||
}
|
|
||||||
|
|
||||||
// DLLName returns DLL function name for function f.
|
|
||||||
func (f *Fn) DLLFuncName() string {
|
|
||||||
if f.dllfuncname == "" {
|
|
||||||
return f.Name
|
|
||||||
}
|
|
||||||
return f.dllfuncname
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *Fn) ConfirmProc() bool {
|
|
||||||
return f.confirmproc
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParamList returns source code for function f parameters.
|
|
||||||
func (f *Fn) ParamList() string {
|
|
||||||
return join(f.Params, func(p *Param) string { return p.Name + " " + p.Type }, ", ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// HelperParamList returns source code for helper function f parameters.
|
|
||||||
func (f *Fn) HelperParamList() string {
|
|
||||||
return join(f.Params, func(p *Param) string { return p.Name + " " + p.HelperType() }, ", ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParamPrintList returns source code of trace printing part correspondent
|
|
||||||
// to syscall input parameters.
|
|
||||||
func (f *Fn) ParamPrintList() string {
|
|
||||||
return join(f.Params, func(p *Param) string { return fmt.Sprintf(`"%s=", %s, `, p.Name, p.Name) }, `", ", `)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParamCount return number of syscall parameters for function f.
|
|
||||||
func (f *Fn) ParamCount() int {
|
|
||||||
n := 0
|
|
||||||
for _, p := range f.Params {
|
|
||||||
n += len(p.SyscallArgList())
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
// SyscallParamCount determines which version of Syscall/Syscall6/Syscall9/...
|
|
||||||
// to use. It returns parameter count for correspondent SyscallX function.
|
|
||||||
func (f *Fn) SyscallParamCount() int {
|
|
||||||
n := f.ParamCount()
|
|
||||||
switch {
|
|
||||||
case n <= 3:
|
|
||||||
return 3
|
|
||||||
case n <= 6:
|
|
||||||
return 6
|
|
||||||
case n <= 9:
|
|
||||||
return 9
|
|
||||||
case n <= 12:
|
|
||||||
return 12
|
|
||||||
case n <= 15:
|
|
||||||
return 15
|
|
||||||
default:
|
|
||||||
panic("too many arguments to system call")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Syscall determines which SyscallX function to use for function f.
|
|
||||||
func (f *Fn) Syscall() string {
|
|
||||||
c := f.SyscallParamCount()
|
|
||||||
if c == 3 {
|
|
||||||
return syscalldot() + "Syscall"
|
|
||||||
}
|
|
||||||
return syscalldot() + "Syscall" + strconv.Itoa(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SyscallParamList returns source code for SyscallX parameters for function f.
|
|
||||||
func (f *Fn) SyscallParamList() string {
|
|
||||||
a := make([]string, 0)
|
|
||||||
for _, p := range f.Params {
|
|
||||||
a = append(a, p.SyscallArgList()...)
|
|
||||||
}
|
|
||||||
for len(a) < f.SyscallParamCount() {
|
|
||||||
a = append(a, "0")
|
|
||||||
}
|
|
||||||
return strings.Join(a, ", ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// HelperCallParamList returns source code of call into function f helper.
|
|
||||||
func (f *Fn) HelperCallParamList() string {
|
|
||||||
a := make([]string, 0, len(f.Params))
|
|
||||||
for _, p := range f.Params {
|
|
||||||
s := p.Name
|
|
||||||
if p.Type == "string" {
|
|
||||||
s = p.tmpVar()
|
|
||||||
}
|
|
||||||
a = append(a, s)
|
|
||||||
}
|
|
||||||
return strings.Join(a, ", ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsUTF16 is true, if f is W (utf16) function. It is false
|
|
||||||
// for all A (ascii) functions.
|
|
||||||
func (_ *Fn) IsUTF16() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// StrconvFunc returns name of Go string to OS string function for f.
|
|
||||||
func (f *Fn) StrconvFunc() string {
|
|
||||||
if f.IsUTF16() {
|
|
||||||
return syscalldot() + "UTF16PtrFromString"
|
|
||||||
}
|
|
||||||
return syscalldot() + "BytePtrFromString"
|
|
||||||
}
|
|
||||||
|
|
||||||
// StrconvType returns Go type name used for OS string for f.
|
|
||||||
func (f *Fn) StrconvType() string {
|
|
||||||
if f.IsUTF16() {
|
|
||||||
return "*uint16"
|
|
||||||
}
|
|
||||||
return "*byte"
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasStringParam is true, if f has at least one string parameter.
|
|
||||||
// Otherwise it is false.
|
|
||||||
func (f *Fn) HasStringParam() bool {
|
|
||||||
for _, p := range f.Params {
|
|
||||||
if p.Type == "string" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
var uniqDllFuncName = make(map[string]bool)
|
|
||||||
|
|
||||||
// IsNotDuplicate is true if f is not a duplicated function
|
|
||||||
func (f *Fn) IsNotDuplicate() bool {
|
|
||||||
funcName := f.DLLFuncName()
|
|
||||||
if uniqDllFuncName[funcName] == false {
|
|
||||||
uniqDllFuncName[funcName] = true
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// HelperName returns name of function f helper.
|
|
||||||
func (f *Fn) HelperName() string {
|
|
||||||
if !f.HasStringParam() {
|
|
||||||
return f.Name
|
|
||||||
}
|
|
||||||
return "_" + f.Name
|
|
||||||
}
|
|
||||||
|
|
||||||
// Source files and functions.
|
|
||||||
type Source struct {
|
|
||||||
Funcs []*Fn
|
|
||||||
Files []string
|
|
||||||
StdLibImports []string
|
|
||||||
ExternalImports []string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (src *Source) Import(pkg string) {
|
|
||||||
src.StdLibImports = append(src.StdLibImports, pkg)
|
|
||||||
sort.Strings(src.StdLibImports)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (src *Source) ExternalImport(pkg string) {
|
|
||||||
src.ExternalImports = append(src.ExternalImports, pkg)
|
|
||||||
sort.Strings(src.ExternalImports)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseFiles parses files listed in fs and extracts all syscall
|
|
||||||
// functions listed in sys comments. It returns source files
|
|
||||||
// and functions collection *Source if successful.
|
|
||||||
func ParseFiles(fs []string) (*Source, error) {
|
|
||||||
src := &Source{
|
|
||||||
Funcs: make([]*Fn, 0),
|
|
||||||
Files: make([]string, 0),
|
|
||||||
StdLibImports: []string{
|
|
||||||
"unsafe",
|
|
||||||
},
|
|
||||||
ExternalImports: make([]string, 0),
|
|
||||||
}
|
|
||||||
for _, file := range fs {
|
|
||||||
if err := src.ParseFile(file); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return src, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DLLs return dll names for a source set src.
|
|
||||||
func (src *Source) DLLs() []string {
|
|
||||||
uniq := make(map[string]bool)
|
|
||||||
r := make([]string, 0)
|
|
||||||
for _, f := range src.Funcs {
|
|
||||||
name := f.DLLName()
|
|
||||||
if _, found := uniq[name]; !found {
|
|
||||||
uniq[name] = true
|
|
||||||
r = append(r, name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseFile adds additional file path to a source set src.
|
|
||||||
func (src *Source) ParseFile(path string) error {
|
|
||||||
file, err := os.Open(path)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
s := bufio.NewScanner(file)
|
|
||||||
for s.Scan() {
|
|
||||||
t := trim(s.Text())
|
|
||||||
if len(t) < 7 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(t, "//sys") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
t = t[5:]
|
|
||||||
if !(t[0] == ' ' || t[0] == '\t') {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
f, err := newFn(t[1:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
src.Funcs = append(src.Funcs, f)
|
|
||||||
}
|
|
||||||
if err := s.Err(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
src.Files = append(src.Files, path)
|
|
||||||
|
|
||||||
// get package name
|
|
||||||
fset := token.NewFileSet()
|
|
||||||
_, err = file.Seek(0, 0)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
pkg, err := parser.ParseFile(fset, "", file, parser.PackageClauseOnly)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
packageName = pkg.Name.Name
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsStdRepo returns true if src is part of standard library.
|
|
||||||
func (src *Source) IsStdRepo() (bool, error) {
|
|
||||||
if len(src.Files) == 0 {
|
|
||||||
return false, errors.New("no input files provided")
|
|
||||||
}
|
|
||||||
abspath, err := filepath.Abs(src.Files[0])
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
goroot := runtime.GOROOT()
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
abspath = strings.ToLower(abspath)
|
|
||||||
goroot = strings.ToLower(goroot)
|
|
||||||
}
|
|
||||||
sep := string(os.PathSeparator)
|
|
||||||
if !strings.HasSuffix(goroot, sep) {
|
|
||||||
goroot += sep
|
|
||||||
}
|
|
||||||
return strings.HasPrefix(abspath, goroot), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate output source file from a source set src.
|
|
||||||
func (src *Source) Generate(w io.Writer) error {
|
|
||||||
const (
|
|
||||||
pkgStd = iota // any package in std library
|
|
||||||
pkgXSysWindows // x/sys/windows package
|
|
||||||
pkgOther
|
|
||||||
)
|
|
||||||
isStdRepo, err := src.IsStdRepo()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var pkgtype int
|
|
||||||
switch {
|
|
||||||
case isStdRepo:
|
|
||||||
pkgtype = pkgStd
|
|
||||||
case packageName == "windows":
|
|
||||||
// TODO: this needs better logic than just using package name
|
|
||||||
pkgtype = pkgXSysWindows
|
|
||||||
default:
|
|
||||||
pkgtype = pkgOther
|
|
||||||
}
|
|
||||||
if *systemDLL {
|
|
||||||
switch pkgtype {
|
|
||||||
case pkgStd:
|
|
||||||
src.Import("internal/syscall/windows/sysdll")
|
|
||||||
case pkgXSysWindows:
|
|
||||||
default:
|
|
||||||
src.ExternalImport("golang.org/x/sys/windows")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if *winio {
|
|
||||||
src.ExternalImport("github.com/Microsoft/go-winio")
|
|
||||||
}
|
|
||||||
if packageName != "syscall" {
|
|
||||||
src.Import("syscall")
|
|
||||||
}
|
|
||||||
funcMap := template.FuncMap{
|
|
||||||
"packagename": packagename,
|
|
||||||
"syscalldot": syscalldot,
|
|
||||||
"newlazydll": func(dll string) string {
|
|
||||||
arg := "\"" + dll + ".dll\""
|
|
||||||
if !*systemDLL {
|
|
||||||
return syscalldot() + "NewLazyDLL(" + arg + ")"
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(dll, "api_") || strings.HasPrefix(dll, "ext_") {
|
|
||||||
arg = strings.Replace(arg, "_", "-", -1)
|
|
||||||
}
|
|
||||||
switch pkgtype {
|
|
||||||
case pkgStd:
|
|
||||||
return syscalldot() + "NewLazyDLL(sysdll.Add(" + arg + "))"
|
|
||||||
case pkgXSysWindows:
|
|
||||||
return "NewLazySystemDLL(" + arg + ")"
|
|
||||||
default:
|
|
||||||
return "windows.NewLazySystemDLL(" + arg + ")"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
t := template.Must(template.New("main").Funcs(funcMap).Parse(srcTemplate))
|
|
||||||
err = t.Execute(w, src)
|
|
||||||
if err != nil {
|
|
||||||
return errors.New("Failed to execute template: " + err.Error())
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func usage() {
|
|
||||||
fmt.Fprintf(os.Stderr, "usage: mksyscall_windows [flags] [path ...]\n")
|
|
||||||
flag.PrintDefaults()
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
flag.Usage = usage
|
|
||||||
flag.Parse()
|
|
||||||
if len(flag.Args()) <= 0 {
|
|
||||||
fmt.Fprintf(os.Stderr, "no files to parse provided\n")
|
|
||||||
usage()
|
|
||||||
}
|
|
||||||
|
|
||||||
src, err := ParseFiles(flag.Args())
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
var buf bytes.Buffer
|
|
||||||
if err := src.Generate(&buf); err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := format.Source(buf.Bytes())
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
if *filename == "" {
|
|
||||||
_, err = os.Stdout.Write(data)
|
|
||||||
} else {
|
|
||||||
err = ioutil.WriteFile(*filename, data, 0644)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: use println instead to print in the following template
|
|
||||||
const srcTemplate = `
|
|
||||||
|
|
||||||
{{define "main"}}// Code generated mksyscall_windows.exe DO NOT EDIT
|
|
||||||
|
|
||||||
package {{packagename}}
|
|
||||||
|
|
||||||
import (
|
|
||||||
{{range .StdLibImports}}"{{.}}"
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{range .ExternalImports}}"{{.}}"
|
|
||||||
{{end}}
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ unsafe.Pointer
|
|
||||||
|
|
||||||
// Do the interface allocations only once for common
|
|
||||||
// Errno values.
|
|
||||||
const (
|
|
||||||
errnoERROR_IO_PENDING = 997
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
errERROR_IO_PENDING error = {{syscalldot}}Errno(errnoERROR_IO_PENDING)
|
|
||||||
)
|
|
||||||
|
|
||||||
// errnoErr returns common boxed Errno values, to prevent
|
|
||||||
// allocations at runtime.
|
|
||||||
func errnoErr(e {{syscalldot}}Errno) error {
|
|
||||||
switch e {
|
|
||||||
case 0:
|
|
||||||
return nil
|
|
||||||
case errnoERROR_IO_PENDING:
|
|
||||||
return errERROR_IO_PENDING
|
|
||||||
}
|
|
||||||
// TODO: add more here, after collecting data on the common
|
|
||||||
// error values see on Windows. (perhaps when running
|
|
||||||
// all.bat?)
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
{{template "dlls" .}}
|
|
||||||
{{template "funcnames" .}})
|
|
||||||
{{range .Funcs}}{{if .HasStringParam}}{{template "helperbody" .}}{{end}}{{template "funcbody" .}}{{end}}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{/* help functions */}}
|
|
||||||
|
|
||||||
{{define "dlls"}}{{range .DLLs}} mod{{.}} = {{newlazydll .}}
|
|
||||||
{{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "funcnames"}}{{range .Funcs}}{{if .IsNotDuplicate}} proc{{.DLLFuncName}} = mod{{.DLLName}}.NewProc("{{.DLLFuncName}}"){{end}}
|
|
||||||
{{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "helperbody"}}
|
|
||||||
func {{.Name}}({{.ParamList}}) {{template "results" .}}{
|
|
||||||
{{template "helpertmpvars" .}} return {{.HelperName}}({{.HelperCallParamList}})
|
|
||||||
}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "funcbody"}}
|
|
||||||
func {{.HelperName}}({{.HelperParamList}}) {{template "results" .}}{
|
|
||||||
{{template "tmpvars" .}} {{template "syscallcheck" .}}{{template "syscall" .}}
|
|
||||||
{{template "seterror" .}}{{template "printtrace" .}} return
|
|
||||||
}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "helpertmpvars"}}{{range .Params}}{{if .TmpVarHelperCode}} {{.TmpVarHelperCode}}
|
|
||||||
{{end}}{{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "tmpvars"}}{{range .Params}}{{if .TmpVarCode}} {{.TmpVarCode}}
|
|
||||||
{{end}}{{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "results"}}{{if .Rets.List}}{{.Rets.List}} {{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "syscall"}}{{.Rets.SetReturnValuesCode}}{{.Syscall}}(proc{{.DLLFuncName}}.Addr(), {{.ParamCount}}, {{.SyscallParamList}}){{end}}
|
|
||||||
|
|
||||||
{{define "syscallcheck"}}{{if .ConfirmProc}}if {{.Rets.ErrorVarName}} = proc{{.DLLFuncName}}.Find(); {{.Rets.ErrorVarName}} != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
{{end}}{{end}}
|
|
||||||
|
|
||||||
|
|
||||||
{{define "seterror"}}{{if .Rets.SetErrorCode}} {{.Rets.SetErrorCode}}
|
|
||||||
{{end}}{{end}}
|
|
||||||
|
|
||||||
{{define "printtrace"}}{{if .PrintTrace}} print("SYSCALL: {{.Name}}(", {{.ParamPrintList}}") (", {{.Rets.PrintList}}")\n")
|
|
||||||
{{end}}{{end}}
|
|
||||||
|
|
||||||
`
|
|
201
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/LICENSE
generated
vendored
201
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/LICENSE
generated
vendored
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
22
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/NOTICE
generated
vendored
22
vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/NOTICE
generated
vendored
@ -1,22 +0,0 @@
|
|||||||
go-runhcs is a fork of go-runc
|
|
||||||
|
|
||||||
The following is runc's legal notice.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
runc
|
|
||||||
|
|
||||||
Copyright 2012-2015 Docker, Inc.
|
|
||||||
|
|
||||||
This product includes software developed at Docker, Inc. (http://www.docker.com).
|
|
||||||
|
|
||||||
The following is courtesy of our legal counsel:
|
|
||||||
|
|
||||||
Use and transfer of Docker may be subject to certain restrictions by the
|
|
||||||
United States and other governments.
|
|
||||||
It is your responsibility to ensure that your use and/or transfer does not
|
|
||||||
violate applicable laws.
|
|
||||||
|
|
||||||
For more information, please see http://www.bis.doc.gov
|
|
||||||
|
|
||||||
See also http://www.apache.org/dev/crypto.html and/or seek legal counsel.
|
|
0
vendor/github.com/containerd/containerd/runtime/linux/runctypes/1.0.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/containerd/runtime/linux/runctypes/1.0.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/containerd/runtime/linux/runctypes/next.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/containerd/runtime/linux/runctypes/next.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/containerd/runtime/v2/runc/options/next.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/containerd/runtime/v2/runc/options/next.pb.txt
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/continuity/sysx/generate.sh
generated
vendored
Executable file → Normal file
0
vendor/github.com/containerd/continuity/sysx/generate.sh
generated
vendored
Executable file → Normal file
15
vendor/github.com/docker/cli/scripts/docs/generate-authors.sh
generated
vendored
15
vendor/github.com/docker/cli/scripts/docs/generate-authors.sh
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd "$(dirname "$(readlink -f "${BASH_SOURCE[*]}")")/../.."
|
|
||||||
|
|
||||||
# see also ".mailmap" for how email addresses and names are deduplicated
|
|
||||||
|
|
||||||
{
|
|
||||||
cat <<-'EOH'
|
|
||||||
# This file lists all individuals having contributed content to the repository.
|
|
||||||
# For how it is generated, see `scripts/docs/generate-authors.sh`.
|
|
||||||
EOH
|
|
||||||
echo
|
|
||||||
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
|
|
||||||
} > AUTHORS
|
|
22
vendor/github.com/docker/docker/contrib/syntax/vim/LICENSE
generated
vendored
22
vendor/github.com/docker/docker/contrib/syntax/vim/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
|||||||
Copyright (c) 2013 Honza Pokorny
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
BIN
vendor/github.com/docker/docker/docs/static_files/contributors.png
generated
vendored
BIN
vendor/github.com/docker/docker/docs/static_files/contributors.png
generated
vendored
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
15
vendor/github.com/docker/docker/hack/generate-authors.sh
generated
vendored
15
vendor/github.com/docker/docker/hack/generate-authors.sh
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."
|
|
||||||
|
|
||||||
# see also ".mailmap" for how email addresses and names are deduplicated
|
|
||||||
|
|
||||||
{
|
|
||||||
cat <<-'EOH'
|
|
||||||
# This file lists all individuals having contributed content to the repository.
|
|
||||||
# For how it is generated, see `hack/generate-authors.sh`.
|
|
||||||
EOH
|
|
||||||
echo
|
|
||||||
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
|
|
||||||
} > AUTHORS
|
|
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/ca.pem
generated
vendored
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/ca.pem
generated
vendored
@ -1 +0,0 @@
|
|||||||
../../../integration/testdata/https/ca.pem
|
|
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/client-cert.pem
generated
vendored
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/client-cert.pem
generated
vendored
@ -1 +0,0 @@
|
|||||||
../../../integration/testdata/https/client-cert.pem
|
|
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/client-key.pem
generated
vendored
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/client-key.pem
generated
vendored
@ -1 +0,0 @@
|
|||||||
../../../integration/testdata/https/client-key.pem
|
|
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/server-cert.pem
generated
vendored
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/server-cert.pem
generated
vendored
@ -1 +0,0 @@
|
|||||||
../../../integration/testdata/https/server-cert.pem
|
|
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/server-key.pem
generated
vendored
1
vendor/github.com/docker/docker/integration-cli/fixtures/https/server-key.pem
generated
vendored
@ -1 +0,0 @@
|
|||||||
../../../integration/testdata/https/server-key.pem
|
|
191
vendor/github.com/docker/docker/pkg/symlink/LICENSE.APACHE
generated
vendored
191
vendor/github.com/docker/docker/pkg/symlink/LICENSE.APACHE
generated
vendored
@ -1,191 +0,0 @@
|
|||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
Copyright 2014-2018 Docker, Inc.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
27
vendor/github.com/docker/docker/pkg/symlink/LICENSE.BSD
generated
vendored
27
vendor/github.com/docker/docker/pkg/symlink/LICENSE.BSD
generated
vendored
@ -1,27 +0,0 @@
|
|||||||
Copyright (c) 2014-2018 The Docker & Go Authors. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
5
vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS
generated
vendored
5
vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
The contributors to the Go protobuf repository:
|
|
||||||
|
|
||||||
# This source code was written by the Go contributors.
|
|
||||||
# The master list of contributors is in the main Go distribution,
|
|
||||||
# visible at http://tip.golang.org/CONTRIBUTORS.
|
|
2
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
2
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
@ -189,6 +189,8 @@ type Marshaler interface {
|
|||||||
// prefixed by a varint-encoded length.
|
// prefixed by a varint-encoded length.
|
||||||
func (p *Buffer) EncodeMessage(pb Message) error {
|
func (p *Buffer) EncodeMessage(pb Message) error {
|
||||||
siz := Size(pb)
|
siz := Size(pb)
|
||||||
|
sizVar := SizeVarint(uint64(siz))
|
||||||
|
p.grow(siz + sizVar)
|
||||||
p.EncodeVarint(uint64(siz))
|
p.EncodeVarint(uint64(siz))
|
||||||
return p.Marshal(pb)
|
return p.Marshal(pb)
|
||||||
}
|
}
|
||||||
|
1
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
1
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
@ -527,6 +527,7 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
|
|||||||
// SetExtension sets the specified extension of pb to the specified value.
|
// SetExtension sets the specified extension of pb to the specified value.
|
||||||
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
|
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
|
||||||
if epb, ok := pb.(extensionsBytes); ok {
|
if epb, ok := pb.(extensionsBytes); ok {
|
||||||
|
ClearExtension(pb, extension)
|
||||||
newb, err := encodeExtension(extension, value)
|
newb, err := encodeExtension(extension, value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
21
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
21
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
@ -154,6 +154,10 @@ func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error)
|
|||||||
return EncodeExtensionMap(m.extensionsWrite(), data)
|
return EncodeExtensionMap(m.extensionsWrite(), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func EncodeInternalExtensionBackwards(m extendableProto, data []byte) (n int, err error) {
|
||||||
|
return EncodeExtensionMapBackwards(m.extensionsWrite(), data)
|
||||||
|
}
|
||||||
|
|
||||||
func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
||||||
o := 0
|
o := 0
|
||||||
for _, e := range m {
|
for _, e := range m {
|
||||||
@ -169,6 +173,23 @@ func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
|||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func EncodeExtensionMapBackwards(m map[int32]Extension, data []byte) (n int, err error) {
|
||||||
|
o := 0
|
||||||
|
end := len(data)
|
||||||
|
for _, e := range m {
|
||||||
|
if err := e.Encode(); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
n := copy(data[end-len(e.enc):], e.enc)
|
||||||
|
if n != len(e.enc) {
|
||||||
|
return 0, io.ErrShortBuffer
|
||||||
|
}
|
||||||
|
end -= n
|
||||||
|
o += n
|
||||||
|
}
|
||||||
|
return o, nil
|
||||||
|
}
|
||||||
|
|
||||||
func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
|
func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
|
||||||
e := m[id]
|
e := m[id]
|
||||||
if err := e.Encode(); err != nil {
|
if err := e.Encode(); err != nil {
|
||||||
|
18
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
18
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
@ -948,13 +948,19 @@ func isProto3Zero(v reflect.Value) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
const (
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
// ProtoPackageIsVersion3 is referenced from generated protocol buffer files
|
||||||
const GoGoProtoPackageIsVersion2 = true
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
|
GoGoProtoPackageIsVersion3 = true
|
||||||
|
|
||||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
const GoGoProtoPackageIsVersion1 = true
|
GoGoProtoPackageIsVersion2 = true
|
||||||
|
|
||||||
|
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
||||||
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
|
GoGoProtoPackageIsVersion1 = true
|
||||||
|
)
|
||||||
|
|
||||||
// InternalMessageInfo is a type used internally by generated .pb.go files.
|
// InternalMessageInfo is a type used internally by generated .pb.go files.
|
||||||
// This type is not intended to be used by non-generated code.
|
// This type is not intended to be used by non-generated code.
|
||||||
|
71
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
71
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
@ -43,7 +43,6 @@ package proto
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -205,7 +204,7 @@ func (p *Properties) Parse(s string) {
|
|||||||
// "bytes,49,opt,name=foo,def=hello!"
|
// "bytes,49,opt,name=foo,def=hello!"
|
||||||
fields := strings.Split(s, ",") // breaks def=, but handled below.
|
fields := strings.Split(s, ",") // breaks def=, but handled below.
|
||||||
if len(fields) < 2 {
|
if len(fields) < 2 {
|
||||||
fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s)
|
log.Printf("proto: tag has too few fields: %q", s)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +224,7 @@ func (p *Properties) Parse(s string) {
|
|||||||
p.WireType = WireBytes
|
p.WireType = WireBytes
|
||||||
// no numeric converter for non-numeric types
|
// no numeric converter for non-numeric types
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s)
|
log.Printf("proto: tag has unknown wire type: %q", s)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,6 +399,15 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
return sprop
|
return sprop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type (
|
||||||
|
oneofFuncsIface interface {
|
||||||
|
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||||
|
}
|
||||||
|
oneofWrappersIface interface {
|
||||||
|
XXX_OneofWrappers() []interface{}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// getPropertiesLocked requires that propertiesMu is held.
|
// getPropertiesLocked requires that propertiesMu is held.
|
||||||
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||||
if prop, ok := propertiesMap[t]; ok {
|
if prop, ok := propertiesMap[t]; ok {
|
||||||
@ -441,37 +449,40 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
// Re-order prop.order.
|
// Re-order prop.order.
|
||||||
sort.Sort(prop)
|
sort.Sort(prop)
|
||||||
|
|
||||||
type oneofMessage interface {
|
if isOneofMessage {
|
||||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
|
||||||
}
|
|
||||||
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok {
|
|
||||||
var oots []interface{}
|
var oots []interface{}
|
||||||
_, _, _, oots = om.XXX_OneofFuncs()
|
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||||
|
case oneofFuncsIface:
|
||||||
// Interpret oneof metadata.
|
_, _, _, oots = m.XXX_OneofFuncs()
|
||||||
prop.OneofTypes = make(map[string]*OneofProperties)
|
case oneofWrappersIface:
|
||||||
for _, oot := range oots {
|
oots = m.XXX_OneofWrappers()
|
||||||
oop := &OneofProperties{
|
}
|
||||||
Type: reflect.ValueOf(oot).Type(), // *T
|
if len(oots) > 0 {
|
||||||
Prop: new(Properties),
|
// Interpret oneof metadata.
|
||||||
}
|
prop.OneofTypes = make(map[string]*OneofProperties)
|
||||||
sft := oop.Type.Elem().Field(0)
|
for _, oot := range oots {
|
||||||
oop.Prop.Name = sft.Name
|
oop := &OneofProperties{
|
||||||
oop.Prop.Parse(sft.Tag.Get("protobuf"))
|
Type: reflect.ValueOf(oot).Type(), // *T
|
||||||
// There will be exactly one interface field that
|
Prop: new(Properties),
|
||||||
// this new value is assignable to.
|
|
||||||
for i := 0; i < t.NumField(); i++ {
|
|
||||||
f := t.Field(i)
|
|
||||||
if f.Type.Kind() != reflect.Interface {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if !oop.Type.AssignableTo(f.Type) {
|
sft := oop.Type.Elem().Field(0)
|
||||||
continue
|
oop.Prop.Name = sft.Name
|
||||||
|
oop.Prop.Parse(sft.Tag.Get("protobuf"))
|
||||||
|
// There will be exactly one interface field that
|
||||||
|
// this new value is assignable to.
|
||||||
|
for i := 0; i < t.NumField(); i++ {
|
||||||
|
f := t.Field(i)
|
||||||
|
if f.Type.Kind() != reflect.Interface {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if !oop.Type.AssignableTo(f.Type) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
oop.Field = i
|
||||||
|
break
|
||||||
}
|
}
|
||||||
oop.Field = i
|
prop.OneofTypes[oop.Prop.OrigName] = oop
|
||||||
break
|
|
||||||
}
|
}
|
||||||
prop.OneofTypes[oop.Prop.OrigName] = oop
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
17
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
@ -389,8 +389,13 @@ func (u *marshalInfo) computeMarshalInfo() {
|
|||||||
// get oneof implementers
|
// get oneof implementers
|
||||||
var oneofImplementers []interface{}
|
var oneofImplementers []interface{}
|
||||||
// gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler
|
// gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler
|
||||||
if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok && isOneofMessage {
|
if isOneofMessage {
|
||||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||||
|
case oneofFuncsIface:
|
||||||
|
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||||
|
case oneofWrappersIface:
|
||||||
|
oneofImplementers = m.XXX_OneofWrappers()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// normal fields
|
// normal fields
|
||||||
@ -519,10 +524,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type oneofMessage interface {
|
|
||||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
|
||||||
}
|
|
||||||
|
|
||||||
// wiretype returns the wire encoding of the type.
|
// wiretype returns the wire encoding of the type.
|
||||||
func wiretype(encoding string) uint64 {
|
func wiretype(encoding string) uint64 {
|
||||||
switch encoding {
|
switch encoding {
|
||||||
@ -2968,7 +2969,9 @@ func (p *Buffer) Marshal(pb Message) error {
|
|||||||
if m, ok := pb.(newMarshaler); ok {
|
if m, ok := pb.(newMarshaler); ok {
|
||||||
siz := m.XXX_Size()
|
siz := m.XXX_Size()
|
||||||
p.grow(siz) // make sure buf has enough capacity
|
p.grow(siz) // make sure buf has enough capacity
|
||||||
p.buf, err = m.XXX_Marshal(p.buf, p.deterministic)
|
pp := p.buf[len(p.buf) : len(p.buf) : len(p.buf)+siz]
|
||||||
|
pp, err = m.XXX_Marshal(pp, p.deterministic)
|
||||||
|
p.buf = append(p.buf, pp...)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if m, ok := pb.(Marshaler); ok {
|
if m, ok := pb.(Marshaler); ok {
|
||||||
|
19
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
19
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
@ -530,6 +530,25 @@ func (mi *mergeInfo) computeMergeInfo() {
|
|||||||
}
|
}
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
switch {
|
switch {
|
||||||
|
case isSlice && !isPointer: // E.g. []pb.T
|
||||||
|
mergeInfo := getMergeInfo(tf)
|
||||||
|
zero := reflect.Zero(tf)
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
// TODO: Make this faster?
|
||||||
|
dstsp := dst.asPointerTo(f.Type)
|
||||||
|
dsts := dstsp.Elem()
|
||||||
|
srcs := src.asPointerTo(f.Type).Elem()
|
||||||
|
for i := 0; i < srcs.Len(); i++ {
|
||||||
|
dsts = reflect.Append(dsts, zero)
|
||||||
|
srcElement := srcs.Index(i).Addr()
|
||||||
|
dstElement := dsts.Index(dsts.Len() - 1).Addr()
|
||||||
|
mergeInfo.merge(valToPointer(dstElement), valToPointer(srcElement))
|
||||||
|
}
|
||||||
|
if dsts.IsNil() {
|
||||||
|
dsts = reflect.MakeSlice(f.Type, 0, 0)
|
||||||
|
}
|
||||||
|
dstsp.Elem().Set(dsts)
|
||||||
|
}
|
||||||
case !isPointer:
|
case !isPointer:
|
||||||
mergeInfo := getMergeInfo(tf)
|
mergeInfo := getMergeInfo(tf)
|
||||||
mfi.merge = func(dst, src pointer) {
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
22
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
22
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
@ -371,15 +371,18 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find any types associated with oneof fields.
|
// Find any types associated with oneof fields.
|
||||||
// TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it?
|
|
||||||
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs")
|
|
||||||
// gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler
|
// gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler
|
||||||
if fn.IsValid() && len(oneofFields) > 0 {
|
if len(oneofFields) > 0 {
|
||||||
res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{}
|
var oneofImplementers []interface{}
|
||||||
for i := res.Len() - 1; i >= 0; i-- {
|
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||||
v := res.Index(i) // interface{}
|
case oneofFuncsIface:
|
||||||
tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X
|
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||||
typ := tptr.Elem() // Msg_X
|
case oneofWrappersIface:
|
||||||
|
oneofImplementers = m.XXX_OneofWrappers()
|
||||||
|
}
|
||||||
|
for _, v := range oneofImplementers {
|
||||||
|
tptr := reflect.TypeOf(v) // *Msg_X
|
||||||
|
typ := tptr.Elem() // Msg_X
|
||||||
|
|
||||||
f := typ.Field(0) // oneof implementers have one field
|
f := typ.Field(0) // oneof implementers have one field
|
||||||
baseUnmarshal := fieldUnmarshaler(&f)
|
baseUnmarshal := fieldUnmarshaler(&f)
|
||||||
@ -407,11 +410,12 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get extension ranges, if any.
|
// Get extension ranges, if any.
|
||||||
fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
||||||
if fn.IsValid() {
|
if fn.IsValid() {
|
||||||
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() {
|
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() {
|
||||||
panic("a message with extensions, but no extensions field in " + t.Name())
|
panic("a message with extensions, but no extensions field in " + t.Name())
|
||||||
|
6
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
6
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
@ -476,6 +476,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
|
||||||
|
|
||||||
// writeAny writes an arbitrary field.
|
// writeAny writes an arbitrary field.
|
||||||
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
|
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
|
||||||
v = reflect.Indirect(v)
|
v = reflect.Indirect(v)
|
||||||
@ -589,8 +591,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
|
|||||||
// mutating this value.
|
// mutating this value.
|
||||||
v = v.Addr()
|
v = v.Addr()
|
||||||
}
|
}
|
||||||
if etm, ok := v.Interface().(encoding.TextMarshaler); ok {
|
if v.Type().Implements(textMarshalerType) {
|
||||||
text, err := etm.MarshalText()
|
text, err := v.Interface().(encoding.TextMarshaler).MarshalText()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
110
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
110
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||||
// URL that describes the type of the serialized message.
|
// URL that describes the type of the serialized message.
|
||||||
@ -155,7 +156,7 @@ func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -309,7 +310,7 @@ func valueToGoStringAny(v interface{}, typ string) string {
|
|||||||
func (m *Any) Marshal() (dAtA []byte, err error) {
|
func (m *Any) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -317,36 +318,46 @@ func (m *Any) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Any) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Any) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.TypeUrl) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
|
|
||||||
i += copy(dAtA[i:], m.TypeUrl)
|
|
||||||
}
|
}
|
||||||
if len(m.Value) > 0 {
|
if len(m.Value) > 0 {
|
||||||
dAtA[i] = 0x12
|
i -= len(m.Value)
|
||||||
i++
|
copy(dAtA[i:], m.Value)
|
||||||
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
|
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
|
||||||
i += copy(dAtA[i:], m.Value)
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if len(m.TypeUrl) > 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.TypeUrl)
|
||||||
|
copy(dAtA[i:], m.TypeUrl)
|
||||||
|
i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintAny(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintAny(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovAny(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedAny(r randyAny, easy bool) *Any {
|
func NewPopulatedAny(r randyAny, easy bool) *Any {
|
||||||
this := &Any{}
|
this := &Any{}
|
||||||
@ -455,14 +466,7 @@ func (m *Any) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovAny(x uint64) (n int) {
|
func sovAny(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozAny(x uint64) (n int) {
|
func sozAny(x uint64) (n int) {
|
||||||
return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -610,6 +614,7 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
func skipAny(dAtA []byte) (n int, err error) {
|
func skipAny(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -641,10 +646,8 @@ func skipAny(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -665,55 +668,30 @@ func skipAny(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthAny
|
return 0, ErrInvalidLengthAny
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthAny
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowAny
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipAny(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthAny
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupAny
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthAny
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
399
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
399
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// Api is a light-weight descriptor for an API Interface.
|
// Api is a light-weight descriptor for an API Interface.
|
||||||
//
|
//
|
||||||
@ -88,7 +89,7 @@ func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Api.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Api.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -194,7 +195,7 @@ func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Method.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Method.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -368,7 +369,7 @@ func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Mixin.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Mixin.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -862,7 +863,7 @@ func valueToGoStringApi(v interface{}, typ string) string {
|
|||||||
func (m *Api) Marshal() (dAtA []byte, err error) {
|
func (m *Api) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -870,83 +871,99 @@ func (m *Api) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Api) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Api) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
|
||||||
if len(m.Methods) > 0 {
|
|
||||||
for _, msg := range m.Methods {
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Options) > 0 {
|
|
||||||
for _, msg := range m.Options {
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Version) > 0 {
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
|
|
||||||
i += copy(dAtA[i:], m.Version)
|
|
||||||
}
|
|
||||||
if m.SourceContext != nil {
|
|
||||||
dAtA[i] = 0x2a
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(m.SourceContext.Size()))
|
|
||||||
n1, err := m.SourceContext.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n1
|
|
||||||
}
|
|
||||||
if len(m.Mixins) > 0 {
|
|
||||||
for _, msg := range m.Mixins {
|
|
||||||
dAtA[i] = 0x32
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if m.Syntax != 0 {
|
if m.Syntax != 0 {
|
||||||
dAtA[i] = 0x38
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x38
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if len(m.Mixins) > 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
for iNdEx := len(m.Mixins) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Mixins[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.SourceContext != nil {
|
||||||
|
{
|
||||||
|
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x2a
|
||||||
|
}
|
||||||
|
if len(m.Version) > 0 {
|
||||||
|
i -= len(m.Version)
|
||||||
|
copy(dAtA[i:], m.Version)
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
|
}
|
||||||
|
if len(m.Options) > 0 {
|
||||||
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Methods) > 0 {
|
||||||
|
for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Name) > 0 {
|
||||||
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Method) Marshal() (dAtA []byte, err error) {
|
func (m *Method) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -954,75 +971,86 @@ func (m *Method) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Method) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Method) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
}
|
||||||
if len(m.RequestTypeUrl) > 0 {
|
if m.Syntax != 0 {
|
||||||
dAtA[i] = 0x12
|
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
||||||
i++
|
i--
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl)))
|
dAtA[i] = 0x38
|
||||||
i += copy(dAtA[i:], m.RequestTypeUrl)
|
|
||||||
}
|
}
|
||||||
if m.RequestStreaming {
|
if len(m.Options) > 0 {
|
||||||
dAtA[i] = 0x18
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
i++
|
{
|
||||||
if m.RequestStreaming {
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
dAtA[i] = 1
|
if err != nil {
|
||||||
} else {
|
return 0, err
|
||||||
dAtA[i] = 0
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
}
|
}
|
||||||
i++
|
|
||||||
}
|
|
||||||
if len(m.ResponseTypeUrl) > 0 {
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
i++
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl)))
|
|
||||||
i += copy(dAtA[i:], m.ResponseTypeUrl)
|
|
||||||
}
|
}
|
||||||
if m.ResponseStreaming {
|
if m.ResponseStreaming {
|
||||||
dAtA[i] = 0x28
|
i--
|
||||||
i++
|
|
||||||
if m.ResponseStreaming {
|
if m.ResponseStreaming {
|
||||||
dAtA[i] = 1
|
dAtA[i] = 1
|
||||||
} else {
|
} else {
|
||||||
dAtA[i] = 0
|
dAtA[i] = 0
|
||||||
}
|
}
|
||||||
i++
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
}
|
}
|
||||||
if len(m.Options) > 0 {
|
if len(m.ResponseTypeUrl) > 0 {
|
||||||
for _, msg := range m.Options {
|
i -= len(m.ResponseTypeUrl)
|
||||||
dAtA[i] = 0x32
|
copy(dAtA[i:], m.ResponseTypeUrl)
|
||||||
i++
|
i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl)))
|
||||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
i--
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
dAtA[i] = 0x22
|
||||||
if err != nil {
|
}
|
||||||
return 0, err
|
if m.RequestStreaming {
|
||||||
}
|
i--
|
||||||
i += n
|
if m.RequestStreaming {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
}
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x18
|
||||||
}
|
}
|
||||||
if m.Syntax != 0 {
|
if len(m.RequestTypeUrl) > 0 {
|
||||||
dAtA[i] = 0x38
|
i -= len(m.RequestTypeUrl)
|
||||||
i++
|
copy(dAtA[i:], m.RequestTypeUrl)
|
||||||
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if len(m.Name) > 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mixin) Marshal() (dAtA []byte, err error) {
|
func (m *Mixin) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1030,48 +1058,58 @@ func (m *Mixin) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mixin) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Mixin) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Mixin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
}
|
||||||
if len(m.Root) > 0 {
|
if len(m.Root) > 0 {
|
||||||
dAtA[i] = 0x12
|
i -= len(m.Root)
|
||||||
i++
|
copy(dAtA[i:], m.Root)
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Root)))
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Root)))
|
||||||
i += copy(dAtA[i:], m.Root)
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if len(m.Name) > 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovApi(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedApi(r randyApi, easy bool) *Api {
|
func NewPopulatedApi(r randyApi, easy bool) *Api {
|
||||||
this := &Api{}
|
this := &Api{}
|
||||||
this.Name = string(randStringApi(r))
|
this.Name = string(randStringApi(r))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v1 := r.Intn(5)
|
v1 := r.Intn(5)
|
||||||
this.Methods = make([]*Method, v1)
|
this.Methods = make([]*Method, v1)
|
||||||
for i := 0; i < v1; i++ {
|
for i := 0; i < v1; i++ {
|
||||||
this.Methods[i] = NewPopulatedMethod(r, easy)
|
this.Methods[i] = NewPopulatedMethod(r, easy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v2 := r.Intn(5)
|
v2 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v2)
|
this.Options = make([]*Option, v2)
|
||||||
for i := 0; i < v2; i++ {
|
for i := 0; i < v2; i++ {
|
||||||
@ -1079,10 +1117,10 @@ func NewPopulatedApi(r randyApi, easy bool) *Api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Version = string(randStringApi(r))
|
this.Version = string(randStringApi(r))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v3 := r.Intn(5)
|
v3 := r.Intn(5)
|
||||||
this.Mixins = make([]*Mixin, v3)
|
this.Mixins = make([]*Mixin, v3)
|
||||||
for i := 0; i < v3; i++ {
|
for i := 0; i < v3; i++ {
|
||||||
@ -1103,7 +1141,7 @@ func NewPopulatedMethod(r randyApi, easy bool) *Method {
|
|||||||
this.RequestStreaming = bool(bool(r.Intn(2) == 0))
|
this.RequestStreaming = bool(bool(r.Intn(2) == 0))
|
||||||
this.ResponseTypeUrl = string(randStringApi(r))
|
this.ResponseTypeUrl = string(randStringApi(r))
|
||||||
this.ResponseStreaming = bool(bool(r.Intn(2) == 0))
|
this.ResponseStreaming = bool(bool(r.Intn(2) == 0))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v4 := r.Intn(5)
|
v4 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v4)
|
this.Options = make([]*Option, v4)
|
||||||
for i := 0; i < v4; i++ {
|
for i := 0; i < v4; i++ {
|
||||||
@ -1304,14 +1342,7 @@ func (m *Mixin) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovApi(x uint64) (n int) {
|
func sovApi(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozApi(x uint64) (n int) {
|
func sozApi(x uint64) (n int) {
|
||||||
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -1320,13 +1351,28 @@ func (this *Api) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForMethods := "[]*Method{"
|
||||||
|
for _, f := range this.Methods {
|
||||||
|
repeatedStringForMethods += strings.Replace(f.String(), "Method", "Method", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForMethods += "}"
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
|
repeatedStringForMixins := "[]*Mixin{"
|
||||||
|
for _, f := range this.Mixins {
|
||||||
|
repeatedStringForMixins += strings.Replace(f.String(), "Mixin", "Mixin", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForMixins += "}"
|
||||||
s := strings.Join([]string{`&Api{`,
|
s := strings.Join([]string{`&Api{`,
|
||||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||||
`Methods:` + strings.Replace(fmt.Sprintf("%v", this.Methods), "Method", "Method", 1) + `,`,
|
`Methods:` + repeatedStringForMethods + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
||||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||||
`Mixins:` + strings.Replace(fmt.Sprintf("%v", this.Mixins), "Mixin", "Mixin", 1) + `,`,
|
`Mixins:` + repeatedStringForMixins + `,`,
|
||||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
@ -1337,13 +1383,18 @@ func (this *Method) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
s := strings.Join([]string{`&Method{`,
|
s := strings.Join([]string{`&Method{`,
|
||||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||||
`RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`,
|
`RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`,
|
||||||
`RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`,
|
`RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`,
|
||||||
`ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`,
|
`ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`,
|
||||||
`ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`,
|
`ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
@ -2009,6 +2060,7 @@ func (m *Mixin) Unmarshal(dAtA []byte) error {
|
|||||||
func skipApi(dAtA []byte) (n int, err error) {
|
func skipApi(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -2040,10 +2092,8 @@ func skipApi(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -2064,55 +2114,30 @@ func skipApi(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthApi
|
return 0, ErrInvalidLengthApi
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipApi(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupApi
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthApi
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
104
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
104
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// A Duration represents a signed, fixed-length span of time represented
|
// A Duration represents a signed, fixed-length span of time represented
|
||||||
// as a count of seconds and fractions of seconds at nanosecond
|
// as a count of seconds and fractions of seconds at nanosecond
|
||||||
@ -115,7 +116,7 @@ func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -272,7 +273,7 @@ func valueToGoStringDuration(v interface{}, typ string) string {
|
|||||||
func (m *Duration) Marshal() (dAtA []byte, err error) {
|
func (m *Duration) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -280,34 +281,42 @@ func (m *Duration) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Duration) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Duration) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Seconds != 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0x8
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintDuration(dAtA, i, uint64(m.Seconds))
|
|
||||||
}
|
}
|
||||||
if m.Nanos != 0 {
|
if m.Nanos != 0 {
|
||||||
dAtA[i] = 0x10
|
|
||||||
i++
|
|
||||||
i = encodeVarintDuration(dAtA, i, uint64(m.Nanos))
|
i = encodeVarintDuration(dAtA, i, uint64(m.Nanos))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.Seconds != 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i = encodeVarintDuration(dAtA, i, uint64(m.Seconds))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintDuration(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintDuration(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovDuration(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func (m *Duration) Size() (n int) {
|
func (m *Duration) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
@ -328,14 +337,7 @@ func (m *Duration) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovDuration(x uint64) (n int) {
|
func sovDuration(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozDuration(x uint64) (n int) {
|
func sozDuration(x uint64) (n int) {
|
||||||
return sovDuration(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovDuration(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -435,6 +437,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
|||||||
func skipDuration(dAtA []byte) (n int, err error) {
|
func skipDuration(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -466,10 +469,8 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -490,55 +491,30 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthDuration
|
return 0, ErrInvalidLengthDuration
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthDuration
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowDuration
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipDuration(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthDuration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupDuration
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthDuration
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupDuration = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
90
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
90
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// A generic empty message that you can re-use to avoid defining duplicated
|
// A generic empty message that you can re-use to avoid defining duplicated
|
||||||
// empty messages in your APIs. A typical example is to use it as the request
|
// empty messages in your APIs. A typical example is to use it as the request
|
||||||
@ -53,7 +54,7 @@ func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -173,7 +174,7 @@ func valueToGoStringEmpty(v interface{}, typ string) string {
|
|||||||
func (m *Empty) Marshal() (dAtA []byte, err error) {
|
func (m *Empty) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -181,24 +182,32 @@ func (m *Empty) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Empty) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Empty) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintEmpty(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintEmpty(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovEmpty(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty {
|
func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty {
|
||||||
this := &Empty{}
|
this := &Empty{}
|
||||||
@ -293,14 +302,7 @@ func (m *Empty) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovEmpty(x uint64) (n int) {
|
func sovEmpty(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozEmpty(x uint64) (n int) {
|
func sozEmpty(x uint64) (n int) {
|
||||||
return sovEmpty(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovEmpty(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -380,6 +382,7 @@ func (m *Empty) Unmarshal(dAtA []byte) error {
|
|||||||
func skipEmpty(dAtA []byte) (n int, err error) {
|
func skipEmpty(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -411,10 +414,8 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -435,55 +436,30 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthEmpty
|
return 0, ErrInvalidLengthEmpty
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthEmpty
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowEmpty
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipEmpty(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthEmpty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupEmpty
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthEmpty
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupEmpty = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
110
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
110
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// `FieldMask` represents a set of symbolic field paths, for example:
|
// `FieldMask` represents a set of symbolic field paths, for example:
|
||||||
//
|
//
|
||||||
@ -244,7 +245,7 @@ func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
|
return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -396,7 +397,7 @@ func valueToGoStringFieldMask(v interface{}, typ string) string {
|
|||||||
func (m *FieldMask) Marshal() (dAtA []byte, err error) {
|
func (m *FieldMask) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -404,39 +405,41 @@ func (m *FieldMask) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *FieldMask) MarshalTo(dAtA []byte) (int, error) {
|
func (m *FieldMask) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FieldMask) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
if len(m.Paths) > 0 {
|
if len(m.Paths) > 0 {
|
||||||
for _, s := range m.Paths {
|
for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(m.Paths[iNdEx])
|
||||||
|
copy(dAtA[i:], m.Paths[iNdEx])
|
||||||
|
i = encodeVarintFieldMask(dAtA, i, uint64(len(m.Paths[iNdEx])))
|
||||||
|
i--
|
||||||
dAtA[i] = 0xa
|
dAtA[i] = 0xa
|
||||||
i++
|
|
||||||
l = len(s)
|
|
||||||
for l >= 1<<7 {
|
|
||||||
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
|
||||||
l >>= 7
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
dAtA[i] = uint8(l)
|
|
||||||
i++
|
|
||||||
i += copy(dAtA[i:], s)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
return len(dAtA) - i, nil
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return i, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintFieldMask(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintFieldMask(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovFieldMask(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedFieldMask(r randyFieldMask, easy bool) *FieldMask {
|
func NewPopulatedFieldMask(r randyFieldMask, easy bool) *FieldMask {
|
||||||
this := &FieldMask{}
|
this := &FieldMask{}
|
||||||
@ -542,14 +545,7 @@ func (m *FieldMask) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovFieldMask(x uint64) (n int) {
|
func sovFieldMask(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozFieldMask(x uint64) (n int) {
|
func sozFieldMask(x uint64) (n int) {
|
||||||
return sovFieldMask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovFieldMask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -662,6 +658,7 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
|||||||
func skipFieldMask(dAtA []byte) (n int, err error) {
|
func skipFieldMask(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -693,10 +690,8 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -717,55 +712,30 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthFieldMask
|
return 0, ErrInvalidLengthFieldMask
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthFieldMask
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowFieldMask
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipFieldMask(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthFieldMask
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupFieldMask
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthFieldMask
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupFieldMask = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
103
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
103
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// `SourceContext` represents information about the source of a
|
// `SourceContext` represents information about the source of a
|
||||||
// protobuf element, like the file in which it is defined.
|
// protobuf element, like the file in which it is defined.
|
||||||
@ -48,7 +49,7 @@ func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
|
|||||||
return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic)
|
return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -190,7 +191,7 @@ func valueToGoStringSourceContext(v interface{}, typ string) string {
|
|||||||
func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -198,30 +199,39 @@ func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) {
|
func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SourceContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.FileName) > 0 {
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName)))
|
|
||||||
i += copy(dAtA[i:], m.FileName)
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if len(m.FileName) > 0 {
|
||||||
|
i -= len(m.FileName)
|
||||||
|
copy(dAtA[i:], m.FileName)
|
||||||
|
i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovSourceContext(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext {
|
func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext {
|
||||||
this := &SourceContext{}
|
this := &SourceContext{}
|
||||||
@ -321,14 +331,7 @@ func (m *SourceContext) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovSourceContext(x uint64) (n int) {
|
func sovSourceContext(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozSourceContext(x uint64) (n int) {
|
func sozSourceContext(x uint64) (n int) {
|
||||||
return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -441,6 +444,7 @@ func (m *SourceContext) Unmarshal(dAtA []byte) error {
|
|||||||
func skipSourceContext(dAtA []byte) (n int, err error) {
|
func skipSourceContext(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -472,10 +476,8 @@ func skipSourceContext(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -496,55 +498,30 @@ func skipSourceContext(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthSourceContext
|
return 0, ErrInvalidLengthSourceContext
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthSourceContext
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowSourceContext
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipSourceContext(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthSourceContext
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupSourceContext
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthSourceContext
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupSourceContext = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
877
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
877
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
114
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
114
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -22,7 +23,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// A Timestamp represents a point in time independent of any time zone or local
|
// A Timestamp represents a point in time independent of any time zone or local
|
||||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||||
@ -97,11 +98,13 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
// 01:30 UTC on January 15, 2017.
|
// 01:30 UTC on January 15, 2017.
|
||||||
//
|
//
|
||||||
// In JavaScript, one can convert a Date object to this format using the
|
// In JavaScript, one can convert a Date object to this format using the
|
||||||
// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
// standard
|
||||||
|
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
// to this format using
|
||||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||||
|
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||||
//
|
//
|
||||||
@ -135,7 +138,7 @@ func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -292,7 +295,7 @@ func valueToGoStringTimestamp(v interface{}, typ string) string {
|
|||||||
func (m *Timestamp) Marshal() (dAtA []byte, err error) {
|
func (m *Timestamp) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -300,34 +303,42 @@ func (m *Timestamp) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Timestamp) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Timestamp) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Seconds != 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0x8
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Seconds))
|
|
||||||
}
|
}
|
||||||
if m.Nanos != 0 {
|
if m.Nanos != 0 {
|
||||||
dAtA[i] = 0x10
|
|
||||||
i++
|
|
||||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos))
|
i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.Seconds != 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i = encodeVarintTimestamp(dAtA, i, uint64(m.Seconds))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintTimestamp(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintTimestamp(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovTimestamp(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func (m *Timestamp) Size() (n int) {
|
func (m *Timestamp) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
@ -348,14 +359,7 @@ func (m *Timestamp) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovTimestamp(x uint64) (n int) {
|
func sovTimestamp(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozTimestamp(x uint64) (n int) {
|
func sozTimestamp(x uint64) (n int) {
|
||||||
return sovTimestamp(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovTimestamp(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -455,6 +459,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
|||||||
func skipTimestamp(dAtA []byte) (n int, err error) {
|
func skipTimestamp(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -486,10 +491,8 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -510,55 +513,30 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthTimestamp
|
return 0, ErrInvalidLengthTimestamp
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthTimestamp
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowTimestamp
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipTimestamp(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthTimestamp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupTimestamp
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthTimestamp
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupTimestamp = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
588
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
588
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strconv "strconv"
|
strconv "strconv"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
@ -23,7 +24,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// The syntax in which a protocol buffer element is defined.
|
// The syntax in which a protocol buffer element is defined.
|
||||||
type Syntax int32
|
type Syntax int32
|
||||||
@ -205,7 +206,7 @@ func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Type.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Type.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -312,7 +313,7 @@ func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Field.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Field.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -435,7 +436,7 @@ func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Enum.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Enum.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -519,7 +520,7 @@ func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -594,7 +595,7 @@ func (m *Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Option.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Option.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1404,7 +1405,7 @@ func valueToGoStringType(v interface{}, typ string) string {
|
|||||||
func (m *Type) Marshal() (dAtA []byte, err error) {
|
func (m *Type) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1412,80 +1413,87 @@ func (m *Type) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Type) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Type) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Type) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
}
|
||||||
if len(m.Fields) > 0 {
|
if m.Syntax != 0 {
|
||||||
for _, msg := range m.Fields {
|
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
||||||
dAtA[i] = 0x12
|
i--
|
||||||
i++
|
dAtA[i] = 0x30
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
}
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
if m.SourceContext != nil {
|
||||||
|
{
|
||||||
|
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
i += n
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x2a
|
||||||
|
}
|
||||||
|
if len(m.Options) > 0 {
|
||||||
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.Oneofs) > 0 {
|
if len(m.Oneofs) > 0 {
|
||||||
for _, s := range m.Oneofs {
|
for iNdEx := len(m.Oneofs) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(m.Oneofs[iNdEx])
|
||||||
|
copy(dAtA[i:], m.Oneofs[iNdEx])
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(len(m.Oneofs[iNdEx])))
|
||||||
|
i--
|
||||||
dAtA[i] = 0x1a
|
dAtA[i] = 0x1a
|
||||||
i++
|
}
|
||||||
l = len(s)
|
}
|
||||||
for l >= 1<<7 {
|
if len(m.Fields) > 0 {
|
||||||
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
l >>= 7
|
{
|
||||||
i++
|
size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
dAtA[i] = uint8(l)
|
i--
|
||||||
i++
|
dAtA[i] = 0x12
|
||||||
i += copy(dAtA[i:], s)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.Options) > 0 {
|
if len(m.Name) > 0 {
|
||||||
for _, msg := range m.Options {
|
i -= len(m.Name)
|
||||||
dAtA[i] = 0x22
|
copy(dAtA[i:], m.Name)
|
||||||
i++
|
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
i--
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
dAtA[i] = 0xa
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if m.SourceContext != nil {
|
return len(dAtA) - i, nil
|
||||||
dAtA[i] = 0x2a
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.SourceContext.Size()))
|
|
||||||
n1, err := m.SourceContext.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n1
|
|
||||||
}
|
|
||||||
if m.Syntax != 0 {
|
|
||||||
dAtA[i] = 0x30
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return i, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Field) Marshal() (dAtA []byte, err error) {
|
func (m *Field) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1493,86 +1501,98 @@ func (m *Field) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Field) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Field) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Kind != 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0x8
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Kind))
|
|
||||||
}
|
}
|
||||||
if m.Cardinality != 0 {
|
if len(m.DefaultValue) > 0 {
|
||||||
dAtA[i] = 0x10
|
i -= len(m.DefaultValue)
|
||||||
i++
|
copy(dAtA[i:], m.DefaultValue)
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Cardinality))
|
i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x5a
|
||||||
}
|
}
|
||||||
if m.Number != 0 {
|
if len(m.JsonName) > 0 {
|
||||||
dAtA[i] = 0x18
|
i -= len(m.JsonName)
|
||||||
i++
|
copy(dAtA[i:], m.JsonName)
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
i = encodeVarintType(dAtA, i, uint64(len(m.JsonName)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x52
|
||||||
}
|
}
|
||||||
if len(m.Name) > 0 {
|
if len(m.Options) > 0 {
|
||||||
dAtA[i] = 0x22
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
i++
|
{
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
i += copy(dAtA[i:], m.Name)
|
if err != nil {
|
||||||
}
|
return 0, err
|
||||||
if len(m.TypeUrl) > 0 {
|
}
|
||||||
dAtA[i] = 0x32
|
i -= size
|
||||||
i++
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl)))
|
}
|
||||||
i += copy(dAtA[i:], m.TypeUrl)
|
i--
|
||||||
}
|
dAtA[i] = 0x4a
|
||||||
if m.OneofIndex != 0 {
|
}
|
||||||
dAtA[i] = 0x38
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.OneofIndex))
|
|
||||||
}
|
}
|
||||||
if m.Packed {
|
if m.Packed {
|
||||||
dAtA[i] = 0x40
|
i--
|
||||||
i++
|
|
||||||
if m.Packed {
|
if m.Packed {
|
||||||
dAtA[i] = 1
|
dAtA[i] = 1
|
||||||
} else {
|
} else {
|
||||||
dAtA[i] = 0
|
dAtA[i] = 0
|
||||||
}
|
}
|
||||||
i++
|
i--
|
||||||
|
dAtA[i] = 0x40
|
||||||
}
|
}
|
||||||
if len(m.Options) > 0 {
|
if m.OneofIndex != 0 {
|
||||||
for _, msg := range m.Options {
|
i = encodeVarintType(dAtA, i, uint64(m.OneofIndex))
|
||||||
dAtA[i] = 0x4a
|
i--
|
||||||
i++
|
dAtA[i] = 0x38
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if len(m.JsonName) > 0 {
|
if len(m.TypeUrl) > 0 {
|
||||||
dAtA[i] = 0x52
|
i -= len(m.TypeUrl)
|
||||||
i++
|
copy(dAtA[i:], m.TypeUrl)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.JsonName)))
|
i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl)))
|
||||||
i += copy(dAtA[i:], m.JsonName)
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
}
|
}
|
||||||
if len(m.DefaultValue) > 0 {
|
if len(m.Name) > 0 {
|
||||||
dAtA[i] = 0x5a
|
i -= len(m.Name)
|
||||||
i++
|
copy(dAtA[i:], m.Name)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue)))
|
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||||
i += copy(dAtA[i:], m.DefaultValue)
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.Number != 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x18
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Cardinality != 0 {
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(m.Cardinality))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if m.Kind != 0 {
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(m.Kind))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Enum) Marshal() (dAtA []byte, err error) {
|
func (m *Enum) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1580,65 +1600,78 @@ func (m *Enum) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Enum) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Enum) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Enum) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
|
||||||
if len(m.Enumvalue) > 0 {
|
|
||||||
for _, msg := range m.Enumvalue {
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Options) > 0 {
|
|
||||||
for _, msg := range m.Options {
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m.SourceContext != nil {
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.SourceContext.Size()))
|
|
||||||
n2, err := m.SourceContext.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n2
|
|
||||||
}
|
}
|
||||||
if m.Syntax != 0 {
|
if m.Syntax != 0 {
|
||||||
dAtA[i] = 0x28
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.SourceContext != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
{
|
||||||
|
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
}
|
}
|
||||||
return i, nil
|
if len(m.Options) > 0 {
|
||||||
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Enumvalue) > 0 {
|
||||||
|
for iNdEx := len(m.Enumvalue) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Enumvalue[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Name) > 0 {
|
||||||
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *EnumValue) Marshal() (dAtA []byte, err error) {
|
func (m *EnumValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1646,43 +1679,52 @@ func (m *EnumValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *EnumValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *EnumValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EnumValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
|
||||||
if m.Number != 0 {
|
|
||||||
dAtA[i] = 0x10
|
|
||||||
i++
|
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
|
||||||
}
|
}
|
||||||
if len(m.Options) > 0 {
|
if len(m.Options) > 0 {
|
||||||
for _, msg := range m.Options {
|
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
dAtA[i] = 0x1a
|
{
|
||||||
i++
|
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
if err != nil {
|
||||||
n, err := msg.MarshalTo(dAtA[i:])
|
return 0, err
|
||||||
if err != nil {
|
}
|
||||||
return 0, err
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i += n
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if m.Number != 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
}
|
}
|
||||||
return i, nil
|
if len(m.Name) > 0 {
|
||||||
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Option) Marshal() (dAtA []byte, err error) {
|
func (m *Option) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1690,45 +1732,56 @@ func (m *Option) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Option) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Option) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Option) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Name) > 0 {
|
if m.XXX_unrecognized != nil {
|
||||||
dAtA[i] = 0xa
|
i -= len(m.XXX_unrecognized)
|
||||||
i++
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
|
||||||
i += copy(dAtA[i:], m.Name)
|
|
||||||
}
|
}
|
||||||
if m.Value != nil {
|
if m.Value != nil {
|
||||||
dAtA[i] = 0x12
|
{
|
||||||
i++
|
size, err := m.Value.MarshalToSizedBuffer(dAtA[:i])
|
||||||
i = encodeVarintType(dAtA, i, uint64(m.Value.Size()))
|
if err != nil {
|
||||||
n3, err := m.Value.MarshalTo(dAtA[i:])
|
return 0, err
|
||||||
if err != nil {
|
}
|
||||||
return 0, err
|
i -= size
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i += n3
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
if len(m.Name) > 0 {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.Name)
|
||||||
|
copy(dAtA[i:], m.Name)
|
||||||
|
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintType(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintType(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovType(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedType(r randyType, easy bool) *Type {
|
func NewPopulatedType(r randyType, easy bool) *Type {
|
||||||
this := &Type{}
|
this := &Type{}
|
||||||
this.Name = string(randStringType(r))
|
this.Name = string(randStringType(r))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v1 := r.Intn(5)
|
v1 := r.Intn(5)
|
||||||
this.Fields = make([]*Field, v1)
|
this.Fields = make([]*Field, v1)
|
||||||
for i := 0; i < v1; i++ {
|
for i := 0; i < v1; i++ {
|
||||||
@ -1740,14 +1793,14 @@ func NewPopulatedType(r randyType, easy bool) *Type {
|
|||||||
for i := 0; i < v2; i++ {
|
for i := 0; i < v2; i++ {
|
||||||
this.Oneofs[i] = string(randStringType(r))
|
this.Oneofs[i] = string(randStringType(r))
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v3 := r.Intn(5)
|
v3 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v3)
|
this.Options = make([]*Option, v3)
|
||||||
for i := 0; i < v3; i++ {
|
for i := 0; i < v3; i++ {
|
||||||
this.Options[i] = NewPopulatedOption(r, easy)
|
this.Options[i] = NewPopulatedOption(r, easy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||||
}
|
}
|
||||||
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
||||||
@ -1772,7 +1825,7 @@ func NewPopulatedField(r randyType, easy bool) *Field {
|
|||||||
this.OneofIndex *= -1
|
this.OneofIndex *= -1
|
||||||
}
|
}
|
||||||
this.Packed = bool(bool(r.Intn(2) == 0))
|
this.Packed = bool(bool(r.Intn(2) == 0))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v4 := r.Intn(5)
|
v4 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v4)
|
this.Options = make([]*Option, v4)
|
||||||
for i := 0; i < v4; i++ {
|
for i := 0; i < v4; i++ {
|
||||||
@ -1790,21 +1843,21 @@ func NewPopulatedField(r randyType, easy bool) *Field {
|
|||||||
func NewPopulatedEnum(r randyType, easy bool) *Enum {
|
func NewPopulatedEnum(r randyType, easy bool) *Enum {
|
||||||
this := &Enum{}
|
this := &Enum{}
|
||||||
this.Name = string(randStringType(r))
|
this.Name = string(randStringType(r))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v5 := r.Intn(5)
|
v5 := r.Intn(5)
|
||||||
this.Enumvalue = make([]*EnumValue, v5)
|
this.Enumvalue = make([]*EnumValue, v5)
|
||||||
for i := 0; i < v5; i++ {
|
for i := 0; i < v5; i++ {
|
||||||
this.Enumvalue[i] = NewPopulatedEnumValue(r, easy)
|
this.Enumvalue[i] = NewPopulatedEnumValue(r, easy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v6 := r.Intn(5)
|
v6 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v6)
|
this.Options = make([]*Option, v6)
|
||||||
for i := 0; i < v6; i++ {
|
for i := 0; i < v6; i++ {
|
||||||
this.Options[i] = NewPopulatedOption(r, easy)
|
this.Options[i] = NewPopulatedOption(r, easy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||||
}
|
}
|
||||||
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
||||||
@ -1821,7 +1874,7 @@ func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue {
|
|||||||
if r.Intn(2) == 0 {
|
if r.Intn(2) == 0 {
|
||||||
this.Number *= -1
|
this.Number *= -1
|
||||||
}
|
}
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
v7 := r.Intn(5)
|
v7 := r.Intn(5)
|
||||||
this.Options = make([]*Option, v7)
|
this.Options = make([]*Option, v7)
|
||||||
for i := 0; i < v7; i++ {
|
for i := 0; i < v7; i++ {
|
||||||
@ -1837,7 +1890,7 @@ func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue {
|
|||||||
func NewPopulatedOption(r randyType, easy bool) *Option {
|
func NewPopulatedOption(r randyType, easy bool) *Option {
|
||||||
this := &Option{}
|
this := &Option{}
|
||||||
this.Name = string(randStringType(r))
|
this.Name = string(randStringType(r))
|
||||||
if r.Intn(10) != 0 {
|
if r.Intn(5) != 0 {
|
||||||
this.Value = NewPopulatedAny(r, easy)
|
this.Value = NewPopulatedAny(r, easy)
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
@ -2089,14 +2142,7 @@ func (m *Option) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovType(x uint64) (n int) {
|
func sovType(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozType(x uint64) (n int) {
|
func sozType(x uint64) (n int) {
|
||||||
return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -2105,11 +2151,21 @@ func (this *Type) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForFields := "[]*Field{"
|
||||||
|
for _, f := range this.Fields {
|
||||||
|
repeatedStringForFields += strings.Replace(f.String(), "Field", "Field", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForFields += "}"
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
s := strings.Join([]string{`&Type{`,
|
s := strings.Join([]string{`&Type{`,
|
||||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||||
`Fields:` + strings.Replace(fmt.Sprintf("%v", this.Fields), "Field", "Field", 1) + `,`,
|
`Fields:` + repeatedStringForFields + `,`,
|
||||||
`Oneofs:` + fmt.Sprintf("%v", this.Oneofs) + `,`,
|
`Oneofs:` + fmt.Sprintf("%v", this.Oneofs) + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
@ -2121,6 +2177,11 @@ func (this *Field) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
s := strings.Join([]string{`&Field{`,
|
s := strings.Join([]string{`&Field{`,
|
||||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||||
`Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`,
|
`Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`,
|
||||||
@ -2129,7 +2190,7 @@ func (this *Field) String() string {
|
|||||||
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
||||||
`OneofIndex:` + fmt.Sprintf("%v", this.OneofIndex) + `,`,
|
`OneofIndex:` + fmt.Sprintf("%v", this.OneofIndex) + `,`,
|
||||||
`Packed:` + fmt.Sprintf("%v", this.Packed) + `,`,
|
`Packed:` + fmt.Sprintf("%v", this.Packed) + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`JsonName:` + fmt.Sprintf("%v", this.JsonName) + `,`,
|
`JsonName:` + fmt.Sprintf("%v", this.JsonName) + `,`,
|
||||||
`DefaultValue:` + fmt.Sprintf("%v", this.DefaultValue) + `,`,
|
`DefaultValue:` + fmt.Sprintf("%v", this.DefaultValue) + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
@ -2141,10 +2202,20 @@ func (this *Enum) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForEnumvalue := "[]*EnumValue{"
|
||||||
|
for _, f := range this.Enumvalue {
|
||||||
|
repeatedStringForEnumvalue += strings.Replace(f.String(), "EnumValue", "EnumValue", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForEnumvalue += "}"
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
s := strings.Join([]string{`&Enum{`,
|
s := strings.Join([]string{`&Enum{`,
|
||||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||||
`Enumvalue:` + strings.Replace(fmt.Sprintf("%v", this.Enumvalue), "EnumValue", "EnumValue", 1) + `,`,
|
`Enumvalue:` + repeatedStringForEnumvalue + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
@ -2156,10 +2227,15 @@ func (this *EnumValue) String() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
repeatedStringForOptions := "[]*Option{"
|
||||||
|
for _, f := range this.Options {
|
||||||
|
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||||
|
}
|
||||||
|
repeatedStringForOptions += "}"
|
||||||
s := strings.Join([]string{`&EnumValue{`,
|
s := strings.Join([]string{`&EnumValue{`,
|
||||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||||
`Number:` + fmt.Sprintf("%v", this.Number) + `,`,
|
`Number:` + fmt.Sprintf("%v", this.Number) + `,`,
|
||||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
`Options:` + repeatedStringForOptions + `,`,
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
@ -3211,6 +3287,7 @@ func (m *Option) Unmarshal(dAtA []byte) error {
|
|||||||
func skipType(dAtA []byte) (n int, err error) {
|
func skipType(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -3242,10 +3319,8 @@ func skipType(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -3266,55 +3341,30 @@ func skipType(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthType
|
return 0, ErrInvalidLengthType
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthType
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowType
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipType(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupType
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthType
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowType = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowType = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupType = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
318
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
318
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
@ -10,6 +10,7 @@ import (
|
|||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
strings "strings"
|
||||||
)
|
)
|
||||||
@ -23,7 +24,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
// Wrapper message for `double`.
|
// Wrapper message for `double`.
|
||||||
//
|
//
|
||||||
@ -50,7 +51,7 @@ func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
|||||||
return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -105,7 +106,7 @@ func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -160,7 +161,7 @@ func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -215,7 +216,7 @@ func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
|||||||
return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -270,7 +271,7 @@ func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -325,7 +326,7 @@ func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
|||||||
return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -380,7 +381,7 @@ func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -435,7 +436,7 @@ func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
|||||||
return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -490,7 +491,7 @@ func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||||||
return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalTo(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1247,7 +1248,7 @@ func valueToGoStringWrappers(v interface{}, typ string) string {
|
|||||||
func (m *DoubleValue) Marshal() (dAtA []byte, err error) {
|
func (m *DoubleValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1255,26 +1256,32 @@ func (m *DoubleValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *DoubleValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *DoubleValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0x9
|
|
||||||
i++
|
|
||||||
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
|
|
||||||
i += 8
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i -= 8
|
||||||
|
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x9
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *FloatValue) Marshal() (dAtA []byte, err error) {
|
func (m *FloatValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1282,26 +1289,32 @@ func (m *FloatValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *FloatValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *FloatValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FloatValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0xd
|
|
||||||
i++
|
|
||||||
encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Value))))
|
|
||||||
i += 4
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i -= 4
|
||||||
|
encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Value))))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xd
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Int64Value) Marshal() (dAtA []byte, err error) {
|
func (m *Int64Value) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1309,25 +1322,31 @@ func (m *Int64Value) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *UInt64Value) Marshal() (dAtA []byte, err error) {
|
func (m *UInt64Value) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1335,25 +1354,31 @@ func (m *UInt64Value) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) {
|
func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Int32Value) Marshal() (dAtA []byte, err error) {
|
func (m *Int32Value) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1361,25 +1386,31 @@ func (m *Int32Value) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Int32Value) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Int32Value) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Int32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *UInt32Value) Marshal() (dAtA []byte, err error) {
|
func (m *UInt32Value) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1387,25 +1418,31 @@ func (m *UInt32Value) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *UInt32Value) MarshalTo(dAtA []byte) (int, error) {
|
func (m *UInt32Value) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *UInt32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Value != 0 {
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if m.Value != 0 {
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *BoolValue) Marshal() (dAtA []byte, err error) {
|
func (m *BoolValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1413,30 +1450,36 @@ func (m *BoolValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *BoolValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *BoolValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
if m.Value {
|
if m.Value {
|
||||||
dAtA[i] = 0x8
|
i--
|
||||||
i++
|
|
||||||
if m.Value {
|
if m.Value {
|
||||||
dAtA[i] = 1
|
dAtA[i] = 1
|
||||||
} else {
|
} else {
|
||||||
dAtA[i] = 0
|
dAtA[i] = 0
|
||||||
}
|
}
|
||||||
i++
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
}
|
}
|
||||||
if m.XXX_unrecognized != nil {
|
return len(dAtA) - i, nil
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return i, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *StringValue) Marshal() (dAtA []byte, err error) {
|
func (m *StringValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1444,26 +1487,33 @@ func (m *StringValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *StringValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *StringValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Value) > 0 {
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
|
||||||
i += copy(dAtA[i:], m.Value)
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if len(m.Value) > 0 {
|
||||||
|
i -= len(m.Value)
|
||||||
|
copy(dAtA[i:], m.Value)
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *BytesValue) Marshal() (dAtA []byte, err error) {
|
func (m *BytesValue) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1471,30 +1521,39 @@ func (m *BytesValue) Marshal() (dAtA []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *BytesValue) MarshalTo(dAtA []byte) (int, error) {
|
func (m *BytesValue) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Value) > 0 {
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
|
||||||
i += copy(dAtA[i:], m.Value)
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
if m.XXX_unrecognized != nil {
|
||||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
|
copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
return i, nil
|
if len(m.Value) > 0 {
|
||||||
|
i -= len(m.Value)
|
||||||
|
copy(dAtA[i:], m.Value)
|
||||||
|
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeVarintWrappers(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintWrappers(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovWrappers(v)
|
||||||
|
base := offset
|
||||||
for v >= 1<<7 {
|
for v >= 1<<7 {
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
v >>= 7
|
v >>= 7
|
||||||
offset++
|
offset++
|
||||||
}
|
}
|
||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return base
|
||||||
}
|
}
|
||||||
func NewPopulatedDoubleValue(r randyWrappers, easy bool) *DoubleValue {
|
func NewPopulatedDoubleValue(r randyWrappers, easy bool) *DoubleValue {
|
||||||
this := &DoubleValue{}
|
this := &DoubleValue{}
|
||||||
@ -1803,14 +1862,7 @@ func (m *BytesValue) Size() (n int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sovWrappers(x uint64) (n int) {
|
func sovWrappers(x uint64) (n int) {
|
||||||
for {
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
n++
|
|
||||||
x >>= 7
|
|
||||||
if x == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
func sozWrappers(x uint64) (n int) {
|
func sozWrappers(x uint64) (n int) {
|
||||||
return sovWrappers(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovWrappers(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
@ -2595,6 +2647,7 @@ func (m *BytesValue) Unmarshal(dAtA []byte) error {
|
|||||||
func skipWrappers(dAtA []byte) (n int, err error) {
|
func skipWrappers(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
var wire uint64
|
var wire uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -2626,10 +2679,8 @@ func skipWrappers(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
|
||||||
case 1:
|
case 1:
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
return iNdEx, nil
|
|
||||||
case 2:
|
case 2:
|
||||||
var length int
|
var length int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -2650,55 +2701,30 @@ func skipWrappers(dAtA []byte) (n int, err error) {
|
|||||||
return 0, ErrInvalidLengthWrappers
|
return 0, ErrInvalidLengthWrappers
|
||||||
}
|
}
|
||||||
iNdEx += length
|
iNdEx += length
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthWrappers
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
depth++
|
||||||
var innerWire uint64
|
|
||||||
var start int = iNdEx
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowWrappers
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
innerWire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
innerWireType := int(innerWire & 0x7)
|
|
||||||
if innerWireType == 4 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
next, err := skipWrappers(dAtA[start:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
iNdEx = start + next
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthWrappers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iNdEx, nil
|
|
||||||
case 4:
|
case 4:
|
||||||
return iNdEx, nil
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupWrappers
|
||||||
|
}
|
||||||
|
depth--
|
||||||
case 5:
|
case 5:
|
||||||
iNdEx += 4
|
iNdEx += 4
|
||||||
return iNdEx, nil
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
}
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthWrappers
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
return 0, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthWrappers = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthWrappers = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowWrappers = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowWrappers = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupWrappers = fmt.Errorf("proto: unexpected end of group")
|
||||||
)
|
)
|
||||||
|
4
vendor/github.com/imdario/mergo/testdata/license.yml
generated
vendored
4
vendor/github.com/imdario/mergo/testdata/license.yml
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
import: ../../../../fossene/db/schema/thing.yml
|
|
||||||
fields:
|
|
||||||
site: string
|
|
||||||
author: root
|
|
1
vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
generated
vendored
1
vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
generated
vendored
@ -27,6 +27,7 @@ We thank all the authors who provided code to this library:
|
|||||||
|
|
||||||
* Felix Kollmann
|
* Felix Kollmann
|
||||||
* Nicolas Perraut
|
* Nicolas Perraut
|
||||||
|
* @dirty49374
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
3
vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
generated
vendored
3
vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
generated
vendored
@ -4,7 +4,6 @@ package sequences
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -27,7 +26,7 @@ func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
|
|||||||
mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||||
}
|
}
|
||||||
|
|
||||||
ret, _, err := setConsoleMode.Call(uintptr(unsafe.Pointer(stream)), uintptr(mode))
|
ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode))
|
||||||
if ret == 0 {
|
if ret == 0 {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
0
vendor/github.com/mattn/go-shellwords/go.test.sh
generated
vendored
Executable file → Normal file
0
vendor/github.com/mattn/go-shellwords/go.test.sh
generated
vendored
Executable file → Normal file
11
vendor/github.com/pkg/errors/.travis.yml
generated
vendored
11
vendor/github.com/pkg/errors/.travis.yml
generated
vendored
@ -1,15 +1,10 @@
|
|||||||
language: go
|
language: go
|
||||||
go_import_path: github.com/pkg/errors
|
go_import_path: github.com/pkg/errors
|
||||||
go:
|
go:
|
||||||
- 1.4.x
|
|
||||||
- 1.5.x
|
|
||||||
- 1.6.x
|
|
||||||
- 1.7.x
|
|
||||||
- 1.8.x
|
|
||||||
- 1.9.x
|
|
||||||
- 1.10.x
|
|
||||||
- 1.11.x
|
- 1.11.x
|
||||||
|
- 1.12.x
|
||||||
|
- 1.13.x
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- go test -v ./...
|
- make check
|
||||||
|
44
vendor/github.com/pkg/errors/Makefile
generated
vendored
Normal file
44
vendor/github.com/pkg/errors/Makefile
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
PKGS := github.com/pkg/errors
|
||||||
|
SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
|
||||||
|
GO := go
|
||||||
|
|
||||||
|
check: test vet gofmt misspell unconvert staticcheck ineffassign unparam
|
||||||
|
|
||||||
|
test:
|
||||||
|
$(GO) test $(PKGS)
|
||||||
|
|
||||||
|
vet: | test
|
||||||
|
$(GO) vet $(PKGS)
|
||||||
|
|
||||||
|
staticcheck:
|
||||||
|
$(GO) get honnef.co/go/tools/cmd/staticcheck
|
||||||
|
staticcheck -checks all $(PKGS)
|
||||||
|
|
||||||
|
misspell:
|
||||||
|
$(GO) get github.com/client9/misspell/cmd/misspell
|
||||||
|
misspell \
|
||||||
|
-locale GB \
|
||||||
|
-error \
|
||||||
|
*.md *.go
|
||||||
|
|
||||||
|
unconvert:
|
||||||
|
$(GO) get github.com/mdempsky/unconvert
|
||||||
|
unconvert -v $(PKGS)
|
||||||
|
|
||||||
|
ineffassign:
|
||||||
|
$(GO) get github.com/gordonklaus/ineffassign
|
||||||
|
find $(SRCDIRS) -name '*.go' | xargs ineffassign
|
||||||
|
|
||||||
|
pedantic: check errcheck
|
||||||
|
|
||||||
|
unparam:
|
||||||
|
$(GO) get mvdan.cc/unparam
|
||||||
|
unparam ./...
|
||||||
|
|
||||||
|
errcheck:
|
||||||
|
$(GO) get github.com/kisielk/errcheck
|
||||||
|
errcheck $(PKGS)
|
||||||
|
|
||||||
|
gofmt:
|
||||||
|
@echo Checking code is gofmted
|
||||||
|
@test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"
|
11
vendor/github.com/pkg/errors/README.md
generated
vendored
11
vendor/github.com/pkg/errors/README.md
generated
vendored
@ -41,11 +41,18 @@ default:
|
|||||||
|
|
||||||
[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
|
[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows:
|
||||||
|
|
||||||
|
- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible)
|
||||||
|
- 1.0. Final release.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high.
|
Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports.
|
||||||
|
|
||||||
Before proposing a change, please discuss your change by raising an issue.
|
Before sending a PR, please discuss your change by raising an issue.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
8
vendor/github.com/pkg/errors/errors.go
generated
vendored
8
vendor/github.com/pkg/errors/errors.go
generated
vendored
@ -82,7 +82,7 @@
|
|||||||
//
|
//
|
||||||
// if err, ok := err.(stackTracer); ok {
|
// if err, ok := err.(stackTracer); ok {
|
||||||
// for _, f := range err.StackTrace() {
|
// for _, f := range err.StackTrace() {
|
||||||
// fmt.Printf("%+s:%d", f)
|
// fmt.Printf("%+s:%d\n", f, f)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -159,6 +159,9 @@ type withStack struct {
|
|||||||
|
|
||||||
func (w *withStack) Cause() error { return w.error }
|
func (w *withStack) Cause() error { return w.error }
|
||||||
|
|
||||||
|
// Unwrap provides compatibility for Go 1.13 error chains.
|
||||||
|
func (w *withStack) Unwrap() error { return w.error }
|
||||||
|
|
||||||
func (w *withStack) Format(s fmt.State, verb rune) {
|
func (w *withStack) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 'v':
|
case 'v':
|
||||||
@ -241,6 +244,9 @@ type withMessage struct {
|
|||||||
func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
|
func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
|
||||||
func (w *withMessage) Cause() error { return w.cause }
|
func (w *withMessage) Cause() error { return w.cause }
|
||||||
|
|
||||||
|
// Unwrap provides compatibility for Go 1.13 error chains.
|
||||||
|
func (w *withMessage) Unwrap() error { return w.cause }
|
||||||
|
|
||||||
func (w *withMessage) Format(s fmt.State, verb rune) {
|
func (w *withMessage) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 'v':
|
case 'v':
|
||||||
|
38
vendor/github.com/pkg/errors/go113.go
generated
vendored
Normal file
38
vendor/github.com/pkg/errors/go113.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// +build go1.13
|
||||||
|
|
||||||
|
package errors
|
||||||
|
|
||||||
|
import (
|
||||||
|
stderrors "errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Is reports whether any error in err's chain matches target.
|
||||||
|
//
|
||||||
|
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||||
|
// repeatedly calling Unwrap.
|
||||||
|
//
|
||||||
|
// An error is considered to match a target if it is equal to that target or if
|
||||||
|
// it implements a method Is(error) bool such that Is(target) returns true.
|
||||||
|
func Is(err, target error) bool { return stderrors.Is(err, target) }
|
||||||
|
|
||||||
|
// As finds the first error in err's chain that matches target, and if so, sets
|
||||||
|
// target to that error value and returns true.
|
||||||
|
//
|
||||||
|
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||||
|
// repeatedly calling Unwrap.
|
||||||
|
//
|
||||||
|
// An error matches target if the error's concrete value is assignable to the value
|
||||||
|
// pointed to by target, or if the error has a method As(interface{}) bool such that
|
||||||
|
// As(target) returns true. In the latter case, the As method is responsible for
|
||||||
|
// setting target.
|
||||||
|
//
|
||||||
|
// As will panic if target is not a non-nil pointer to either a type that implements
|
||||||
|
// error, or to any interface type. As returns false if err is nil.
|
||||||
|
func As(err error, target interface{}) bool { return stderrors.As(err, target) }
|
||||||
|
|
||||||
|
// Unwrap returns the result of calling the Unwrap method on err, if err's
|
||||||
|
// type contains an Unwrap method returning error.
|
||||||
|
// Otherwise, Unwrap returns nil.
|
||||||
|
func Unwrap(err error) error {
|
||||||
|
return stderrors.Unwrap(err)
|
||||||
|
}
|
58
vendor/github.com/pkg/errors/stack.go
generated
vendored
58
vendor/github.com/pkg/errors/stack.go
generated
vendored
@ -5,10 +5,13 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Frame represents a program counter inside a stack frame.
|
// Frame represents a program counter inside a stack frame.
|
||||||
|
// For historical reasons if Frame is interpreted as a uintptr
|
||||||
|
// its value represents the program counter + 1.
|
||||||
type Frame uintptr
|
type Frame uintptr
|
||||||
|
|
||||||
// pc returns the program counter for this frame;
|
// pc returns the program counter for this frame;
|
||||||
@ -37,6 +40,15 @@ func (f Frame) line() int {
|
|||||||
return line
|
return line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// name returns the name of this function, if known.
|
||||||
|
func (f Frame) name() string {
|
||||||
|
fn := runtime.FuncForPC(f.pc())
|
||||||
|
if fn == nil {
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
return fn.Name()
|
||||||
|
}
|
||||||
|
|
||||||
// Format formats the frame according to the fmt.Formatter interface.
|
// Format formats the frame according to the fmt.Formatter interface.
|
||||||
//
|
//
|
||||||
// %s source file
|
// %s source file
|
||||||
@ -54,22 +66,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
|||||||
case 's':
|
case 's':
|
||||||
switch {
|
switch {
|
||||||
case s.Flag('+'):
|
case s.Flag('+'):
|
||||||
pc := f.pc()
|
io.WriteString(s, f.name())
|
||||||
fn := runtime.FuncForPC(pc)
|
io.WriteString(s, "\n\t")
|
||||||
if fn == nil {
|
io.WriteString(s, f.file())
|
||||||
io.WriteString(s, "unknown")
|
|
||||||
} else {
|
|
||||||
file, _ := fn.FileLine(pc)
|
|
||||||
fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
io.WriteString(s, path.Base(f.file()))
|
io.WriteString(s, path.Base(f.file()))
|
||||||
}
|
}
|
||||||
case 'd':
|
case 'd':
|
||||||
fmt.Fprintf(s, "%d", f.line())
|
io.WriteString(s, strconv.Itoa(f.line()))
|
||||||
case 'n':
|
case 'n':
|
||||||
name := runtime.FuncForPC(f.pc()).Name()
|
io.WriteString(s, funcname(f.name()))
|
||||||
io.WriteString(s, funcname(name))
|
|
||||||
case 'v':
|
case 'v':
|
||||||
f.Format(s, 's')
|
f.Format(s, 's')
|
||||||
io.WriteString(s, ":")
|
io.WriteString(s, ":")
|
||||||
@ -77,6 +83,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalText formats a stacktrace Frame as a text string. The output is the
|
||||||
|
// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
|
||||||
|
func (f Frame) MarshalText() ([]byte, error) {
|
||||||
|
name := f.name()
|
||||||
|
if name == "unknown" {
|
||||||
|
return []byte(name), nil
|
||||||
|
}
|
||||||
|
return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
|
||||||
|
}
|
||||||
|
|
||||||
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
||||||
type StackTrace []Frame
|
type StackTrace []Frame
|
||||||
|
|
||||||
@ -94,18 +110,32 @@ func (st StackTrace) Format(s fmt.State, verb rune) {
|
|||||||
switch {
|
switch {
|
||||||
case s.Flag('+'):
|
case s.Flag('+'):
|
||||||
for _, f := range st {
|
for _, f := range st {
|
||||||
fmt.Fprintf(s, "\n%+v", f)
|
io.WriteString(s, "\n")
|
||||||
|
f.Format(s, verb)
|
||||||
}
|
}
|
||||||
case s.Flag('#'):
|
case s.Flag('#'):
|
||||||
fmt.Fprintf(s, "%#v", []Frame(st))
|
fmt.Fprintf(s, "%#v", []Frame(st))
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(s, "%v", []Frame(st))
|
st.formatSlice(s, verb)
|
||||||
}
|
}
|
||||||
case 's':
|
case 's':
|
||||||
fmt.Fprintf(s, "%s", []Frame(st))
|
st.formatSlice(s, verb)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// formatSlice will format this StackTrace into the given buffer as a slice of
|
||||||
|
// Frame, only valid when called with '%s' or '%v'.
|
||||||
|
func (st StackTrace) formatSlice(s fmt.State, verb rune) {
|
||||||
|
io.WriteString(s, "[")
|
||||||
|
for i, f := range st {
|
||||||
|
if i > 0 {
|
||||||
|
io.WriteString(s, " ")
|
||||||
|
}
|
||||||
|
f.Format(s, verb)
|
||||||
|
}
|
||||||
|
io.WriteString(s, "]")
|
||||||
|
}
|
||||||
|
|
||||||
// stack represents a stack of program counters.
|
// stack represents a stack of program counters.
|
||||||
type stack []uintptr
|
type stack []uintptr
|
||||||
|
|
||||||
|
40
vendor/github.com/sirupsen/logrus/.golangci.yml
generated
vendored
Normal file
40
vendor/github.com/sirupsen/logrus/.golangci.yml
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
run:
|
||||||
|
# do not run on test files yet
|
||||||
|
tests: false
|
||||||
|
|
||||||
|
# all available settings of specific linters
|
||||||
|
linters-settings:
|
||||||
|
errcheck:
|
||||||
|
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
|
||||||
|
# default is false: such cases aren't reported by default.
|
||||||
|
check-type-assertions: false
|
||||||
|
|
||||||
|
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
|
||||||
|
# default is false: such cases aren't reported by default.
|
||||||
|
check-blank: false
|
||||||
|
|
||||||
|
lll:
|
||||||
|
line-length: 100
|
||||||
|
tab-width: 4
|
||||||
|
|
||||||
|
prealloc:
|
||||||
|
simple: false
|
||||||
|
range-loops: false
|
||||||
|
for-loops: false
|
||||||
|
|
||||||
|
whitespace:
|
||||||
|
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
|
||||||
|
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- megacheck
|
||||||
|
- govet
|
||||||
|
disable:
|
||||||
|
- maligned
|
||||||
|
- prealloc
|
||||||
|
disable-all: false
|
||||||
|
presets:
|
||||||
|
- bugs
|
||||||
|
- unused
|
||||||
|
fast: false
|
14
vendor/github.com/sirupsen/logrus/.travis.yml
generated
vendored
14
vendor/github.com/sirupsen/logrus/.travis.yml
generated
vendored
@ -4,17 +4,13 @@ git:
|
|||||||
depth: 1
|
depth: 1
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=on
|
- GO111MODULE=on
|
||||||
- GO111MODULE=off
|
go: [1.13.x, 1.14.x]
|
||||||
go: [ 1.10.x, 1.11.x, 1.12.x ]
|
os: [linux, osx]
|
||||||
os: [ linux, osx, windows ]
|
|
||||||
matrix:
|
|
||||||
exclude:
|
|
||||||
- env: GO111MODULE=on
|
|
||||||
go: 1.10.x
|
|
||||||
install:
|
install:
|
||||||
- if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi
|
- ./travis/install.sh
|
||||||
- if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi
|
|
||||||
script:
|
script:
|
||||||
|
- ./travis/cross_build.sh
|
||||||
|
- ./travis/lint.sh
|
||||||
- export GOMAXPROCS=4
|
- export GOMAXPROCS=4
|
||||||
- export GORACE=halt_on_error=1
|
- export GORACE=halt_on_error=1
|
||||||
- go test -race -v ./...
|
- go test -race -v ./...
|
||||||
|
29
vendor/github.com/sirupsen/logrus/CHANGELOG.md
generated
vendored
29
vendor/github.com/sirupsen/logrus/CHANGELOG.md
generated
vendored
@ -1,7 +1,32 @@
|
|||||||
|
# 1.6.0
|
||||||
|
Fixes:
|
||||||
|
* end of line cleanup
|
||||||
|
* revert the entry concurrency bug fix whic leads to deadlock under some circumstances
|
||||||
|
* update dependency on go-windows-terminal-sequences to fix a crash with go 1.14
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* add an option to the `TextFormatter` to completely disable fields quoting
|
||||||
|
|
||||||
|
# 1.5.0
|
||||||
|
Code quality:
|
||||||
|
* add golangci linter run on travis
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
* add mutex for hooks concurrent access on `Entry` data
|
||||||
|
* caller function field for go1.14
|
||||||
|
* fix build issue for gopherjs target
|
||||||
|
|
||||||
|
Feature:
|
||||||
|
* add an hooks/writer sub-package whose goal is to split output on different stream depending on the trace level
|
||||||
|
* add a `DisableHTMLEscape` option in the `JSONFormatter`
|
||||||
|
* add `ForceQuote` and `PadLevelText` options in the `TextFormatter`
|
||||||
|
|
||||||
|
# 1.4.2
|
||||||
|
* Fixes build break for plan9, nacl, solaris
|
||||||
# 1.4.1
|
# 1.4.1
|
||||||
This new release introduces:
|
This new release introduces:
|
||||||
* Enhance TextFormatter to not print caller information when they are empty (#944)
|
* Enhance TextFormatter to not print caller information when they are empty (#944)
|
||||||
* Remove dependency on golang.org/x/crypto (#932, #943)
|
* Remove dependency on golang.org/x/crypto (#932, #943)
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
* Fix Entry.WithContext method to return a copy of the initial entry (#941)
|
* Fix Entry.WithContext method to return a copy of the initial entry (#941)
|
||||||
@ -9,7 +34,7 @@ Fixes:
|
|||||||
# 1.4.0
|
# 1.4.0
|
||||||
This new release introduces:
|
This new release introduces:
|
||||||
* Add `DeferExitHandler`, similar to `RegisterExitHandler` but prepending the handler to the list of handlers (semantically like `defer`) (#848).
|
* Add `DeferExitHandler`, similar to `RegisterExitHandler` but prepending the handler to the list of handlers (semantically like `defer`) (#848).
|
||||||
* Add `CallerPrettyfier` to `JSONFormatter` and `TextFormatter (#909, #911)
|
* Add `CallerPrettyfier` to `JSONFormatter` and `TextFormatter` (#909, #911)
|
||||||
* Add `Entry.WithContext()` and `Entry.Context`, to set a context on entries to be used e.g. in hooks (#919).
|
* Add `Entry.WithContext()` and `Entry.Context`, to set a context on entries to be used e.g. in hooks (#919).
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
|
44
vendor/github.com/sirupsen/logrus/README.md
generated
vendored
44
vendor/github.com/sirupsen/logrus/README.md
generated
vendored
@ -1,8 +1,28 @@
|
|||||||
# Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/> [](https://travis-ci.org/sirupsen/logrus) [](https://godoc.org/github.com/sirupsen/logrus)
|
# Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/> [](https://travis-ci.org/sirupsen/logrus) [](https://godoc.org/github.com/sirupsen/logrus)
|
||||||
|
|
||||||
Logrus is a structured logger for Go (golang), completely API compatible with
|
Logrus is a structured logger for Go (golang), completely API compatible with
|
||||||
the standard library logger.
|
the standard library logger.
|
||||||
|
|
||||||
|
**Logrus is in maintenance-mode.** We will not be introducing new features. It's
|
||||||
|
simply too hard to do in a way that won't break many people's projects, which is
|
||||||
|
the last thing you want from your Logging library (again...).
|
||||||
|
|
||||||
|
This does not mean Logrus is dead. Logrus will continue to be maintained for
|
||||||
|
security, (backwards compatible) bug fixes, and performance (where we are
|
||||||
|
limited by the interface).
|
||||||
|
|
||||||
|
I believe Logrus' biggest contribution is to have played a part in today's
|
||||||
|
widespread use of structured logging in Golang. There doesn't seem to be a
|
||||||
|
reason to do a major, breaking iteration into Logrus V2, since the fantastic Go
|
||||||
|
community has built those independently. Many fantastic alternatives have sprung
|
||||||
|
up. Logrus would look like those, had it been re-designed with what we know
|
||||||
|
about structured logging in Go today. Check out, for example,
|
||||||
|
[Zerolog][zerolog], [Zap][zap], and [Apex][apex].
|
||||||
|
|
||||||
|
[zerolog]: https://github.com/rs/zerolog
|
||||||
|
[zap]: https://github.com/uber-go/zap
|
||||||
|
[apex]: https://github.com/apex/log
|
||||||
|
|
||||||
**Seeing weird case-sensitive problems?** It's in the past been possible to
|
**Seeing weird case-sensitive problems?** It's in the past been possible to
|
||||||
import Logrus as both upper- and lower-case. Due to the Go package environment,
|
import Logrus as both upper- and lower-case. Due to the Go package environment,
|
||||||
this caused issues in the community and we needed a standard. Some environments
|
this caused issues in the community and we needed a standard. Some environments
|
||||||
@ -15,11 +35,6 @@ comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437).
|
|||||||
For an in-depth explanation of the casing issue, see [this
|
For an in-depth explanation of the casing issue, see [this
|
||||||
comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).
|
comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).
|
||||||
|
|
||||||
**Are you interested in assisting in maintaining Logrus?** Currently I have a
|
|
||||||
lot of obligations, and I am unable to provide Logrus with the maintainership it
|
|
||||||
needs. If you'd like to help, please reach out to me at `simon at author's
|
|
||||||
username dot com`.
|
|
||||||
|
|
||||||
Nicely color-coded in development (when a TTY is attached, otherwise just
|
Nicely color-coded in development (when a TTY is attached, otherwise just
|
||||||
plain text):
|
plain text):
|
||||||
|
|
||||||
@ -187,7 +202,7 @@ func main() {
|
|||||||
log.Out = os.Stdout
|
log.Out = os.Stdout
|
||||||
|
|
||||||
// You could set this to any `io.Writer` such as a file
|
// You could set this to any `io.Writer` such as a file
|
||||||
// file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666)
|
// file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
||||||
// if err == nil {
|
// if err == nil {
|
||||||
// log.Out = file
|
// log.Out = file
|
||||||
// } else {
|
// } else {
|
||||||
@ -272,7 +287,7 @@ func init() {
|
|||||||
```
|
```
|
||||||
Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
|
Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
|
||||||
|
|
||||||
A list of currently known of service hook can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks)
|
A list of currently known service hooks can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks)
|
||||||
|
|
||||||
|
|
||||||
#### Level logging
|
#### Level logging
|
||||||
@ -354,6 +369,7 @@ The built-in logging formatters are:
|
|||||||
[github.com/mattn/go-colorable](https://github.com/mattn/go-colorable).
|
[github.com/mattn/go-colorable](https://github.com/mattn/go-colorable).
|
||||||
* When colors are enabled, levels are truncated to 4 characters by default. To disable
|
* When colors are enabled, levels are truncated to 4 characters by default. To disable
|
||||||
truncation set the `DisableLevelTruncation` field to `true`.
|
truncation set the `DisableLevelTruncation` field to `true`.
|
||||||
|
* When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text.
|
||||||
* All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter).
|
* All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter).
|
||||||
* `logrus.JSONFormatter`. Logs fields as JSON.
|
* `logrus.JSONFormatter`. Logs fields as JSON.
|
||||||
* All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter).
|
* All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter).
|
||||||
@ -364,8 +380,10 @@ Third party logging formatters:
|
|||||||
* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html).
|
* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html).
|
||||||
* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events.
|
* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events.
|
||||||
* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout.
|
* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout.
|
||||||
* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦.
|
* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the Power of Zalgo.
|
||||||
* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure.
|
* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure.
|
||||||
|
* [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Sava log to files.
|
||||||
|
* [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added.
|
||||||
|
|
||||||
You can define your formatter by implementing the `Formatter` interface,
|
You can define your formatter by implementing the `Formatter` interface,
|
||||||
requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a
|
requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a
|
||||||
@ -430,14 +448,14 @@ entries. It should not be a feature of the application-level logger.
|
|||||||
|
|
||||||
| Tool | Description |
|
| Tool | Description |
|
||||||
| ---- | ----------- |
|
| ---- | ----------- |
|
||||||
|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.|
|
|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will be generated with different configs in different environments.|
|
||||||
|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) |
|
|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) |
|
||||||
|
|
||||||
#### Testing
|
#### Testing
|
||||||
|
|
||||||
Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides:
|
Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides:
|
||||||
|
|
||||||
* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook
|
* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just adds the `test` hook
|
||||||
* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any):
|
* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any):
|
||||||
|
|
||||||
```go
|
```go
|
||||||
@ -465,7 +483,7 @@ func TestSomething(t*testing.T){
|
|||||||
|
|
||||||
Logrus can register one or more functions that will be called when any `fatal`
|
Logrus can register one or more functions that will be called when any `fatal`
|
||||||
level message is logged. The registered handlers will be executed before
|
level message is logged. The registered handlers will be executed before
|
||||||
logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need
|
logrus performs an `os.Exit(1)`. This behavior may be helpful if callers need
|
||||||
to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted.
|
to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted.
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -490,6 +508,6 @@ Situation when locking is not needed includes:
|
|||||||
|
|
||||||
1) logger.Out is protected by locks.
|
1) logger.Out is protected by locks.
|
||||||
|
|
||||||
2) logger.Out is a os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allow multi-thread/multi-process writing)
|
2) logger.Out is an os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allows multi-thread/multi-process writing)
|
||||||
|
|
||||||
(Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/)
|
(Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/)
|
||||||
|
28
vendor/github.com/sirupsen/logrus/appveyor.yml
generated
vendored
28
vendor/github.com/sirupsen/logrus/appveyor.yml
generated
vendored
@ -1,14 +1,14 @@
|
|||||||
version: "{build}"
|
version: "{build}"
|
||||||
platform: x64
|
platform: x64
|
||||||
clone_folder: c:\gopath\src\github.com\sirupsen\logrus
|
clone_folder: c:\gopath\src\github.com\sirupsen\logrus
|
||||||
environment:
|
environment:
|
||||||
GOPATH: c:\gopath
|
GOPATH: c:\gopath
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
install:
|
install:
|
||||||
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
||||||
- go version
|
- go version
|
||||||
build_script:
|
build_script:
|
||||||
- go get -t
|
- go get -t
|
||||||
- go test
|
- go test
|
||||||
|
47
vendor/github.com/sirupsen/logrus/entry.go
generated
vendored
47
vendor/github.com/sirupsen/logrus/entry.go
generated
vendored
@ -85,10 +85,15 @@ func NewEntry(logger *Logger) *Entry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the bytes representation of this entry from the formatter.
|
||||||
|
func (entry *Entry) Bytes() ([]byte, error) {
|
||||||
|
return entry.Logger.Formatter.Format(entry)
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the string representation from the reader and ultimately the
|
// Returns the string representation from the reader and ultimately the
|
||||||
// formatter.
|
// formatter.
|
||||||
func (entry *Entry) String() (string, error) {
|
func (entry *Entry) String() (string, error) {
|
||||||
serialized, err := entry.Logger.Formatter.Format(entry)
|
serialized, err := entry.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -103,7 +108,11 @@ func (entry *Entry) WithError(err error) *Entry {
|
|||||||
|
|
||||||
// Add a context to the Entry.
|
// Add a context to the Entry.
|
||||||
func (entry *Entry) WithContext(ctx context.Context) *Entry {
|
func (entry *Entry) WithContext(ctx context.Context) *Entry {
|
||||||
return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx}
|
dataCopy := make(Fields, len(entry.Data))
|
||||||
|
for k, v := range entry.Data {
|
||||||
|
dataCopy[k] = v
|
||||||
|
}
|
||||||
|
return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a single field to the Entry.
|
// Add a single field to the Entry.
|
||||||
@ -144,7 +153,11 @@ func (entry *Entry) WithFields(fields Fields) *Entry {
|
|||||||
|
|
||||||
// Overrides the time of the Entry.
|
// Overrides the time of the Entry.
|
||||||
func (entry *Entry) WithTime(t time.Time) *Entry {
|
func (entry *Entry) WithTime(t time.Time) *Entry {
|
||||||
return &Entry{Logger: entry.Logger, Data: entry.Data, Time: t, err: entry.err, Context: entry.Context}
|
dataCopy := make(Fields, len(entry.Data))
|
||||||
|
for k, v := range entry.Data {
|
||||||
|
dataCopy[k] = v
|
||||||
|
}
|
||||||
|
return &Entry{Logger: entry.Logger, Data: dataCopy, Time: t, err: entry.err, Context: entry.Context}
|
||||||
}
|
}
|
||||||
|
|
||||||
// getPackageName reduces a fully qualified function name to the package name
|
// getPackageName reduces a fully qualified function name to the package name
|
||||||
@ -165,15 +178,20 @@ func getPackageName(f string) string {
|
|||||||
|
|
||||||
// getCaller retrieves the name of the first non-logrus calling function
|
// getCaller retrieves the name of the first non-logrus calling function
|
||||||
func getCaller() *runtime.Frame {
|
func getCaller() *runtime.Frame {
|
||||||
|
|
||||||
// cache this package's fully-qualified name
|
// cache this package's fully-qualified name
|
||||||
callerInitOnce.Do(func() {
|
callerInitOnce.Do(func() {
|
||||||
pcs := make([]uintptr, 2)
|
pcs := make([]uintptr, maximumCallerDepth)
|
||||||
_ = runtime.Callers(0, pcs)
|
_ = runtime.Callers(0, pcs)
|
||||||
logrusPackage = getPackageName(runtime.FuncForPC(pcs[1]).Name())
|
|
||||||
|
|
||||||
// now that we have the cache, we can skip a minimum count of known-logrus functions
|
// dynamic get the package name and the minimum caller depth
|
||||||
// XXX this is dubious, the number of frames may vary
|
for i := 0; i < maximumCallerDepth; i++ {
|
||||||
|
funcName := runtime.FuncForPC(pcs[i]).Name()
|
||||||
|
if strings.Contains(funcName, "getCaller") {
|
||||||
|
logrusPackage = getPackageName(funcName)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
minimumCallerDepth = knownLogrusFrames
|
minimumCallerDepth = knownLogrusFrames
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -187,7 +205,7 @@ func getCaller() *runtime.Frame {
|
|||||||
|
|
||||||
// If the caller isn't part of this package, we're done
|
// If the caller isn't part of this package, we're done
|
||||||
if pkg != logrusPackage {
|
if pkg != logrusPackage {
|
||||||
return &f
|
return &f //nolint:scopelint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,9 +235,11 @@ func (entry Entry) log(level Level, msg string) {
|
|||||||
|
|
||||||
entry.Level = level
|
entry.Level = level
|
||||||
entry.Message = msg
|
entry.Message = msg
|
||||||
|
entry.Logger.mu.Lock()
|
||||||
if entry.Logger.ReportCaller {
|
if entry.Logger.ReportCaller {
|
||||||
entry.Caller = getCaller()
|
entry.Caller = getCaller()
|
||||||
}
|
}
|
||||||
|
entry.Logger.mu.Unlock()
|
||||||
|
|
||||||
entry.fireHooks()
|
entry.fireHooks()
|
||||||
|
|
||||||
@ -255,11 +275,10 @@ func (entry *Entry) write() {
|
|||||||
serialized, err := entry.Logger.Formatter.Format(entry)
|
serialized, err := entry.Logger.Formatter.Format(entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
|
||||||
} else {
|
return
|
||||||
_, err = entry.Logger.Out.Write(serialized)
|
}
|
||||||
if err != nil {
|
if _, err = entry.Logger.Out.Write(serialized); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vendor/github.com/sirupsen/logrus/exported.go
generated
vendored
2
vendor/github.com/sirupsen/logrus/exported.go
generated
vendored
@ -80,7 +80,7 @@ func WithFields(fields Fields) *Entry {
|
|||||||
return std.WithFields(fields)
|
return std.WithFields(fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTime creats an entry from the standard logger and overrides the time of
|
// WithTime creates an entry from the standard logger and overrides the time of
|
||||||
// logs generated with it.
|
// logs generated with it.
|
||||||
//
|
//
|
||||||
// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
|
// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
|
||||||
|
7
vendor/github.com/sirupsen/logrus/go.mod
generated
vendored
7
vendor/github.com/sirupsen/logrus/go.mod
generated
vendored
@ -2,9 +2,10 @@ module github.com/sirupsen/logrus
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/stretchr/objx v0.1.1 // indirect
|
|
||||||
github.com/stretchr/testify v1.2.2
|
github.com/stretchr/testify v1.2.2
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894
|
||||||
)
|
)
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
11
vendor/github.com/sirupsen/logrus/go.sum
generated
vendored
11
vendor/github.com/sirupsen/logrus/go.sum
generated
vendored
@ -1,13 +1,12 @@
|
|||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
||||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
4
vendor/github.com/sirupsen/logrus/json_formatter.go
generated
vendored
4
vendor/github.com/sirupsen/logrus/json_formatter.go
generated
vendored
@ -28,6 +28,9 @@ type JSONFormatter struct {
|
|||||||
// DisableTimestamp allows disabling automatic timestamps in output
|
// DisableTimestamp allows disabling automatic timestamps in output
|
||||||
DisableTimestamp bool
|
DisableTimestamp bool
|
||||||
|
|
||||||
|
// DisableHTMLEscape allows disabling html escaping in output
|
||||||
|
DisableHTMLEscape bool
|
||||||
|
|
||||||
// DataKey allows users to put all the log entry parameters into a nested dictionary at a given key.
|
// DataKey allows users to put all the log entry parameters into a nested dictionary at a given key.
|
||||||
DataKey string
|
DataKey string
|
||||||
|
|
||||||
@ -110,6 +113,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
encoder := json.NewEncoder(b)
|
encoder := json.NewEncoder(b)
|
||||||
|
encoder.SetEscapeHTML(!f.DisableHTMLEscape)
|
||||||
if f.PrettyPrint {
|
if f.PrettyPrint {
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
}
|
}
|
||||||
|
11
vendor/github.com/sirupsen/logrus/logger.go
generated
vendored
11
vendor/github.com/sirupsen/logrus/logger.go
generated
vendored
@ -68,10 +68,10 @@ func (mw *MutexWrap) Disable() {
|
|||||||
// `Out` and `Hooks` directly on the default logger instance. You can also just
|
// `Out` and `Hooks` directly on the default logger instance. You can also just
|
||||||
// instantiate your own:
|
// instantiate your own:
|
||||||
//
|
//
|
||||||
// var log = &Logger{
|
// var log = &logrus.Logger{
|
||||||
// Out: os.Stderr,
|
// Out: os.Stderr,
|
||||||
// Formatter: new(JSONFormatter),
|
// Formatter: new(logrus.JSONFormatter),
|
||||||
// Hooks: make(LevelHooks),
|
// Hooks: make(logrus.LevelHooks),
|
||||||
// Level: logrus.DebugLevel,
|
// Level: logrus.DebugLevel,
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -100,8 +100,9 @@ func (logger *Logger) releaseEntry(entry *Entry) {
|
|||||||
logger.entryPool.Put(entry)
|
logger.entryPool.Put(entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds a field to the log entry, note that it doesn't log until you call
|
// WithField allocates a new entry and adds a field to it.
|
||||||
// Debug, Print, Info, Warn, Error, Fatal or Panic. It only creates a log entry.
|
// Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to
|
||||||
|
// this new returned entry.
|
||||||
// If you want multiple fields, use `WithFields`.
|
// If you want multiple fields, use `WithFields`.
|
||||||
func (logger *Logger) WithField(key string, value interface{}) *Entry {
|
func (logger *Logger) WithField(key string, value interface{}) *Entry {
|
||||||
entry := logger.newEntry()
|
entry := logger.newEntry()
|
||||||
|
2
vendor/github.com/sirupsen/logrus/logrus.go
generated
vendored
2
vendor/github.com/sirupsen/logrus/logrus.go
generated
vendored
@ -51,7 +51,7 @@ func (level *Level) UnmarshalText(text []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
*level = Level(l)
|
*level = l
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
generated
vendored
2
vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
generated
vendored
@ -1,4 +1,5 @@
|
|||||||
// +build darwin dragonfly freebsd netbsd openbsd
|
// +build darwin dragonfly freebsd netbsd openbsd
|
||||||
|
// +build !js
|
||||||
|
|
||||||
package logrus
|
package logrus
|
||||||
|
|
||||||
@ -10,4 +11,3 @@ func isTerminal(fd int) bool {
|
|||||||
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
vendor/github.com/sirupsen/logrus/terminal_check_js.go
generated
vendored
6
vendor/github.com/sirupsen/logrus/terminal_check_js.go
generated
vendored
@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
package logrus
|
package logrus
|
||||||
|
|
||||||
import (
|
func isTerminal(fd int) bool {
|
||||||
"io"
|
|
||||||
)
|
|
||||||
|
|
||||||
func checkIfTerminal(w io.Writer) bool {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
11
vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go
generated
vendored
Normal file
11
vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build js nacl plan9
|
||||||
|
|
||||||
|
package logrus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
)
|
||||||
|
|
||||||
|
func checkIfTerminal(w io.Writer) bool {
|
||||||
|
return false
|
||||||
|
}
|
2
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go
generated
vendored
2
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// +build !appengine,!js,!windows
|
// +build !appengine,!js,!windows,!nacl,!plan9
|
||||||
|
|
||||||
package logrus
|
package logrus
|
||||||
|
|
||||||
|
11
vendor/github.com/sirupsen/logrus/terminal_check_solaris.go
generated
vendored
Normal file
11
vendor/github.com/sirupsen/logrus/terminal_check_solaris.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package logrus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||||
|
func isTerminal(fd int) bool {
|
||||||
|
_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
|
||||||
|
return err == nil
|
||||||
|
}
|
2
vendor/github.com/sirupsen/logrus/terminal_check_unix.go
generated
vendored
2
vendor/github.com/sirupsen/logrus/terminal_check_unix.go
generated
vendored
@ -1,4 +1,5 @@
|
|||||||
// +build linux aix
|
// +build linux aix
|
||||||
|
// +build !js
|
||||||
|
|
||||||
package logrus
|
package logrus
|
||||||
|
|
||||||
@ -10,4 +11,3 @@ func isTerminal(fd int) bool {
|
|||||||
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
18
vendor/github.com/sirupsen/logrus/terminal_check_windows.go
generated
vendored
18
vendor/github.com/sirupsen/logrus/terminal_check_windows.go
generated
vendored
@ -6,15 +6,29 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
sequences "github.com/konsorten/go-windows-terminal-sequences"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func initTerminal(w io.Writer) {
|
||||||
|
switch v := w.(type) {
|
||||||
|
case *os.File:
|
||||||
|
sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func checkIfTerminal(w io.Writer) bool {
|
func checkIfTerminal(w io.Writer) bool {
|
||||||
|
var ret bool
|
||||||
switch v := w.(type) {
|
switch v := w.(type) {
|
||||||
case *os.File:
|
case *os.File:
|
||||||
var mode uint32
|
var mode uint32
|
||||||
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
|
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
|
||||||
return err == nil
|
ret = (err == nil)
|
||||||
default:
|
default:
|
||||||
return false
|
ret = false
|
||||||
}
|
}
|
||||||
|
if ret {
|
||||||
|
initTerminal(w)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
8
vendor/github.com/sirupsen/logrus/terminal_notwindows.go
generated
vendored
8
vendor/github.com/sirupsen/logrus/terminal_notwindows.go
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
// +build !windows
|
|
||||||
|
|
||||||
package logrus
|
|
||||||
|
|
||||||
import "io"
|
|
||||||
|
|
||||||
func initTerminal(w io.Writer) {
|
|
||||||
}
|
|
18
vendor/github.com/sirupsen/logrus/terminal_windows.go
generated
vendored
18
vendor/github.com/sirupsen/logrus/terminal_windows.go
generated
vendored
@ -1,18 +0,0 @@
|
|||||||
// +build !appengine,!js,windows
|
|
||||||
|
|
||||||
package logrus
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"syscall"
|
|
||||||
|
|
||||||
sequences "github.com/konsorten/go-windows-terminal-sequences"
|
|
||||||
)
|
|
||||||
|
|
||||||
func initTerminal(w io.Writer) {
|
|
||||||
switch v := w.(type) {
|
|
||||||
case *os.File:
|
|
||||||
sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
|
|
||||||
}
|
|
||||||
}
|
|
57
vendor/github.com/sirupsen/logrus/text_formatter.go
generated
vendored
57
vendor/github.com/sirupsen/logrus/text_formatter.go
generated
vendored
@ -6,9 +6,11 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -32,6 +34,14 @@ type TextFormatter struct {
|
|||||||
// Force disabling colors.
|
// Force disabling colors.
|
||||||
DisableColors bool
|
DisableColors bool
|
||||||
|
|
||||||
|
// Force quoting of all values
|
||||||
|
ForceQuote bool
|
||||||
|
|
||||||
|
// DisableQuote disables quoting for all values.
|
||||||
|
// DisableQuote will have a lower priority than ForceQuote.
|
||||||
|
// If both of them are set to true, quote will be forced on all values.
|
||||||
|
DisableQuote bool
|
||||||
|
|
||||||
// Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/
|
// Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/
|
||||||
EnvironmentOverrideColors bool
|
EnvironmentOverrideColors bool
|
||||||
|
|
||||||
@ -57,6 +67,10 @@ type TextFormatter struct {
|
|||||||
// Disables the truncation of the level text to 4 characters.
|
// Disables the truncation of the level text to 4 characters.
|
||||||
DisableLevelTruncation bool
|
DisableLevelTruncation bool
|
||||||
|
|
||||||
|
// PadLevelText Adds padding the level text so that all the levels output at the same length
|
||||||
|
// PadLevelText is a superset of the DisableLevelTruncation option
|
||||||
|
PadLevelText bool
|
||||||
|
|
||||||
// QuoteEmptyFields will wrap empty fields in quotes if true
|
// QuoteEmptyFields will wrap empty fields in quotes if true
|
||||||
QuoteEmptyFields bool
|
QuoteEmptyFields bool
|
||||||
|
|
||||||
@ -79,14 +93,20 @@ type TextFormatter struct {
|
|||||||
CallerPrettyfier func(*runtime.Frame) (function string, file string)
|
CallerPrettyfier func(*runtime.Frame) (function string, file string)
|
||||||
|
|
||||||
terminalInitOnce sync.Once
|
terminalInitOnce sync.Once
|
||||||
|
|
||||||
|
// The max length of the level text, generated dynamically on init
|
||||||
|
levelTextMaxLength int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *TextFormatter) init(entry *Entry) {
|
func (f *TextFormatter) init(entry *Entry) {
|
||||||
if entry.Logger != nil {
|
if entry.Logger != nil {
|
||||||
f.isTerminal = checkIfTerminal(entry.Logger.Out)
|
f.isTerminal = checkIfTerminal(entry.Logger.Out)
|
||||||
|
}
|
||||||
if f.isTerminal {
|
// Get the max length of the level text
|
||||||
initTerminal(entry.Logger.Out)
|
for _, level := range AllLevels {
|
||||||
|
levelTextLength := utf8.RuneCount([]byte(level.String()))
|
||||||
|
if levelTextLength > f.levelTextMaxLength {
|
||||||
|
f.levelTextMaxLength = levelTextLength
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,11 +115,10 @@ func (f *TextFormatter) isColored() bool {
|
|||||||
isColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != "windows"))
|
isColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != "windows"))
|
||||||
|
|
||||||
if f.EnvironmentOverrideColors {
|
if f.EnvironmentOverrideColors {
|
||||||
if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok && force != "0" {
|
switch force, ok := os.LookupEnv("CLICOLOR_FORCE"); {
|
||||||
|
case ok && force != "0":
|
||||||
isColored = true
|
isColored = true
|
||||||
} else if ok && force == "0" {
|
case ok && force == "0", os.Getenv("CLICOLOR") == "0":
|
||||||
isColored = false
|
|
||||||
} else if os.Getenv("CLICOLOR") == "0" {
|
|
||||||
isColored = false
|
isColored = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,9 +240,18 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
levelText := strings.ToUpper(entry.Level.String())
|
levelText := strings.ToUpper(entry.Level.String())
|
||||||
if !f.DisableLevelTruncation {
|
if !f.DisableLevelTruncation && !f.PadLevelText {
|
||||||
levelText = levelText[0:4]
|
levelText = levelText[0:4]
|
||||||
}
|
}
|
||||||
|
if f.PadLevelText {
|
||||||
|
// Generates the format string used in the next line, for example "%-6s" or "%-7s".
|
||||||
|
// Based on the max level text length.
|
||||||
|
formatString := "%-" + strconv.Itoa(f.levelTextMaxLength) + "s"
|
||||||
|
// Formats the level text by appending spaces up to the max length, for example:
|
||||||
|
// - "INFO "
|
||||||
|
// - "WARNING"
|
||||||
|
levelText = fmt.Sprintf(formatString, levelText)
|
||||||
|
}
|
||||||
|
|
||||||
// Remove a single newline if it already exists in the message to keep
|
// Remove a single newline if it already exists in the message to keep
|
||||||
// the behavior of logrus text_formatter the same as the stdlib log package
|
// the behavior of logrus text_formatter the same as the stdlib log package
|
||||||
@ -247,11 +275,12 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if f.DisableTimestamp {
|
switch {
|
||||||
|
case f.DisableTimestamp:
|
||||||
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message)
|
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message)
|
||||||
} else if !f.FullTimestamp {
|
case !f.FullTimestamp:
|
||||||
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d]%s %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), caller, entry.Message)
|
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d]%s %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), caller, entry.Message)
|
||||||
} else {
|
default:
|
||||||
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message)
|
fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message)
|
||||||
}
|
}
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
@ -262,9 +291,15 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *TextFormatter) needsQuoting(text string) bool {
|
func (f *TextFormatter) needsQuoting(text string) bool {
|
||||||
|
if f.ForceQuote {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if f.QuoteEmptyFields && len(text) == 0 {
|
if f.QuoteEmptyFields && len(text) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if f.DisableQuote {
|
||||||
|
return false
|
||||||
|
}
|
||||||
for _, ch := range text {
|
for _, ch := range text {
|
||||||
if !((ch >= 'a' && ch <= 'z') ||
|
if !((ch >= 'a' && ch <= 'z') ||
|
||||||
(ch >= 'A' && ch <= 'Z') ||
|
(ch >= 'A' && ch <= 'Z') ||
|
||||||
|
6
vendor/github.com/sirupsen/logrus/writer.go
generated
vendored
6
vendor/github.com/sirupsen/logrus/writer.go
generated
vendored
@ -6,10 +6,16 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Writer at INFO level. See WriterLevel for details.
|
||||||
func (logger *Logger) Writer() *io.PipeWriter {
|
func (logger *Logger) Writer() *io.PipeWriter {
|
||||||
return logger.WriterLevel(InfoLevel)
|
return logger.WriterLevel(InfoLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WriterLevel returns an io.Writer that can be used to write arbitrary text to
|
||||||
|
// the logger at the given log level. Each line written to the writer will be
|
||||||
|
// printed in the usual way using formatters and hooks. The writer is part of an
|
||||||
|
// io.Pipe and it is the callers responsibility to close the writer when done.
|
||||||
|
// This can be used to override the standard library logger easily.
|
||||||
func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
|
func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
|
||||||
return NewEntry(logger).WriterLevel(level)
|
return NewEntry(logger).WriterLevel(level)
|
||||||
}
|
}
|
||||||
|
8
vendor/golang.org/x/sync/semaphore/semaphore.go
generated
vendored
8
vendor/golang.org/x/sync/semaphore/semaphore.go
generated
vendored
@ -32,9 +32,9 @@ type Weighted struct {
|
|||||||
waiters list.List
|
waiters list.List
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acquire acquires the semaphore with a weight of n, blocking only until ctx
|
// Acquire acquires the semaphore with a weight of n, blocking until resources
|
||||||
// is done. On success, returns nil. On failure, returns ctx.Err() and leaves
|
// are available or ctx is done. On success, returns nil. On failure, returns
|
||||||
// the semaphore unchanged.
|
// ctx.Err() and leaves the semaphore unchanged.
|
||||||
//
|
//
|
||||||
// If ctx is already done, Acquire may still succeed without blocking.
|
// If ctx is already done, Acquire may still succeed without blocking.
|
||||||
func (s *Weighted) Acquire(ctx context.Context, n int64) error {
|
func (s *Weighted) Acquire(ctx context.Context, n int64) error {
|
||||||
@ -95,7 +95,7 @@ func (s *Weighted) Release(n int64) {
|
|||||||
s.cur -= n
|
s.cur -= n
|
||||||
if s.cur < 0 {
|
if s.cur < 0 {
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
panic("semaphore: bad release")
|
panic("semaphore: released more than held")
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
next := s.waiters.Front()
|
next := s.waiters.Front()
|
||||||
|
0
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
Executable file → Normal file
0
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
Executable file → Normal file
78
vendor/golang.org/x/sys/unix/mkasm_darwin.go
generated
vendored
78
vendor/golang.org/x/sys/unix/mkasm_darwin.go
generated
vendored
@ -1,78 +0,0 @@
|
|||||||
// Copyright 2018 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go.
|
|
||||||
//This program must be run after mksyscall.go.
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func writeASMFile(in string, fileName string, buildTags string) {
|
|
||||||
trampolines := map[string]bool{}
|
|
||||||
|
|
||||||
var out bytes.Buffer
|
|
||||||
|
|
||||||
fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " "))
|
|
||||||
fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
|
|
||||||
fmt.Fprintf(&out, "\n")
|
|
||||||
fmt.Fprintf(&out, "// +build %s\n", buildTags)
|
|
||||||
fmt.Fprintf(&out, "\n")
|
|
||||||
fmt.Fprintf(&out, "#include \"textflag.h\"\n")
|
|
||||||
for _, line := range strings.Split(in, "\n") {
|
|
||||||
if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
fn := line[5 : len(line)-13]
|
|
||||||
if !trampolines[fn] {
|
|
||||||
trampolines[fn] = true
|
|
||||||
fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn)
|
|
||||||
fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err := ioutil.WriteFile(fileName, out.Bytes(), 0644)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't write %s: %s", fileName, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
in1, err := ioutil.ReadFile("syscall_darwin.go")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't open syscall_darwin.go: %s", err)
|
|
||||||
}
|
|
||||||
arch := os.Args[1]
|
|
||||||
in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
|
|
||||||
}
|
|
||||||
in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
|
|
||||||
}
|
|
||||||
in := string(in1) + string(in2) + string(in3)
|
|
||||||
|
|
||||||
writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.s", arch), "go1.12")
|
|
||||||
|
|
||||||
in1, err = ioutil.ReadFile("syscall_darwin.1_13.go")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't open syscall_darwin.1_13.go: %s", err)
|
|
||||||
}
|
|
||||||
in2, err = ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.1_13.go", arch))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("can't open zsyscall_darwin_%s.1_13.go: %s", arch, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
in = string(in1) + string(in2)
|
|
||||||
|
|
||||||
writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.1_13.s", arch), "go1.13")
|
|
||||||
}
|
|
0
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
Executable file → Normal file
0
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
Executable file → Normal file
127
vendor/golang.org/x/sys/unix/mkpost.go
generated
vendored
127
vendor/golang.org/x/sys/unix/mkpost.go
generated
vendored
@ -1,127 +0,0 @@
|
|||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
// mkpost processes the output of cgo -godefs to
|
|
||||||
// modify the generated types. It is used to clean up
|
|
||||||
// the sys API in an architecture specific manner.
|
|
||||||
//
|
|
||||||
// mkpost is run after cgo -godefs; see README.md.
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"fmt"
|
|
||||||
"go/format"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"regexp"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
// Get the OS and architecture (using GOARCH_TARGET if it exists)
|
|
||||||
goos := os.Getenv("GOOS")
|
|
||||||
goarch := os.Getenv("GOARCH_TARGET")
|
|
||||||
if goarch == "" {
|
|
||||||
goarch = os.Getenv("GOARCH")
|
|
||||||
}
|
|
||||||
// Check that we are using the Docker-based build system if we should be.
|
|
||||||
if goos == "linux" {
|
|
||||||
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
|
|
||||||
os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n")
|
|
||||||
os.Stderr.WriteString("See README.md\n")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(os.Stdin)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if goos == "aix" {
|
|
||||||
// Replace type of Atim, Mtim and Ctim by Timespec in Stat_t
|
|
||||||
// to avoid having both StTimespec and Timespec.
|
|
||||||
sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`)
|
|
||||||
b = sttimespec.ReplaceAll(b, []byte("Timespec"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Intentionally export __val fields in Fsid and Sigset_t
|
|
||||||
valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`)
|
|
||||||
b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}"))
|
|
||||||
|
|
||||||
// Intentionally export __fds_bits field in FdSet
|
|
||||||
fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)
|
|
||||||
b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}"))
|
|
||||||
|
|
||||||
// If we have empty Ptrace structs, we should delete them. Only s390x emits
|
|
||||||
// nonempty Ptrace structs.
|
|
||||||
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
|
|
||||||
b = ptraceRexexp.ReplaceAll(b, nil)
|
|
||||||
|
|
||||||
// Replace the control_regs union with a blank identifier for now.
|
|
||||||
controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
|
|
||||||
b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
|
|
||||||
|
|
||||||
// Remove fields that are added by glibc
|
|
||||||
// Note that this is unstable as the identifers are private.
|
|
||||||
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
|
|
||||||
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
|
||||||
|
|
||||||
// Convert [65]int8 to [65]byte in Utsname members to simplify
|
|
||||||
// conversion to string; see golang.org/issue/20753
|
|
||||||
convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
|
|
||||||
b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
|
||||||
|
|
||||||
// Convert [n]int8 to [n]byte in Statvfs_t members to simplify
|
|
||||||
// conversion to string.
|
|
||||||
convertStatvfsRegex := regexp.MustCompile(`((Fstype|Mnton|Mntfrom)name)(\s+)\[(\d+)\]int8`)
|
|
||||||
b = convertStatvfsRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
|
||||||
|
|
||||||
// Convert [1024]int8 to [1024]byte in Ptmget members
|
|
||||||
convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`)
|
|
||||||
b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte"))
|
|
||||||
|
|
||||||
// Remove spare fields (e.g. in Statx_t)
|
|
||||||
spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
|
|
||||||
b = spareFieldsRegex.ReplaceAll(b, []byte("_"))
|
|
||||||
|
|
||||||
// Remove cgo padding fields
|
|
||||||
removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
|
|
||||||
b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
|
|
||||||
|
|
||||||
// Remove padding, hidden, or unused fields
|
|
||||||
removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`)
|
|
||||||
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
|
||||||
|
|
||||||
// Remove the first line of warning from cgo
|
|
||||||
b = b[bytes.IndexByte(b, '\n')+1:]
|
|
||||||
// Modify the command in the header to include:
|
|
||||||
// mkpost, our own warning, and a build tag.
|
|
||||||
replacement := fmt.Sprintf(`$1 | go run mkpost.go
|
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
|
||||||
|
|
||||||
// +build %s,%s`, goarch, goos)
|
|
||||||
cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
|
|
||||||
b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
|
|
||||||
|
|
||||||
// Rename Stat_t time fields
|
|
||||||
if goos == "freebsd" && goarch == "386" {
|
|
||||||
// Hide Stat_t.[AMCB]tim_ext fields
|
|
||||||
renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`)
|
|
||||||
b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_"))
|
|
||||||
}
|
|
||||||
renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`)
|
|
||||||
b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}"))
|
|
||||||
|
|
||||||
// gofmt
|
|
||||||
b, err = format.Source(b)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Stdout.Write(b)
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user