diff --git a/Gopkg.lock b/Gopkg.lock
deleted file mode 100644
index ec0fabb..0000000
--- a/Gopkg.lock
+++ /dev/null
@@ -1,71 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- digest = "1:0d5fdcd4a963f5486979d53d72c7d784ced34836e3eba766977962c1e630fedd"
- name = "github.com/cenkalti/backoff"
- packages = ["."]
- pruneopts = "UT"
- revision = "b02f2bbce11d7ea6b97f282ef1771b0fe2f65ef3"
-
-[[projects]]
- digest = "1:0a69a1c0db3591fcefb47f115b224592c8dfa4368b7ba9fae509d5e16cdc95c8"
- name = "github.com/konsorten/go-windows-terminal-sequences"
- packages = ["."]
- pruneopts = "UT"
- revision = "5c8c8bd35d3832f5d134ae1e1e375b69a4d25242"
- version = "v1.0.1"
-
-[[projects]]
- digest = "1:69b1cc331fca23d702bd72f860c6a647afd0aa9fcbc1d0659b1365e26546dd70"
- name = "github.com/sirupsen/logrus"
- packages = ["."]
- pruneopts = "UT"
- revision = "bcd833dfe83d3cebad139e4a29ed79cb2318bf95"
- version = "v1.2.0"
-
-[[projects]]
- digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
- name = "github.com/spf13/pflag"
- packages = ["."]
- pruneopts = "UT"
- revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
- version = "v1.0.3"
-
-[[projects]]
- digest = "1:aa7ab4fd27851221e4153921472ef7e3c1b048eaacca8e87c73fb7a094250dd7"
- name = "github.com/zorkian/go-datadog-api"
- packages = ["."]
- pruneopts = "UT"
- revision = "f3f6d2f4859047aae0cac1ce3d16689608480fd9"
- version = "v2.18.0"
-
-[[projects]]
- branch = "master"
- digest = "1:38f553aff0273ad6f367cb0a0f8b6eecbaef8dc6cb8b50e57b6a81c1d5b1e332"
- name = "golang.org/x/crypto"
- packages = ["ssh/terminal"]
- pruneopts = "UT"
- revision = "8d7daa0c54b357f3071e11eaef7efc4e19a417e2"
-
-[[projects]]
- branch = "master"
- digest = "1:191cccd950a4aeadb60306062f2bdc2f924d750d0156ec6c691b17211bfd7349"
- name = "golang.org/x/sys"
- packages = [
- "unix",
- "windows",
- ]
- pruneopts = "UT"
- revision = "82a175fd1598e8a172e58ebdf5ed262bb29129e5"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- input-imports = [
- "github.com/sirupsen/logrus",
- "github.com/spf13/pflag",
- "github.com/zorkian/go-datadog-api",
- ]
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
deleted file mode 100644
index e5b43fc..0000000
--- a/Gopkg.toml
+++ /dev/null
@@ -1,42 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-# name = "github.com/user/project"
-# version = "1.0.0"
-#
-# [[constraint]]
-# name = "github.com/user/project2"
-# branch = "dev"
-# source = "github.com/myfork/project2"
-#
-# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
-#
-# [prune]
-# non-go = false
-# go-tests = true
-# unused-packages = true
-
-
-[[constraint]]
- name = "github.com/sirupsen/logrus"
- version = "1.2.0"
-
-[[constraint]]
- name = "github.com/spf13/pflag"
- version = "1.0.3"
-
-[[constraint]]
- name = "github.com/zorkian/go-datadog-api"
- version = "2.18.0"
-
-[prune]
- go-tests = true
- unused-packages = true
diff --git a/README.md b/README.md
index faed778..a6250ed 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
[](https://travis-ci.org/amnk/dd2tf)
-A simple utility to convert DataDog dashboards and/or monitors to Terraform format.
+A simple utility to convert DataDog dashboards and/or monitors to Terraform format.
Requires `DATADOG_API_KEY` and `DATADOG_APP_KEY` environment variables.
@@ -9,8 +9,8 @@ Useful, if you had all dashboards configured adhoc and now want to follow DevOps
# How to build
Just run (GOPATH and sometimes GOBIN have to be set):
```bash
-dep ensure
-go generate && go build
+cd src
+go build && ./dd2tf
```
# Examples
diff --git a/dashboards.go b/src/dashboards.go
similarity index 78%
rename from dashboards.go
rename to src/dashboards.go
index 325d1c0..fd13af0 100644
--- a/dashboards.go
+++ b/src/dashboards.go
@@ -3,14 +3,16 @@
package main
import (
+ "fmt"
"github.com/zorkian/go-datadog-api"
)
type Dashboard struct {
}
-func (d Dashboard) getElement(client datadog.Client, id int) (interface{}, error) {
- dash, err := client.GetDashboard(*datadog.Int(id))
+func (d Dashboard) getElement(client datadog.Client, id interface{}) (interface{}, error) {
+ idStr := fmt.Sprintf("%v", id)
+ dash, err := client.GetDashboard(idStr)
return dash, err
}
diff --git a/dashboards_test.go b/src/dashboards_test.go
similarity index 100%
rename from dashboards_test.go
rename to src/dashboards_test.go
diff --git a/src/dd2tf b/src/dd2tf
new file mode 100755
index 0000000..0de8c5d
Binary files /dev/null and b/src/dd2tf differ
diff --git a/src/go.mod b/src/go.mod
new file mode 100644
index 0000000..b8bdd70
--- /dev/null
+++ b/src/go.mod
@@ -0,0 +1,8 @@
+module github.com/amnk/dd2tf
+
+require (
+ github.com/cenkalti/backoff v2.2.1+incompatible // indirect
+ github.com/sirupsen/logrus v1.4.2
+ github.com/spf13/pflag v1.0.5
+ github.com/zorkian/go-datadog-api v2.27.0+incompatible
+)
diff --git a/src/go.sum b/src/go.sum
new file mode 100644
index 0000000..4bffc10
--- /dev/null
+++ b/src/go.sum
@@ -0,0 +1,19 @@
+github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
+github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
+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/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+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/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/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/zorkian/go-datadog-api v2.27.0+incompatible h1:n2O5e7F1xu2WuFyMcX1tYbOwkI/BbqanxnHFWa2nUZw=
+github.com/zorkian/go-datadog-api v2.27.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/main.go b/src/main.go
similarity index 95%
rename from main.go
rename to src/main.go
index 374d80a..850c140 100644
--- a/main.go
+++ b/src/main.go
@@ -26,14 +26,14 @@ var config = LocalConfig{
}
type DatadogElement interface {
- getElement(client datadog.Client, i int) (interface{}, error)
+ getElement(client datadog.Client, i interface{}) (interface{}, error)
getAsset() string
getName() string
getAllElements(client datadog.Client) ([]Item, error)
}
type Item struct {
- id int
+ id interface{}
d DatadogElement
}
@@ -60,13 +60,13 @@ func (i *Item) renderElement(item interface{}, config LocalConfig) {
file := fmt.Sprintf("%v-%v.tf", i.d.getName(), i.id)
f, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE, 0755)
if err != nil {
- log.Fatal(err)
+ // log.Fatal(err)
}
out := bufio.NewWriter(f)
t.Execute(out, item)
out.Flush()
if err := f.Close(); err != nil {
- log.Fatal(err)
+ // log.Fatal(err)
}
} else {
t.Execute(os.Stdout, item)
@@ -79,7 +79,7 @@ func escapeCharacters(line string) string {
}
type SecondaryOptions struct {
- ids []int
+ ids []string
files bool
all bool
debug bool
@@ -87,7 +87,7 @@ type SecondaryOptions struct {
func NewSecondaryOptions(cmd *flag.FlagSet) *SecondaryOptions {
options := &SecondaryOptions{}
- cmd.IntSliceVar(&options.ids, "ids", []int{}, "IDs of the elements to fetch.")
+ cmd.StringSliceVar(&options.ids, "ids", []string{}, "IDs of the elements to fetch.")
cmd.BoolVar(&options.all, "all", false, "Export all available elements.")
cmd.BoolVar(&options.files, "files", false, "Save each element into a separate file.")
cmd.BoolVar(&options.debug, "debug", false, "Enable debug output.")
diff --git a/monitors.go b/src/monitors.go
similarity index 80%
rename from monitors.go
rename to src/monitors.go
index 24ff7db..7110fea 100644
--- a/monitors.go
+++ b/src/monitors.go
@@ -9,8 +9,8 @@ import (
type Monitor struct {
}
-func (m Monitor) getElement(client datadog.Client, id int) (interface{}, error) {
- mon, err := client.GetMonitor(id)
+func (m Monitor) getElement(client datadog.Client, id interface{}) (interface{}, error) {
+ mon, err := client.GetMonitor(*datadog.Int(id.(int)))
return mon, err
}
diff --git a/screenboards.go b/src/screenboards.go
similarity index 77%
rename from screenboards.go
rename to src/screenboards.go
index f8f2703..fd7e346 100644
--- a/screenboards.go
+++ b/src/screenboards.go
@@ -3,14 +3,16 @@
package main
import (
+ "fmt"
"github.com/zorkian/go-datadog-api"
)
type ScreenBoard struct {
}
-func (s ScreenBoard) getElement(client datadog.Client, id int) (interface{}, error) {
- elem, err := client.GetScreenboard(*datadog.Int(id))
+func (s ScreenBoard) getElement(client datadog.Client, id interface{}) (interface{}, error) {
+ idStr := fmt.Sprintf("%v", id)
+ elem, err := client.GetScreenboard(*datadog.String(idStr))
return elem, err
}
diff --git a/screenboards_test.go b/src/screenboards_test.go
similarity index 100%
rename from screenboards_test.go
rename to src/screenboards_test.go
diff --git a/tmpl/monitor.tmpl b/src/tmpl/monitor.tmpl
similarity index 100%
rename from tmpl/monitor.tmpl
rename to src/tmpl/monitor.tmpl
diff --git a/tmpl/screenboard.tmpl b/src/tmpl/screenboard.tmpl
similarity index 100%
rename from tmpl/screenboard.tmpl
rename to src/tmpl/screenboard.tmpl
diff --git a/tmpl/timeboard.tmpl b/src/tmpl/timeboard.tmpl
similarity index 100%
rename from tmpl/timeboard.tmpl
rename to src/tmpl/timeboard.tmpl
diff --git a/tpl.go b/src/tpl.go
similarity index 100%
rename from tpl.go
rename to src/tpl.go
diff --git a/vendor/github.com/cenkalti/backoff/.gitignore b/vendor/github.com/cenkalti/backoff/.gitignore
deleted file mode 100644
index 0026861..0000000
--- a/vendor/github.com/cenkalti/backoff/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
diff --git a/vendor/github.com/cenkalti/backoff/.travis.yml b/vendor/github.com/cenkalti/backoff/.travis.yml
deleted file mode 100644
index 1040404..0000000
--- a/vendor/github.com/cenkalti/backoff/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: go
-go:
- - 1.3.3
- - tip
-before_install:
- - go get github.com/mattn/goveralls
- - go get golang.org/x/tools/cmd/cover
-script:
- - $HOME/gopath/bin/goveralls -service=travis-ci
diff --git a/vendor/github.com/cenkalti/backoff/LICENSE b/vendor/github.com/cenkalti/backoff/LICENSE
deleted file mode 100644
index 89b8179..0000000
--- a/vendor/github.com/cenkalti/backoff/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Cenk Altı
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/cenkalti/backoff/README.md b/vendor/github.com/cenkalti/backoff/README.md
deleted file mode 100644
index 13b347f..0000000
--- a/vendor/github.com/cenkalti/backoff/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls]
-
-This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
-
-[Exponential backoff][exponential backoff wiki]
-is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
-in order to gradually find an acceptable rate.
-The retries exponentially increase and stop increasing when a certain threshold is met.
-
-## Usage
-
-See https://godoc.org/github.com/cenkalti/backoff#pkg-examples
-
-## Contributing
-
-* I would like to keep this library as small as possible.
-* Please don't send a PR without opening an issue and discussing it first.
-* If proposed change is not a common use case, I will probably not accept it.
-
-[godoc]: https://godoc.org/github.com/cenkalti/backoff
-[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
-[travis]: https://travis-ci.org/cenkalti/backoff
-[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master
-[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master
-[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master
-
-[google-http-java-client]: https://github.com/google/google-http-java-client
-[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
-
-[advanced example]: https://godoc.org/github.com/cenkalti/backoff#example_
diff --git a/vendor/github.com/cenkalti/backoff/backoff.go b/vendor/github.com/cenkalti/backoff/backoff.go
deleted file mode 100644
index 2102c5f..0000000
--- a/vendor/github.com/cenkalti/backoff/backoff.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Package backoff implements backoff algorithms for retrying operations.
-//
-// Use Retry function for retrying operations that may fail.
-// If Retry does not meet your needs,
-// copy/paste the function into your project and modify as you wish.
-//
-// There is also Ticker type similar to time.Ticker.
-// You can use it if you need to work with channels.
-//
-// See Examples section below for usage examples.
-package backoff
-
-import "time"
-
-// BackOff is a backoff policy for retrying an operation.
-type BackOff interface {
- // NextBackOff returns the duration to wait before retrying the operation,
- // or backoff.Stop to indicate that no more retries should be made.
- //
- // Example usage:
- //
- // duration := backoff.NextBackOff();
- // if (duration == backoff.Stop) {
- // // Do not retry operation.
- // } else {
- // // Sleep for duration and retry operation.
- // }
- //
- NextBackOff() time.Duration
-
- // Reset to initial state.
- Reset()
-}
-
-// Stop indicates that no more retries should be made for use in NextBackOff().
-const Stop time.Duration = -1
-
-// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
-// meaning that the operation is retried immediately without waiting, indefinitely.
-type ZeroBackOff struct{}
-
-func (b *ZeroBackOff) Reset() {}
-
-func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
-
-// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
-// NextBackOff(), meaning that the operation should never be retried.
-type StopBackOff struct{}
-
-func (b *StopBackOff) Reset() {}
-
-func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
-
-// ConstantBackOff is a backoff policy that always returns the same backoff delay.
-// This is in contrast to an exponential backoff policy,
-// which returns a delay that grows longer as you call NextBackOff() over and over again.
-type ConstantBackOff struct {
- Interval time.Duration
-}
-
-func (b *ConstantBackOff) Reset() {}
-func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
-
-func NewConstantBackOff(d time.Duration) *ConstantBackOff {
- return &ConstantBackOff{Interval: d}
-}
diff --git a/vendor/github.com/cenkalti/backoff/exponential.go b/vendor/github.com/cenkalti/backoff/exponential.go
deleted file mode 100644
index ae65516..0000000
--- a/vendor/github.com/cenkalti/backoff/exponential.go
+++ /dev/null
@@ -1,156 +0,0 @@
-package backoff
-
-import (
- "math/rand"
- "time"
-)
-
-/*
-ExponentialBackOff is a backoff implementation that increases the backoff
-period for each retry attempt using a randomization function that grows exponentially.
-
-NextBackOff() is calculated using the following formula:
-
- randomized interval =
- RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
-
-In other words NextBackOff() will range between the randomization factor
-percentage below and above the retry interval.
-
-For example, given the following parameters:
-
- RetryInterval = 2
- RandomizationFactor = 0.5
- Multiplier = 2
-
-the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
-multiplied by the exponential, that is, between 2 and 6 seconds.
-
-Note: MaxInterval caps the RetryInterval and not the randomized interval.
-
-If the time elapsed since an ExponentialBackOff instance is created goes past the
-MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.
-
-The elapsed time can be reset by calling Reset().
-
-Example: Given the following default arguments, for 10 tries the sequence will be,
-and assuming we go over the MaxElapsedTime on the 10th try:
-
- Request # RetryInterval (seconds) Randomized Interval (seconds)
-
- 1 0.5 [0.25, 0.75]
- 2 0.75 [0.375, 1.125]
- 3 1.125 [0.562, 1.687]
- 4 1.687 [0.8435, 2.53]
- 5 2.53 [1.265, 3.795]
- 6 3.795 [1.897, 5.692]
- 7 5.692 [2.846, 8.538]
- 8 8.538 [4.269, 12.807]
- 9 12.807 [6.403, 19.210]
- 10 19.210 backoff.Stop
-
-Note: Implementation is not thread-safe.
-*/
-type ExponentialBackOff struct {
- InitialInterval time.Duration
- RandomizationFactor float64
- Multiplier float64
- MaxInterval time.Duration
- // After MaxElapsedTime the ExponentialBackOff stops.
- // It never stops if MaxElapsedTime == 0.
- MaxElapsedTime time.Duration
- Clock Clock
-
- currentInterval time.Duration
- startTime time.Time
-}
-
-// Clock is an interface that returns current time for BackOff.
-type Clock interface {
- Now() time.Time
-}
-
-// Default values for ExponentialBackOff.
-const (
- DefaultInitialInterval = 500 * time.Millisecond
- DefaultRandomizationFactor = 0.5
- DefaultMultiplier = 1.5
- DefaultMaxInterval = 60 * time.Second
- DefaultMaxElapsedTime = 15 * time.Minute
-)
-
-// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
-func NewExponentialBackOff() *ExponentialBackOff {
- b := &ExponentialBackOff{
- InitialInterval: DefaultInitialInterval,
- RandomizationFactor: DefaultRandomizationFactor,
- Multiplier: DefaultMultiplier,
- MaxInterval: DefaultMaxInterval,
- MaxElapsedTime: DefaultMaxElapsedTime,
- Clock: SystemClock,
- }
- if b.RandomizationFactor < 0 {
- b.RandomizationFactor = 0
- } else if b.RandomizationFactor > 1 {
- b.RandomizationFactor = 1
- }
- b.Reset()
- return b
-}
-
-type systemClock struct{}
-
-func (t systemClock) Now() time.Time {
- return time.Now()
-}
-
-// SystemClock implements Clock interface that uses time.Now().
-var SystemClock = systemClock{}
-
-// Reset the interval back to the initial retry interval and restarts the timer.
-func (b *ExponentialBackOff) Reset() {
- b.currentInterval = b.InitialInterval
- b.startTime = b.Clock.Now()
-}
-
-// NextBackOff calculates the next backoff interval using the formula:
-// Randomized interval = RetryInterval +/- (RandomizationFactor * RetryInterval)
-func (b *ExponentialBackOff) NextBackOff() time.Duration {
- // Make sure we have not gone over the maximum elapsed time.
- if b.MaxElapsedTime != 0 && b.GetElapsedTime() > b.MaxElapsedTime {
- return Stop
- }
- defer b.incrementCurrentInterval()
- return getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)
-}
-
-// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance
-// is created and is reset when Reset() is called.
-//
-// The elapsed time is computed using time.Now().UnixNano().
-func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
- return b.Clock.Now().Sub(b.startTime)
-}
-
-// Increments the current interval by multiplying it with the multiplier.
-func (b *ExponentialBackOff) incrementCurrentInterval() {
- // Check for overflow, if overflow is detected set the current interval to the max interval.
- if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
- b.currentInterval = b.MaxInterval
- } else {
- b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
- }
-}
-
-// Returns a random value from the following interval:
-// [randomizationFactor * currentInterval, randomizationFactor * currentInterval].
-func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
- var delta = randomizationFactor * float64(currentInterval)
- var minInterval = float64(currentInterval) - delta
- var maxInterval = float64(currentInterval) + delta
-
- // Get a random value from the range [minInterval, maxInterval].
- // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
- // we want a 33% chance for selecting either 1, 2 or 3.
- return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
-}
diff --git a/vendor/github.com/cenkalti/backoff/retry.go b/vendor/github.com/cenkalti/backoff/retry.go
deleted file mode 100644
index 6bc88ce..0000000
--- a/vendor/github.com/cenkalti/backoff/retry.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package backoff
-
-import "time"
-
-// An Operation is executing by Retry() or RetryNotify().
-// The operation will be retried using a backoff policy if it returns an error.
-type Operation func() error
-
-// Notify is a notify-on-error function. It receives an operation error and
-// backoff delay if the operation failed (with an error).
-//
-// NOTE that if the backoff policy stated to stop retrying,
-// the notify function isn't called.
-type Notify func(error, time.Duration)
-
-// Retry the operation o until it does not return error or BackOff stops.
-// o is guaranteed to be run at least once.
-// It is the caller's responsibility to reset b after Retry returns.
-//
-// Retry sleeps the goroutine for the duration returned by BackOff after a
-// failed operation returns.
-func Retry(o Operation, b BackOff) error { return RetryNotify(o, b, nil) }
-
-// RetryNotify calls notify function with the error and wait duration
-// for each failed attempt before sleep.
-func RetryNotify(operation Operation, b BackOff, notify Notify) error {
- var err error
- var next time.Duration
-
- b.Reset()
- for {
- if err = operation(); err == nil {
- return nil
- }
-
- if next = b.NextBackOff(); next == Stop {
- return err
- }
-
- if notify != nil {
- notify(err, next)
- }
-
- time.Sleep(next)
- }
-}
diff --git a/vendor/github.com/cenkalti/backoff/ticker.go b/vendor/github.com/cenkalti/backoff/ticker.go
deleted file mode 100644
index 7a5ff4e..0000000
--- a/vendor/github.com/cenkalti/backoff/ticker.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package backoff
-
-import (
- "runtime"
- "sync"
- "time"
-)
-
-// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
-//
-// Ticks will continue to arrive when the previous operation is still running,
-// so operations that take a while to fail could run in quick succession.
-type Ticker struct {
- C <-chan time.Time
- c chan time.Time
- b BackOff
- stop chan struct{}
- stopOnce sync.Once
-}
-
-// NewTicker returns a new Ticker containing a channel that will send the time at times
-// specified by the BackOff argument. Ticker is guaranteed to tick at least once.
-// The channel is closed when Stop method is called or BackOff stops.
-func NewTicker(b BackOff) *Ticker {
- c := make(chan time.Time)
- t := &Ticker{
- C: c,
- c: c,
- b: b,
- stop: make(chan struct{}),
- }
- go t.run()
- runtime.SetFinalizer(t, (*Ticker).Stop)
- return t
-}
-
-// Stop turns off a ticker. After Stop, no more ticks will be sent.
-func (t *Ticker) Stop() {
- t.stopOnce.Do(func() { close(t.stop) })
-}
-
-func (t *Ticker) run() {
- c := t.c
- defer close(c)
- t.b.Reset()
-
- // Ticker is guaranteed to tick at least once.
- afterC := t.send(time.Now())
-
- for {
- if afterC == nil {
- return
- }
-
- select {
- case tick := <-afterC:
- afterC = t.send(tick)
- case <-t.stop:
- t.c = nil // Prevent future ticks from being sent to the channel.
- return
- }
- }
-}
-
-func (t *Ticker) send(tick time.Time) <-chan time.Time {
- select {
- case t.c <- tick:
- case <-t.stop:
- return nil
- }
-
- next := t.b.NextBackOff()
- if next == Stop {
- t.Stop()
- return nil
- }
-
- return time.After(next)
-}
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE b/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
deleted file mode 100644
index 14127cd..0000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
+++ /dev/null
@@ -1,9 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
deleted file mode 100644
index 949b77e..0000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Windows Terminal Sequences
-
-This library allow for enabling Windows terminal color support for Go.
-
-See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details.
-
-## Usage
-
-```go
-import (
- "syscall"
-
- sequences "github.com/konsorten/go-windows-terminal-sequences"
-)
-
-func main() {
- sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true)
-}
-
-```
-
-## Authors
-
-The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de).
-
-We thank all the authors who provided code to this library:
-
-* Felix Kollmann
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod b/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
deleted file mode 100644
index 716c613..0000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module github.com/konsorten/go-windows-terminal-sequences
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
deleted file mode 100644
index ef18d8f..0000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// +build windows
-
-package sequences
-
-import (
- "syscall"
- "unsafe"
-)
-
-var (
- kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll")
- setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode")
-)
-
-func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
- const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4
-
- var mode uint32
- err := syscall.GetConsoleMode(syscall.Stdout, &mode)
- if err != nil {
- return err
- }
-
- if enable {
- mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- } else {
- mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- }
-
- ret, _, err := setConsoleMode.Call(uintptr(unsafe.Pointer(stream)), uintptr(mode))
- if ret == 0 {
- return err
- }
-
- return nil
-}
diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore
deleted file mode 100644
index 6b7d7d1..0000000
--- a/vendor/github.com/sirupsen/logrus/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-logrus
-vendor
diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml
deleted file mode 100644
index 1f953be..0000000
--- a/vendor/github.com/sirupsen/logrus/.travis.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-language: go
-env:
- - GOMAXPROCS=4 GORACE=halt_on_error=1
-matrix:
- include:
- - go: 1.10.x
- install:
- - go get github.com/stretchr/testify/assert
- - go get golang.org/x/crypto/ssh/terminal
- - go get golang.org/x/sys/unix
- - go get golang.org/x/sys/windows
- script:
- - go test -race -v ./...
- - go: 1.11.x
- env: GO111MODULE=on
- install:
- - go mod download
- script:
- - go test -race -v ./...
- - go: 1.11.x
- env: GO111MODULE=off
- install:
- - go get github.com/stretchr/testify/assert
- - go get golang.org/x/crypto/ssh/terminal
- - go get golang.org/x/sys/unix
- - go get golang.org/x/sys/windows
- script:
- - go test -race -v ./...
- - go: 1.10.x
- install:
- - go get github.com/stretchr/testify/assert
- - go get golang.org/x/crypto/ssh/terminal
- - go get golang.org/x/sys/unix
- - go get golang.org/x/sys/windows
- script:
- - go test -race -v -tags appengine ./...
- - go: 1.11.x
- env: GO111MODULE=on
- install:
- - go mod download
- script:
- - go test -race -v -tags appengine ./...
- - go: 1.11.x
- env: GO111MODULE=off
- install:
- - go get github.com/stretchr/testify/assert
- - go get golang.org/x/crypto/ssh/terminal
- - go get golang.org/x/sys/unix
- - go get golang.org/x/sys/windows
- script:
- - go test -race -v -tags appengine ./...
diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md
deleted file mode 100644
index cb85d9f..0000000
--- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md
+++ /dev/null
@@ -1,165 +0,0 @@
-# 1.2.0
-This new release introduces:
- * A new method `SetReportCaller` in the `Logger` to enable the file, line and calling function from which the trace has been issued
- * A new trace level named `Trace` whose level is below `Debug`
- * A configurable exit function to be called upon a Fatal trace
- * The `Level` object now implements `encoding.TextUnmarshaler` interface
-
-# 1.1.1
-This is a bug fix release.
- * fix the build break on Solaris
- * don't drop a whole trace in JSONFormatter when a field param is a function pointer which can not be serialized
-
-# 1.1.0
-This new release introduces:
- * several fixes:
- * a fix for a race condition on entry formatting
- * proper cleanup of previously used entries before putting them back in the pool
- * the extra new line at the end of message in text formatter has been removed
- * a new global public API to check if a level is activated: IsLevelEnabled
- * the following methods have been added to the Logger object
- * IsLevelEnabled
- * SetFormatter
- * SetOutput
- * ReplaceHooks
- * introduction of go module
- * an indent configuration for the json formatter
- * output colour support for windows
- * the field sort function is now configurable for text formatter
- * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater
-
-# 1.0.6
-
-This new release introduces:
- * a new api WithTime which allows to easily force the time of the log entry
- which is mostly useful for logger wrapper
- * a fix reverting the immutability of the entry given as parameter to the hooks
- a new configuration field of the json formatter in order to put all the fields
- in a nested dictionnary
- * a new SetOutput method in the Logger
- * a new configuration of the textformatter to configure the name of the default keys
- * a new configuration of the text formatter to disable the level truncation
-
-# 1.0.5
-
-* Fix hooks race (#707)
-* Fix panic deadlock (#695)
-
-# 1.0.4
-
-* Fix race when adding hooks (#612)
-* Fix terminal check in AppEngine (#635)
-
-# 1.0.3
-
-* Replace example files with testable examples
-
-# 1.0.2
-
-* bug: quote non-string values in text formatter (#583)
-* Make (*Logger) SetLevel a public method
-
-# 1.0.1
-
-* bug: fix escaping in text formatter (#575)
-
-# 1.0.0
-
-* Officially changed name to lower-case
-* bug: colors on Windows 10 (#541)
-* bug: fix race in accessing level (#512)
-
-# 0.11.5
-
-* feature: add writer and writerlevel to entry (#372)
-
-# 0.11.4
-
-* bug: fix undefined variable on solaris (#493)
-
-# 0.11.3
-
-* formatter: configure quoting of empty values (#484)
-* formatter: configure quoting character (default is `"`) (#484)
-* bug: fix not importing io correctly in non-linux environments (#481)
-
-# 0.11.2
-
-* bug: fix windows terminal detection (#476)
-
-# 0.11.1
-
-* bug: fix tty detection with custom out (#471)
-
-# 0.11.0
-
-* performance: Use bufferpool to allocate (#370)
-* terminal: terminal detection for app-engine (#343)
-* feature: exit handler (#375)
-
-# 0.10.0
-
-* feature: Add a test hook (#180)
-* feature: `ParseLevel` is now case-insensitive (#326)
-* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308)
-* performance: avoid re-allocations on `WithFields` (#335)
-
-# 0.9.0
-
-* logrus/text_formatter: don't emit empty msg
-* logrus/hooks/airbrake: move out of main repository
-* logrus/hooks/sentry: move out of main repository
-* logrus/hooks/papertrail: move out of main repository
-* logrus/hooks/bugsnag: move out of main repository
-* logrus/core: run tests with `-race`
-* logrus/core: detect TTY based on `stderr`
-* logrus/core: support `WithError` on logger
-* logrus/core: Solaris support
-
-# 0.8.7
-
-* logrus/core: fix possible race (#216)
-* logrus/doc: small typo fixes and doc improvements
-
-
-# 0.8.6
-
-* hooks/raven: allow passing an initialized client
-
-# 0.8.5
-
-* logrus/core: revert #208
-
-# 0.8.4
-
-* formatter/text: fix data race (#218)
-
-# 0.8.3
-
-* logrus/core: fix entry log level (#208)
-* logrus/core: improve performance of text formatter by 40%
-* logrus/core: expose `LevelHooks` type
-* logrus/core: add support for DragonflyBSD and NetBSD
-* formatter/text: print structs more verbosely
-
-# 0.8.2
-
-* logrus: fix more Fatal family functions
-
-# 0.8.1
-
-* logrus: fix not exiting on `Fatalf` and `Fatalln`
-
-# 0.8.0
-
-* logrus: defaults to stderr instead of stdout
-* hooks/sentry: add special field for `*http.Request`
-* formatter/text: ignore Windows for colors
-
-# 0.7.3
-
-* formatter/\*: allow configuration of timestamp layout
-
-# 0.7.2
-
-* formatter/text: Add configuration option for time format (#158)
diff --git a/vendor/github.com/sirupsen/logrus/LICENSE b/vendor/github.com/sirupsen/logrus/LICENSE
deleted file mode 100644
index f090cb4..0000000
--- a/vendor/github.com/sirupsen/logrus/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Simon Eskildsen
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md
deleted file mode 100644
index 093bb13..0000000
--- a/vendor/github.com/sirupsen/logrus/README.md
+++ /dev/null
@@ -1,493 +0,0 @@
-# Logrus
[](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
-the standard library logger.
-
-**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,
-this caused issues in the community and we needed a standard. Some environments
-experienced problems with the upper-case variant, so the lower-case was decided.
-Everything using `logrus` will need to use the lower-case:
-`github.com/sirupsen/logrus`. Any package that isn't, should be changed.
-
-To fix Glide, see [these
-comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437).
-For an in-depth explanation of the casing issue, see [this
-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
-plain text):
-
-
-
-With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
-or Splunk:
-
-```json
-{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
-ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
-
-{"level":"warning","msg":"The group's number increased tremendously!",
-"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"}
-
-{"animal":"walrus","level":"info","msg":"A giant walrus appears!",
-"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"}
-
-{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.",
-"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"}
-
-{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true,
-"time":"2014-03-10 19:57:38.562543128 -0400 EDT"}
-```
-
-With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not
-attached, the output is compatible with the
-[logfmt](http://godoc.org/github.com/kr/logfmt) format:
-
-```text
-time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8
-time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10
-time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true
-time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4
-time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009
-time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true
-```
-To ensure this behaviour even if a TTY is attached, set your formatter as follows:
-
-```go
- log.SetFormatter(&log.TextFormatter{
- DisableColors: true,
- FullTimestamp: true,
- })
-```
-
-#### Logging Method Name
-
-If you wish to add the calling method as a field, instruct the logger via:
-```go
-log.SetReportCaller(true)
-```
-This adds the caller as 'method' like so:
-
-```json
-{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by",
-"time":"2014-03-10 19:57:38.562543129 -0400 EDT"}
-```
-
-```text
-time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin
-```
-Note that this does add measurable overhead - the cost will depend on the version of Go, but is
-between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your
-environment via benchmarks:
-```
-go test -bench=.*CallerTracing
-```
-
-
-#### Case-sensitivity
-
-The organization's name was changed to lower-case--and this will not be changed
-back. If you are getting import conflicts due to case sensitivity, please use
-the lower-case import: `github.com/sirupsen/logrus`.
-
-#### Example
-
-The simplest way to use Logrus is simply the package-level exported logger:
-
-```go
-package main
-
-import (
- log "github.com/sirupsen/logrus"
-)
-
-func main() {
- log.WithFields(log.Fields{
- "animal": "walrus",
- }).Info("A walrus appears")
-}
-```
-
-Note that it's completely api-compatible with the stdlib logger, so you can
-replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"`
-and you'll now have the flexibility of Logrus. You can customize it all you
-want:
-
-```go
-package main
-
-import (
- "os"
- log "github.com/sirupsen/logrus"
-)
-
-func init() {
- // Log as JSON instead of the default ASCII formatter.
- log.SetFormatter(&log.JSONFormatter{})
-
- // Output to stdout instead of the default stderr
- // Can be any io.Writer, see below for File example
- log.SetOutput(os.Stdout)
-
- // Only log the warning severity or above.
- log.SetLevel(log.WarnLevel)
-}
-
-func main() {
- log.WithFields(log.Fields{
- "animal": "walrus",
- "size": 10,
- }).Info("A group of walrus emerges from the ocean")
-
- log.WithFields(log.Fields{
- "omg": true,
- "number": 122,
- }).Warn("The group's number increased tremendously!")
-
- log.WithFields(log.Fields{
- "omg": true,
- "number": 100,
- }).Fatal("The ice breaks!")
-
- // A common pattern is to re-use fields between logging statements by re-using
- // the logrus.Entry returned from WithFields()
- contextLogger := log.WithFields(log.Fields{
- "common": "this is a common field",
- "other": "I also should be logged always",
- })
-
- contextLogger.Info("I'll be logged with common and other field")
- contextLogger.Info("Me too")
-}
-```
-
-For more advanced usage such as logging to multiple locations from the same
-application, you can also create an instance of the `logrus` Logger:
-
-```go
-package main
-
-import (
- "os"
- "github.com/sirupsen/logrus"
-)
-
-// Create a new instance of the logger. You can have any number of instances.
-var log = logrus.New()
-
-func main() {
- // The API for setting attributes is a little different than the package level
- // exported logger. See Godoc.
- log.Out = os.Stdout
-
- // 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)
- // if err == nil {
- // log.Out = file
- // } else {
- // log.Info("Failed to log to file, using default stderr")
- // }
-
- log.WithFields(logrus.Fields{
- "animal": "walrus",
- "size": 10,
- }).Info("A group of walrus emerges from the ocean")
-}
-```
-
-#### Fields
-
-Logrus encourages careful, structured logging through logging fields instead of
-long, unparseable error messages. For example, instead of: `log.Fatalf("Failed
-to send event %s to topic %s with key %d")`, you should log the much more
-discoverable:
-
-```go
-log.WithFields(log.Fields{
- "event": event,
- "topic": topic,
- "key": key,
-}).Fatal("Failed to send event")
-```
-
-We've found this API forces you to think about logging in a way that produces
-much more useful logging messages. We've been in countless situations where just
-a single added field to a log statement that was already there would've saved us
-hours. The `WithFields` call is optional.
-
-In general, with Logrus using any of the `printf`-family functions should be
-seen as a hint you should add a field, however, you can still use the
-`printf`-family functions with Logrus.
-
-#### Default Fields
-
-Often it's helpful to have fields _always_ attached to log statements in an
-application or parts of one. For example, you may want to always log the
-`request_id` and `user_ip` in the context of a request. Instead of writing
-`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on
-every line, you can create a `logrus.Entry` to pass around instead:
-
-```go
-requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})
-requestLogger.Info("something happened on that request") # will log request_id and user_ip
-requestLogger.Warn("something not great happened")
-```
-
-#### Hooks
-
-You can add hooks for logging levels. For example to send errors to an exception
-tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to
-multiple places simultaneously, e.g. syslog.
-
-Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in
-`init`:
-
-```go
-import (
- log "github.com/sirupsen/logrus"
- "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake"
- logrus_syslog "github.com/sirupsen/logrus/hooks/syslog"
- "log/syslog"
-)
-
-func init() {
-
- // Use the Airbrake hook to report errors that have Error severity or above to
- // an exception tracker. You can create custom hooks, see the Hooks section.
- log.AddHook(airbrake.NewHook(123, "xyz", "production"))
-
- hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
- if err != nil {
- log.Error("Unable to connect to local syslog daemon")
- } else {
- log.AddHook(hook)
- }
-}
-```
-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)
-
-
-#### Level logging
-
-Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic.
-
-```go
-log.Trace("Something very low level.")
-log.Debug("Useful debugging information.")
-log.Info("Something noteworthy happened!")
-log.Warn("You should probably take a look at this.")
-log.Error("Something failed but I'm not quitting.")
-// Calls os.Exit(1) after logging
-log.Fatal("Bye.")
-// Calls panic() after logging
-log.Panic("I'm bailing.")
-```
-
-You can set the logging level on a `Logger`, then it will only log entries with
-that severity or anything above it:
-
-```go
-// Will log anything that is info or above (warn, error, fatal, panic). Default.
-log.SetLevel(log.InfoLevel)
-```
-
-It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
-environment if your application has that.
-
-#### Entries
-
-Besides the fields added with `WithField` or `WithFields` some fields are
-automatically added to all logging events:
-
-1. `time`. The timestamp when the entry was created.
-2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after
- the `AddFields` call. E.g. `Failed to send event.`
-3. `level`. The logging level. E.g. `info`.
-
-#### Environments
-
-Logrus has no notion of environment.
-
-If you wish for hooks and formatters to only be used in specific environments,
-you should handle that yourself. For example, if your application has a global
-variable `Environment`, which is a string representation of the environment you
-could do:
-
-```go
-import (
- log "github.com/sirupsen/logrus"
-)
-
-init() {
- // do something here to set environment depending on an environment variable
- // or command-line flag
- if Environment == "production" {
- log.SetFormatter(&log.JSONFormatter{})
- } else {
- // The TextFormatter is default, you don't actually have to do this.
- log.SetFormatter(&log.TextFormatter{})
- }
-}
-```
-
-This configuration is how `logrus` was intended to be used, but JSON in
-production is mostly only useful if you do log aggregation with tools like
-Splunk or Logstash.
-
-#### Formatters
-
-The built-in logging formatters are:
-
-* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise
- without colors.
- * *Note:* to force colored output when there is no TTY, set the `ForceColors`
- field to `true`. To force no colored output even if there is a TTY set the
- `DisableColors` field to `true`. For Windows, see
- [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
- truncation set the `DisableLevelTruncation` field to `true`.
- * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter).
-* `logrus.JSONFormatter`. Logs fields as JSON.
- * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter).
-
-Third party logging formatters:
-
-* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine.
-* [`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.
-* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦.
-
-You can define your formatter by implementing the `Formatter` interface,
-requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a
-`Fields` type (`map[string]interface{}`) with all your fields as well as the
-default ones (see Entries section above):
-
-```go
-type MyJSONFormatter struct {
-}
-
-log.SetFormatter(new(MyJSONFormatter))
-
-func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {
- // Note this doesn't include Time, Level and Message which are available on
- // the Entry. Consult `godoc` on information about those fields or read the
- // source of the official loggers.
- serialized, err := json.Marshal(entry.Data)
- if err != nil {
- return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
- }
- return append(serialized, '\n'), nil
-}
-```
-
-#### Logger as an `io.Writer`
-
-Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it.
-
-```go
-w := logger.Writer()
-defer w.Close()
-
-srv := http.Server{
- // create a stdlib log.Logger that writes to
- // logrus.Logger.
- ErrorLog: log.New(w, "", 0),
-}
-```
-
-Each line written to that writer will be printed the usual way, using formatters
-and hooks. The level for those entries is `info`.
-
-This means that we can override the standard library logger easily:
-
-```go
-logger := logrus.New()
-logger.Formatter = &logrus.JSONFormatter{}
-
-// Use logrus for standard log output
-// Note that `log` here references stdlib's log
-// Not logrus imported under the name `log`.
-log.SetOutput(logger.Writer())
-```
-
-#### Rotation
-
-Log rotation is not provided with Logrus. Log rotation should be done by an
-external program (like `logrotate(8)`) that can compress and delete old log
-entries. It should not be a feature of the application-level logger.
-
-#### Tools
-
-| 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 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
-
-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
-* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any):
-
-```go
-import(
- "github.com/sirupsen/logrus"
- "github.com/sirupsen/logrus/hooks/test"
- "github.com/stretchr/testify/assert"
- "testing"
-)
-
-func TestSomething(t*testing.T){
- logger, hook := test.NewNullLogger()
- logger.Error("Helloerror")
-
- assert.Equal(t, 1, len(hook.Entries))
- assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level)
- assert.Equal(t, "Helloerror", hook.LastEntry().Message)
-
- hook.Reset()
- assert.Nil(t, hook.LastEntry())
-}
-```
-
-#### Fatal handlers
-
-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
-logrus performs a `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.
-
-```
-...
-handler := func() {
- // gracefully shutdown something...
-}
-logrus.RegisterExitHandler(handler)
-...
-```
-
-#### Thread safety
-
-By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs.
-If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking.
-
-Situation when locking is not needed includes:
-
-* You have no hooks registered, or hooks calling is already thread-safe.
-
-* Writing to logger.Out is already thread-safe, for example:
-
- 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)
-
- (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/)
diff --git a/vendor/github.com/sirupsen/logrus/alt_exit.go b/vendor/github.com/sirupsen/logrus/alt_exit.go
deleted file mode 100644
index 8af9063..0000000
--- a/vendor/github.com/sirupsen/logrus/alt_exit.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package logrus
-
-// The following code was sourced and modified from the
-// https://github.com/tebeka/atexit package governed by the following license:
-//
-// Copyright (c) 2012 Miki Tebeka .
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-import (
- "fmt"
- "os"
-)
-
-var handlers = []func(){}
-
-func runHandler(handler func()) {
- defer func() {
- if err := recover(); err != nil {
- fmt.Fprintln(os.Stderr, "Error: Logrus exit handler error:", err)
- }
- }()
-
- handler()
-}
-
-func runHandlers() {
- for _, handler := range handlers {
- runHandler(handler)
- }
-}
-
-// Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code)
-func Exit(code int) {
- runHandlers()
- os.Exit(code)
-}
-
-// RegisterExitHandler adds a Logrus Exit handler, call logrus.Exit to invoke
-// all handlers. The handlers will also be invoked when any Fatal log entry is
-// made.
-//
-// This method is useful when a caller wishes to use logrus to log a fatal
-// message but also needs to gracefully shutdown. An example usecase could be
-// closing database connections, or sending a alert that the application is
-// closing.
-func RegisterExitHandler(handler func()) {
- handlers = append(handlers, handler)
-}
diff --git a/vendor/github.com/sirupsen/logrus/appveyor.yml b/vendor/github.com/sirupsen/logrus/appveyor.yml
deleted file mode 100644
index 96c2ce1..0000000
--- a/vendor/github.com/sirupsen/logrus/appveyor.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-version: "{build}"
-platform: x64
-clone_folder: c:\gopath\src\github.com\sirupsen\logrus
-environment:
- GOPATH: c:\gopath
-branches:
- only:
- - master
-install:
- - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- - go version
-build_script:
- - go get -t
- - go test
diff --git a/vendor/github.com/sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go
deleted file mode 100644
index da67aba..0000000
--- a/vendor/github.com/sirupsen/logrus/doc.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
-
-
-The simplest way to use Logrus is simply the package-level exported logger:
-
- package main
-
- import (
- log "github.com/sirupsen/logrus"
- )
-
- func main() {
- log.WithFields(log.Fields{
- "animal": "walrus",
- "number": 1,
- "size": 10,
- }).Info("A walrus appears")
- }
-
-Output:
- time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
-
-For a full guide visit https://github.com/sirupsen/logrus
-*/
-package logrus
diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go
deleted file mode 100644
index cc85d3a..0000000
--- a/vendor/github.com/sirupsen/logrus/entry.go
+++ /dev/null
@@ -1,408 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "fmt"
- "os"
- "reflect"
- "runtime"
- "strings"
- "sync"
- "time"
-)
-
-var (
- bufferPool *sync.Pool
-
- // qualified package name, cached at first use
- logrusPackage string
-
- // Positions in the call stack when tracing to report the calling method
- minimumCallerDepth int
-
- // Used for caller information initialisation
- callerInitOnce sync.Once
-)
-
-const (
- maximumCallerDepth int = 25
- knownLogrusFrames int = 4
-)
-
-func init() {
- bufferPool = &sync.Pool{
- New: func() interface{} {
- return new(bytes.Buffer)
- },
- }
-
- // start at the bottom of the stack before the package-name cache is primed
- minimumCallerDepth = 1
-}
-
-// Defines the key when adding errors using WithError.
-var ErrorKey = "error"
-
-// An entry is the final or intermediate Logrus logging entry. It contains all
-// the fields passed with WithField{,s}. It's finally logged when Trace, Debug,
-// Info, Warn, Error, Fatal or Panic is called on it. These objects can be
-// reused and passed around as much as you wish to avoid field duplication.
-type Entry struct {
- Logger *Logger
-
- // Contains all the fields set by the user.
- Data Fields
-
- // Time at which the log entry was created
- Time time.Time
-
- // Level the log entry was logged at: Trace, Debug, Info, Warn, Error, Fatal or Panic
- // This field will be set on entry firing and the value will be equal to the one in Logger struct field.
- Level Level
-
- // Calling method, with package name
- Caller *runtime.Frame
-
- // Message passed to Trace, Debug, Info, Warn, Error, Fatal or Panic
- Message string
-
- // When formatter is called in entry.log(), a Buffer may be set to entry
- Buffer *bytes.Buffer
-
- // err may contain a field formatting error
- err string
-}
-
-func NewEntry(logger *Logger) *Entry {
- return &Entry{
- Logger: logger,
- // Default is three fields, plus one optional. Give a little extra room.
- Data: make(Fields, 6),
- }
-}
-
-// Returns the string representation from the reader and ultimately the
-// formatter.
-func (entry *Entry) String() (string, error) {
- serialized, err := entry.Logger.Formatter.Format(entry)
- if err != nil {
- return "", err
- }
- str := string(serialized)
- return str, nil
-}
-
-// Add an error as single field (using the key defined in ErrorKey) to the Entry.
-func (entry *Entry) WithError(err error) *Entry {
- return entry.WithField(ErrorKey, err)
-}
-
-// Add a single field to the Entry.
-func (entry *Entry) WithField(key string, value interface{}) *Entry {
- return entry.WithFields(Fields{key: value})
-}
-
-// Add a map of fields to the Entry.
-func (entry *Entry) WithFields(fields Fields) *Entry {
- data := make(Fields, len(entry.Data)+len(fields))
- for k, v := range entry.Data {
- data[k] = v
- }
- var field_err string
- for k, v := range fields {
- if t := reflect.TypeOf(v); t != nil && t.Kind() == reflect.Func {
- field_err = fmt.Sprintf("can not add field %q", k)
- if entry.err != "" {
- field_err = entry.err + ", " + field_err
- }
- } else {
- data[k] = v
- }
- }
- return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, err: field_err}
-}
-
-// Overrides the time of the Entry.
-func (entry *Entry) WithTime(t time.Time) *Entry {
- return &Entry{Logger: entry.Logger, Data: entry.Data, Time: t}
-}
-
-// getPackageName reduces a fully qualified function name to the package name
-// There really ought to be to be a better way...
-func getPackageName(f string) string {
- for {
- lastPeriod := strings.LastIndex(f, ".")
- lastSlash := strings.LastIndex(f, "/")
- if lastPeriod > lastSlash {
- f = f[:lastPeriod]
- } else {
- break
- }
- }
-
- return f
-}
-
-// getCaller retrieves the name of the first non-logrus calling function
-func getCaller() *runtime.Frame {
- // Restrict the lookback frames to avoid runaway lookups
- pcs := make([]uintptr, maximumCallerDepth)
- depth := runtime.Callers(minimumCallerDepth, pcs)
- frames := runtime.CallersFrames(pcs[:depth])
-
- // cache this package's fully-qualified name
- callerInitOnce.Do(func() {
- logrusPackage = getPackageName(runtime.FuncForPC(pcs[0]).Name())
-
- // now that we have the cache, we can skip a minimum count of known-logrus functions
- // XXX this is dubious, the number of frames may vary store an entry in a logger interface
- minimumCallerDepth = knownLogrusFrames
- })
-
- for f, again := frames.Next(); again; f, again = frames.Next() {
- pkg := getPackageName(f.Function)
-
- // If the caller isn't part of this package, we're done
- if pkg != logrusPackage {
- return &f
- }
- }
-
- // if we got here, we failed to find the caller's context
- return nil
-}
-
-func (entry Entry) HasCaller() (has bool) {
- return entry.Logger != nil &&
- entry.Logger.ReportCaller &&
- entry.Caller != nil
-}
-
-// This function is not declared with a pointer value because otherwise
-// race conditions will occur when using multiple goroutines
-func (entry Entry) log(level Level, msg string) {
- var buffer *bytes.Buffer
-
- // Default to now, but allow users to override if they want.
- //
- // We don't have to worry about polluting future calls to Entry#log()
- // with this assignment because this function is declared with a
- // non-pointer receiver.
- if entry.Time.IsZero() {
- entry.Time = time.Now()
- }
-
- entry.Level = level
- entry.Message = msg
- if entry.Logger.ReportCaller {
- entry.Caller = getCaller()
- }
-
- entry.fireHooks()
-
- buffer = bufferPool.Get().(*bytes.Buffer)
- buffer.Reset()
- defer bufferPool.Put(buffer)
- entry.Buffer = buffer
-
- entry.write()
-
- entry.Buffer = nil
-
- // To avoid Entry#log() returning a value that only would make sense for
- // panic() to use in Entry#Panic(), we avoid the allocation by checking
- // directly here.
- if level <= PanicLevel {
- panic(&entry)
- }
-}
-
-func (entry *Entry) fireHooks() {
- entry.Logger.mu.Lock()
- defer entry.Logger.mu.Unlock()
- err := entry.Logger.Hooks.Fire(entry.Level, entry)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)
- }
-}
-
-func (entry *Entry) write() {
- entry.Logger.mu.Lock()
- defer entry.Logger.mu.Unlock()
- serialized, err := entry.Logger.Formatter.Format(entry)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
- } else {
- _, err = entry.Logger.Out.Write(serialized)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
- }
- }
-}
-
-func (entry *Entry) Trace(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(TraceLevel) {
- entry.log(TraceLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Debug(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(DebugLevel) {
- entry.log(DebugLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Print(args ...interface{}) {
- entry.Info(args...)
-}
-
-func (entry *Entry) Info(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(InfoLevel) {
- entry.log(InfoLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Warn(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(WarnLevel) {
- entry.log(WarnLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Warning(args ...interface{}) {
- entry.Warn(args...)
-}
-
-func (entry *Entry) Error(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(ErrorLevel) {
- entry.log(ErrorLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Fatal(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(FatalLevel) {
- entry.log(FatalLevel, fmt.Sprint(args...))
- }
- entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panic(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(PanicLevel) {
- entry.log(PanicLevel, fmt.Sprint(args...))
- }
- panic(fmt.Sprint(args...))
-}
-
-// Entry Printf family functions
-
-func (entry *Entry) Tracef(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(TraceLevel) {
- entry.Trace(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Debugf(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(DebugLevel) {
- entry.Debug(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Infof(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(InfoLevel) {
- entry.Info(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Printf(format string, args ...interface{}) {
- entry.Infof(format, args...)
-}
-
-func (entry *Entry) Warnf(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(WarnLevel) {
- entry.Warn(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Warningf(format string, args ...interface{}) {
- entry.Warnf(format, args...)
-}
-
-func (entry *Entry) Errorf(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(ErrorLevel) {
- entry.Error(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Fatalf(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(FatalLevel) {
- entry.Fatal(fmt.Sprintf(format, args...))
- }
- entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panicf(format string, args ...interface{}) {
- if entry.Logger.IsLevelEnabled(PanicLevel) {
- entry.Panic(fmt.Sprintf(format, args...))
- }
-}
-
-// Entry Println family functions
-
-func (entry *Entry) Traceln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(TraceLevel) {
- entry.Trace(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Debugln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(DebugLevel) {
- entry.Debug(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Infoln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(InfoLevel) {
- entry.Info(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Println(args ...interface{}) {
- entry.Infoln(args...)
-}
-
-func (entry *Entry) Warnln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(WarnLevel) {
- entry.Warn(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Warningln(args ...interface{}) {
- entry.Warnln(args...)
-}
-
-func (entry *Entry) Errorln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(ErrorLevel) {
- entry.Error(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Fatalln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(FatalLevel) {
- entry.Fatal(entry.sprintlnn(args...))
- }
- entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panicln(args ...interface{}) {
- if entry.Logger.IsLevelEnabled(PanicLevel) {
- entry.Panic(entry.sprintlnn(args...))
- }
-}
-
-// Sprintlnn => Sprint no newline. This is to get the behavior of how
-// fmt.Sprintln where spaces are always added between operands, regardless of
-// their type. Instead of vendoring the Sprintln implementation to spare a
-// string allocation, we do the simplest thing.
-func (entry *Entry) sprintlnn(args ...interface{}) string {
- msg := fmt.Sprintln(args...)
- return msg[:len(msg)-1]
-}
diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go
deleted file mode 100644
index 7342613..0000000
--- a/vendor/github.com/sirupsen/logrus/exported.go
+++ /dev/null
@@ -1,219 +0,0 @@
-package logrus
-
-import (
- "io"
- "time"
-)
-
-var (
- // std is the name of the standard logger in stdlib `log`
- std = New()
-)
-
-func StandardLogger() *Logger {
- return std
-}
-
-// SetOutput sets the standard logger output.
-func SetOutput(out io.Writer) {
- std.SetOutput(out)
-}
-
-// SetFormatter sets the standard logger formatter.
-func SetFormatter(formatter Formatter) {
- std.SetFormatter(formatter)
-}
-
-// SetReportCaller sets whether the standard logger will include the calling
-// method as a field.
-func SetReportCaller(include bool) {
- std.SetReportCaller(include)
-}
-
-// SetLevel sets the standard logger level.
-func SetLevel(level Level) {
- std.SetLevel(level)
-}
-
-// GetLevel returns the standard logger level.
-func GetLevel() Level {
- return std.GetLevel()
-}
-
-// IsLevelEnabled checks if the log level of the standard logger is greater than the level param
-func IsLevelEnabled(level Level) bool {
- return std.IsLevelEnabled(level)
-}
-
-// AddHook adds a hook to the standard logger hooks.
-func AddHook(hook Hook) {
- std.AddHook(hook)
-}
-
-// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
-func WithError(err error) *Entry {
- return std.WithField(ErrorKey, err)
-}
-
-// WithField creates an entry from the standard logger and adds a field to
-// it. If you want multiple fields, use `WithFields`.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithField(key string, value interface{}) *Entry {
- return std.WithField(key, value)
-}
-
-// WithFields creates an entry from the standard logger and adds multiple
-// fields to it. This is simply a helper for `WithField`, invoking it
-// once for each field.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithFields(fields Fields) *Entry {
- return std.WithFields(fields)
-}
-
-// WithTime creats an entry from the standard logger and overrides the time of
-// logs generated with it.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithTime(t time.Time) *Entry {
- return std.WithTime(t)
-}
-
-// Trace logs a message at level Trace on the standard logger.
-func Trace(args ...interface{}) {
- std.Trace(args...)
-}
-
-// Debug logs a message at level Debug on the standard logger.
-func Debug(args ...interface{}) {
- std.Debug(args...)
-}
-
-// Print logs a message at level Info on the standard logger.
-func Print(args ...interface{}) {
- std.Print(args...)
-}
-
-// Info logs a message at level Info on the standard logger.
-func Info(args ...interface{}) {
- std.Info(args...)
-}
-
-// Warn logs a message at level Warn on the standard logger.
-func Warn(args ...interface{}) {
- std.Warn(args...)
-}
-
-// Warning logs a message at level Warn on the standard logger.
-func Warning(args ...interface{}) {
- std.Warning(args...)
-}
-
-// Error logs a message at level Error on the standard logger.
-func Error(args ...interface{}) {
- std.Error(args...)
-}
-
-// Panic logs a message at level Panic on the standard logger.
-func Panic(args ...interface{}) {
- std.Panic(args...)
-}
-
-// Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatal(args ...interface{}) {
- std.Fatal(args...)
-}
-
-// Tracef logs a message at level Trace on the standard logger.
-func Tracef(format string, args ...interface{}) {
- std.Tracef(format, args...)
-}
-
-// Debugf logs a message at level Debug on the standard logger.
-func Debugf(format string, args ...interface{}) {
- std.Debugf(format, args...)
-}
-
-// Printf logs a message at level Info on the standard logger.
-func Printf(format string, args ...interface{}) {
- std.Printf(format, args...)
-}
-
-// Infof logs a message at level Info on the standard logger.
-func Infof(format string, args ...interface{}) {
- std.Infof(format, args...)
-}
-
-// Warnf logs a message at level Warn on the standard logger.
-func Warnf(format string, args ...interface{}) {
- std.Warnf(format, args...)
-}
-
-// Warningf logs a message at level Warn on the standard logger.
-func Warningf(format string, args ...interface{}) {
- std.Warningf(format, args...)
-}
-
-// Errorf logs a message at level Error on the standard logger.
-func Errorf(format string, args ...interface{}) {
- std.Errorf(format, args...)
-}
-
-// Panicf logs a message at level Panic on the standard logger.
-func Panicf(format string, args ...interface{}) {
- std.Panicf(format, args...)
-}
-
-// Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatalf(format string, args ...interface{}) {
- std.Fatalf(format, args...)
-}
-
-// Traceln logs a message at level Trace on the standard logger.
-func Traceln(args ...interface{}) {
- std.Traceln(args...)
-}
-
-// Debugln logs a message at level Debug on the standard logger.
-func Debugln(args ...interface{}) {
- std.Debugln(args...)
-}
-
-// Println logs a message at level Info on the standard logger.
-func Println(args ...interface{}) {
- std.Println(args...)
-}
-
-// Infoln logs a message at level Info on the standard logger.
-func Infoln(args ...interface{}) {
- std.Infoln(args...)
-}
-
-// Warnln logs a message at level Warn on the standard logger.
-func Warnln(args ...interface{}) {
- std.Warnln(args...)
-}
-
-// Warningln logs a message at level Warn on the standard logger.
-func Warningln(args ...interface{}) {
- std.Warningln(args...)
-}
-
-// Errorln logs a message at level Error on the standard logger.
-func Errorln(args ...interface{}) {
- std.Errorln(args...)
-}
-
-// Panicln logs a message at level Panic on the standard logger.
-func Panicln(args ...interface{}) {
- std.Panicln(args...)
-}
-
-// Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatalln(args ...interface{}) {
- std.Fatalln(args...)
-}
diff --git a/vendor/github.com/sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go
deleted file mode 100644
index 4088837..0000000
--- a/vendor/github.com/sirupsen/logrus/formatter.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package logrus
-
-import "time"
-
-// Default key names for the default fields
-const (
- defaultTimestampFormat = time.RFC3339
- FieldKeyMsg = "msg"
- FieldKeyLevel = "level"
- FieldKeyTime = "time"
- FieldKeyLogrusError = "logrus_error"
- FieldKeyFunc = "func"
- FieldKeyFile = "file"
-)
-
-// The Formatter interface is used to implement a custom Formatter. It takes an
-// `Entry`. It exposes all the fields, including the default ones:
-//
-// * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
-// * `entry.Data["time"]`. The timestamp.
-// * `entry.Data["level"]. The level the entry was logged at.
-//
-// Any additional fields added with `WithField` or `WithFields` are also in
-// `entry.Data`. Format is expected to return an array of bytes which are then
-// logged to `logger.Out`.
-type Formatter interface {
- Format(*Entry) ([]byte, error)
-}
-
-// This is to not silently overwrite `time`, `msg`, `func` and `level` fields when
-// dumping it. If this code wasn't there doing:
-//
-// logrus.WithField("level", 1).Info("hello")
-//
-// Would just silently drop the user provided level. Instead with this code
-// it'll logged as:
-//
-// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
-//
-// It's not exported because it's still using Data in an opinionated way. It's to
-// avoid code duplication between the two default formatters.
-func prefixFieldClashes(data Fields, fieldMap FieldMap, reportCaller bool) {
- timeKey := fieldMap.resolve(FieldKeyTime)
- if t, ok := data[timeKey]; ok {
- data["fields."+timeKey] = t
- delete(data, timeKey)
- }
-
- msgKey := fieldMap.resolve(FieldKeyMsg)
- if m, ok := data[msgKey]; ok {
- data["fields."+msgKey] = m
- delete(data, msgKey)
- }
-
- levelKey := fieldMap.resolve(FieldKeyLevel)
- if l, ok := data[levelKey]; ok {
- data["fields."+levelKey] = l
- delete(data, levelKey)
- }
-
- logrusErrKey := fieldMap.resolve(FieldKeyLogrusError)
- if l, ok := data[logrusErrKey]; ok {
- data["fields."+logrusErrKey] = l
- delete(data, logrusErrKey)
- }
-
- // If reportCaller is not set, 'func' will not conflict.
- if reportCaller {
- funcKey := fieldMap.resolve(FieldKeyFunc)
- if l, ok := data[funcKey]; ok {
- data["fields."+funcKey] = l
- }
- fileKey := fieldMap.resolve(FieldKeyFile)
- if l, ok := data[fileKey]; ok {
- data["fields."+fileKey] = l
- }
- }
-}
diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod
deleted file mode 100644
index 94574cc..0000000
--- a/vendor/github.com/sirupsen/logrus/go.mod
+++ /dev/null
@@ -1,11 +0,0 @@
-module github.com/sirupsen/logrus
-
-require (
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/konsorten/go-windows-terminal-sequences v1.0.1
- github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/stretchr/objx v0.1.1 // indirect
- github.com/stretchr/testify v1.2.2
- golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
- golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
-)
diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum
deleted file mode 100644
index 133d34a..0000000
--- a/vendor/github.com/sirupsen/logrus/go.sum
+++ /dev/null
@@ -1,15 +0,0 @@
-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/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs=
-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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-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/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
diff --git a/vendor/github.com/sirupsen/logrus/hooks.go b/vendor/github.com/sirupsen/logrus/hooks.go
deleted file mode 100644
index 3f151cd..0000000
--- a/vendor/github.com/sirupsen/logrus/hooks.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package logrus
-
-// A hook to be fired when logging on the logging levels returned from
-// `Levels()` on your implementation of the interface. Note that this is not
-// fired in a goroutine or a channel with workers, you should handle such
-// functionality yourself if your call is non-blocking and you don't wish for
-// the logging calls for levels returned from `Levels()` to block.
-type Hook interface {
- Levels() []Level
- Fire(*Entry) error
-}
-
-// Internal type for storing the hooks on a logger instance.
-type LevelHooks map[Level][]Hook
-
-// Add a hook to an instance of logger. This is called with
-// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
-func (hooks LevelHooks) Add(hook Hook) {
- for _, level := range hook.Levels() {
- hooks[level] = append(hooks[level], hook)
- }
-}
-
-// Fire all the hooks for the passed level. Used by `entry.log` to fire
-// appropriate hooks for a log entry.
-func (hooks LevelHooks) Fire(level Level, entry *Entry) error {
- for _, hook := range hooks[level] {
- if err := hook.Fire(entry); err != nil {
- return err
- }
- }
-
- return nil
-}
diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go
deleted file mode 100644
index 2605753..0000000
--- a/vendor/github.com/sirupsen/logrus/json_formatter.go
+++ /dev/null
@@ -1,105 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
-)
-
-type fieldKey string
-
-// FieldMap allows customization of the key names for default fields.
-type FieldMap map[fieldKey]string
-
-func (f FieldMap) resolve(key fieldKey) string {
- if k, ok := f[key]; ok {
- return k
- }
-
- return string(key)
-}
-
-// JSONFormatter formats logs into parsable json
-type JSONFormatter struct {
- // TimestampFormat sets the format used for marshaling timestamps.
- TimestampFormat string
-
- // DisableTimestamp allows disabling automatic timestamps in output
- DisableTimestamp bool
-
- // DataKey allows users to put all the log entry parameters into a nested dictionary at a given key.
- DataKey string
-
- // FieldMap allows users to customize the names of keys for default fields.
- // As an example:
- // formatter := &JSONFormatter{
- // FieldMap: FieldMap{
- // FieldKeyTime: "@timestamp",
- // FieldKeyLevel: "@level",
- // FieldKeyMsg: "@message",
- // FieldKeyFunc: "@caller",
- // },
- // }
- FieldMap FieldMap
-
- // PrettyPrint will indent all json logs
- PrettyPrint bool
-}
-
-// Format renders a single log entry
-func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
- data := make(Fields, len(entry.Data)+4)
- for k, v := range entry.Data {
- switch v := v.(type) {
- case error:
- // Otherwise errors are ignored by `encoding/json`
- // https://github.com/sirupsen/logrus/issues/137
- data[k] = v.Error()
- default:
- data[k] = v
- }
- }
-
- if f.DataKey != "" {
- newData := make(Fields, 4)
- newData[f.DataKey] = data
- data = newData
- }
-
- prefixFieldClashes(data, f.FieldMap, entry.HasCaller())
-
- timestampFormat := f.TimestampFormat
- if timestampFormat == "" {
- timestampFormat = defaultTimestampFormat
- }
-
- if entry.err != "" {
- data[f.FieldMap.resolve(FieldKeyLogrusError)] = entry.err
- }
- if !f.DisableTimestamp {
- data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat)
- }
- data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message
- data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String()
- if entry.HasCaller() {
- data[f.FieldMap.resolve(FieldKeyFunc)] = entry.Caller.Function
- data[f.FieldMap.resolve(FieldKeyFile)] = fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line)
- }
-
- var b *bytes.Buffer
- if entry.Buffer != nil {
- b = entry.Buffer
- } else {
- b = &bytes.Buffer{}
- }
-
- encoder := json.NewEncoder(b)
- if f.PrettyPrint {
- encoder.SetIndent("", " ")
- }
- if err := encoder.Encode(data); err != nil {
- return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
- }
-
- return b.Bytes(), nil
-}
diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go
deleted file mode 100644
index 5ceca0e..0000000
--- a/vendor/github.com/sirupsen/logrus/logger.go
+++ /dev/null
@@ -1,415 +0,0 @@
-package logrus
-
-import (
- "io"
- "os"
- "sync"
- "sync/atomic"
- "time"
-)
-
-type Logger struct {
- // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
- // file, or leave it default which is `os.Stderr`. You can also set this to
- // something more adventurous, such as logging to Kafka.
- Out io.Writer
- // Hooks for the logger instance. These allow firing events based on logging
- // levels and log entries. For example, to send errors to an error tracking
- // service, log to StatsD or dump the core on fatal errors.
- Hooks LevelHooks
- // All log entries pass through the formatter before logged to Out. The
- // included formatters are `TextFormatter` and `JSONFormatter` for which
- // TextFormatter is the default. In development (when a TTY is attached) it
- // logs with colors, but to a file it wouldn't. You can easily implement your
- // own that implements the `Formatter` interface, see the `README` or included
- // formatters for examples.
- Formatter Formatter
-
- // Flag for whether to log caller info (off by default)
- ReportCaller bool
-
- // The logging level the logger should log at. This is typically (and defaults
- // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be
- // logged.
- Level Level
- // Used to sync writing to the log. Locking is enabled by Default
- mu MutexWrap
- // Reusable empty entry
- entryPool sync.Pool
- // Function to exit the application, defaults to `os.Exit()`
- ExitFunc exitFunc
-}
-
-type exitFunc func(int)
-
-type MutexWrap struct {
- lock sync.Mutex
- disabled bool
-}
-
-func (mw *MutexWrap) Lock() {
- if !mw.disabled {
- mw.lock.Lock()
- }
-}
-
-func (mw *MutexWrap) Unlock() {
- if !mw.disabled {
- mw.lock.Unlock()
- }
-}
-
-func (mw *MutexWrap) Disable() {
- mw.disabled = true
-}
-
-// Creates a new logger. Configuration should be set by changing `Formatter`,
-// `Out` and `Hooks` directly on the default logger instance. You can also just
-// instantiate your own:
-//
-// var log = &Logger{
-// Out: os.Stderr,
-// Formatter: new(JSONFormatter),
-// Hooks: make(LevelHooks),
-// Level: logrus.DebugLevel,
-// }
-//
-// It's recommended to make this a global instance called `log`.
-func New() *Logger {
- return &Logger{
- Out: os.Stderr,
- Formatter: new(TextFormatter),
- Hooks: make(LevelHooks),
- Level: InfoLevel,
- ExitFunc: os.Exit,
- ReportCaller: false,
- }
-}
-
-func (logger *Logger) newEntry() *Entry {
- entry, ok := logger.entryPool.Get().(*Entry)
- if ok {
- return entry
- }
- return NewEntry(logger)
-}
-
-func (logger *Logger) releaseEntry(entry *Entry) {
- entry.Data = map[string]interface{}{}
- logger.entryPool.Put(entry)
-}
-
-// Adds a field to the log entry, note that it doesn't log until you call
-// Debug, Print, Info, Warn, Error, Fatal or Panic. It only creates a log entry.
-// If you want multiple fields, use `WithFields`.
-func (logger *Logger) WithField(key string, value interface{}) *Entry {
- entry := logger.newEntry()
- defer logger.releaseEntry(entry)
- return entry.WithField(key, value)
-}
-
-// Adds a struct of fields to the log entry. All it does is call `WithField` for
-// each `Field`.
-func (logger *Logger) WithFields(fields Fields) *Entry {
- entry := logger.newEntry()
- defer logger.releaseEntry(entry)
- return entry.WithFields(fields)
-}
-
-// Add an error as single field to the log entry. All it does is call
-// `WithError` for the given `error`.
-func (logger *Logger) WithError(err error) *Entry {
- entry := logger.newEntry()
- defer logger.releaseEntry(entry)
- return entry.WithError(err)
-}
-
-// Overrides the time of the log entry.
-func (logger *Logger) WithTime(t time.Time) *Entry {
- entry := logger.newEntry()
- defer logger.releaseEntry(entry)
- return entry.WithTime(t)
-}
-
-func (logger *Logger) Tracef(format string, args ...interface{}) {
- if logger.IsLevelEnabled(TraceLevel) {
- entry := logger.newEntry()
- entry.Tracef(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Debugf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(DebugLevel) {
- entry := logger.newEntry()
- entry.Debugf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Infof(format string, args ...interface{}) {
- if logger.IsLevelEnabled(InfoLevel) {
- entry := logger.newEntry()
- entry.Infof(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Printf(format string, args ...interface{}) {
- entry := logger.newEntry()
- entry.Printf(format, args...)
- logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warnf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warnf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warningf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warnf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Errorf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(ErrorLevel) {
- entry := logger.newEntry()
- entry.Errorf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatalf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(FatalLevel) {
- entry := logger.newEntry()
- entry.Fatalf(format, args...)
- logger.releaseEntry(entry)
- }
- logger.Exit(1)
-}
-
-func (logger *Logger) Panicf(format string, args ...interface{}) {
- if logger.IsLevelEnabled(PanicLevel) {
- entry := logger.newEntry()
- entry.Panicf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Trace(args ...interface{}) {
- if logger.IsLevelEnabled(TraceLevel) {
- entry := logger.newEntry()
- entry.Trace(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Debug(args ...interface{}) {
- if logger.IsLevelEnabled(DebugLevel) {
- entry := logger.newEntry()
- entry.Debug(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Info(args ...interface{}) {
- if logger.IsLevelEnabled(InfoLevel) {
- entry := logger.newEntry()
- entry.Info(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Print(args ...interface{}) {
- entry := logger.newEntry()
- entry.Info(args...)
- logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warn(args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warn(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warning(args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warn(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Error(args ...interface{}) {
- if logger.IsLevelEnabled(ErrorLevel) {
- entry := logger.newEntry()
- entry.Error(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatal(args ...interface{}) {
- if logger.IsLevelEnabled(FatalLevel) {
- entry := logger.newEntry()
- entry.Fatal(args...)
- logger.releaseEntry(entry)
- }
- logger.Exit(1)
-}
-
-func (logger *Logger) Panic(args ...interface{}) {
- if logger.IsLevelEnabled(PanicLevel) {
- entry := logger.newEntry()
- entry.Panic(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Traceln(args ...interface{}) {
- if logger.IsLevelEnabled(TraceLevel) {
- entry := logger.newEntry()
- entry.Traceln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Debugln(args ...interface{}) {
- if logger.IsLevelEnabled(DebugLevel) {
- entry := logger.newEntry()
- entry.Debugln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Infoln(args ...interface{}) {
- if logger.IsLevelEnabled(InfoLevel) {
- entry := logger.newEntry()
- entry.Infoln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Println(args ...interface{}) {
- entry := logger.newEntry()
- entry.Println(args...)
- logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warnln(args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warnln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warningln(args ...interface{}) {
- if logger.IsLevelEnabled(WarnLevel) {
- entry := logger.newEntry()
- entry.Warnln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Errorln(args ...interface{}) {
- if logger.IsLevelEnabled(ErrorLevel) {
- entry := logger.newEntry()
- entry.Errorln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatalln(args ...interface{}) {
- if logger.IsLevelEnabled(FatalLevel) {
- entry := logger.newEntry()
- entry.Fatalln(args...)
- logger.releaseEntry(entry)
- }
- logger.Exit(1)
-}
-
-func (logger *Logger) Panicln(args ...interface{}) {
- if logger.IsLevelEnabled(PanicLevel) {
- entry := logger.newEntry()
- entry.Panicln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Exit(code int) {
- runHandlers()
- if logger.ExitFunc == nil {
- logger.ExitFunc = os.Exit
- }
- logger.ExitFunc(code)
-}
-
-//When file is opened with appending mode, it's safe to
-//write concurrently to a file (within 4k message on Linux).
-//In these cases user can choose to disable the lock.
-func (logger *Logger) SetNoLock() {
- logger.mu.Disable()
-}
-
-func (logger *Logger) level() Level {
- return Level(atomic.LoadUint32((*uint32)(&logger.Level)))
-}
-
-// SetLevel sets the logger level.
-func (logger *Logger) SetLevel(level Level) {
- atomic.StoreUint32((*uint32)(&logger.Level), uint32(level))
-}
-
-// GetLevel returns the logger level.
-func (logger *Logger) GetLevel() Level {
- return logger.level()
-}
-
-// AddHook adds a hook to the logger hooks.
-func (logger *Logger) AddHook(hook Hook) {
- logger.mu.Lock()
- defer logger.mu.Unlock()
- logger.Hooks.Add(hook)
-}
-
-// IsLevelEnabled checks if the log level of the logger is greater than the level param
-func (logger *Logger) IsLevelEnabled(level Level) bool {
- return logger.level() >= level
-}
-
-// SetFormatter sets the logger formatter.
-func (logger *Logger) SetFormatter(formatter Formatter) {
- logger.mu.Lock()
- defer logger.mu.Unlock()
- logger.Formatter = formatter
-}
-
-// SetOutput sets the logger output.
-func (logger *Logger) SetOutput(output io.Writer) {
- logger.mu.Lock()
- defer logger.mu.Unlock()
- logger.Out = output
-}
-
-func (logger *Logger) SetReportCaller(reportCaller bool) {
- logger.mu.Lock()
- defer logger.mu.Unlock()
- logger.ReportCaller = reportCaller
-}
-
-// ReplaceHooks replaces the logger hooks and returns the old ones
-func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks {
- logger.mu.Lock()
- oldHooks := logger.Hooks
- logger.Hooks = hooks
- logger.mu.Unlock()
- return oldHooks
-}
diff --git a/vendor/github.com/sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go
deleted file mode 100644
index 4ef4518..0000000
--- a/vendor/github.com/sirupsen/logrus/logrus.go
+++ /dev/null
@@ -1,178 +0,0 @@
-package logrus
-
-import (
- "fmt"
- "log"
- "strings"
-)
-
-// Fields type, used to pass to `WithFields`.
-type Fields map[string]interface{}
-
-// Level type
-type Level uint32
-
-// Convert the Level to a string. E.g. PanicLevel becomes "panic".
-func (level Level) String() string {
- switch level {
- case TraceLevel:
- return "trace"
- case DebugLevel:
- return "debug"
- case InfoLevel:
- return "info"
- case WarnLevel:
- return "warning"
- case ErrorLevel:
- return "error"
- case FatalLevel:
- return "fatal"
- case PanicLevel:
- return "panic"
- }
-
- return "unknown"
-}
-
-// ParseLevel takes a string level and returns the Logrus log level constant.
-func ParseLevel(lvl string) (Level, error) {
- switch strings.ToLower(lvl) {
- case "panic":
- return PanicLevel, nil
- case "fatal":
- return FatalLevel, nil
- case "error":
- return ErrorLevel, nil
- case "warn", "warning":
- return WarnLevel, nil
- case "info":
- return InfoLevel, nil
- case "debug":
- return DebugLevel, nil
- case "trace":
- return TraceLevel, nil
- }
-
- var l Level
- return l, fmt.Errorf("not a valid logrus Level: %q", lvl)
-}
-
-// UnmarshalText implements encoding.TextUnmarshaler.
-func (level *Level) UnmarshalText(text []byte) error {
- l, err := ParseLevel(string(text))
- if err != nil {
- return err
- }
-
- *level = Level(l)
-
- return nil
-}
-
-// A constant exposing all logging levels
-var AllLevels = []Level{
- PanicLevel,
- FatalLevel,
- ErrorLevel,
- WarnLevel,
- InfoLevel,
- DebugLevel,
- TraceLevel,
-}
-
-// These are the different logging levels. You can set the logging level to log
-// on your instance of logger, obtained with `logrus.New()`.
-const (
- // PanicLevel level, highest level of severity. Logs and then calls panic with the
- // message passed to Debug, Info, ...
- PanicLevel Level = iota
- // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
- // logging level is set to Panic.
- FatalLevel
- // ErrorLevel level. Logs. Used for errors that should definitely be noted.
- // Commonly used for hooks to send errors to an error tracking service.
- ErrorLevel
- // WarnLevel level. Non-critical entries that deserve eyes.
- WarnLevel
- // InfoLevel level. General operational entries about what's going on inside the
- // application.
- InfoLevel
- // DebugLevel level. Usually only enabled when debugging. Very verbose logging.
- DebugLevel
- // TraceLevel level. Designates finer-grained informational events than the Debug.
- TraceLevel
-)
-
-// Won't compile if StdLogger can't be realized by a log.Logger
-var (
- _ StdLogger = &log.Logger{}
- _ StdLogger = &Entry{}
- _ StdLogger = &Logger{}
-)
-
-// StdLogger is what your logrus-enabled library should take, that way
-// it'll accept a stdlib logger and a logrus logger. There's no standard
-// interface, this is the closest we get, unfortunately.
-type StdLogger interface {
- Print(...interface{})
- Printf(string, ...interface{})
- Println(...interface{})
-
- Fatal(...interface{})
- Fatalf(string, ...interface{})
- Fatalln(...interface{})
-
- Panic(...interface{})
- Panicf(string, ...interface{})
- Panicln(...interface{})
-}
-
-// The FieldLogger interface generalizes the Entry and Logger types
-type FieldLogger interface {
- WithField(key string, value interface{}) *Entry
- WithFields(fields Fields) *Entry
- WithError(err error) *Entry
-
- Debugf(format string, args ...interface{})
- Infof(format string, args ...interface{})
- Printf(format string, args ...interface{})
- Warnf(format string, args ...interface{})
- Warningf(format string, args ...interface{})
- Errorf(format string, args ...interface{})
- Fatalf(format string, args ...interface{})
- Panicf(format string, args ...interface{})
-
- Debug(args ...interface{})
- Info(args ...interface{})
- Print(args ...interface{})
- Warn(args ...interface{})
- Warning(args ...interface{})
- Error(args ...interface{})
- Fatal(args ...interface{})
- Panic(args ...interface{})
-
- Debugln(args ...interface{})
- Infoln(args ...interface{})
- Println(args ...interface{})
- Warnln(args ...interface{})
- Warningln(args ...interface{})
- Errorln(args ...interface{})
- Fatalln(args ...interface{})
- Panicln(args ...interface{})
-
- // IsDebugEnabled() bool
- // IsInfoEnabled() bool
- // IsWarnEnabled() bool
- // IsErrorEnabled() bool
- // IsFatalEnabled() bool
- // IsPanicEnabled() bool
-}
-
-// Ext1FieldLogger (the first extension to FieldLogger) is superfluous, it is
-// here for consistancy. Do not use. Use Logger or Entry instead.
-type Ext1FieldLogger interface {
- FieldLogger
- Tracef(format string, args ...interface{})
- Trace(args ...interface{})
- Traceln(args ...interface{})
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go
deleted file mode 100644
index 2403de9..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build appengine
-
-package logrus
-
-import (
- "io"
-)
-
-func checkIfTerminal(w io.Writer) bool {
- return true
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_js.go b/vendor/github.com/sirupsen/logrus/terminal_check_js.go
deleted file mode 100644
index 0c20975..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_check_js.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build js
-
-package logrus
-
-import (
- "io"
-)
-
-func checkIfTerminal(w io.Writer) bool {
- return false
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go
deleted file mode 100644
index cf309d6..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// +build !appengine,!js,!windows
-
-package logrus
-
-import (
- "io"
- "os"
-
- "golang.org/x/crypto/ssh/terminal"
-)
-
-func checkIfTerminal(w io.Writer) bool {
- switch v := w.(type) {
- case *os.File:
- return terminal.IsTerminal(int(v.Fd()))
- default:
- return false
- }
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
deleted file mode 100644
index 3b9d286..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// +build !appengine,!js,windows
-
-package logrus
-
-import (
- "io"
- "os"
- "syscall"
-)
-
-func checkIfTerminal(w io.Writer) bool {
- switch v := w.(type) {
- case *os.File:
- var mode uint32
- err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
- return err == nil
- default:
- return false
- }
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/sirupsen/logrus/terminal_notwindows.go
deleted file mode 100644
index 3dbd237..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_notwindows.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// +build !windows
-
-package logrus
-
-import "io"
-
-func initTerminal(w io.Writer) {
-}
diff --git a/vendor/github.com/sirupsen/logrus/terminal_windows.go b/vendor/github.com/sirupsen/logrus/terminal_windows.go
deleted file mode 100644
index b4ef528..0000000
--- a/vendor/github.com/sirupsen/logrus/terminal_windows.go
+++ /dev/null
@@ -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)
- }
-}
diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go
deleted file mode 100644
index 49ec92f..0000000
--- a/vendor/github.com/sirupsen/logrus/text_formatter.go
+++ /dev/null
@@ -1,269 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "fmt"
- "os"
- "sort"
- "strings"
- "sync"
- "time"
-)
-
-const (
- nocolor = 0
- red = 31
- green = 32
- yellow = 33
- blue = 36
- gray = 37
-)
-
-var (
- baseTimestamp time.Time
- emptyFieldMap FieldMap
-)
-
-func init() {
- baseTimestamp = time.Now()
-}
-
-// TextFormatter formats logs into text
-type TextFormatter struct {
- // Set to true to bypass checking for a TTY before outputting colors.
- ForceColors bool
-
- // Force disabling colors.
- DisableColors bool
-
- // Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/
- EnvironmentOverrideColors bool
-
- // Disable timestamp logging. useful when output is redirected to logging
- // system that already adds timestamps.
- DisableTimestamp bool
-
- // Enable logging the full timestamp when a TTY is attached instead of just
- // the time passed since beginning of execution.
- FullTimestamp bool
-
- // TimestampFormat to use for display when a full timestamp is printed
- TimestampFormat string
-
- // The fields are sorted by default for a consistent output. For applications
- // that log extremely frequently and don't use the JSON formatter this may not
- // be desired.
- DisableSorting bool
-
- // The keys sorting function, when uninitialized it uses sort.Strings.
- SortingFunc func([]string)
-
- // Disables the truncation of the level text to 4 characters.
- DisableLevelTruncation bool
-
- // QuoteEmptyFields will wrap empty fields in quotes if true
- QuoteEmptyFields bool
-
- // Whether the logger's out is to a terminal
- isTerminal bool
-
- // FieldMap allows users to customize the names of keys for default fields.
- // As an example:
- // formatter := &TextFormatter{
- // FieldMap: FieldMap{
- // FieldKeyTime: "@timestamp",
- // FieldKeyLevel: "@level",
- // FieldKeyMsg: "@message"}}
- FieldMap FieldMap
-
- terminalInitOnce sync.Once
-}
-
-func (f *TextFormatter) init(entry *Entry) {
- if entry.Logger != nil {
- f.isTerminal = checkIfTerminal(entry.Logger.Out)
-
- if f.isTerminal {
- initTerminal(entry.Logger.Out)
- }
- }
-}
-
-func (f *TextFormatter) isColored() bool {
- isColored := f.ForceColors || f.isTerminal
-
- if f.EnvironmentOverrideColors {
- if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok && force != "0" {
- isColored = true
- } else if ok && force == "0" {
- isColored = false
- } else if os.Getenv("CLICOLOR") == "0" {
- isColored = false
- }
- }
-
- return isColored && !f.DisableColors
-}
-
-// Format renders a single log entry
-func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
- prefixFieldClashes(entry.Data, f.FieldMap, entry.HasCaller())
-
- keys := make([]string, 0, len(entry.Data))
- for k := range entry.Data {
- keys = append(keys, k)
- }
-
- fixedKeys := make([]string, 0, 4+len(entry.Data))
- if !f.DisableTimestamp {
- fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyTime))
- }
- fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLevel))
- if entry.Message != "" {
- fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyMsg))
- }
- if entry.err != "" {
- fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLogrusError))
- }
- if entry.HasCaller() {
- fixedKeys = append(fixedKeys,
- f.FieldMap.resolve(FieldKeyFunc), f.FieldMap.resolve(FieldKeyFile))
- }
-
- if !f.DisableSorting {
- if f.SortingFunc == nil {
- sort.Strings(keys)
- fixedKeys = append(fixedKeys, keys...)
- } else {
- if !f.isColored() {
- fixedKeys = append(fixedKeys, keys...)
- f.SortingFunc(fixedKeys)
- } else {
- f.SortingFunc(keys)
- }
- }
- } else {
- fixedKeys = append(fixedKeys, keys...)
- }
-
- var b *bytes.Buffer
- if entry.Buffer != nil {
- b = entry.Buffer
- } else {
- b = &bytes.Buffer{}
- }
-
- f.terminalInitOnce.Do(func() { f.init(entry) })
-
- timestampFormat := f.TimestampFormat
- if timestampFormat == "" {
- timestampFormat = defaultTimestampFormat
- }
- if f.isColored() {
- f.printColored(b, entry, keys, timestampFormat)
- } else {
- for _, key := range fixedKeys {
- var value interface{}
- switch {
- case key == f.FieldMap.resolve(FieldKeyTime):
- value = entry.Time.Format(timestampFormat)
- case key == f.FieldMap.resolve(FieldKeyLevel):
- value = entry.Level.String()
- case key == f.FieldMap.resolve(FieldKeyMsg):
- value = entry.Message
- case key == f.FieldMap.resolve(FieldKeyLogrusError):
- value = entry.err
- case key == f.FieldMap.resolve(FieldKeyFunc) && entry.HasCaller():
- value = entry.Caller.Function
- case key == f.FieldMap.resolve(FieldKeyFile) && entry.HasCaller():
- value = fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line)
- default:
- value = entry.Data[key]
- }
- f.appendKeyValue(b, key, value)
- }
- }
-
- b.WriteByte('\n')
- return b.Bytes(), nil
-}
-
-func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) {
- var levelColor int
- switch entry.Level {
- case DebugLevel, TraceLevel:
- levelColor = gray
- case WarnLevel:
- levelColor = yellow
- case ErrorLevel, FatalLevel, PanicLevel:
- levelColor = red
- default:
- levelColor = blue
- }
-
- levelText := strings.ToUpper(entry.Level.String())
- if !f.DisableLevelTruncation {
- levelText = levelText[0:4]
- }
-
- // 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
- entry.Message = strings.TrimSuffix(entry.Message, "\n")
-
- caller := ""
-
- if entry.HasCaller() {
- caller = fmt.Sprintf("%s:%d %s()",
- entry.Caller.File, entry.Caller.Line, entry.Caller.Function)
- }
-
- if f.DisableTimestamp {
- fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message)
- } else if !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)
- } else {
- fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message)
- }
- for _, k := range keys {
- v := entry.Data[k]
- fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=", levelColor, k)
- f.appendValue(b, v)
- }
-}
-
-func (f *TextFormatter) needsQuoting(text string) bool {
- if f.QuoteEmptyFields && len(text) == 0 {
- return true
- }
- for _, ch := range text {
- if !((ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') ||
- ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '@' || ch == '^' || ch == '+') {
- return true
- }
- }
- return false
-}
-
-func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {
- if b.Len() > 0 {
- b.WriteByte(' ')
- }
- b.WriteString(key)
- b.WriteByte('=')
- f.appendValue(b, value)
-}
-
-func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) {
- stringVal, ok := value.(string)
- if !ok {
- stringVal = fmt.Sprint(value)
- }
-
- if !f.needsQuoting(stringVal) {
- b.WriteString(stringVal)
- } else {
- b.WriteString(fmt.Sprintf("%q", stringVal))
- }
-}
diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go
deleted file mode 100644
index 9e1f751..0000000
--- a/vendor/github.com/sirupsen/logrus/writer.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package logrus
-
-import (
- "bufio"
- "io"
- "runtime"
-)
-
-func (logger *Logger) Writer() *io.PipeWriter {
- return logger.WriterLevel(InfoLevel)
-}
-
-func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
- return NewEntry(logger).WriterLevel(level)
-}
-
-func (entry *Entry) Writer() *io.PipeWriter {
- return entry.WriterLevel(InfoLevel)
-}
-
-func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
- reader, writer := io.Pipe()
-
- var printFunc func(args ...interface{})
-
- switch level {
- case TraceLevel:
- printFunc = entry.Trace
- case DebugLevel:
- printFunc = entry.Debug
- case InfoLevel:
- printFunc = entry.Info
- case WarnLevel:
- printFunc = entry.Warn
- case ErrorLevel:
- printFunc = entry.Error
- case FatalLevel:
- printFunc = entry.Fatal
- case PanicLevel:
- printFunc = entry.Panic
- default:
- printFunc = entry.Print
- }
-
- go entry.writerScanner(reader, printFunc)
- runtime.SetFinalizer(writer, writerFinalizer)
-
- return writer
-}
-
-func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
- scanner := bufio.NewScanner(reader)
- for scanner.Scan() {
- printFunc(scanner.Text())
- }
- if err := scanner.Err(); err != nil {
- entry.Errorf("Error while reading from Writer: %s", err)
- }
- reader.Close()
-}
-
-func writerFinalizer(writer *io.PipeWriter) {
- writer.Close()
-}
diff --git a/vendor/github.com/spf13/pflag/.gitignore b/vendor/github.com/spf13/pflag/.gitignore
deleted file mode 100644
index c3da290..0000000
--- a/vendor/github.com/spf13/pflag/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.idea/*
-
diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml
deleted file mode 100644
index f8a63b3..0000000
--- a/vendor/github.com/spf13/pflag/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-sudo: false
-
-language: go
-
-go:
- - 1.7.3
- - 1.8.1
- - tip
-
-matrix:
- allow_failures:
- - go: tip
-
-install:
- - go get github.com/golang/lint/golint
- - export PATH=$GOPATH/bin:$PATH
- - go install ./...
-
-script:
- - verify/all.sh -v
- - go test ./...
diff --git a/vendor/github.com/spf13/pflag/LICENSE b/vendor/github.com/spf13/pflag/LICENSE
deleted file mode 100644
index 63ed1cf..0000000
--- a/vendor/github.com/spf13/pflag/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012 Alex Ogier. All rights reserved.
-Copyright (c) 2012 The 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.
diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md
deleted file mode 100644
index b052414..0000000
--- a/vendor/github.com/spf13/pflag/README.md
+++ /dev/null
@@ -1,296 +0,0 @@
-[](https://travis-ci.org/spf13/pflag)
-[](https://goreportcard.com/report/github.com/spf13/pflag)
-[](https://godoc.org/github.com/spf13/pflag)
-
-## Description
-
-pflag is a drop-in replacement for Go's flag package, implementing
-POSIX/GNU-style --flags.
-
-pflag is compatible with the [GNU extensions to the POSIX recommendations
-for command-line options][1]. For a more precise description, see the
-"Command-line flag syntax" section below.
-
-[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
-
-pflag is available under the same style of BSD license as the Go language,
-which can be found in the LICENSE file.
-
-## Installation
-
-pflag is available using the standard `go get` command.
-
-Install by running:
-
- go get github.com/spf13/pflag
-
-Run tests by running:
-
- go test github.com/spf13/pflag
-
-## Usage
-
-pflag is a drop-in replacement of Go's native flag package. If you import
-pflag under the name "flag" then all code should continue to function
-with no changes.
-
-``` go
-import flag "github.com/spf13/pflag"
-```
-
-There is one exception to this: if you directly instantiate the Flag struct
-there is one more field "Shorthand" that you will need to set.
-Most code never instantiates this struct directly, and instead uses
-functions such as String(), BoolVar(), and Var(), and is therefore
-unaffected.
-
-Define flags using flag.String(), Bool(), Int(), etc.
-
-This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
-
-``` go
-var ip *int = flag.Int("flagname", 1234, "help message for flagname")
-```
-
-If you like, you can bind the flag to a variable using the Var() functions.
-
-``` go
-var flagvar int
-func init() {
- flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
-}
-```
-
-Or you can create custom flags that satisfy the Value interface (with
-pointer receivers) and couple them to flag parsing by
-
-``` go
-flag.Var(&flagVal, "name", "help message for flagname")
-```
-
-For such flags, the default value is just the initial value of the variable.
-
-After all flags are defined, call
-
-``` go
-flag.Parse()
-```
-
-to parse the command line into the defined flags.
-
-Flags may then be used directly. If you're using the flags themselves,
-they are all pointers; if you bind to variables, they're values.
-
-``` go
-fmt.Println("ip has value ", *ip)
-fmt.Println("flagvar has value ", flagvar)
-```
-
-There are helpers function to get values later if you have the FlagSet but
-it was difficult to keep up with all of the flag pointers in your code.
-If you have a pflag.FlagSet with a flag called 'flagname' of type int you
-can use GetInt() to get the int value. But notice that 'flagname' must exist
-and it must be an int. GetString("flagname") will fail.
-
-``` go
-i, err := flagset.GetInt("flagname")
-```
-
-After parsing, the arguments after the flag are available as the
-slice flag.Args() or individually as flag.Arg(i).
-The arguments are indexed from 0 through flag.NArg()-1.
-
-The pflag package also defines some new functions that are not in flag,
-that give one-letter shorthands for flags. You can use these by appending
-'P' to the name of any function that defines a flag.
-
-``` go
-var ip = flag.IntP("flagname", "f", 1234, "help message")
-var flagvar bool
-func init() {
- flag.BoolVarP(&flagvar, "boolname", "b", true, "help message")
-}
-flag.VarP(&flagVal, "varname", "v", "help message")
-```
-
-Shorthand letters can be used with single dashes on the command line.
-Boolean shorthand flags can be combined with other shorthand flags.
-
-The default set of command-line flags is controlled by
-top-level functions. The FlagSet type allows one to define
-independent sets of flags, such as to implement subcommands
-in a command-line interface. The methods of FlagSet are
-analogous to the top-level functions for the command-line
-flag set.
-
-## Setting no option default values for flags
-
-After you create a flag it is possible to set the pflag.NoOptDefVal for
-the given flag. Doing this changes the meaning of the flag slightly. If
-a flag has a NoOptDefVal and the flag is set on the command line without
-an option the flag will be set to the NoOptDefVal. For example given:
-
-``` go
-var ip = flag.IntP("flagname", "f", 1234, "help message")
-flag.Lookup("flagname").NoOptDefVal = "4321"
-```
-
-Would result in something like
-
-| Parsed Arguments | Resulting Value |
-| ------------- | ------------- |
-| --flagname=1357 | ip=1357 |
-| --flagname | ip=4321 |
-| [nothing] | ip=1234 |
-
-## Command line flag syntax
-
-```
---flag // boolean flags, or flags with no option default values
---flag x // only on flags without a default value
---flag=x
-```
-
-Unlike the flag package, a single dash before an option means something
-different than a double dash. Single dashes signify a series of shorthand
-letters for flags. All but the last shorthand letter must be boolean flags
-or a flag with a default value
-
-```
-// boolean or flags where the 'no option default value' is set
--f
--f=true
--abc
-but
--b true is INVALID
-
-// non-boolean and flags without a 'no option default value'
--n 1234
--n=1234
--n1234
-
-// mixed
--abcs "hello"
--absd="hello"
--abcs1234
-```
-
-Flag parsing stops after the terminator "--". Unlike the flag package,
-flags can be interspersed with arguments anywhere on the command line
-before this terminator.
-
-Integer flags accept 1234, 0664, 0x1234 and may be negative.
-Boolean flags (in their long form) accept 1, 0, t, f, true, false,
-TRUE, FALSE, True, False.
-Duration flags accept any input valid for time.ParseDuration.
-
-## Mutating or "Normalizing" Flag names
-
-It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow.
-
-**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag
-
-``` go
-func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
- from := []string{"-", "_"}
- to := "."
- for _, sep := range from {
- name = strings.Replace(name, sep, to, -1)
- }
- return pflag.NormalizedName(name)
-}
-
-myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc)
-```
-
-**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name
-
-``` go
-func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
- switch name {
- case "old-flag-name":
- name = "new-flag-name"
- break
- }
- return pflag.NormalizedName(name)
-}
-
-myFlagSet.SetNormalizeFunc(aliasNormalizeFunc)
-```
-
-## Deprecating a flag or its shorthand
-It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used.
-
-**Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead.
-```go
-// deprecate a flag by specifying its name and a usage message
-flags.MarkDeprecated("badflag", "please use --good-flag instead")
-```
-This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used.
-
-**Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n".
-```go
-// deprecate a flag shorthand by specifying its flag name and a usage message
-flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only")
-```
-This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used.
-
-Note that usage message is essential here, and it should not be empty.
-
-## Hidden flags
-It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text.
-
-**Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available.
-```go
-// hide a flag by specifying its name
-flags.MarkHidden("secretFlag")
-```
-
-## Disable sorting of flags
-`pflag` allows you to disable sorting of flags for help and usage message.
-
-**Example**:
-```go
-flags.BoolP("verbose", "v", false, "verbose output")
-flags.String("coolflag", "yeaah", "it's really cool flag")
-flags.Int("usefulflag", 777, "sometimes it's very useful")
-flags.SortFlags = false
-flags.PrintDefaults()
-```
-**Output**:
-```
- -v, --verbose verbose output
- --coolflag string it's really cool flag (default "yeaah")
- --usefulflag int sometimes it's very useful (default 777)
-```
-
-
-## Supporting Go flags when using pflag
-In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary
-to support flags defined by third-party dependencies (e.g. `golang/glog`).
-
-**Example**: You want to add the Go flags to the `CommandLine` flagset
-```go
-import (
- goflag "flag"
- flag "github.com/spf13/pflag"
-)
-
-var ip *int = flag.Int("flagname", 1234, "help message for flagname")
-
-func main() {
- flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
- flag.Parse()
-}
-```
-
-## More info
-
-You can see the full reference documentation of the pflag package
-[at godoc.org][3], or through go's standard documentation system by
-running `godoc -http=:6060` and browsing to
-[http://localhost:6060/pkg/github.com/spf13/pflag][2] after
-installation.
-
-[2]: http://localhost:6060/pkg/github.com/spf13/pflag
-[3]: http://godoc.org/github.com/spf13/pflag
diff --git a/vendor/github.com/spf13/pflag/bool.go b/vendor/github.com/spf13/pflag/bool.go
deleted file mode 100644
index c4c5c0b..0000000
--- a/vendor/github.com/spf13/pflag/bool.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package pflag
-
-import "strconv"
-
-// optional interface to indicate boolean flags that can be
-// supplied without "=value" text
-type boolFlag interface {
- Value
- IsBoolFlag() bool
-}
-
-// -- bool Value
-type boolValue bool
-
-func newBoolValue(val bool, p *bool) *boolValue {
- *p = val
- return (*boolValue)(p)
-}
-
-func (b *boolValue) Set(s string) error {
- v, err := strconv.ParseBool(s)
- *b = boolValue(v)
- return err
-}
-
-func (b *boolValue) Type() string {
- return "bool"
-}
-
-func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) }
-
-func (b *boolValue) IsBoolFlag() bool { return true }
-
-func boolConv(sval string) (interface{}, error) {
- return strconv.ParseBool(sval)
-}
-
-// GetBool return the bool value of a flag with the given name
-func (f *FlagSet) GetBool(name string) (bool, error) {
- val, err := f.getFlagType(name, "bool", boolConv)
- if err != nil {
- return false, err
- }
- return val.(bool), nil
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
- f.BoolVarP(p, name, "", value, usage)
-}
-
-// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)
- flag.NoOptDefVal = "true"
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func BoolVar(p *bool, name string, value bool, usage string) {
- BoolVarP(p, name, "", value, usage)
-}
-
-// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage)
- flag.NoOptDefVal = "true"
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
- return f.BoolP(name, "", value, usage)
-}
-
-// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
- p := new(bool)
- f.BoolVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func Bool(name string, value bool, usage string) *bool {
- return BoolP(name, "", value, usage)
-}
-
-// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
-func BoolP(name, shorthand string, value bool, usage string) *bool {
- b := CommandLine.BoolP(name, shorthand, value, usage)
- return b
-}
diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go
deleted file mode 100644
index 5af02f1..0000000
--- a/vendor/github.com/spf13/pflag/bool_slice.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package pflag
-
-import (
- "io"
- "strconv"
- "strings"
-)
-
-// -- boolSlice Value
-type boolSliceValue struct {
- value *[]bool
- changed bool
-}
-
-func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue {
- bsv := new(boolSliceValue)
- bsv.value = p
- *bsv.value = val
- return bsv
-}
-
-// Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag.
-// If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended.
-func (s *boolSliceValue) Set(val string) error {
-
- // remove all quote characters
- rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
-
- // read flag arguments with CSV parser
- boolStrSlice, err := readAsCSV(rmQuote.Replace(val))
- if err != nil && err != io.EOF {
- return err
- }
-
- // parse boolean values into slice
- out := make([]bool, 0, len(boolStrSlice))
- for _, boolStr := range boolStrSlice {
- b, err := strconv.ParseBool(strings.TrimSpace(boolStr))
- if err != nil {
- return err
- }
- out = append(out, b)
- }
-
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
-
- s.changed = true
-
- return nil
-}
-
-// Type returns a string that uniquely represents this flag's type.
-func (s *boolSliceValue) Type() string {
- return "boolSlice"
-}
-
-// String defines a "native" format for this boolean slice flag value.
-func (s *boolSliceValue) String() string {
-
- boolStrSlice := make([]string, len(*s.value))
- for i, b := range *s.value {
- boolStrSlice[i] = strconv.FormatBool(b)
- }
-
- out, _ := writeAsCSV(boolStrSlice)
-
- return "[" + out + "]"
-}
-
-func boolSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []bool{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]bool, len(ss))
- for i, t := range ss {
- var err error
- out[i], err = strconv.ParseBool(t)
- if err != nil {
- return nil, err
- }
- }
- return out, nil
-}
-
-// GetBoolSlice returns the []bool value of a flag with the given name.
-func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
- val, err := f.getFlagType(name, "boolSlice", boolSliceConv)
- if err != nil {
- return []bool{}, err
- }
- return val.([]bool), nil
-}
-
-// BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string.
-// The argument p points to a []bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
- f.VarP(newBoolSliceValue(value, p), name, "", usage)
-}
-
-// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
- f.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
-}
-
-// BoolSliceVar defines a []bool flag with specified name, default value, and usage string.
-// The argument p points to a []bool variable in which to store the value of the flag.
-func BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
- CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage)
-}
-
-// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
- CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
-}
-
-// BoolSlice defines a []bool flag with specified name, default value, and usage string.
-// The return value is the address of a []bool variable that stores the value of the flag.
-func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool {
- p := []bool{}
- f.BoolSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
- p := []bool{}
- f.BoolSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// BoolSlice defines a []bool flag with specified name, default value, and usage string.
-// The return value is the address of a []bool variable that stores the value of the flag.
-func BoolSlice(name string, value []bool, usage string) *[]bool {
- return CommandLine.BoolSliceP(name, "", value, usage)
-}
-
-// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
-func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
- return CommandLine.BoolSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/bytes.go b/vendor/github.com/spf13/pflag/bytes.go
deleted file mode 100644
index 67d5304..0000000
--- a/vendor/github.com/spf13/pflag/bytes.go
+++ /dev/null
@@ -1,209 +0,0 @@
-package pflag
-
-import (
- "encoding/base64"
- "encoding/hex"
- "fmt"
- "strings"
-)
-
-// BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded
-type bytesHexValue []byte
-
-// String implements pflag.Value.String.
-func (bytesHex bytesHexValue) String() string {
- return fmt.Sprintf("%X", []byte(bytesHex))
-}
-
-// Set implements pflag.Value.Set.
-func (bytesHex *bytesHexValue) Set(value string) error {
- bin, err := hex.DecodeString(strings.TrimSpace(value))
-
- if err != nil {
- return err
- }
-
- *bytesHex = bin
-
- return nil
-}
-
-// Type implements pflag.Value.Type.
-func (*bytesHexValue) Type() string {
- return "bytesHex"
-}
-
-func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue {
- *p = val
- return (*bytesHexValue)(p)
-}
-
-func bytesHexConv(sval string) (interface{}, error) {
-
- bin, err := hex.DecodeString(sval)
-
- if err == nil {
- return bin, nil
- }
-
- return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err)
-}
-
-// GetBytesHex return the []byte value of a flag with the given name
-func (f *FlagSet) GetBytesHex(name string) ([]byte, error) {
- val, err := f.getFlagType(name, "bytesHex", bytesHexConv)
-
- if err != nil {
- return []byte{}, err
- }
-
- return val.([]byte), nil
-}
-
-// BytesHexVar defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) {
- f.VarP(newBytesHexValue(value, p), name, "", usage)
-}
-
-// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- f.VarP(newBytesHexValue(value, p), name, shorthand, usage)
-}
-
-// BytesHexVar defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func BytesHexVar(p *[]byte, name string, value []byte, usage string) {
- CommandLine.VarP(newBytesHexValue(value, p), name, "", usage)
-}
-
-// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.
-func BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- CommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage)
-}
-
-// BytesHex defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesHexVarP(p, name, "", value, usage)
- return p
-}
-
-// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesHexVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// BytesHex defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func BytesHex(name string, value []byte, usage string) *[]byte {
- return CommandLine.BytesHexP(name, "", value, usage)
-}
-
-// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.
-func BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {
- return CommandLine.BytesHexP(name, shorthand, value, usage)
-}
-
-// BytesBase64 adapts []byte for use as a flag. Value of flag is Base64 encoded
-type bytesBase64Value []byte
-
-// String implements pflag.Value.String.
-func (bytesBase64 bytesBase64Value) String() string {
- return base64.StdEncoding.EncodeToString([]byte(bytesBase64))
-}
-
-// Set implements pflag.Value.Set.
-func (bytesBase64 *bytesBase64Value) Set(value string) error {
- bin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value))
-
- if err != nil {
- return err
- }
-
- *bytesBase64 = bin
-
- return nil
-}
-
-// Type implements pflag.Value.Type.
-func (*bytesBase64Value) Type() string {
- return "bytesBase64"
-}
-
-func newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value {
- *p = val
- return (*bytesBase64Value)(p)
-}
-
-func bytesBase64ValueConv(sval string) (interface{}, error) {
-
- bin, err := base64.StdEncoding.DecodeString(sval)
- if err == nil {
- return bin, nil
- }
-
- return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err)
-}
-
-// GetBytesBase64 return the []byte value of a flag with the given name
-func (f *FlagSet) GetBytesBase64(name string) ([]byte, error) {
- val, err := f.getFlagType(name, "bytesBase64", bytesBase64ValueConv)
-
- if err != nil {
- return []byte{}, err
- }
-
- return val.([]byte), nil
-}
-
-// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func (f *FlagSet) BytesBase64Var(p *[]byte, name string, value []byte, usage string) {
- f.VarP(newBytesBase64Value(value, p), name, "", usage)
-}
-
-// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- f.VarP(newBytesBase64Value(value, p), name, shorthand, usage)
-}
-
-// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func BytesBase64Var(p *[]byte, name string, value []byte, usage string) {
- CommandLine.VarP(newBytesBase64Value(value, p), name, "", usage)
-}
-
-// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.
-func BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- CommandLine.VarP(newBytesBase64Value(value, p), name, shorthand, usage)
-}
-
-// BytesBase64 defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func (f *FlagSet) BytesBase64(name string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesBase64VarP(p, name, "", value, usage)
- return p
-}
-
-// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesBase64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// BytesBase64 defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func BytesBase64(name string, value []byte, usage string) *[]byte {
- return CommandLine.BytesBase64P(name, "", value, usage)
-}
-
-// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.
-func BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {
- return CommandLine.BytesBase64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go
deleted file mode 100644
index aa126e4..0000000
--- a/vendor/github.com/spf13/pflag/count.go
+++ /dev/null
@@ -1,96 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- count Value
-type countValue int
-
-func newCountValue(val int, p *int) *countValue {
- *p = val
- return (*countValue)(p)
-}
-
-func (i *countValue) Set(s string) error {
- // "+1" means that no specific value was passed, so increment
- if s == "+1" {
- *i = countValue(*i + 1)
- return nil
- }
- v, err := strconv.ParseInt(s, 0, 0)
- *i = countValue(v)
- return err
-}
-
-func (i *countValue) Type() string {
- return "count"
-}
-
-func (i *countValue) String() string { return strconv.Itoa(int(*i)) }
-
-func countConv(sval string) (interface{}, error) {
- i, err := strconv.Atoi(sval)
- if err != nil {
- return nil, err
- }
- return i, nil
-}
-
-// GetCount return the int value of a flag with the given name
-func (f *FlagSet) GetCount(name string) (int, error) {
- val, err := f.getFlagType(name, "count", countConv)
- if err != nil {
- return 0, err
- }
- return val.(int), nil
-}
-
-// CountVar defines a count flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func (f *FlagSet) CountVar(p *int, name string, usage string) {
- f.CountVarP(p, name, "", usage)
-}
-
-// CountVarP is like CountVar only take a shorthand for the flag name.
-func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) {
- flag := f.VarPF(newCountValue(0, p), name, shorthand, usage)
- flag.NoOptDefVal = "+1"
-}
-
-// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
-func CountVar(p *int, name string, usage string) {
- CommandLine.CountVar(p, name, usage)
-}
-
-// CountVarP is like CountVar only take a shorthand for the flag name.
-func CountVarP(p *int, name, shorthand string, usage string) {
- CommandLine.CountVarP(p, name, shorthand, usage)
-}
-
-// Count defines a count flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func (f *FlagSet) Count(name string, usage string) *int {
- p := new(int)
- f.CountVarP(p, name, "", usage)
- return p
-}
-
-// CountP is like Count only takes a shorthand for the flag name.
-func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
- p := new(int)
- f.CountVarP(p, name, shorthand, usage)
- return p
-}
-
-// Count defines a count flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func Count(name string, usage string) *int {
- return CommandLine.CountP(name, "", usage)
-}
-
-// CountP is like Count only takes a shorthand for the flag name.
-func CountP(name, shorthand string, usage string) *int {
- return CommandLine.CountP(name, shorthand, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/duration.go b/vendor/github.com/spf13/pflag/duration.go
deleted file mode 100644
index e9debef..0000000
--- a/vendor/github.com/spf13/pflag/duration.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package pflag
-
-import (
- "time"
-)
-
-// -- time.Duration Value
-type durationValue time.Duration
-
-func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
- *p = val
- return (*durationValue)(p)
-}
-
-func (d *durationValue) Set(s string) error {
- v, err := time.ParseDuration(s)
- *d = durationValue(v)
- return err
-}
-
-func (d *durationValue) Type() string {
- return "duration"
-}
-
-func (d *durationValue) String() string { return (*time.Duration)(d).String() }
-
-func durationConv(sval string) (interface{}, error) {
- return time.ParseDuration(sval)
-}
-
-// GetDuration return the duration value of a flag with the given name
-func (f *FlagSet) GetDuration(name string) (time.Duration, error) {
- val, err := f.getFlagType(name, "duration", durationConv)
- if err != nil {
- return 0, err
- }
- return val.(time.Duration), nil
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
- f.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
- f.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
- CommandLine.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
- CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {
- p := new(time.Duration)
- f.DurationVarP(p, name, "", value, usage)
- return p
-}
-
-// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
- p := new(time.Duration)
- f.DurationVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func Duration(name string, value time.Duration, usage string) *time.Duration {
- return CommandLine.DurationP(name, "", value, usage)
-}
-
-// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
-func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
- return CommandLine.DurationP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go
deleted file mode 100644
index 52c6b6d..0000000
--- a/vendor/github.com/spf13/pflag/duration_slice.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strings"
- "time"
-)
-
-// -- durationSlice Value
-type durationSliceValue struct {
- value *[]time.Duration
- changed bool
-}
-
-func newDurationSliceValue(val []time.Duration, p *[]time.Duration) *durationSliceValue {
- dsv := new(durationSliceValue)
- dsv.value = p
- *dsv.value = val
- return dsv
-}
-
-func (s *durationSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]time.Duration, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = time.ParseDuration(d)
- if err != nil {
- return err
- }
-
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *durationSliceValue) Type() string {
- return "durationSlice"
-}
-
-func (s *durationSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%s", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func durationSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []time.Duration{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]time.Duration, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = time.ParseDuration(d)
- if err != nil {
- return nil, err
- }
-
- }
- return out, nil
-}
-
-// GetDurationSlice returns the []time.Duration value of a flag with the given name
-func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) {
- val, err := f.getFlagType(name, "durationSlice", durationSliceConv)
- if err != nil {
- return []time.Duration{}, err
- }
- return val.([]time.Duration), nil
-}
-
-// DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string.
-// The argument p points to a []time.Duration variable in which to store the value of the flag.
-func (f *FlagSet) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) {
- f.VarP(newDurationSliceValue(value, p), name, "", usage)
-}
-
-// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) {
- f.VarP(newDurationSliceValue(value, p), name, shorthand, usage)
-}
-
-// DurationSliceVar defines a duration[] flag with specified name, default value, and usage string.
-// The argument p points to a duration[] variable in which to store the value of the flag.
-func DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) {
- CommandLine.VarP(newDurationSliceValue(value, p), name, "", usage)
-}
-
-// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) {
- CommandLine.VarP(newDurationSliceValue(value, p), name, shorthand, usage)
-}
-
-// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a []time.Duration variable that stores the value of the flag.
-func (f *FlagSet) DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration {
- p := []time.Duration{}
- f.DurationSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration {
- p := []time.Duration{}
- f.DurationSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a []time.Duration variable that stores the value of the flag.
-func DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration {
- return CommandLine.DurationSliceP(name, "", value, usage)
-}
-
-// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash.
-func DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration {
- return CommandLine.DurationSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
deleted file mode 100644
index 9beeda8..0000000
--- a/vendor/github.com/spf13/pflag/flag.go
+++ /dev/null
@@ -1,1227 +0,0 @@
-// Copyright 2009 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.
-
-/*
-Package pflag is a drop-in replacement for Go's flag package, implementing
-POSIX/GNU-style --flags.
-
-pflag is compatible with the GNU extensions to the POSIX recommendations
-for command-line options. See
-http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
-
-Usage:
-
-pflag is a drop-in replacement of Go's native flag package. If you import
-pflag under the name "flag" then all code should continue to function
-with no changes.
-
- import flag "github.com/spf13/pflag"
-
-There is one exception to this: if you directly instantiate the Flag struct
-there is one more field "Shorthand" that you will need to set.
-Most code never instantiates this struct directly, and instead uses
-functions such as String(), BoolVar(), and Var(), and is therefore
-unaffected.
-
-Define flags using flag.String(), Bool(), Int(), etc.
-
-This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
- var ip = flag.Int("flagname", 1234, "help message for flagname")
-If you like, you can bind the flag to a variable using the Var() functions.
- var flagvar int
- func init() {
- flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
- }
-Or you can create custom flags that satisfy the Value interface (with
-pointer receivers) and couple them to flag parsing by
- flag.Var(&flagVal, "name", "help message for flagname")
-For such flags, the default value is just the initial value of the variable.
-
-After all flags are defined, call
- flag.Parse()
-to parse the command line into the defined flags.
-
-Flags may then be used directly. If you're using the flags themselves,
-they are all pointers; if you bind to variables, they're values.
- fmt.Println("ip has value ", *ip)
- fmt.Println("flagvar has value ", flagvar)
-
-After parsing, the arguments after the flag are available as the
-slice flag.Args() or individually as flag.Arg(i).
-The arguments are indexed from 0 through flag.NArg()-1.
-
-The pflag package also defines some new functions that are not in flag,
-that give one-letter shorthands for flags. You can use these by appending
-'P' to the name of any function that defines a flag.
- var ip = flag.IntP("flagname", "f", 1234, "help message")
- var flagvar bool
- func init() {
- flag.BoolVarP("boolname", "b", true, "help message")
- }
- flag.VarP(&flagVar, "varname", "v", 1234, "help message")
-Shorthand letters can be used with single dashes on the command line.
-Boolean shorthand flags can be combined with other shorthand flags.
-
-Command line flag syntax:
- --flag // boolean flags only
- --flag=x
-
-Unlike the flag package, a single dash before an option means something
-different than a double dash. Single dashes signify a series of shorthand
-letters for flags. All but the last shorthand letter must be boolean flags.
- // boolean flags
- -f
- -abc
- // non-boolean flags
- -n 1234
- -Ifile
- // mixed
- -abcs "hello"
- -abcn1234
-
-Flag parsing stops after the terminator "--". Unlike the flag package,
-flags can be interspersed with arguments anywhere on the command line
-before this terminator.
-
-Integer flags accept 1234, 0664, 0x1234 and may be negative.
-Boolean flags (in their long form) accept 1, 0, t, f, true, false,
-TRUE, FALSE, True, False.
-Duration flags accept any input valid for time.ParseDuration.
-
-The default set of command-line flags is controlled by
-top-level functions. The FlagSet type allows one to define
-independent sets of flags, such as to implement subcommands
-in a command-line interface. The methods of FlagSet are
-analogous to the top-level functions for the command-line
-flag set.
-*/
-package pflag
-
-import (
- "bytes"
- "errors"
- goflag "flag"
- "fmt"
- "io"
- "os"
- "sort"
- "strings"
-)
-
-// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.
-var ErrHelp = errors.New("pflag: help requested")
-
-// ErrorHandling defines how to handle flag parsing errors.
-type ErrorHandling int
-
-const (
- // ContinueOnError will return an err from Parse() if an error is found
- ContinueOnError ErrorHandling = iota
- // ExitOnError will call os.Exit(2) if an error is found when parsing
- ExitOnError
- // PanicOnError will panic() if an error is found when parsing flags
- PanicOnError
-)
-
-// ParseErrorsWhitelist defines the parsing errors that can be ignored
-type ParseErrorsWhitelist struct {
- // UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
- UnknownFlags bool
-}
-
-// NormalizedName is a flag name that has been normalized according to rules
-// for the FlagSet (e.g. making '-' and '_' equivalent).
-type NormalizedName string
-
-// A FlagSet represents a set of defined flags.
-type FlagSet struct {
- // Usage is the function called when an error occurs while parsing flags.
- // The field is a function (not a method) that may be changed to point to
- // a custom error handler.
- Usage func()
-
- // SortFlags is used to indicate, if user wants to have sorted flags in
- // help/usage messages.
- SortFlags bool
-
- // ParseErrorsWhitelist is used to configure a whitelist of errors
- ParseErrorsWhitelist ParseErrorsWhitelist
-
- name string
- parsed bool
- actual map[NormalizedName]*Flag
- orderedActual []*Flag
- sortedActual []*Flag
- formal map[NormalizedName]*Flag
- orderedFormal []*Flag
- sortedFormal []*Flag
- shorthands map[byte]*Flag
- args []string // arguments after flags
- argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no --
- errorHandling ErrorHandling
- output io.Writer // nil means stderr; use out() accessor
- interspersed bool // allow interspersed option/non-option args
- normalizeNameFunc func(f *FlagSet, name string) NormalizedName
-
- addedGoFlagSets []*goflag.FlagSet
-}
-
-// A Flag represents the state of a flag.
-type Flag struct {
- Name string // name as it appears on command line
- Shorthand string // one-letter abbreviated flag
- Usage string // help message
- Value Value // value as set
- DefValue string // default value (as text); for usage message
- Changed bool // If the user set the value (or if left to default)
- NoOptDefVal string // default value (as text); if the flag is on the command line without any options
- Deprecated string // If this flag is deprecated, this string is the new or now thing to use
- Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text
- ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use
- Annotations map[string][]string // used by cobra.Command bash autocomple code
-}
-
-// Value is the interface to the dynamic value stored in a flag.
-// (The default value is represented as a string.)
-type Value interface {
- String() string
- Set(string) error
- Type() string
-}
-
-// sortFlags returns the flags as a slice in lexicographical sorted order.
-func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
- list := make(sort.StringSlice, len(flags))
- i := 0
- for k := range flags {
- list[i] = string(k)
- i++
- }
- list.Sort()
- result := make([]*Flag, len(list))
- for i, name := range list {
- result[i] = flags[NormalizedName(name)]
- }
- return result
-}
-
-// SetNormalizeFunc allows you to add a function which can translate flag names.
-// Flags added to the FlagSet will be translated and then when anything tries to
-// look up the flag that will also be translated. So it would be possible to create
-// a flag named "getURL" and have it translated to "geturl". A user could then pass
-// "--getUrl" which may also be translated to "geturl" and everything will work.
-func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
- f.normalizeNameFunc = n
- f.sortedFormal = f.sortedFormal[:0]
- for fname, flag := range f.formal {
- nname := f.normalizeFlagName(flag.Name)
- if fname == nname {
- continue
- }
- flag.Name = string(nname)
- delete(f.formal, fname)
- f.formal[nname] = flag
- if _, set := f.actual[fname]; set {
- delete(f.actual, fname)
- f.actual[nname] = flag
- }
- }
-}
-
-// GetNormalizeFunc returns the previously set NormalizeFunc of a function which
-// does no translation, if not set previously.
-func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName {
- if f.normalizeNameFunc != nil {
- return f.normalizeNameFunc
- }
- return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) }
-}
-
-func (f *FlagSet) normalizeFlagName(name string) NormalizedName {
- n := f.GetNormalizeFunc()
- return n(f, name)
-}
-
-func (f *FlagSet) out() io.Writer {
- if f.output == nil {
- return os.Stderr
- }
- return f.output
-}
-
-// SetOutput sets the destination for usage and error messages.
-// If output is nil, os.Stderr is used.
-func (f *FlagSet) SetOutput(output io.Writer) {
- f.output = output
-}
-
-// VisitAll visits the flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits all flags, even those not set.
-func (f *FlagSet) VisitAll(fn func(*Flag)) {
- if len(f.formal) == 0 {
- return
- }
-
- var flags []*Flag
- if f.SortFlags {
- if len(f.formal) != len(f.sortedFormal) {
- f.sortedFormal = sortFlags(f.formal)
- }
- flags = f.sortedFormal
- } else {
- flags = f.orderedFormal
- }
-
- for _, flag := range flags {
- fn(flag)
- }
-}
-
-// HasFlags returns a bool to indicate if the FlagSet has any flags defined.
-func (f *FlagSet) HasFlags() bool {
- return len(f.formal) > 0
-}
-
-// HasAvailableFlags returns a bool to indicate if the FlagSet has any flags
-// that are not hidden.
-func (f *FlagSet) HasAvailableFlags() bool {
- for _, flag := range f.formal {
- if !flag.Hidden {
- return true
- }
- }
- return false
-}
-
-// VisitAll visits the command-line flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits all flags, even those not set.
-func VisitAll(fn func(*Flag)) {
- CommandLine.VisitAll(fn)
-}
-
-// Visit visits the flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits only those flags that have been set.
-func (f *FlagSet) Visit(fn func(*Flag)) {
- if len(f.actual) == 0 {
- return
- }
-
- var flags []*Flag
- if f.SortFlags {
- if len(f.actual) != len(f.sortedActual) {
- f.sortedActual = sortFlags(f.actual)
- }
- flags = f.sortedActual
- } else {
- flags = f.orderedActual
- }
-
- for _, flag := range flags {
- fn(flag)
- }
-}
-
-// Visit visits the command-line flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits only those flags that have been set.
-func Visit(fn func(*Flag)) {
- CommandLine.Visit(fn)
-}
-
-// Lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) Lookup(name string) *Flag {
- return f.lookup(f.normalizeFlagName(name))
-}
-
-// ShorthandLookup returns the Flag structure of the short handed flag,
-// returning nil if none exists.
-// It panics, if len(name) > 1.
-func (f *FlagSet) ShorthandLookup(name string) *Flag {
- if name == "" {
- return nil
- }
- if len(name) > 1 {
- msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- c := name[0]
- return f.shorthands[c]
-}
-
-// lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) lookup(name NormalizedName) *Flag {
- return f.formal[name]
-}
-
-// func to return a given type for a given flag name
-func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {
- flag := f.Lookup(name)
- if flag == nil {
- err := fmt.Errorf("flag accessed but not defined: %s", name)
- return nil, err
- }
-
- if flag.Value.Type() != ftype {
- err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type())
- return nil, err
- }
-
- sval := flag.Value.String()
- result, err := convFunc(sval)
- if err != nil {
- return nil, err
- }
- return result, nil
-}
-
-// ArgsLenAtDash will return the length of f.Args at the moment when a -- was
-// found during arg parsing. This allows your program to know which args were
-// before the -- and which came after.
-func (f *FlagSet) ArgsLenAtDash() int {
- return f.argsLenAtDash
-}
-
-// MarkDeprecated indicated that a flag is deprecated in your program. It will
-// continue to function but will not show up in help or usage messages. Using
-// this flag will also print the given usageMessage.
-func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- if usageMessage == "" {
- return fmt.Errorf("deprecated message for flag %q must be set", name)
- }
- flag.Deprecated = usageMessage
- flag.Hidden = true
- return nil
-}
-
-// MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your
-// program. It will continue to function but will not show up in help or usage
-// messages. Using this flag will also print the given usageMessage.
-func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- if usageMessage == "" {
- return fmt.Errorf("deprecated message for flag %q must be set", name)
- }
- flag.ShorthandDeprecated = usageMessage
- return nil
-}
-
-// MarkHidden sets a flag to 'hidden' in your program. It will continue to
-// function but will not show up in help or usage messages.
-func (f *FlagSet) MarkHidden(name string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- flag.Hidden = true
- return nil
-}
-
-// Lookup returns the Flag structure of the named command-line flag,
-// returning nil if none exists.
-func Lookup(name string) *Flag {
- return CommandLine.Lookup(name)
-}
-
-// ShorthandLookup returns the Flag structure of the short handed flag,
-// returning nil if none exists.
-func ShorthandLookup(name string) *Flag {
- return CommandLine.ShorthandLookup(name)
-}
-
-// Set sets the value of the named flag.
-func (f *FlagSet) Set(name, value string) error {
- normalName := f.normalizeFlagName(name)
- flag, ok := f.formal[normalName]
- if !ok {
- return fmt.Errorf("no such flag -%v", name)
- }
-
- err := flag.Value.Set(value)
- if err != nil {
- var flagName string
- if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
- flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name)
- } else {
- flagName = fmt.Sprintf("--%s", flag.Name)
- }
- return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err)
- }
-
- if !flag.Changed {
- if f.actual == nil {
- f.actual = make(map[NormalizedName]*Flag)
- }
- f.actual[normalName] = flag
- f.orderedActual = append(f.orderedActual, flag)
-
- flag.Changed = true
- }
-
- if flag.Deprecated != "" {
- fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
- }
- return nil
-}
-
-// SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet.
-// This is sometimes used by spf13/cobra programs which want to generate additional
-// bash completion information.
-func (f *FlagSet) SetAnnotation(name, key string, values []string) error {
- normalName := f.normalizeFlagName(name)
- flag, ok := f.formal[normalName]
- if !ok {
- return fmt.Errorf("no such flag -%v", name)
- }
- if flag.Annotations == nil {
- flag.Annotations = map[string][]string{}
- }
- flag.Annotations[key] = values
- return nil
-}
-
-// Changed returns true if the flag was explicitly set during Parse() and false
-// otherwise
-func (f *FlagSet) Changed(name string) bool {
- flag := f.Lookup(name)
- // If a flag doesn't exist, it wasn't changed....
- if flag == nil {
- return false
- }
- return flag.Changed
-}
-
-// Set sets the value of the named command-line flag.
-func Set(name, value string) error {
- return CommandLine.Set(name, value)
-}
-
-// PrintDefaults prints, to standard error unless configured
-// otherwise, the default values of all defined flags in the set.
-func (f *FlagSet) PrintDefaults() {
- usages := f.FlagUsages()
- fmt.Fprint(f.out(), usages)
-}
-
-// defaultIsZeroValue returns true if the default value for this flag represents
-// a zero value.
-func (f *Flag) defaultIsZeroValue() bool {
- switch f.Value.(type) {
- case boolFlag:
- return f.DefValue == "false"
- case *durationValue:
- // Beginning in Go 1.7, duration zero values are "0s"
- return f.DefValue == "0" || f.DefValue == "0s"
- case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value:
- return f.DefValue == "0"
- case *stringValue:
- return f.DefValue == ""
- case *ipValue, *ipMaskValue, *ipNetValue:
- return f.DefValue == ""
- case *intSliceValue, *stringSliceValue, *stringArrayValue:
- return f.DefValue == "[]"
- default:
- switch f.Value.String() {
- case "false":
- return true
- case "":
- return true
- case "":
- return true
- case "0":
- return true
- }
- return false
- }
-}
-
-// UnquoteUsage extracts a back-quoted name from the usage
-// string for a flag and returns it and the un-quoted usage.
-// Given "a `name` to show" it returns ("name", "a name to show").
-// If there are no back quotes, the name is an educated guess of the
-// type of the flag's value, or the empty string if the flag is boolean.
-func UnquoteUsage(flag *Flag) (name string, usage string) {
- // Look for a back-quoted name, but avoid the strings package.
- usage = flag.Usage
- for i := 0; i < len(usage); i++ {
- if usage[i] == '`' {
- for j := i + 1; j < len(usage); j++ {
- if usage[j] == '`' {
- name = usage[i+1 : j]
- usage = usage[:i] + name + usage[j+1:]
- return name, usage
- }
- }
- break // Only one back quote; use type name.
- }
- }
-
- name = flag.Value.Type()
- switch name {
- case "bool":
- name = ""
- case "float64":
- name = "float"
- case "int64":
- name = "int"
- case "uint64":
- name = "uint"
- case "stringSlice":
- name = "strings"
- case "intSlice":
- name = "ints"
- case "uintSlice":
- name = "uints"
- case "boolSlice":
- name = "bools"
- }
-
- return
-}
-
-// Splits the string `s` on whitespace into an initial substring up to
-// `i` runes in length and the remainder. Will go `slop` over `i` if
-// that encompasses the entire string (which allows the caller to
-// avoid short orphan words on the final line).
-func wrapN(i, slop int, s string) (string, string) {
- if i+slop > len(s) {
- return s, ""
- }
-
- w := strings.LastIndexAny(s[:i], " \t\n")
- if w <= 0 {
- return s, ""
- }
- nlPos := strings.LastIndex(s[:i], "\n")
- if nlPos > 0 && nlPos < w {
- return s[:nlPos], s[nlPos+1:]
- }
- return s[:w], s[w+1:]
-}
-
-// Wraps the string `s` to a maximum width `w` with leading indent
-// `i`. The first line is not indented (this is assumed to be done by
-// caller). Pass `w` == 0 to do no wrapping
-func wrap(i, w int, s string) string {
- if w == 0 {
- return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1)
- }
-
- // space between indent i and end of line width w into which
- // we should wrap the text.
- wrap := w - i
-
- var r, l string
-
- // Not enough space for sensible wrapping. Wrap as a block on
- // the next line instead.
- if wrap < 24 {
- i = 16
- wrap = w - i
- r += "\n" + strings.Repeat(" ", i)
- }
- // If still not enough space then don't even try to wrap.
- if wrap < 24 {
- return strings.Replace(s, "\n", r, -1)
- }
-
- // Try to avoid short orphan words on the final line, by
- // allowing wrapN to go a bit over if that would fit in the
- // remainder of the line.
- slop := 5
- wrap = wrap - slop
-
- // Handle first line, which is indented by the caller (or the
- // special case above)
- l, s = wrapN(wrap, slop, s)
- r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1)
-
- // Now wrap the rest
- for s != "" {
- var t string
-
- t, s = wrapN(wrap, slop, s)
- r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1)
- }
-
- return r
-
-}
-
-// FlagUsagesWrapped returns a string containing the usage information
-// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no
-// wrapping)
-func (f *FlagSet) FlagUsagesWrapped(cols int) string {
- buf := new(bytes.Buffer)
-
- lines := make([]string, 0, len(f.formal))
-
- maxlen := 0
- f.VisitAll(func(flag *Flag) {
- if flag.Hidden {
- return
- }
-
- line := ""
- if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
- line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name)
- } else {
- line = fmt.Sprintf(" --%s", flag.Name)
- }
-
- varname, usage := UnquoteUsage(flag)
- if varname != "" {
- line += " " + varname
- }
- if flag.NoOptDefVal != "" {
- switch flag.Value.Type() {
- case "string":
- line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal)
- case "bool":
- if flag.NoOptDefVal != "true" {
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- case "count":
- if flag.NoOptDefVal != "+1" {
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- default:
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- }
-
- // This special character will be replaced with spacing once the
- // correct alignment is calculated
- line += "\x00"
- if len(line) > maxlen {
- maxlen = len(line)
- }
-
- line += usage
- if !flag.defaultIsZeroValue() {
- if flag.Value.Type() == "string" {
- line += fmt.Sprintf(" (default %q)", flag.DefValue)
- } else {
- line += fmt.Sprintf(" (default %s)", flag.DefValue)
- }
- }
- if len(flag.Deprecated) != 0 {
- line += fmt.Sprintf(" (DEPRECATED: %s)", flag.Deprecated)
- }
-
- lines = append(lines, line)
- })
-
- for _, line := range lines {
- sidx := strings.Index(line, "\x00")
- spacing := strings.Repeat(" ", maxlen-sidx)
- // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx
- fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:]))
- }
-
- return buf.String()
-}
-
-// FlagUsages returns a string containing the usage information for all flags in
-// the FlagSet
-func (f *FlagSet) FlagUsages() string {
- return f.FlagUsagesWrapped(0)
-}
-
-// PrintDefaults prints to standard error the default values of all defined command-line flags.
-func PrintDefaults() {
- CommandLine.PrintDefaults()
-}
-
-// defaultUsage is the default function to print a usage message.
-func defaultUsage(f *FlagSet) {
- fmt.Fprintf(f.out(), "Usage of %s:\n", f.name)
- f.PrintDefaults()
-}
-
-// NOTE: Usage is not just defaultUsage(CommandLine)
-// because it serves (via godoc flag Usage) as the example
-// for how to write your own usage function.
-
-// Usage prints to standard error a usage message documenting all defined command-line flags.
-// The function is a variable that may be changed to point to a custom function.
-// By default it prints a simple header and calls PrintDefaults; for details about the
-// format of the output and how to control it, see the documentation for PrintDefaults.
-var Usage = func() {
- fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
- PrintDefaults()
-}
-
-// NFlag returns the number of flags that have been set.
-func (f *FlagSet) NFlag() int { return len(f.actual) }
-
-// NFlag returns the number of command-line flags that have been set.
-func NFlag() int { return len(CommandLine.actual) }
-
-// Arg returns the i'th argument. Arg(0) is the first remaining argument
-// after flags have been processed.
-func (f *FlagSet) Arg(i int) string {
- if i < 0 || i >= len(f.args) {
- return ""
- }
- return f.args[i]
-}
-
-// Arg returns the i'th command-line argument. Arg(0) is the first remaining argument
-// after flags have been processed.
-func Arg(i int) string {
- return CommandLine.Arg(i)
-}
-
-// NArg is the number of arguments remaining after flags have been processed.
-func (f *FlagSet) NArg() int { return len(f.args) }
-
-// NArg is the number of arguments remaining after flags have been processed.
-func NArg() int { return len(CommandLine.args) }
-
-// Args returns the non-flag arguments.
-func (f *FlagSet) Args() []string { return f.args }
-
-// Args returns the non-flag command-line arguments.
-func Args() []string { return CommandLine.args }
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func (f *FlagSet) Var(value Value, name string, usage string) {
- f.VarP(value, name, "", usage)
-}
-
-// VarPF is like VarP, but returns the flag created
-func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
- // Remember the default value as a string; it won't change.
- flag := &Flag{
- Name: name,
- Shorthand: shorthand,
- Usage: usage,
- Value: value,
- DefValue: value.String(),
- }
- f.AddFlag(flag)
- return flag
-}
-
-// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
- f.VarPF(value, name, shorthand, usage)
-}
-
-// AddFlag will add the flag to the FlagSet
-func (f *FlagSet) AddFlag(flag *Flag) {
- normalizedFlagName := f.normalizeFlagName(flag.Name)
-
- _, alreadyThere := f.formal[normalizedFlagName]
- if alreadyThere {
- msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
- fmt.Fprintln(f.out(), msg)
- panic(msg) // Happens only if flags are declared with identical names
- }
- if f.formal == nil {
- f.formal = make(map[NormalizedName]*Flag)
- }
-
- flag.Name = string(normalizedFlagName)
- f.formal[normalizedFlagName] = flag
- f.orderedFormal = append(f.orderedFormal, flag)
-
- if flag.Shorthand == "" {
- return
- }
- if len(flag.Shorthand) > 1 {
- msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- if f.shorthands == nil {
- f.shorthands = make(map[byte]*Flag)
- }
- c := flag.Shorthand[0]
- used, alreadyThere := f.shorthands[c]
- if alreadyThere {
- msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- f.shorthands[c] = flag
-}
-
-// AddFlagSet adds one FlagSet to another. If a flag is already present in f
-// the flag from newSet will be ignored.
-func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
- if newSet == nil {
- return
- }
- newSet.VisitAll(func(flag *Flag) {
- if f.Lookup(flag.Name) == nil {
- f.AddFlag(flag)
- }
- })
-}
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func Var(value Value, name string, usage string) {
- CommandLine.VarP(value, name, "", usage)
-}
-
-// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
-func VarP(value Value, name, shorthand, usage string) {
- CommandLine.VarP(value, name, shorthand, usage)
-}
-
-// failf prints to standard error a formatted error and usage message and
-// returns the error.
-func (f *FlagSet) failf(format string, a ...interface{}) error {
- err := fmt.Errorf(format, a...)
- if f.errorHandling != ContinueOnError {
- fmt.Fprintln(f.out(), err)
- f.usage()
- }
- return err
-}
-
-// usage calls the Usage method for the flag set, or the usage function if
-// the flag set is CommandLine.
-func (f *FlagSet) usage() {
- if f == CommandLine {
- Usage()
- } else if f.Usage == nil {
- defaultUsage(f)
- } else {
- f.Usage()
- }
-}
-
-//--unknown (args will be empty)
-//--unknown --next-flag ... (args will be --next-flag ...)
-//--unknown arg ... (args will be arg ...)
-func stripUnknownFlagValue(args []string) []string {
- if len(args) == 0 {
- //--unknown
- return args
- }
-
- first := args[0]
- if len(first) > 0 && first[0] == '-' {
- //--unknown --next-flag ...
- return args
- }
-
- //--unknown arg ... (args will be arg ...)
- if len(args) > 1 {
- return args[1:]
- }
- return nil
-}
-
-func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) {
- a = args
- name := s[2:]
- if len(name) == 0 || name[0] == '-' || name[0] == '=' {
- err = f.failf("bad flag syntax: %s", s)
- return
- }
-
- split := strings.SplitN(name, "=", 2)
- name = split[0]
- flag, exists := f.formal[f.normalizeFlagName(name)]
-
- if !exists {
- switch {
- case name == "help":
- f.usage()
- return a, ErrHelp
- case f.ParseErrorsWhitelist.UnknownFlags:
- // --unknown=unknownval arg ...
- // we do not want to lose arg in this case
- if len(split) >= 2 {
- return a, nil
- }
-
- return stripUnknownFlagValue(a), nil
- default:
- err = f.failf("unknown flag: --%s", name)
- return
- }
- }
-
- var value string
- if len(split) == 2 {
- // '--flag=arg'
- value = split[1]
- } else if flag.NoOptDefVal != "" {
- // '--flag' (arg was optional)
- value = flag.NoOptDefVal
- } else if len(a) > 0 {
- // '--flag arg'
- value = a[0]
- a = a[1:]
- } else {
- // '--flag' (arg was required)
- err = f.failf("flag needs an argument: %s", s)
- return
- }
-
- err = fn(flag, value)
- if err != nil {
- f.failf(err.Error())
- }
- return
-}
-
-func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
- outArgs = args
-
- if strings.HasPrefix(shorthands, "test.") {
- return
- }
-
- outShorts = shorthands[1:]
- c := shorthands[0]
-
- flag, exists := f.shorthands[c]
- if !exists {
- switch {
- case c == 'h':
- f.usage()
- err = ErrHelp
- return
- case f.ParseErrorsWhitelist.UnknownFlags:
- // '-f=arg arg ...'
- // we do not want to lose arg in this case
- if len(shorthands) > 2 && shorthands[1] == '=' {
- outShorts = ""
- return
- }
-
- outArgs = stripUnknownFlagValue(outArgs)
- return
- default:
- err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
- return
- }
- }
-
- var value string
- if len(shorthands) > 2 && shorthands[1] == '=' {
- // '-f=arg'
- value = shorthands[2:]
- outShorts = ""
- } else if flag.NoOptDefVal != "" {
- // '-f' (arg was optional)
- value = flag.NoOptDefVal
- } else if len(shorthands) > 1 {
- // '-farg'
- value = shorthands[1:]
- outShorts = ""
- } else if len(args) > 0 {
- // '-f arg'
- value = args[0]
- outArgs = args[1:]
- } else {
- // '-f' (arg was required)
- err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
- return
- }
-
- if flag.ShorthandDeprecated != "" {
- fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated)
- }
-
- err = fn(flag, value)
- if err != nil {
- f.failf(err.Error())
- }
- return
-}
-
-func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) {
- a = args
- shorthands := s[1:]
-
- // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv").
- for len(shorthands) > 0 {
- shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn)
- if err != nil {
- return
- }
- }
-
- return
-}
-
-func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
- for len(args) > 0 {
- s := args[0]
- args = args[1:]
- if len(s) == 0 || s[0] != '-' || len(s) == 1 {
- if !f.interspersed {
- f.args = append(f.args, s)
- f.args = append(f.args, args...)
- return nil
- }
- f.args = append(f.args, s)
- continue
- }
-
- if s[1] == '-' {
- if len(s) == 2 { // "--" terminates the flags
- f.argsLenAtDash = len(f.args)
- f.args = append(f.args, args...)
- break
- }
- args, err = f.parseLongArg(s, args, fn)
- } else {
- args, err = f.parseShortArg(s, args, fn)
- }
- if err != nil {
- return
- }
- }
- return
-}
-
-// Parse parses flag definitions from the argument list, which should not
-// include the command name. Must be called after all flags in the FlagSet
-// are defined and before flags are accessed by the program.
-// The return value will be ErrHelp if -help was set but not defined.
-func (f *FlagSet) Parse(arguments []string) error {
- if f.addedGoFlagSets != nil {
- for _, goFlagSet := range f.addedGoFlagSets {
- goFlagSet.Parse(nil)
- }
- }
- f.parsed = true
-
- if len(arguments) < 0 {
- return nil
- }
-
- f.args = make([]string, 0, len(arguments))
-
- set := func(flag *Flag, value string) error {
- return f.Set(flag.Name, value)
- }
-
- err := f.parseArgs(arguments, set)
- if err != nil {
- switch f.errorHandling {
- case ContinueOnError:
- return err
- case ExitOnError:
- fmt.Println(err)
- os.Exit(2)
- case PanicOnError:
- panic(err)
- }
- }
- return nil
-}
-
-type parseFunc func(flag *Flag, value string) error
-
-// ParseAll parses flag definitions from the argument list, which should not
-// include the command name. The arguments for fn are flag and value. Must be
-// called after all flags in the FlagSet are defined and before flags are
-// accessed by the program. The return value will be ErrHelp if -help was set
-// but not defined.
-func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error {
- f.parsed = true
- f.args = make([]string, 0, len(arguments))
-
- err := f.parseArgs(arguments, fn)
- if err != nil {
- switch f.errorHandling {
- case ContinueOnError:
- return err
- case ExitOnError:
- os.Exit(2)
- case PanicOnError:
- panic(err)
- }
- }
- return nil
-}
-
-// Parsed reports whether f.Parse has been called.
-func (f *FlagSet) Parsed() bool {
- return f.parsed
-}
-
-// Parse parses the command-line flags from os.Args[1:]. Must be called
-// after all flags are defined and before flags are accessed by the program.
-func Parse() {
- // Ignore errors; CommandLine is set for ExitOnError.
- CommandLine.Parse(os.Args[1:])
-}
-
-// ParseAll parses the command-line flags from os.Args[1:] and called fn for each.
-// The arguments for fn are flag and value. Must be called after all flags are
-// defined and before flags are accessed by the program.
-func ParseAll(fn func(flag *Flag, value string) error) {
- // Ignore errors; CommandLine is set for ExitOnError.
- CommandLine.ParseAll(os.Args[1:], fn)
-}
-
-// SetInterspersed sets whether to support interspersed option/non-option arguments.
-func SetInterspersed(interspersed bool) {
- CommandLine.SetInterspersed(interspersed)
-}
-
-// Parsed returns true if the command-line flags have been parsed.
-func Parsed() bool {
- return CommandLine.Parsed()
-}
-
-// CommandLine is the default set of command-line flags, parsed from os.Args.
-var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
-
-// NewFlagSet returns a new, empty flag set with the specified name,
-// error handling property and SortFlags set to true.
-func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
- f := &FlagSet{
- name: name,
- errorHandling: errorHandling,
- argsLenAtDash: -1,
- interspersed: true,
- SortFlags: true,
- }
- return f
-}
-
-// SetInterspersed sets whether to support interspersed option/non-option arguments.
-func (f *FlagSet) SetInterspersed(interspersed bool) {
- f.interspersed = interspersed
-}
-
-// Init sets the name and error handling property for a flag set.
-// By default, the zero FlagSet uses an empty name and the
-// ContinueOnError error handling policy.
-func (f *FlagSet) Init(name string, errorHandling ErrorHandling) {
- f.name = name
- f.errorHandling = errorHandling
- f.argsLenAtDash = -1
-}
diff --git a/vendor/github.com/spf13/pflag/float32.go b/vendor/github.com/spf13/pflag/float32.go
deleted file mode 100644
index a243f81..0000000
--- a/vendor/github.com/spf13/pflag/float32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- float32 Value
-type float32Value float32
-
-func newFloat32Value(val float32, p *float32) *float32Value {
- *p = val
- return (*float32Value)(p)
-}
-
-func (f *float32Value) Set(s string) error {
- v, err := strconv.ParseFloat(s, 32)
- *f = float32Value(v)
- return err
-}
-
-func (f *float32Value) Type() string {
- return "float32"
-}
-
-func (f *float32Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 32) }
-
-func float32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseFloat(sval, 32)
- if err != nil {
- return 0, err
- }
- return float32(v), nil
-}
-
-// GetFloat32 return the float32 value of a flag with the given name
-func (f *FlagSet) GetFloat32(name string) (float32, error) {
- val, err := f.getFlagType(name, "float32", float32Conv)
- if err != nil {
- return 0, err
- }
- return val.(float32), nil
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {
- f.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
- f.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func Float32Var(p *float32, name string, value float32, usage string) {
- CommandLine.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
- CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
- p := new(float32)
- f.Float32VarP(p, name, "", value, usage)
- return p
-}
-
-// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {
- p := new(float32)
- f.Float32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func Float32(name string, value float32, usage string) *float32 {
- return CommandLine.Float32P(name, "", value, usage)
-}
-
-// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.
-func Float32P(name, shorthand string, value float32, usage string) *float32 {
- return CommandLine.Float32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/float64.go b/vendor/github.com/spf13/pflag/float64.go
deleted file mode 100644
index 04b5492..0000000
--- a/vendor/github.com/spf13/pflag/float64.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- float64 Value
-type float64Value float64
-
-func newFloat64Value(val float64, p *float64) *float64Value {
- *p = val
- return (*float64Value)(p)
-}
-
-func (f *float64Value) Set(s string) error {
- v, err := strconv.ParseFloat(s, 64)
- *f = float64Value(v)
- return err
-}
-
-func (f *float64Value) Type() string {
- return "float64"
-}
-
-func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) }
-
-func float64Conv(sval string) (interface{}, error) {
- return strconv.ParseFloat(sval, 64)
-}
-
-// GetFloat64 return the float64 value of a flag with the given name
-func (f *FlagSet) GetFloat64(name string) (float64, error) {
- val, err := f.getFlagType(name, "float64", float64Conv)
- if err != nil {
- return 0, err
- }
- return val.(float64), nil
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) {
- f.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
- f.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func Float64Var(p *float64, name string, value float64, usage string) {
- CommandLine.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
- CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
- p := new(float64)
- f.Float64VarP(p, name, "", value, usage)
- return p
-}
-
-// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 {
- p := new(float64)
- f.Float64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func Float64(name string, value float64, usage string) *float64 {
- return CommandLine.Float64P(name, "", value, usage)
-}
-
-// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.
-func Float64P(name, shorthand string, value float64, usage string) *float64 {
- return CommandLine.Float64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go
deleted file mode 100644
index d3dd72b..0000000
--- a/vendor/github.com/spf13/pflag/golangflag.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2009 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.
-
-package pflag
-
-import (
- goflag "flag"
- "reflect"
- "strings"
-)
-
-// flagValueWrapper implements pflag.Value around a flag.Value. The main
-// difference here is the addition of the Type method that returns a string
-// name of the type. As this is generally unknown, we approximate that with
-// reflection.
-type flagValueWrapper struct {
- inner goflag.Value
- flagType string
-}
-
-// We are just copying the boolFlag interface out of goflag as that is what
-// they use to decide if a flag should get "true" when no arg is given.
-type goBoolFlag interface {
- goflag.Value
- IsBoolFlag() bool
-}
-
-func wrapFlagValue(v goflag.Value) Value {
- // If the flag.Value happens to also be a pflag.Value, just use it directly.
- if pv, ok := v.(Value); ok {
- return pv
- }
-
- pv := &flagValueWrapper{
- inner: v,
- }
-
- t := reflect.TypeOf(v)
- if t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr {
- t = t.Elem()
- }
-
- pv.flagType = strings.TrimSuffix(t.Name(), "Value")
- return pv
-}
-
-func (v *flagValueWrapper) String() string {
- return v.inner.String()
-}
-
-func (v *flagValueWrapper) Set(s string) error {
- return v.inner.Set(s)
-}
-
-func (v *flagValueWrapper) Type() string {
- return v.flagType
-}
-
-// PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag
-// If the *flag.Flag.Name was a single character (ex: `v`) it will be accessiblei
-// with both `-v` and `--v` in flags. If the golang flag was more than a single
-// character (ex: `verbose`) it will only be accessible via `--verbose`
-func PFlagFromGoFlag(goflag *goflag.Flag) *Flag {
- // Remember the default value as a string; it won't change.
- flag := &Flag{
- Name: goflag.Name,
- Usage: goflag.Usage,
- Value: wrapFlagValue(goflag.Value),
- // Looks like golang flags don't set DefValue correctly :-(
- //DefValue: goflag.DefValue,
- DefValue: goflag.Value.String(),
- }
- // Ex: if the golang flag was -v, allow both -v and --v to work
- if len(flag.Name) == 1 {
- flag.Shorthand = flag.Name
- }
- if fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() {
- flag.NoOptDefVal = "true"
- }
- return flag
-}
-
-// AddGoFlag will add the given *flag.Flag to the pflag.FlagSet
-func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) {
- if f.Lookup(goflag.Name) != nil {
- return
- }
- newflag := PFlagFromGoFlag(goflag)
- f.AddFlag(newflag)
-}
-
-// AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet
-func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {
- if newSet == nil {
- return
- }
- newSet.VisitAll(func(goflag *goflag.Flag) {
- f.AddGoFlag(goflag)
- })
- if f.addedGoFlagSets == nil {
- f.addedGoFlagSets = make([]*goflag.FlagSet, 0)
- }
- f.addedGoFlagSets = append(f.addedGoFlagSets, newSet)
-}
diff --git a/vendor/github.com/spf13/pflag/int.go b/vendor/github.com/spf13/pflag/int.go
deleted file mode 100644
index 1474b89..0000000
--- a/vendor/github.com/spf13/pflag/int.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int Value
-type intValue int
-
-func newIntValue(val int, p *int) *intValue {
- *p = val
- return (*intValue)(p)
-}
-
-func (i *intValue) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 64)
- *i = intValue(v)
- return err
-}
-
-func (i *intValue) Type() string {
- return "int"
-}
-
-func (i *intValue) String() string { return strconv.Itoa(int(*i)) }
-
-func intConv(sval string) (interface{}, error) {
- return strconv.Atoi(sval)
-}
-
-// GetInt return the int value of a flag with the given name
-func (f *FlagSet) GetInt(name string) (int, error) {
- val, err := f.getFlagType(name, "int", intConv)
- if err != nil {
- return 0, err
- }
- return val.(int), nil
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
- f.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) {
- f.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func IntVar(p *int, name string, value int, usage string) {
- CommandLine.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func IntVarP(p *int, name, shorthand string, value int, usage string) {
- CommandLine.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func (f *FlagSet) Int(name string, value int, usage string) *int {
- p := new(int)
- f.IntVarP(p, name, "", value, usage)
- return p
-}
-
-// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int {
- p := new(int)
- f.IntVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func Int(name string, value int, usage string) *int {
- return CommandLine.IntP(name, "", value, usage)
-}
-
-// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.
-func IntP(name, shorthand string, value int, usage string) *int {
- return CommandLine.IntP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int16.go b/vendor/github.com/spf13/pflag/int16.go
deleted file mode 100644
index f1a01d0..0000000
--- a/vendor/github.com/spf13/pflag/int16.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int16 Value
-type int16Value int16
-
-func newInt16Value(val int16, p *int16) *int16Value {
- *p = val
- return (*int16Value)(p)
-}
-
-func (i *int16Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 16)
- *i = int16Value(v)
- return err
-}
-
-func (i *int16Value) Type() string {
- return "int16"
-}
-
-func (i *int16Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int16Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 16)
- if err != nil {
- return 0, err
- }
- return int16(v), nil
-}
-
-// GetInt16 returns the int16 value of a flag with the given name
-func (f *FlagSet) GetInt16(name string) (int16, error) {
- val, err := f.getFlagType(name, "int16", int16Conv)
- if err != nil {
- return 0, err
- }
- return val.(int16), nil
-}
-
-// Int16Var defines an int16 flag with specified name, default value, and usage string.
-// The argument p points to an int16 variable in which to store the value of the flag.
-func (f *FlagSet) Int16Var(p *int16, name string, value int16, usage string) {
- f.VarP(newInt16Value(value, p), name, "", usage)
-}
-
-// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int16VarP(p *int16, name, shorthand string, value int16, usage string) {
- f.VarP(newInt16Value(value, p), name, shorthand, usage)
-}
-
-// Int16Var defines an int16 flag with specified name, default value, and usage string.
-// The argument p points to an int16 variable in which to store the value of the flag.
-func Int16Var(p *int16, name string, value int16, usage string) {
- CommandLine.VarP(newInt16Value(value, p), name, "", usage)
-}
-
-// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
-func Int16VarP(p *int16, name, shorthand string, value int16, usage string) {
- CommandLine.VarP(newInt16Value(value, p), name, shorthand, usage)
-}
-
-// Int16 defines an int16 flag with specified name, default value, and usage string.
-// The return value is the address of an int16 variable that stores the value of the flag.
-func (f *FlagSet) Int16(name string, value int16, usage string) *int16 {
- p := new(int16)
- f.Int16VarP(p, name, "", value, usage)
- return p
-}
-
-// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int16P(name, shorthand string, value int16, usage string) *int16 {
- p := new(int16)
- f.Int16VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int16 defines an int16 flag with specified name, default value, and usage string.
-// The return value is the address of an int16 variable that stores the value of the flag.
-func Int16(name string, value int16, usage string) *int16 {
- return CommandLine.Int16P(name, "", value, usage)
-}
-
-// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
-func Int16P(name, shorthand string, value int16, usage string) *int16 {
- return CommandLine.Int16P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int32.go b/vendor/github.com/spf13/pflag/int32.go
deleted file mode 100644
index 9b95944..0000000
--- a/vendor/github.com/spf13/pflag/int32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int32 Value
-type int32Value int32
-
-func newInt32Value(val int32, p *int32) *int32Value {
- *p = val
- return (*int32Value)(p)
-}
-
-func (i *int32Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 32)
- *i = int32Value(v)
- return err
-}
-
-func (i *int32Value) Type() string {
- return "int32"
-}
-
-func (i *int32Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 32)
- if err != nil {
- return 0, err
- }
- return int32(v), nil
-}
-
-// GetInt32 return the int32 value of a flag with the given name
-func (f *FlagSet) GetInt32(name string) (int32, error) {
- val, err := f.getFlagType(name, "int32", int32Conv)
- if err != nil {
- return 0, err
- }
- return val.(int32), nil
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
- f.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
- f.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func Int32Var(p *int32, name string, value int32, usage string) {
- CommandLine.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
- CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
- p := new(int32)
- f.Int32VarP(p, name, "", value, usage)
- return p
-}
-
-// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 {
- p := new(int32)
- f.Int32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func Int32(name string, value int32, usage string) *int32 {
- return CommandLine.Int32P(name, "", value, usage)
-}
-
-// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.
-func Int32P(name, shorthand string, value int32, usage string) *int32 {
- return CommandLine.Int32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int64.go b/vendor/github.com/spf13/pflag/int64.go
deleted file mode 100644
index 0026d78..0000000
--- a/vendor/github.com/spf13/pflag/int64.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int64 Value
-type int64Value int64
-
-func newInt64Value(val int64, p *int64) *int64Value {
- *p = val
- return (*int64Value)(p)
-}
-
-func (i *int64Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 64)
- *i = int64Value(v)
- return err
-}
-
-func (i *int64Value) Type() string {
- return "int64"
-}
-
-func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int64Conv(sval string) (interface{}, error) {
- return strconv.ParseInt(sval, 0, 64)
-}
-
-// GetInt64 return the int64 value of a flag with the given name
-func (f *FlagSet) GetInt64(name string) (int64, error) {
- val, err := f.getFlagType(name, "int64", int64Conv)
- if err != nil {
- return 0, err
- }
- return val.(int64), nil
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
- f.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
- f.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func Int64Var(p *int64, name string, value int64, usage string) {
- CommandLine.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
- CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
- p := new(int64)
- f.Int64VarP(p, name, "", value, usage)
- return p
-}
-
-// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 {
- p := new(int64)
- f.Int64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func Int64(name string, value int64, usage string) *int64 {
- return CommandLine.Int64P(name, "", value, usage)
-}
-
-// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.
-func Int64P(name, shorthand string, value int64, usage string) *int64 {
- return CommandLine.Int64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int8.go b/vendor/github.com/spf13/pflag/int8.go
deleted file mode 100644
index 4da9222..0000000
--- a/vendor/github.com/spf13/pflag/int8.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int8 Value
-type int8Value int8
-
-func newInt8Value(val int8, p *int8) *int8Value {
- *p = val
- return (*int8Value)(p)
-}
-
-func (i *int8Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 8)
- *i = int8Value(v)
- return err
-}
-
-func (i *int8Value) Type() string {
- return "int8"
-}
-
-func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int8Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 8)
- if err != nil {
- return 0, err
- }
- return int8(v), nil
-}
-
-// GetInt8 return the int8 value of a flag with the given name
-func (f *FlagSet) GetInt8(name string) (int8, error) {
- val, err := f.getFlagType(name, "int8", int8Conv)
- if err != nil {
- return 0, err
- }
- return val.(int8), nil
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
- f.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
- f.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func Int8Var(p *int8, name string, value int8, usage string) {
- CommandLine.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
- CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
- p := new(int8)
- f.Int8VarP(p, name, "", value, usage)
- return p
-}
-
-// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 {
- p := new(int8)
- f.Int8VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func Int8(name string, value int8, usage string) *int8 {
- return CommandLine.Int8P(name, "", value, usage)
-}
-
-// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.
-func Int8P(name, shorthand string, value int8, usage string) *int8 {
- return CommandLine.Int8P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go
deleted file mode 100644
index 1e7c9ed..0000000
--- a/vendor/github.com/spf13/pflag/int_slice.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- intSlice Value
-type intSliceValue struct {
- value *[]int
- changed bool
-}
-
-func newIntSliceValue(val []int, p *[]int) *intSliceValue {
- isv := new(intSliceValue)
- isv.value = p
- *isv.value = val
- return isv
-}
-
-func (s *intSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]int, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = strconv.Atoi(d)
- if err != nil {
- return err
- }
-
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *intSliceValue) Type() string {
- return "intSlice"
-}
-
-func (s *intSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%d", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func intSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []int{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]int, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = strconv.Atoi(d)
- if err != nil {
- return nil, err
- }
-
- }
- return out, nil
-}
-
-// GetIntSlice return the []int value of a flag with the given name
-func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
- val, err := f.getFlagType(name, "intSlice", intSliceConv)
- if err != nil {
- return []int{}, err
- }
- return val.([]int), nil
-}
-
-// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.
-// The argument p points to a []int variable in which to store the value of the flag.
-func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {
- f.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
- f.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSliceVar defines a int[] flag with specified name, default value, and usage string.
-// The argument p points to a int[] variable in which to store the value of the flag.
-func IntSliceVar(p *[]int, name string, value []int, usage string) {
- CommandLine.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
- CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
- p := []int{}
- f.IntSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {
- p := []int{}
- f.IntSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func IntSlice(name string, value []int, usage string) *[]int {
- return CommandLine.IntSliceP(name, "", value, usage)
-}
-
-// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceP(name, shorthand string, value []int, usage string) *[]int {
- return CommandLine.IntSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ip.go b/vendor/github.com/spf13/pflag/ip.go
deleted file mode 100644
index 3d414ba..0000000
--- a/vendor/github.com/spf13/pflag/ip.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strings"
-)
-
-// -- net.IP value
-type ipValue net.IP
-
-func newIPValue(val net.IP, p *net.IP) *ipValue {
- *p = val
- return (*ipValue)(p)
-}
-
-func (i *ipValue) String() string { return net.IP(*i).String() }
-func (i *ipValue) Set(s string) error {
- ip := net.ParseIP(strings.TrimSpace(s))
- if ip == nil {
- return fmt.Errorf("failed to parse IP: %q", s)
- }
- *i = ipValue(ip)
- return nil
-}
-
-func (i *ipValue) Type() string {
- return "ip"
-}
-
-func ipConv(sval string) (interface{}, error) {
- ip := net.ParseIP(sval)
- if ip != nil {
- return ip, nil
- }
- return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
-}
-
-// GetIP return the net.IP value of a flag with the given name
-func (f *FlagSet) GetIP(name string) (net.IP, error) {
- val, err := f.getFlagType(name, "ip", ipConv)
- if err != nil {
- return nil, err
- }
- return val.(net.IP), nil
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
- f.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
- f.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func IPVar(p *net.IP, name string, value net.IP, usage string) {
- CommandLine.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
- CommandLine.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
- p := new(net.IP)
- f.IPVarP(p, name, "", value, usage)
- return p
-}
-
-// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP {
- p := new(net.IP)
- f.IPVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func IP(name string, value net.IP, usage string) *net.IP {
- return CommandLine.IPP(name, "", value, usage)
-}
-
-// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPP(name, shorthand string, value net.IP, usage string) *net.IP {
- return CommandLine.IPP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go
deleted file mode 100644
index 7dd196f..0000000
--- a/vendor/github.com/spf13/pflag/ip_slice.go
+++ /dev/null
@@ -1,148 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "io"
- "net"
- "strings"
-)
-
-// -- ipSlice Value
-type ipSliceValue struct {
- value *[]net.IP
- changed bool
-}
-
-func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue {
- ipsv := new(ipSliceValue)
- ipsv.value = p
- *ipsv.value = val
- return ipsv
-}
-
-// Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag.
-// If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended.
-func (s *ipSliceValue) Set(val string) error {
-
- // remove all quote characters
- rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
-
- // read flag arguments with CSV parser
- ipStrSlice, err := readAsCSV(rmQuote.Replace(val))
- if err != nil && err != io.EOF {
- return err
- }
-
- // parse ip values into slice
- out := make([]net.IP, 0, len(ipStrSlice))
- for _, ipStr := range ipStrSlice {
- ip := net.ParseIP(strings.TrimSpace(ipStr))
- if ip == nil {
- return fmt.Errorf("invalid string being converted to IP address: %s", ipStr)
- }
- out = append(out, ip)
- }
-
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
-
- s.changed = true
-
- return nil
-}
-
-// Type returns a string that uniquely represents this flag's type.
-func (s *ipSliceValue) Type() string {
- return "ipSlice"
-}
-
-// String defines a "native" format for this net.IP slice flag value.
-func (s *ipSliceValue) String() string {
-
- ipStrSlice := make([]string, len(*s.value))
- for i, ip := range *s.value {
- ipStrSlice[i] = ip.String()
- }
-
- out, _ := writeAsCSV(ipStrSlice)
-
- return "[" + out + "]"
-}
-
-func ipSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Emtpy string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []net.IP{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]net.IP, len(ss))
- for i, sval := range ss {
- ip := net.ParseIP(strings.TrimSpace(sval))
- if ip == nil {
- return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
- }
- out[i] = ip
- }
- return out, nil
-}
-
-// GetIPSlice returns the []net.IP value of a flag with the given name
-func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) {
- val, err := f.getFlagType(name, "ipSlice", ipSliceConv)
- if err != nil {
- return []net.IP{}, err
- }
- return val.([]net.IP), nil
-}
-
-// IPSliceVar defines a ipSlice flag with specified name, default value, and usage string.
-// The argument p points to a []net.IP variable in which to store the value of the flag.
-func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
- f.VarP(newIPSliceValue(value, p), name, "", usage)
-}
-
-// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
- f.VarP(newIPSliceValue(value, p), name, shorthand, usage)
-}
-
-// IPSliceVar defines a []net.IP flag with specified name, default value, and usage string.
-// The argument p points to a []net.IP variable in which to store the value of the flag.
-func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
- CommandLine.VarP(newIPSliceValue(value, p), name, "", usage)
-}
-
-// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
- CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage)
-}
-
-// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
-// The return value is the address of a []net.IP variable that stores the value of that flag.
-func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP {
- p := []net.IP{}
- f.IPSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
- p := []net.IP{}
- f.IPSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
-// The return value is the address of a []net.IP variable that stores the value of the flag.
-func IPSlice(name string, value []net.IP, usage string) *[]net.IP {
- return CommandLine.IPSliceP(name, "", value, usage)
-}
-
-// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
-func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
- return CommandLine.IPSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ipmask.go b/vendor/github.com/spf13/pflag/ipmask.go
deleted file mode 100644
index 5bd44bd..0000000
--- a/vendor/github.com/spf13/pflag/ipmask.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strconv"
-)
-
-// -- net.IPMask value
-type ipMaskValue net.IPMask
-
-func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
- *p = val
- return (*ipMaskValue)(p)
-}
-
-func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
-func (i *ipMaskValue) Set(s string) error {
- ip := ParseIPv4Mask(s)
- if ip == nil {
- return fmt.Errorf("failed to parse IP mask: %q", s)
- }
- *i = ipMaskValue(ip)
- return nil
-}
-
-func (i *ipMaskValue) Type() string {
- return "ipMask"
-}
-
-// ParseIPv4Mask written in IP form (e.g. 255.255.255.0).
-// This function should really belong to the net package.
-func ParseIPv4Mask(s string) net.IPMask {
- mask := net.ParseIP(s)
- if mask == nil {
- if len(s) != 8 {
- return nil
- }
- // net.IPMask.String() actually outputs things like ffffff00
- // so write a horrible parser for that as well :-(
- m := []int{}
- for i := 0; i < 4; i++ {
- b := "0x" + s[2*i:2*i+2]
- d, err := strconv.ParseInt(b, 0, 0)
- if err != nil {
- return nil
- }
- m = append(m, int(d))
- }
- s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3])
- mask = net.ParseIP(s)
- if mask == nil {
- return nil
- }
- }
- return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])
-}
-
-func parseIPv4Mask(sval string) (interface{}, error) {
- mask := ParseIPv4Mask(sval)
- if mask == nil {
- return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval)
- }
- return mask, nil
-}
-
-// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name
-func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
- val, err := f.getFlagType(name, "ipMask", parseIPv4Mask)
- if err != nil {
- return nil, err
- }
- return val.(net.IPMask), nil
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
- f.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
- f.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
- CommandLine.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
- CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {
- p := new(net.IPMask)
- f.IPMaskVarP(p, name, "", value, usage)
- return p
-}
-
-// IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
- p := new(net.IPMask)
- f.IPMaskVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
- return CommandLine.IPMaskP(name, "", value, usage)
-}
-
-// IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
- return CommandLine.IPMaskP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ipnet.go b/vendor/github.com/spf13/pflag/ipnet.go
deleted file mode 100644
index e2c1b8b..0000000
--- a/vendor/github.com/spf13/pflag/ipnet.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strings"
-)
-
-// IPNet adapts net.IPNet for use as a flag.
-type ipNetValue net.IPNet
-
-func (ipnet ipNetValue) String() string {
- n := net.IPNet(ipnet)
- return n.String()
-}
-
-func (ipnet *ipNetValue) Set(value string) error {
- _, n, err := net.ParseCIDR(strings.TrimSpace(value))
- if err != nil {
- return err
- }
- *ipnet = ipNetValue(*n)
- return nil
-}
-
-func (*ipNetValue) Type() string {
- return "ipNet"
-}
-
-func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
- *p = val
- return (*ipNetValue)(p)
-}
-
-func ipNetConv(sval string) (interface{}, error) {
- _, n, err := net.ParseCIDR(strings.TrimSpace(sval))
- if err == nil {
- return *n, nil
- }
- return nil, fmt.Errorf("invalid string being converted to IPNet: %s", sval)
-}
-
-// GetIPNet return the net.IPNet value of a flag with the given name
-func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) {
- val, err := f.getFlagType(name, "ipNet", ipNetConv)
- if err != nil {
- return net.IPNet{}, err
- }
- return val.(net.IPNet), nil
-}
-
-// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.
-// The argument p points to an net.IPNet variable in which to store the value of the flag.
-func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
- f.VarP(newIPNetValue(value, p), name, "", usage)
-}
-
-// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {
- f.VarP(newIPNetValue(value, p), name, shorthand, usage)
-}
-
-// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.
-// The argument p points to an net.IPNet variable in which to store the value of the flag.
-func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
- CommandLine.VarP(newIPNetValue(value, p), name, "", usage)
-}
-
-// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.
-func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {
- CommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage)
-}
-
-// IPNet defines an net.IPNet flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPNet variable that stores the value of the flag.
-func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet {
- p := new(net.IPNet)
- f.IPNetVarP(p, name, "", value, usage)
- return p
-}
-
-// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {
- p := new(net.IPNet)
- f.IPNetVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IPNet defines an net.IPNet flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPNet variable that stores the value of the flag.
-func IPNet(name string, value net.IPNet, usage string) *net.IPNet {
- return CommandLine.IPNetP(name, "", value, usage)
-}
-
-// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.
-func IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {
- return CommandLine.IPNetP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string.go b/vendor/github.com/spf13/pflag/string.go
deleted file mode 100644
index 04e0a26..0000000
--- a/vendor/github.com/spf13/pflag/string.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package pflag
-
-// -- string Value
-type stringValue string
-
-func newStringValue(val string, p *string) *stringValue {
- *p = val
- return (*stringValue)(p)
-}
-
-func (s *stringValue) Set(val string) error {
- *s = stringValue(val)
- return nil
-}
-func (s *stringValue) Type() string {
- return "string"
-}
-
-func (s *stringValue) String() string { return string(*s) }
-
-func stringConv(sval string) (interface{}, error) {
- return sval, nil
-}
-
-// GetString return the string value of a flag with the given name
-func (f *FlagSet) GetString(name string) (string, error) {
- val, err := f.getFlagType(name, "string", stringConv)
- if err != nil {
- return "", err
- }
- return val.(string), nil
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func (f *FlagSet) StringVar(p *string, name string, value string, usage string) {
- f.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {
- f.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func StringVar(p *string, name string, value string, usage string) {
- CommandLine.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func StringVarP(p *string, name, shorthand string, value string, usage string) {
- CommandLine.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func (f *FlagSet) String(name string, value string, usage string) *string {
- p := new(string)
- f.StringVarP(p, name, "", value, usage)
- return p
-}
-
-// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {
- p := new(string)
- f.StringVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func String(name string, value string, usage string) *string {
- return CommandLine.StringP(name, "", value, usage)
-}
-
-// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
-func StringP(name, shorthand string, value string, usage string) *string {
- return CommandLine.StringP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go
deleted file mode 100644
index fa7bc60..0000000
--- a/vendor/github.com/spf13/pflag/string_array.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package pflag
-
-// -- stringArray Value
-type stringArrayValue struct {
- value *[]string
- changed bool
-}
-
-func newStringArrayValue(val []string, p *[]string) *stringArrayValue {
- ssv := new(stringArrayValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-func (s *stringArrayValue) Set(val string) error {
- if !s.changed {
- *s.value = []string{val}
- s.changed = true
- } else {
- *s.value = append(*s.value, val)
- }
- return nil
-}
-
-func (s *stringArrayValue) Type() string {
- return "stringArray"
-}
-
-func (s *stringArrayValue) String() string {
- str, _ := writeAsCSV(*s.value)
- return "[" + str + "]"
-}
-
-func stringArrayConv(sval string) (interface{}, error) {
- sval = sval[1 : len(sval)-1]
- // An empty string would cause a array with one (empty) string
- if len(sval) == 0 {
- return []string{}, nil
- }
- return readAsCSV(sval)
-}
-
-// GetStringArray return the []string value of a flag with the given name
-func (f *FlagSet) GetStringArray(name string) ([]string, error) {
- val, err := f.getFlagType(name, "stringArray", stringArrayConv)
- if err != nil {
- return []string{}, err
- }
- return val.([]string), nil
-}
-
-// StringArrayVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) {
- f.VarP(newStringArrayValue(value, p), name, "", usage)
-}
-
-// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) {
- f.VarP(newStringArrayValue(value, p), name, shorthand, usage)
-}
-
-// StringArrayVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func StringArrayVar(p *[]string, name string, value []string, usage string) {
- CommandLine.VarP(newStringArrayValue(value, p), name, "", usage)
-}
-
-// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
-func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) {
- CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage)
-}
-
-// StringArray defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string {
- p := []string{}
- f.StringArrayVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string {
- p := []string{}
- f.StringArrayVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringArray defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func StringArray(name string, value []string, usage string) *[]string {
- return CommandLine.StringArrayP(name, "", value, usage)
-}
-
-// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
-func StringArrayP(name, shorthand string, value []string, usage string) *[]string {
- return CommandLine.StringArrayP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go
deleted file mode 100644
index 0cd3ccc..0000000
--- a/vendor/github.com/spf13/pflag/string_slice.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "encoding/csv"
- "strings"
-)
-
-// -- stringSlice Value
-type stringSliceValue struct {
- value *[]string
- changed bool
-}
-
-func newStringSliceValue(val []string, p *[]string) *stringSliceValue {
- ssv := new(stringSliceValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-func readAsCSV(val string) ([]string, error) {
- if val == "" {
- return []string{}, nil
- }
- stringReader := strings.NewReader(val)
- csvReader := csv.NewReader(stringReader)
- return csvReader.Read()
-}
-
-func writeAsCSV(vals []string) (string, error) {
- b := &bytes.Buffer{}
- w := csv.NewWriter(b)
- err := w.Write(vals)
- if err != nil {
- return "", err
- }
- w.Flush()
- return strings.TrimSuffix(b.String(), "\n"), nil
-}
-
-func (s *stringSliceValue) Set(val string) error {
- v, err := readAsCSV(val)
- if err != nil {
- return err
- }
- if !s.changed {
- *s.value = v
- } else {
- *s.value = append(*s.value, v...)
- }
- s.changed = true
- return nil
-}
-
-func (s *stringSliceValue) Type() string {
- return "stringSlice"
-}
-
-func (s *stringSliceValue) String() string {
- str, _ := writeAsCSV(*s.value)
- return "[" + str + "]"
-}
-
-func stringSliceConv(sval string) (interface{}, error) {
- sval = sval[1 : len(sval)-1]
- // An empty string would cause a slice with one (empty) string
- if len(sval) == 0 {
- return []string{}, nil
- }
- return readAsCSV(sval)
-}
-
-// GetStringSlice return the []string value of a flag with the given name
-func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
- val, err := f.getFlagType(name, "stringSlice", stringSliceConv)
- if err != nil {
- return []string{}, err
- }
- return val.([]string), nil
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
- f.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
- f.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func StringSliceVar(p *[]string, name string, value []string, usage string) {
- CommandLine.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
- CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
- p := []string{}
- f.StringSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {
- p := []string{}
- f.StringSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func StringSlice(name string, value []string, usage string) *[]string {
- return CommandLine.StringSliceP(name, "", value, usage)
-}
-
-// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceP(name, shorthand string, value []string, usage string) *[]string {
- return CommandLine.StringSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_to_int.go b/vendor/github.com/spf13/pflag/string_to_int.go
deleted file mode 100644
index 5ceda39..0000000
--- a/vendor/github.com/spf13/pflag/string_to_int.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- stringToInt Value
-type stringToIntValue struct {
- value *map[string]int
- changed bool
-}
-
-func newStringToIntValue(val map[string]int, p *map[string]int) *stringToIntValue {
- ssv := new(stringToIntValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-// Format: a=1,b=2
-func (s *stringToIntValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make(map[string]int, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return fmt.Errorf("%s must be formatted as key=value", pair)
- }
- var err error
- out[kv[0]], err = strconv.Atoi(kv[1])
- if err != nil {
- return err
- }
- }
- if !s.changed {
- *s.value = out
- } else {
- for k, v := range out {
- (*s.value)[k] = v
- }
- }
- s.changed = true
- return nil
-}
-
-func (s *stringToIntValue) Type() string {
- return "stringToInt"
-}
-
-func (s *stringToIntValue) String() string {
- var buf bytes.Buffer
- i := 0
- for k, v := range *s.value {
- if i > 0 {
- buf.WriteRune(',')
- }
- buf.WriteString(k)
- buf.WriteRune('=')
- buf.WriteString(strconv.Itoa(v))
- i++
- }
- return "[" + buf.String() + "]"
-}
-
-func stringToIntConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // An empty string would cause an empty map
- if len(val) == 0 {
- return map[string]int{}, nil
- }
- ss := strings.Split(val, ",")
- out := make(map[string]int, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return nil, fmt.Errorf("%s must be formatted as key=value", pair)
- }
- var err error
- out[kv[0]], err = strconv.Atoi(kv[1])
- if err != nil {
- return nil, err
- }
- }
- return out, nil
-}
-
-// GetStringToInt return the map[string]int value of a flag with the given name
-func (f *FlagSet) GetStringToInt(name string) (map[string]int, error) {
- val, err := f.getFlagType(name, "stringToInt", stringToIntConv)
- if err != nil {
- return map[string]int{}, err
- }
- return val.(map[string]int), nil
-}
-
-// StringToIntVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]int variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) {
- f.VarP(newStringToIntValue(value, p), name, "", usage)
-}
-
-// StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) {
- f.VarP(newStringToIntValue(value, p), name, shorthand, usage)
-}
-
-// StringToIntVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]int variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) {
- CommandLine.VarP(newStringToIntValue(value, p), name, "", usage)
-}
-
-// StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash.
-func StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) {
- CommandLine.VarP(newStringToIntValue(value, p), name, shorthand, usage)
-}
-
-// StringToInt defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]int variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToInt(name string, value map[string]int, usage string) *map[string]int {
- p := map[string]int{}
- f.StringToIntVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int {
- p := map[string]int{}
- f.StringToIntVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringToInt defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]int variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToInt(name string, value map[string]int, usage string) *map[string]int {
- return CommandLine.StringToIntP(name, "", value, usage)
-}
-
-// StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash.
-func StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int {
- return CommandLine.StringToIntP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_to_string.go b/vendor/github.com/spf13/pflag/string_to_string.go
deleted file mode 100644
index 890a01a..0000000
--- a/vendor/github.com/spf13/pflag/string_to_string.go
+++ /dev/null
@@ -1,160 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "encoding/csv"
- "fmt"
- "strings"
-)
-
-// -- stringToString Value
-type stringToStringValue struct {
- value *map[string]string
- changed bool
-}
-
-func newStringToStringValue(val map[string]string, p *map[string]string) *stringToStringValue {
- ssv := new(stringToStringValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-// Format: a=1,b=2
-func (s *stringToStringValue) Set(val string) error {
- var ss []string
- n := strings.Count(val, "=")
- switch n {
- case 0:
- return fmt.Errorf("%s must be formatted as key=value", val)
- case 1:
- ss = append(ss, strings.Trim(val, `"`))
- default:
- r := csv.NewReader(strings.NewReader(val))
- var err error
- ss, err = r.Read()
- if err != nil {
- return err
- }
- }
-
- out := make(map[string]string, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return fmt.Errorf("%s must be formatted as key=value", pair)
- }
- out[kv[0]] = kv[1]
- }
- if !s.changed {
- *s.value = out
- } else {
- for k, v := range out {
- (*s.value)[k] = v
- }
- }
- s.changed = true
- return nil
-}
-
-func (s *stringToStringValue) Type() string {
- return "stringToString"
-}
-
-func (s *stringToStringValue) String() string {
- records := make([]string, 0, len(*s.value)>>1)
- for k, v := range *s.value {
- records = append(records, k+"="+v)
- }
-
- var buf bytes.Buffer
- w := csv.NewWriter(&buf)
- if err := w.Write(records); err != nil {
- panic(err)
- }
- w.Flush()
- return "[" + strings.TrimSpace(buf.String()) + "]"
-}
-
-func stringToStringConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // An empty string would cause an empty map
- if len(val) == 0 {
- return map[string]string{}, nil
- }
- r := csv.NewReader(strings.NewReader(val))
- ss, err := r.Read()
- if err != nil {
- return nil, err
- }
- out := make(map[string]string, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return nil, fmt.Errorf("%s must be formatted as key=value", pair)
- }
- out[kv[0]] = kv[1]
- }
- return out, nil
-}
-
-// GetStringToString return the map[string]string value of a flag with the given name
-func (f *FlagSet) GetStringToString(name string) (map[string]string, error) {
- val, err := f.getFlagType(name, "stringToString", stringToStringConv)
- if err != nil {
- return map[string]string{}, err
- }
- return val.(map[string]string), nil
-}
-
-// StringToStringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]string variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) {
- f.VarP(newStringToStringValue(value, p), name, "", usage)
-}
-
-// StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) {
- f.VarP(newStringToStringValue(value, p), name, shorthand, usage)
-}
-
-// StringToStringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]string variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) {
- CommandLine.VarP(newStringToStringValue(value, p), name, "", usage)
-}
-
-// StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash.
-func StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) {
- CommandLine.VarP(newStringToStringValue(value, p), name, shorthand, usage)
-}
-
-// StringToString defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToString(name string, value map[string]string, usage string) *map[string]string {
- p := map[string]string{}
- f.StringToStringVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string {
- p := map[string]string{}
- f.StringToStringVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringToString defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToString(name string, value map[string]string, usage string) *map[string]string {
- return CommandLine.StringToStringP(name, "", value, usage)
-}
-
-// StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash.
-func StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string {
- return CommandLine.StringToStringP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint.go b/vendor/github.com/spf13/pflag/uint.go
deleted file mode 100644
index dcbc2b7..0000000
--- a/vendor/github.com/spf13/pflag/uint.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint Value
-type uintValue uint
-
-func newUintValue(val uint, p *uint) *uintValue {
- *p = val
- return (*uintValue)(p)
-}
-
-func (i *uintValue) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 64)
- *i = uintValue(v)
- return err
-}
-
-func (i *uintValue) Type() string {
- return "uint"
-}
-
-func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uintConv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 0)
- if err != nil {
- return 0, err
- }
- return uint(v), nil
-}
-
-// GetUint return the uint value of a flag with the given name
-func (f *FlagSet) GetUint(name string) (uint, error) {
- val, err := f.getFlagType(name, "uint", uintConv)
- if err != nil {
- return 0, err
- }
- return val.(uint), nil
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
- f.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
- f.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func UintVar(p *uint, name string, value uint, usage string) {
- CommandLine.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
- CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
- p := new(uint)
- f.UintVarP(p, name, "", value, usage)
- return p
-}
-
-// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
- p := new(uint)
- f.UintVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func Uint(name string, value uint, usage string) *uint {
- return CommandLine.UintP(name, "", value, usage)
-}
-
-// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
-func UintP(name, shorthand string, value uint, usage string) *uint {
- return CommandLine.UintP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint16.go b/vendor/github.com/spf13/pflag/uint16.go
deleted file mode 100644
index 7e9914e..0000000
--- a/vendor/github.com/spf13/pflag/uint16.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint16 value
-type uint16Value uint16
-
-func newUint16Value(val uint16, p *uint16) *uint16Value {
- *p = val
- return (*uint16Value)(p)
-}
-
-func (i *uint16Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 16)
- *i = uint16Value(v)
- return err
-}
-
-func (i *uint16Value) Type() string {
- return "uint16"
-}
-
-func (i *uint16Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint16Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 16)
- if err != nil {
- return 0, err
- }
- return uint16(v), nil
-}
-
-// GetUint16 return the uint16 value of a flag with the given name
-func (f *FlagSet) GetUint16(name string) (uint16, error) {
- val, err := f.getFlagType(name, "uint16", uint16Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint16), nil
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) {
- f.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
- f.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func Uint16Var(p *uint16, name string, value uint16, usage string) {
- CommandLine.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
- CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
- p := new(uint16)
- f.Uint16VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
- p := new(uint16)
- f.Uint16VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func Uint16(name string, value uint16, usage string) *uint16 {
- return CommandLine.Uint16P(name, "", value, usage)
-}
-
-// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
- return CommandLine.Uint16P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint32.go b/vendor/github.com/spf13/pflag/uint32.go
deleted file mode 100644
index d802453..0000000
--- a/vendor/github.com/spf13/pflag/uint32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint32 value
-type uint32Value uint32
-
-func newUint32Value(val uint32, p *uint32) *uint32Value {
- *p = val
- return (*uint32Value)(p)
-}
-
-func (i *uint32Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 32)
- *i = uint32Value(v)
- return err
-}
-
-func (i *uint32Value) Type() string {
- return "uint32"
-}
-
-func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 32)
- if err != nil {
- return 0, err
- }
- return uint32(v), nil
-}
-
-// GetUint32 return the uint32 value of a flag with the given name
-func (f *FlagSet) GetUint32(name string) (uint32, error) {
- val, err := f.getFlagType(name, "uint32", uint32Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint32), nil
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32 variable in which to store the value of the flag.
-func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {
- f.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
- f.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32 variable in which to store the value of the flag.
-func Uint32Var(p *uint32, name string, value uint32, usage string) {
- CommandLine.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
- CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32 variable that stores the value of the flag.
-func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
- p := new(uint32)
- f.Uint32VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
- p := new(uint32)
- f.Uint32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32 variable that stores the value of the flag.
-func Uint32(name string, value uint32, usage string) *uint32 {
- return CommandLine.Uint32P(name, "", value, usage)
-}
-
-// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
- return CommandLine.Uint32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint64.go b/vendor/github.com/spf13/pflag/uint64.go
deleted file mode 100644
index f62240f..0000000
--- a/vendor/github.com/spf13/pflag/uint64.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint64 Value
-type uint64Value uint64
-
-func newUint64Value(val uint64, p *uint64) *uint64Value {
- *p = val
- return (*uint64Value)(p)
-}
-
-func (i *uint64Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 64)
- *i = uint64Value(v)
- return err
-}
-
-func (i *uint64Value) Type() string {
- return "uint64"
-}
-
-func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint64Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 64)
- if err != nil {
- return 0, err
- }
- return uint64(v), nil
-}
-
-// GetUint64 return the uint64 value of a flag with the given name
-func (f *FlagSet) GetUint64(name string) (uint64, error) {
- val, err := f.getFlagType(name, "uint64", uint64Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint64), nil
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
- f.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
- f.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func Uint64Var(p *uint64, name string, value uint64, usage string) {
- CommandLine.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
- CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
- p := new(uint64)
- f.Uint64VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
- p := new(uint64)
- f.Uint64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func Uint64(name string, value uint64, usage string) *uint64 {
- return CommandLine.Uint64P(name, "", value, usage)
-}
-
-// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
- return CommandLine.Uint64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint8.go b/vendor/github.com/spf13/pflag/uint8.go
deleted file mode 100644
index bb0e83c..0000000
--- a/vendor/github.com/spf13/pflag/uint8.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint8 Value
-type uint8Value uint8
-
-func newUint8Value(val uint8, p *uint8) *uint8Value {
- *p = val
- return (*uint8Value)(p)
-}
-
-func (i *uint8Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 8)
- *i = uint8Value(v)
- return err
-}
-
-func (i *uint8Value) Type() string {
- return "uint8"
-}
-
-func (i *uint8Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint8Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 8)
- if err != nil {
- return 0, err
- }
- return uint8(v), nil
-}
-
-// GetUint8 return the uint8 value of a flag with the given name
-func (f *FlagSet) GetUint8(name string) (uint8, error) {
- val, err := f.getFlagType(name, "uint8", uint8Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint8), nil
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
- f.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
- f.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func Uint8Var(p *uint8, name string, value uint8, usage string) {
- CommandLine.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
- CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
- p := new(uint8)
- f.Uint8VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
- p := new(uint8)
- f.Uint8VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func Uint8(name string, value uint8, usage string) *uint8 {
- return CommandLine.Uint8P(name, "", value, usage)
-}
-
-// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
- return CommandLine.Uint8P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go
deleted file mode 100644
index edd94c6..0000000
--- a/vendor/github.com/spf13/pflag/uint_slice.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- uintSlice Value
-type uintSliceValue struct {
- value *[]uint
- changed bool
-}
-
-func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
- uisv := new(uintSliceValue)
- uisv.value = p
- *uisv.value = val
- return uisv
-}
-
-func (s *uintSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]uint, len(ss))
- for i, d := range ss {
- u, err := strconv.ParseUint(d, 10, 0)
- if err != nil {
- return err
- }
- out[i] = uint(u)
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *uintSliceValue) Type() string {
- return "uintSlice"
-}
-
-func (s *uintSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%d", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func uintSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []uint{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]uint, len(ss))
- for i, d := range ss {
- u, err := strconv.ParseUint(d, 10, 0)
- if err != nil {
- return nil, err
- }
- out[i] = uint(u)
- }
- return out, nil
-}
-
-// GetUintSlice returns the []uint value of a flag with the given name.
-func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
- val, err := f.getFlagType(name, "uintSlice", uintSliceConv)
- if err != nil {
- return []uint{}, err
- }
- return val.([]uint), nil
-}
-
-// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
-// The argument p points to a []uint variable in which to store the value of the flag.
-func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) {
- f.VarP(newUintSliceValue(value, p), name, "", usage)
-}
-
-// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
- f.VarP(newUintSliceValue(value, p), name, shorthand, usage)
-}
-
-// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
-// The argument p points to a uint[] variable in which to store the value of the flag.
-func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
- CommandLine.VarP(newUintSliceValue(value, p), name, "", usage)
-}
-
-// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
- CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage)
-}
-
-// UintSlice defines a []uint flag with specified name, default value, and usage string.
-// The return value is the address of a []uint variable that stores the value of the flag.
-func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint {
- p := []uint{}
- f.UintSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
- p := []uint{}
- f.UintSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// UintSlice defines a []uint flag with specified name, default value, and usage string.
-// The return value is the address of a []uint variable that stores the value of the flag.
-func UintSlice(name string, value []uint, usage string) *[]uint {
- return CommandLine.UintSliceP(name, "", value, usage)
-}
-
-// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
-func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
- return CommandLine.UintSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/.gitignore b/vendor/github.com/zorkian/go-datadog-api/.gitignore
deleted file mode 100644
index d2631dc..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.sublime*
-cmd
diff --git a/vendor/github.com/zorkian/go-datadog-api/.travis.yml b/vendor/github.com/zorkian/go-datadog-api/.travis.yml
deleted file mode 100644
index deecba4..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-language: go
-
-go:
- - "1.9"
- - "1.10.x"
- - "1.11.x"
- - "tip"
-
-env:
- - "PATH=/home/travis/gopath/bin:$PATH"
-
-install:
- - go get -v -t .
-
-script:
- - scripts/check-fmt.sh
- - go get -u golang.org/x/lint/golint
- - golint ./... | grep -v vendor/
- - make
- - scripts/check-code-generation-ran.sh
- # PR's don't have access to Travis EnvVars with DDog API Keys. Skip acceptance tests on PR.
- - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make testacc; fi'
-
-matrix:
- allow_failures:
- - go: tip
diff --git a/vendor/github.com/zorkian/go-datadog-api/LICENSE b/vendor/github.com/zorkian/go-datadog-api/LICENSE
deleted file mode 100644
index f0903d2..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/LICENSE
+++ /dev/null
@@ -1,30 +0,0 @@
-Copyright (c) 2013 by authors and contributors.
-
-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 the 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
-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.
diff --git a/vendor/github.com/zorkian/go-datadog-api/Makefile b/vendor/github.com/zorkian/go-datadog-api/Makefile
deleted file mode 100644
index d915d21..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-TEST?=$$(go list ./... | grep -v '/go-datadog-api/vendor/')
-VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
-GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
-
-default: test fmt
-
-generate:
- go generate
-
-# test runs the unit tests and vets the code
-test:
- go test . $(TESTARGS) -v -timeout=30s -parallel=4
- @$(MAKE) vet
-
-# testacc runs acceptance tests
-testacc:
- go test integration/* -v $(TESTARGS) -timeout 90m
-
-# testrace runs the race checker
-testrace:
- go test -race $(TEST) $(TESTARGS)
-
-fmt:
- gofmt -w $(GOFMT_FILES)
-
-# vet runs the Go source code static analysis tool `vet` to find
-# any common errors.
-vet:
- @go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
- go get golang.org/x/tools/cmd/vet; \
- fi
- @echo "go tool vet $(VETARGS)"
- @go tool vet $(VETARGS) $$(ls -d */ | grep -v vendor) ; if [ $$? -eq 1 ]; then \
- echo ""; \
- echo "Vet found suspicious constructs. Please check the reported constructs"; \
- echo "and fix them if necessary before submitting the code for review."; \
- exit 1; \
- fi
-
-.PHONY: default test testacc updatedeps vet
diff --git a/vendor/github.com/zorkian/go-datadog-api/README.md b/vendor/github.com/zorkian/go-datadog-api/README.md
deleted file mode 100644
index b9d7fcb..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/README.md
+++ /dev/null
@@ -1,120 +0,0 @@
-[](https://godoc.org/gopkg.in/zorkian/go-datadog-api.v2)
-[](https://opensource.org/licenses/BSD-3-Clause)
-[](https://travis-ci.org/zorkian/go-datadog-api)
-[](https://goreportcard.com/report/github.com/zorkian/go-datadog-api)
-
-# Datadog API in Go
-
-**This is the v2.0 version of the API, and has breaking changes. Use the v1.0 branch if you need
-legacy code to be supported.**
-
-A Go wrapper for the Datadog API. Use this library if you need to interact
-with the Datadog system. You can post metrics with it if you want, but this library is probably
-mostly used for automating dashboards/alerting and retrieving data (events, etc).
-
-The source API documentation is here:
-
-## Installation
-To use the default branch, include it in your code like:
-```go
- import "github.com/zorkian/go-datadog-api"
-```
-
-Or, if you need to control which version to use, import using [gopkg.in](http://labix.org/gopkg.in). Like so:
-```go
- import "gopkg.in/zorkian/go-datadog-api.v2"
-```
-
-Using go get:
-```bash
-go get gopkg.in/zorkian/go-datadog-api.v2
-```
-
-## USAGE
-This library uses pointers to be able to verify if values are set or not (vs the default value for the type). Like
- protobuf there are helpers to enhance the API. You can decide to not use them, but you'll have to be careful handling
- nil pointers.
-
-Using the client:
-```go
- client := datadog.NewClient("api key", "application key")
-
- dash, err := client.GetDashboard(*datadog.Int(10880))
- if err != nil {
- log.Fatalf("fatal: %s\n", err)
- }
-
- log.Printf("dashboard %d: %s\n", dash.GetId(), dash.GetTitle())
-```
-
-An example using datadog.String(), which allocates a pointer for you:
-```go
- m := datadog.Monitor{
- Name: datadog.String("Monitor other things"),
- Creator: &datadog.Creator{
- Name: datadog.String("Joe Creator"),
- },
- }
-```
-
-An example using the SetXx, HasXx, GetXx and GetXxOk accessors:
-```go
- m := datadog.Monitor{}
- m.SetName("Monitor all the things")
- m.SetMessage("Electromagnetic energy loss")
-
- // Use HasMessage(), to verify we have interest in the message.
- // Using GetMessage() always safe as it returns the actual or, if never set, default value for that type.
- if m.HasMessage() {
- fmt.Printf("Found message %s\n", m.GetMessage())
- }
-
- // Alternatively, use GetMessageOk(), it returns a tuple with the (default) value and a boolean expressing
- // if it was set at all:
- if v, ok := m.GetMessageOk(); ok {
- fmt.Printf("Found message %s\n", v)
- }
-```
-
-Check out the Godoc link for the available API methods and, if you can't find the one you need,
-let us know (or patches welcome)!
-
-## DOCUMENTATION
-
-Please see:
-
-## BUGS/PROBLEMS/CONTRIBUTING
-
-There are certainly some, but presently no known major bugs. If you do
-find something that doesn't work as expected, please file an issue on
-Github:
-
-
-
-Thanks in advance! And, as always, patches welcome!
-
-## DEVELOPMENT
-### Running tests
-* Run tests tests with `make test`.
-* Integration tests can be run with `make testacc`. Run specific integration tests with `make testacc TESTARGS='-run=TestCreateAndDeleteMonitor'`
-
-The acceptance tests require _DATADOG_API_KEY_ and _DATADOG_APP_KEY_ to be available
-in your environment variables.
-
-*Warning: the integrations tests will create and remove real resources in your Datadog account.*
-
-### Regenerating code
-Accessors `HasXx`, `GetXx`, `GetOkXx` and `SetXx` are generated for each struct field type type that contains pointers.
-When structs are updated a contributor has to regenerate these using `go generate` and commit these changes.
-Optionally there is a make target for the generation:
-
-```bash
-make generate
-```
-
-## COPYRIGHT AND LICENSE
-
-Please see the LICENSE file for the included license information.
-
-Copyright 2013-2017 by authors and contributors.
diff --git a/vendor/github.com/zorkian/go-datadog-api/alerts.go b/vendor/github.com/zorkian/go-datadog-api/alerts.go
deleted file mode 100644
index ce1adcc..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/alerts.go
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
-)
-
-// Alert represents the data of an alert: a query that can fire and send a
-// message to the users.
-type Alert struct {
- Id *int `json:"id,omitempty"`
- Creator *int `json:"creator,omitempty"`
- Query *string `json:"query,omitempty"`
- Name *string `json:"name,omitempty"`
- Message *string `json:"message,omitempty"`
- Silenced *bool `json:"silenced,omitempty"`
- NotifyNoData *bool `json:"notify_no_data,omitempty"`
- State *string `json:"state,omitempty"`
-}
-
-// reqAlerts receives a slice of all alerts.
-type reqAlerts struct {
- Alerts []Alert `json:"alerts,omitempty"`
-}
-
-// CreateAlert adds a new alert to the system. This returns a pointer to an
-// Alert so you can pass that to UpdateAlert later if needed.
-func (client *Client) CreateAlert(alert *Alert) (*Alert, error) {
- var out Alert
- if err := client.doJsonRequest("POST", "/v1/alert", alert, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// UpdateAlert takes an alert that was previously retrieved through some method
-// and sends it back to the server.
-func (client *Client) UpdateAlert(alert *Alert) error {
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/alert/%d", alert.Id),
- alert, nil)
-}
-
-// GetAlert retrieves an alert by identifier.
-func (client *Client) GetAlert(id int) (*Alert, error) {
- var out Alert
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/alert/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// DeleteAlert removes an alert from the system.
-func (client *Client) DeleteAlert(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/alert/%d", id),
- nil, nil)
-}
-
-// GetAlerts returns a slice of all alerts.
-func (client *Client) GetAlerts() ([]Alert, error) {
- var out reqAlerts
- if err := client.doJsonRequest("GET", "/v1/alert", nil, &out); err != nil {
- return nil, err
- }
- return out.Alerts, nil
-}
-
-// MuteAlerts turns off alerting notifications.
-func (client *Client) MuteAlerts() error {
- return client.doJsonRequest("POST", "/v1/mute_alerts", nil, nil)
-}
-
-// UnmuteAlerts turns on alerting notifications.
-func (client *Client) UnmuteAlerts() error {
- return client.doJsonRequest("POST", "/v1/unmute_alerts", nil, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/checks.go b/vendor/github.com/zorkian/go-datadog-api/checks.go
deleted file mode 100644
index 5ed6de7..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/checks.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package datadog
-
-type Check struct {
- Check *string `json:"check,omitempty"`
- HostName *string `json:"host_name,omitempty"`
- Status *Status `json:"status,omitempty"`
- Timestamp *string `json:"timestamp,omitempty"`
- Message *string `json:"message,omitempty"`
- Tags []string `json:"tags,omitempty"`
-}
-
-type Status int
-
-const (
- OK Status = iota
- WARNING
- CRITICAL
- UNKNOWN
-)
-
-// PostCheck posts the result of a check run to the server
-func (client *Client) PostCheck(check Check) error {
- return client.doJsonRequest("POST", "/v1/check_run",
- check, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/client.go b/vendor/github.com/zorkian/go-datadog-api/client.go
deleted file mode 100644
index aa5d17f..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/client.go
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
- "os"
- "time"
-)
-
-// Client is the object that handles talking to the Datadog API. This maintains
-// state information for a particular application connection.
-type Client struct {
- apiKey, appKey, baseUrl string
-
- //The Http Client that is used to make requests
- HttpClient *http.Client
- RetryTimeout time.Duration
-}
-
-// valid is the struct to unmarshal validation endpoint responses into.
-type valid struct {
- Errors []string `json:"errors"`
- IsValid bool `json:"valid"`
-}
-
-// NewClient returns a new datadog.Client which can be used to access the API
-// methods. The expected argument is the API key.
-func NewClient(apiKey, appKey string) *Client {
- baseUrl := os.Getenv("DATADOG_HOST")
- if baseUrl == "" {
- baseUrl = "https://app.datadoghq.com"
- }
-
- return &Client{
- apiKey: apiKey,
- appKey: appKey,
- baseUrl: baseUrl,
- HttpClient: http.DefaultClient,
- RetryTimeout: time.Duration(60 * time.Second),
- }
-}
-
-// SetKeys changes the value of apiKey and appKey.
-func (c *Client) SetKeys(apiKey, appKey string) {
- c.apiKey = apiKey
- c.appKey = appKey
-}
-
-// SetBaseUrl changes the value of baseUrl.
-func (c *Client) SetBaseUrl(baseUrl string) {
- c.baseUrl = baseUrl
-}
-
-// GetBaseUrl returns the baseUrl.
-func (c *Client) GetBaseUrl() string {
- return c.baseUrl
-}
-
-// Validate checks if the API and application keys are valid.
-func (client *Client) Validate() (bool, error) {
- var out valid
- var resp *http.Response
-
- uri, err := client.uriForAPI("/v1/validate")
- if err != nil {
- return false, err
- }
-
- req, err := http.NewRequest("GET", uri, nil)
- if err != nil {
- return false, err
- }
-
- resp, err = client.doRequestWithRetries(req, client.RetryTimeout)
- if err != nil {
- return false, err
- }
-
- defer resp.Body.Close()
-
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return false, err
- }
-
- if err = json.Unmarshal(body, &out); err != nil {
- return false, err
- }
-
- return out.IsValid, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/comments.go b/vendor/github.com/zorkian/go-datadog-api/comments.go
deleted file mode 100644
index 41acd66..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/comments.go
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
-)
-
-// Comment is a special form of event that appears in a stream.
-type Comment struct {
- Id *int `json:"id,omitempty"`
- RelatedId *int `json:"related_event_id,omitempty"`
- Handle *string `json:"handle,omitempty"`
- Message *string `json:"message,omitempty"`
- Resource *string `json:"resource,omitempty"`
- Url *string `json:"url,omitempty"`
-}
-
-// reqComment is the container for receiving commenst.
-type reqComment struct {
- Comment *Comment `json:"comment,omitempty"`
-}
-
-// CreateComment adds a new comment to the system.
-func (client *Client) CreateComment(handle, message string) (*Comment, error) {
- var out reqComment
- comment := Comment{Message: String(message)}
- if len(handle) > 0 {
- comment.Handle = String(handle)
- }
- if err := client.doJsonRequest("POST", "/v1/comments", &comment, &out); err != nil {
- return nil, err
- }
- return out.Comment, nil
-}
-
-// CreateRelatedComment adds a new comment, but lets you specify the related
-// identifier for the comment.
-func (client *Client) CreateRelatedComment(handle, message string,
- relid int) (*Comment, error) {
- var out reqComment
- comment := Comment{Message: String(message), RelatedId: Int(relid)}
- if len(handle) > 0 {
- comment.Handle = String(handle)
- }
- if err := client.doJsonRequest("POST", "/v1/comments", &comment, &out); err != nil {
- return nil, err
- }
- return out.Comment, nil
-}
-
-// EditComment changes the message and possibly handle of a particular comment.
-func (client *Client) EditComment(id int, handle, message string) error {
- comment := Comment{Message: String(message)}
- if len(handle) > 0 {
- comment.Handle = String(handle)
- }
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/comments/%d", id),
- &comment, nil)
-}
-
-// DeleteComment does exactly what you expect.
-func (client *Client) DeleteComment(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/comments/%d", id),
- nil, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/dashboard_lists.go b/vendor/github.com/zorkian/go-datadog-api/dashboard_lists.go
deleted file mode 100644
index 68bade9..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/dashboard_lists.go
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2018 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
-)
-
-const (
- DashboardListItemCustomTimeboard = "custom_timeboard"
- DashboardListItemCustomScreenboard = "custom_screenboard"
- DashboardListItemIntegerationTimeboard = "integration_timeboard"
- DashboardListItemIntegrationScreenboard = "integration_screenboard"
- DashboardListItemHostTimeboard = "host_timeboard"
-)
-
-// DashboardList represents a dashboard list.
-type DashboardList struct {
- Id *int `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- DashboardCount *int `json:"dashboard_count,omitempty"`
-}
-
-// DashboardListItem represents a single dashboard in a dashboard list.
-type DashboardListItem struct {
- Id *int `json:"id,omitempty"`
- Type *string `json:"type,omitempty"`
-}
-
-type reqDashboardListItems struct {
- Dashboards []DashboardListItem `json:"dashboards,omitempty"`
-}
-
-type reqAddedDashboardListItems struct {
- Dashboards []DashboardListItem `json:"added_dashboards_to_list,omitempty"`
-}
-
-type reqDeletedDashboardListItems struct {
- Dashboards []DashboardListItem `json:"deleted_dashboards_from_list,omitempty"`
-}
-
-type reqUpdateDashboardList struct {
- Name string `json:"name,omitempty"`
-}
-
-type reqGetDashboardLists struct {
- DashboardLists []DashboardList `json:"dashboard_lists,omitempty"`
-}
-
-// GetDashboardList returns a single dashboard list created on this account.
-func (client *Client) GetDashboardList(id int) (*DashboardList, error) {
- var out DashboardList
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/dashboard/lists/manual/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// GetDashboardLists returns a list of all dashboard lists created on this account.
-func (client *Client) GetDashboardLists() ([]DashboardList, error) {
- var out reqGetDashboardLists
- if err := client.doJsonRequest("GET", "/v1/dashboard/lists/manual", nil, &out); err != nil {
- return nil, err
- }
- return out.DashboardLists, nil
-}
-
-// CreateDashboardList returns a single dashboard list created on this account.
-func (client *Client) CreateDashboardList(list *DashboardList) (*DashboardList, error) {
- var out DashboardList
- if err := client.doJsonRequest("POST", "/v1/dashboard/lists/manual", list, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// UpdateDashboardList returns a single dashboard list created on this account.
-func (client *Client) UpdateDashboardList(list *DashboardList) error {
- req := reqUpdateDashboardList{list.GetName()}
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/dashboard/lists/manual/%d", *list.Id), req, nil)
-}
-
-// DeleteDashboardList deletes a dashboard list by the identifier.
-func (client *Client) DeleteDashboardList(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/dashboard/lists/manual/%d", id), nil, nil)
-}
-
-// GetDashboardListItems fetches the dashboard list's dashboard definitions.
-func (client *Client) GetDashboardListItems(id int) ([]DashboardListItem, error) {
- var out reqDashboardListItems
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/dashboard/lists/manual/%d/dashboards", id), nil, &out); err != nil {
- return nil, err
- }
- return out.Dashboards, nil
-}
-
-// AddDashboardListItems adds dashboards to an existing dashboard list.
-//
-// Any items already in the list are ignored (not added twice).
-func (client *Client) AddDashboardListItems(dashboardListId int, items []DashboardListItem) ([]DashboardListItem, error) {
- req := reqDashboardListItems{items}
- var out reqAddedDashboardListItems
- if err := client.doJsonRequest("POST", fmt.Sprintf("/v1/dashboard/lists/manual/%d/dashboards", dashboardListId), req, &out); err != nil {
- return nil, err
- }
- return out.Dashboards, nil
-}
-
-// UpdateDashboardListItems updates dashboards of an existing dashboard list.
-//
-// This will set the list of dashboards to contain only the items in items.
-func (client *Client) UpdateDashboardListItems(dashboardListId int, items []DashboardListItem) ([]DashboardListItem, error) {
- req := reqDashboardListItems{items}
- var out reqDashboardListItems
- if err := client.doJsonRequest("PUT", fmt.Sprintf("/v1/dashboard/lists/manual/%d/dashboards", dashboardListId), req, &out); err != nil {
- return nil, err
- }
- return out.Dashboards, nil
-}
-
-// DeleteDashboardListItems deletes dashboards from an existing dashboard list.
-//
-// Deletes any dashboards in the list of items from the dashboard list.
-func (client *Client) DeleteDashboardListItems(dashboardListId int, items []DashboardListItem) ([]DashboardListItem, error) {
- req := reqDashboardListItems{items}
- var out reqDeletedDashboardListItems
- if err := client.doJsonRequest("DELETE", fmt.Sprintf("/v1/dashboard/lists/manual/%d/dashboards", dashboardListId), req, &out); err != nil {
- return nil, err
- }
- return out.Dashboards, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/dashboards.go b/vendor/github.com/zorkian/go-datadog-api/dashboards.go
deleted file mode 100644
index 904eade..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/dashboards.go
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "encoding/json"
- "fmt"
-)
-
-// GraphDefinitionRequestStyle represents the graph style attributes
-type GraphDefinitionRequestStyle struct {
- Palette *string `json:"palette,omitempty"`
- Width *string `json:"width,omitempty"`
- Type *string `json:"type,omitempty"`
-}
-
-// GraphDefinitionRequest represents the requests passed into each graph.
-type GraphDefinitionRequest struct {
- Query *string `json:"q,omitempty"`
- Stacked *bool `json:"stacked,omitempty"`
- Aggregator *string `json:"aggregator,omitempty"`
- ConditionalFormats []DashboardConditionalFormat `json:"conditional_formats,omitempty"`
- Type *string `json:"type,omitempty"`
- Style *GraphDefinitionRequestStyle `json:"style,omitempty"`
-
- // For change type graphs
- ChangeType *string `json:"change_type,omitempty"`
- OrderDirection *string `json:"order_dir,omitempty"`
- CompareTo *string `json:"compare_to,omitempty"`
- IncreaseGood *bool `json:"increase_good,omitempty"`
- OrderBy *string `json:"order_by,omitempty"`
- ExtraCol *string `json:"extra_col,omitempty"`
-}
-
-type GraphDefinitionMarker struct {
- Type *string `json:"type,omitempty"`
- Value *string `json:"value,omitempty"`
- Label *string `json:"label,omitempty"`
- Val *json.Number `json:"val,omitempty"`
- Min *json.Number `json:"min,omitempty"`
- Max *json.Number `json:"max,omitempty"`
-}
-
-type GraphEvent struct {
- Query *string `json:"q,omitempty"`
-}
-
-type Yaxis struct {
- Min *float64 `json:"min,omitempty"`
- AutoMin bool `json:"-"`
- Max *float64 `json:"max,omitempty"`
- AutoMax bool `json:"-"`
- Scale *string `json:"scale,omitempty"`
- IncludeZero *bool `json:"includeZero,omitempty"`
- IncludeUnits *bool `json:"units,omitempty"`
-}
-
-// UnmarshalJSON is a Custom Unmarshal for Yaxis.Min/Yaxis.Max. If the datadog API
-// returns "auto" for min or max, then we should set Yaxis.min or Yaxis.max to nil,
-// respectively.
-func (y *Yaxis) UnmarshalJSON(data []byte) error {
- type Alias Yaxis
- wrapper := &struct {
- Min *json.Number `json:"min,omitempty"`
- Max *json.Number `json:"max,omitempty"`
- *Alias
- }{
- Alias: (*Alias)(y),
- }
-
- if err := json.Unmarshal(data, &wrapper); err != nil {
- return err
- }
-
- if wrapper.Min != nil {
- if *wrapper.Min == "auto" {
- y.AutoMin = true
- y.Min = nil
- } else {
- f, err := wrapper.Min.Float64()
- if err != nil {
- return err
- }
- y.Min = &f
- }
- }
-
- if wrapper.Max != nil {
- if *wrapper.Max == "auto" {
- y.AutoMax = true
- y.Max = nil
- } else {
- f, err := wrapper.Max.Float64()
- if err != nil {
- return err
- }
- y.Max = &f
- }
- }
- return nil
-}
-
-type Style struct {
- Palette *string `json:"palette,omitempty"`
- PaletteFlip *bool `json:"paletteFlip,omitempty"`
- FillMin *json.Number `json:"fillMin,omitempty"`
- FillMax *json.Number `json:"fillMax,omitempty"`
-}
-
-type GraphDefinition struct {
- Viz *string `json:"viz,omitempty"`
- Requests []GraphDefinitionRequest `json:"requests,omitempty"`
- Events []GraphEvent `json:"events,omitempty"`
- Markers []GraphDefinitionMarker `json:"markers,omitempty"`
-
- // For timeseries type graphs
- Yaxis Yaxis `json:"yaxis,omitempty"`
-
- // For query value type graphs
- Autoscale *bool `json:"autoscale,omitempty"`
- TextAlign *string `json:"text_align,omitempty"`
- Precision *json.Number `json:"precision,omitempty"`
- CustomUnit *string `json:"custom_unit,omitempty"`
-
- // For hostmaps
- Style *Style `json:"style,omitempty"`
- Groups []string `json:"group,omitempty"`
- IncludeNoMetricHosts *bool `json:"noMetricHosts,omitempty"`
- Scopes []string `json:"scope,omitempty"`
- IncludeUngroupedHosts *bool `json:"noGroupHosts,omitempty"`
- NodeType *string `json:"nodeType,omitempty"`
-}
-
-// Graph represents a graph that might exist on a dashboard.
-type Graph struct {
- Title *string `json:"title,omitempty"`
- Definition *GraphDefinition `json:"definition"`
-}
-
-// Template variable represents a template variable that might exist on a dashboard
-type TemplateVariable struct {
- Name *string `json:"name,omitempty"`
- Prefix *string `json:"prefix,omitempty"`
- Default *string `json:"default,omitempty"`
-}
-
-// Dashboard represents a user created dashboard. This is the full dashboard
-// struct when we load a dashboard in detail.
-type Dashboard struct {
- Id *int `json:"id,omitempty"`
- Description *string `json:"description,omitempty"`
- Title *string `json:"title,omitempty"`
- Graphs []Graph `json:"graphs,omitempty"`
- TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
- ReadOnly *bool `json:"read_only,omitempty"`
-}
-
-// DashboardLite represents a user created dashboard. This is the mini
-// struct when we load the summaries.
-type DashboardLite struct {
- Id *int `json:"id,string,omitempty"` // TODO: Remove ',string'.
- Resource *string `json:"resource,omitempty"`
- Description *string `json:"description,omitempty"`
- Title *string `json:"title,omitempty"`
- ReadOnly *bool `json:"read_only,omitempty"`
- Created *string `json:"created,omitempty"`
- Modified *string `json:"modified,omitempty"`
- CreatedBy *CreatedBy `json:"created_by,omitempty"`
-}
-
-// CreatedBy represents a field from DashboardLite.
-type CreatedBy struct {
- Disabled *bool `json:"disabled,omitempty"`
- Handle *string `json:"handle,omitempty"`
- Name *string `json:"name,omitempty"`
- IsAdmin *bool `json:"is_admin,omitempty"`
- Role *string `json:"role,omitempty"`
- AccessRole *string `json:"access_role,omitempty"`
- Verified *bool `json:"verified,omitempty"`
- Email *string `json:"email,omitempty"`
- Icon *string `json:"icon,omitempty"`
-}
-
-// reqGetDashboards from /api/v1/dash
-type reqGetDashboards struct {
- Dashboards []DashboardLite `json:"dashes,omitempty"`
-}
-
-// reqGetDashboard from /api/v1/dash/:dashboard_id
-type reqGetDashboard struct {
- Resource *string `json:"resource,omitempty"`
- Url *string `json:"url,omitempty"`
- Dashboard *Dashboard `json:"dash,omitempty"`
-}
-
-type DashboardConditionalFormat struct {
- Palette *string `json:"palette,omitempty"`
- Comparator *string `json:"comparator,omitempty"`
- CustomBgColor *string `json:"custom_bg_color,omitempty"`
- Value *json.Number `json:"value,omitempty"`
- Inverted *bool `json:"invert,omitempty"`
- CustomFgColor *string `json:"custom_fg_color,omitempty"`
- CustomImageUrl *string `json:"custom_image,omitempty"`
-}
-
-// GetDashboard returns a single dashboard created on this account.
-func (client *Client) GetDashboard(id int) (*Dashboard, error) {
- var out reqGetDashboard
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/dash/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return out.Dashboard, nil
-}
-
-// GetDashboards returns a list of all dashboards created on this account.
-func (client *Client) GetDashboards() ([]DashboardLite, error) {
- var out reqGetDashboards
- if err := client.doJsonRequest("GET", "/v1/dash", nil, &out); err != nil {
- return nil, err
- }
- return out.Dashboards, nil
-}
-
-// DeleteDashboard deletes a dashboard by the identifier.
-func (client *Client) DeleteDashboard(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/dash/%d", id), nil, nil)
-}
-
-// CreateDashboard creates a new dashboard when given a Dashboard struct. Note
-// that the Id, Resource, Url and similar elements are not used in creation.
-func (client *Client) CreateDashboard(dash *Dashboard) (*Dashboard, error) {
- var out reqGetDashboard
- if err := client.doJsonRequest("POST", "/v1/dash", dash, &out); err != nil {
- return nil, err
- }
- return out.Dashboard, nil
-}
-
-// UpdateDashboard in essence takes a Dashboard struct and persists it back to
-// the server. Use this if you've updated your local and need to push it back.
-func (client *Client) UpdateDashboard(dash *Dashboard) error {
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/dash/%d", *dash.Id),
- dash, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/datadog-accessors.go b/vendor/github.com/zorkian/go-datadog-api/datadog-accessors.go
deleted file mode 100644
index 6994935..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/datadog-accessors.go
+++ /dev/null
@@ -1,11019 +0,0 @@
-/*
- THIS FILE IS AUTOMATICALLY GENERATED BY create-accessors; DO NOT EDIT.
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2018 by authors and contributors.
-*/
-
-package datadog
-
-import (
- "encoding/json"
-)
-
-// GetCreator returns the Creator field if non-nil, zero value otherwise.
-func (a *Alert) GetCreator() int {
- if a == nil || a.Creator == nil {
- return 0
- }
- return *a.Creator
-}
-
-// GetCreatorOk returns a tuple with the Creator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetCreatorOk() (int, bool) {
- if a == nil || a.Creator == nil {
- return 0, false
- }
- return *a.Creator, true
-}
-
-// HasCreator returns a boolean if a field has been set.
-func (a *Alert) HasCreator() bool {
- if a != nil && a.Creator != nil {
- return true
- }
-
- return false
-}
-
-// SetCreator allocates a new a.Creator and returns the pointer to it.
-func (a *Alert) SetCreator(v int) {
- a.Creator = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (a *Alert) GetId() int {
- if a == nil || a.Id == nil {
- return 0
- }
- return *a.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetIdOk() (int, bool) {
- if a == nil || a.Id == nil {
- return 0, false
- }
- return *a.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (a *Alert) HasId() bool {
- if a != nil && a.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new a.Id and returns the pointer to it.
-func (a *Alert) SetId(v int) {
- a.Id = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (a *Alert) GetMessage() string {
- if a == nil || a.Message == nil {
- return ""
- }
- return *a.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetMessageOk() (string, bool) {
- if a == nil || a.Message == nil {
- return "", false
- }
- return *a.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (a *Alert) HasMessage() bool {
- if a != nil && a.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new a.Message and returns the pointer to it.
-func (a *Alert) SetMessage(v string) {
- a.Message = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (a *Alert) GetName() string {
- if a == nil || a.Name == nil {
- return ""
- }
- return *a.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetNameOk() (string, bool) {
- if a == nil || a.Name == nil {
- return "", false
- }
- return *a.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (a *Alert) HasName() bool {
- if a != nil && a.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new a.Name and returns the pointer to it.
-func (a *Alert) SetName(v string) {
- a.Name = &v
-}
-
-// GetNotifyNoData returns the NotifyNoData field if non-nil, zero value otherwise.
-func (a *Alert) GetNotifyNoData() bool {
- if a == nil || a.NotifyNoData == nil {
- return false
- }
- return *a.NotifyNoData
-}
-
-// GetNotifyNoDataOk returns a tuple with the NotifyNoData field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetNotifyNoDataOk() (bool, bool) {
- if a == nil || a.NotifyNoData == nil {
- return false, false
- }
- return *a.NotifyNoData, true
-}
-
-// HasNotifyNoData returns a boolean if a field has been set.
-func (a *Alert) HasNotifyNoData() bool {
- if a != nil && a.NotifyNoData != nil {
- return true
- }
-
- return false
-}
-
-// SetNotifyNoData allocates a new a.NotifyNoData and returns the pointer to it.
-func (a *Alert) SetNotifyNoData(v bool) {
- a.NotifyNoData = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (a *Alert) GetQuery() string {
- if a == nil || a.Query == nil {
- return ""
- }
- return *a.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetQueryOk() (string, bool) {
- if a == nil || a.Query == nil {
- return "", false
- }
- return *a.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (a *Alert) HasQuery() bool {
- if a != nil && a.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new a.Query and returns the pointer to it.
-func (a *Alert) SetQuery(v string) {
- a.Query = &v
-}
-
-// GetSilenced returns the Silenced field if non-nil, zero value otherwise.
-func (a *Alert) GetSilenced() bool {
- if a == nil || a.Silenced == nil {
- return false
- }
- return *a.Silenced
-}
-
-// GetSilencedOk returns a tuple with the Silenced field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetSilencedOk() (bool, bool) {
- if a == nil || a.Silenced == nil {
- return false, false
- }
- return *a.Silenced, true
-}
-
-// HasSilenced returns a boolean if a field has been set.
-func (a *Alert) HasSilenced() bool {
- if a != nil && a.Silenced != nil {
- return true
- }
-
- return false
-}
-
-// SetSilenced allocates a new a.Silenced and returns the pointer to it.
-func (a *Alert) SetSilenced(v bool) {
- a.Silenced = &v
-}
-
-// GetState returns the State field if non-nil, zero value otherwise.
-func (a *Alert) GetState() string {
- if a == nil || a.State == nil {
- return ""
- }
- return *a.State
-}
-
-// GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (a *Alert) GetStateOk() (string, bool) {
- if a == nil || a.State == nil {
- return "", false
- }
- return *a.State, true
-}
-
-// HasState returns a boolean if a field has been set.
-func (a *Alert) HasState() bool {
- if a != nil && a.State != nil {
- return true
- }
-
- return false
-}
-
-// SetState allocates a new a.State and returns the pointer to it.
-func (a *Alert) SetState(v string) {
- a.State = &v
-}
-
-// GetAccount returns the Account field if non-nil, zero value otherwise.
-func (c *ChannelSlackRequest) GetAccount() string {
- if c == nil || c.Account == nil {
- return ""
- }
- return *c.Account
-}
-
-// GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ChannelSlackRequest) GetAccountOk() (string, bool) {
- if c == nil || c.Account == nil {
- return "", false
- }
- return *c.Account, true
-}
-
-// HasAccount returns a boolean if a field has been set.
-func (c *ChannelSlackRequest) HasAccount() bool {
- if c != nil && c.Account != nil {
- return true
- }
-
- return false
-}
-
-// SetAccount allocates a new c.Account and returns the pointer to it.
-func (c *ChannelSlackRequest) SetAccount(v string) {
- c.Account = &v
-}
-
-// GetChannelName returns the ChannelName field if non-nil, zero value otherwise.
-func (c *ChannelSlackRequest) GetChannelName() string {
- if c == nil || c.ChannelName == nil {
- return ""
- }
- return *c.ChannelName
-}
-
-// GetChannelNameOk returns a tuple with the ChannelName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ChannelSlackRequest) GetChannelNameOk() (string, bool) {
- if c == nil || c.ChannelName == nil {
- return "", false
- }
- return *c.ChannelName, true
-}
-
-// HasChannelName returns a boolean if a field has been set.
-func (c *ChannelSlackRequest) HasChannelName() bool {
- if c != nil && c.ChannelName != nil {
- return true
- }
-
- return false
-}
-
-// SetChannelName allocates a new c.ChannelName and returns the pointer to it.
-func (c *ChannelSlackRequest) SetChannelName(v string) {
- c.ChannelName = &v
-}
-
-// GetTransferAllUserComments returns the TransferAllUserComments field if non-nil, zero value otherwise.
-func (c *ChannelSlackRequest) GetTransferAllUserComments() bool {
- if c == nil || c.TransferAllUserComments == nil {
- return false
- }
- return *c.TransferAllUserComments
-}
-
-// GetTransferAllUserCommentsOk returns a tuple with the TransferAllUserComments field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ChannelSlackRequest) GetTransferAllUserCommentsOk() (bool, bool) {
- if c == nil || c.TransferAllUserComments == nil {
- return false, false
- }
- return *c.TransferAllUserComments, true
-}
-
-// HasTransferAllUserComments returns a boolean if a field has been set.
-func (c *ChannelSlackRequest) HasTransferAllUserComments() bool {
- if c != nil && c.TransferAllUserComments != nil {
- return true
- }
-
- return false
-}
-
-// SetTransferAllUserComments allocates a new c.TransferAllUserComments and returns the pointer to it.
-func (c *ChannelSlackRequest) SetTransferAllUserComments(v bool) {
- c.TransferAllUserComments = &v
-}
-
-// GetCheck returns the Check field if non-nil, zero value otherwise.
-func (c *Check) GetCheck() string {
- if c == nil || c.Check == nil {
- return ""
- }
- return *c.Check
-}
-
-// GetCheckOk returns a tuple with the Check field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Check) GetCheckOk() (string, bool) {
- if c == nil || c.Check == nil {
- return "", false
- }
- return *c.Check, true
-}
-
-// HasCheck returns a boolean if a field has been set.
-func (c *Check) HasCheck() bool {
- if c != nil && c.Check != nil {
- return true
- }
-
- return false
-}
-
-// SetCheck allocates a new c.Check and returns the pointer to it.
-func (c *Check) SetCheck(v string) {
- c.Check = &v
-}
-
-// GetHostName returns the HostName field if non-nil, zero value otherwise.
-func (c *Check) GetHostName() string {
- if c == nil || c.HostName == nil {
- return ""
- }
- return *c.HostName
-}
-
-// GetHostNameOk returns a tuple with the HostName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Check) GetHostNameOk() (string, bool) {
- if c == nil || c.HostName == nil {
- return "", false
- }
- return *c.HostName, true
-}
-
-// HasHostName returns a boolean if a field has been set.
-func (c *Check) HasHostName() bool {
- if c != nil && c.HostName != nil {
- return true
- }
-
- return false
-}
-
-// SetHostName allocates a new c.HostName and returns the pointer to it.
-func (c *Check) SetHostName(v string) {
- c.HostName = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (c *Check) GetMessage() string {
- if c == nil || c.Message == nil {
- return ""
- }
- return *c.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Check) GetMessageOk() (string, bool) {
- if c == nil || c.Message == nil {
- return "", false
- }
- return *c.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (c *Check) HasMessage() bool {
- if c != nil && c.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new c.Message and returns the pointer to it.
-func (c *Check) SetMessage(v string) {
- c.Message = &v
-}
-
-// GetStatus returns the Status field if non-nil, zero value otherwise.
-func (c *Check) GetStatus() Status {
- if c == nil || c.Status == nil {
- return 0
- }
- return *c.Status
-}
-
-// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Check) GetStatusOk() (Status, bool) {
- if c == nil || c.Status == nil {
- return 0, false
- }
- return *c.Status, true
-}
-
-// HasStatus returns a boolean if a field has been set.
-func (c *Check) HasStatus() bool {
- if c != nil && c.Status != nil {
- return true
- }
-
- return false
-}
-
-// SetStatus allocates a new c.Status and returns the pointer to it.
-func (c *Check) SetStatus(v Status) {
- c.Status = &v
-}
-
-// GetTimestamp returns the Timestamp field if non-nil, zero value otherwise.
-func (c *Check) GetTimestamp() string {
- if c == nil || c.Timestamp == nil {
- return ""
- }
- return *c.Timestamp
-}
-
-// GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Check) GetTimestampOk() (string, bool) {
- if c == nil || c.Timestamp == nil {
- return "", false
- }
- return *c.Timestamp, true
-}
-
-// HasTimestamp returns a boolean if a field has been set.
-func (c *Check) HasTimestamp() bool {
- if c != nil && c.Timestamp != nil {
- return true
- }
-
- return false
-}
-
-// SetTimestamp allocates a new c.Timestamp and returns the pointer to it.
-func (c *Check) SetTimestamp(v string) {
- c.Timestamp = &v
-}
-
-// GetHandle returns the Handle field if non-nil, zero value otherwise.
-func (c *Comment) GetHandle() string {
- if c == nil || c.Handle == nil {
- return ""
- }
- return *c.Handle
-}
-
-// GetHandleOk returns a tuple with the Handle field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetHandleOk() (string, bool) {
- if c == nil || c.Handle == nil {
- return "", false
- }
- return *c.Handle, true
-}
-
-// HasHandle returns a boolean if a field has been set.
-func (c *Comment) HasHandle() bool {
- if c != nil && c.Handle != nil {
- return true
- }
-
- return false
-}
-
-// SetHandle allocates a new c.Handle and returns the pointer to it.
-func (c *Comment) SetHandle(v string) {
- c.Handle = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (c *Comment) GetId() int {
- if c == nil || c.Id == nil {
- return 0
- }
- return *c.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetIdOk() (int, bool) {
- if c == nil || c.Id == nil {
- return 0, false
- }
- return *c.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (c *Comment) HasId() bool {
- if c != nil && c.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new c.Id and returns the pointer to it.
-func (c *Comment) SetId(v int) {
- c.Id = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (c *Comment) GetMessage() string {
- if c == nil || c.Message == nil {
- return ""
- }
- return *c.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetMessageOk() (string, bool) {
- if c == nil || c.Message == nil {
- return "", false
- }
- return *c.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (c *Comment) HasMessage() bool {
- if c != nil && c.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new c.Message and returns the pointer to it.
-func (c *Comment) SetMessage(v string) {
- c.Message = &v
-}
-
-// GetRelatedId returns the RelatedId field if non-nil, zero value otherwise.
-func (c *Comment) GetRelatedId() int {
- if c == nil || c.RelatedId == nil {
- return 0
- }
- return *c.RelatedId
-}
-
-// GetRelatedIdOk returns a tuple with the RelatedId field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetRelatedIdOk() (int, bool) {
- if c == nil || c.RelatedId == nil {
- return 0, false
- }
- return *c.RelatedId, true
-}
-
-// HasRelatedId returns a boolean if a field has been set.
-func (c *Comment) HasRelatedId() bool {
- if c != nil && c.RelatedId != nil {
- return true
- }
-
- return false
-}
-
-// SetRelatedId allocates a new c.RelatedId and returns the pointer to it.
-func (c *Comment) SetRelatedId(v int) {
- c.RelatedId = &v
-}
-
-// GetResource returns the Resource field if non-nil, zero value otherwise.
-func (c *Comment) GetResource() string {
- if c == nil || c.Resource == nil {
- return ""
- }
- return *c.Resource
-}
-
-// GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetResourceOk() (string, bool) {
- if c == nil || c.Resource == nil {
- return "", false
- }
- return *c.Resource, true
-}
-
-// HasResource returns a boolean if a field has been set.
-func (c *Comment) HasResource() bool {
- if c != nil && c.Resource != nil {
- return true
- }
-
- return false
-}
-
-// SetResource allocates a new c.Resource and returns the pointer to it.
-func (c *Comment) SetResource(v string) {
- c.Resource = &v
-}
-
-// GetUrl returns the Url field if non-nil, zero value otherwise.
-func (c *Comment) GetUrl() string {
- if c == nil || c.Url == nil {
- return ""
- }
- return *c.Url
-}
-
-// GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Comment) GetUrlOk() (string, bool) {
- if c == nil || c.Url == nil {
- return "", false
- }
- return *c.Url, true
-}
-
-// HasUrl returns a boolean if a field has been set.
-func (c *Comment) HasUrl() bool {
- if c != nil && c.Url != nil {
- return true
- }
-
- return false
-}
-
-// SetUrl allocates a new c.Url and returns the pointer to it.
-func (c *Comment) SetUrl(v string) {
- c.Url = &v
-}
-
-// GetColor returns the Color field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetColor() string {
- if c == nil || c.Color == nil {
- return ""
- }
- return *c.Color
-}
-
-// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetColorOk() (string, bool) {
- if c == nil || c.Color == nil {
- return "", false
- }
- return *c.Color, true
-}
-
-// HasColor returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasColor() bool {
- if c != nil && c.Color != nil {
- return true
- }
-
- return false
-}
-
-// SetColor allocates a new c.Color and returns the pointer to it.
-func (c *ConditionalFormat) SetColor(v string) {
- c.Color = &v
-}
-
-// GetComparator returns the Comparator field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetComparator() string {
- if c == nil || c.Comparator == nil {
- return ""
- }
- return *c.Comparator
-}
-
-// GetComparatorOk returns a tuple with the Comparator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetComparatorOk() (string, bool) {
- if c == nil || c.Comparator == nil {
- return "", false
- }
- return *c.Comparator, true
-}
-
-// HasComparator returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasComparator() bool {
- if c != nil && c.Comparator != nil {
- return true
- }
-
- return false
-}
-
-// SetComparator allocates a new c.Comparator and returns the pointer to it.
-func (c *ConditionalFormat) SetComparator(v string) {
- c.Comparator = &v
-}
-
-// GetImageURL returns the ImageURL field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetImageURL() string {
- if c == nil || c.ImageURL == nil {
- return ""
- }
- return *c.ImageURL
-}
-
-// GetImageURLOk returns a tuple with the ImageURL field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetImageURLOk() (string, bool) {
- if c == nil || c.ImageURL == nil {
- return "", false
- }
- return *c.ImageURL, true
-}
-
-// HasImageURL returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasImageURL() bool {
- if c != nil && c.ImageURL != nil {
- return true
- }
-
- return false
-}
-
-// SetImageURL allocates a new c.ImageURL and returns the pointer to it.
-func (c *ConditionalFormat) SetImageURL(v string) {
- c.ImageURL = &v
-}
-
-// GetInvert returns the Invert field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetInvert() bool {
- if c == nil || c.Invert == nil {
- return false
- }
- return *c.Invert
-}
-
-// GetInvertOk returns a tuple with the Invert field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetInvertOk() (bool, bool) {
- if c == nil || c.Invert == nil {
- return false, false
- }
- return *c.Invert, true
-}
-
-// HasInvert returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasInvert() bool {
- if c != nil && c.Invert != nil {
- return true
- }
-
- return false
-}
-
-// SetInvert allocates a new c.Invert and returns the pointer to it.
-func (c *ConditionalFormat) SetInvert(v bool) {
- c.Invert = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetPalette() string {
- if c == nil || c.Palette == nil {
- return ""
- }
- return *c.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetPaletteOk() (string, bool) {
- if c == nil || c.Palette == nil {
- return "", false
- }
- return *c.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasPalette() bool {
- if c != nil && c.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new c.Palette and returns the pointer to it.
-func (c *ConditionalFormat) SetPalette(v string) {
- c.Palette = &v
-}
-
-// GetValue returns the Value field if non-nil, zero value otherwise.
-func (c *ConditionalFormat) GetValue() string {
- if c == nil || c.Value == nil {
- return ""
- }
- return *c.Value
-}
-
-// GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *ConditionalFormat) GetValueOk() (string, bool) {
- if c == nil || c.Value == nil {
- return "", false
- }
- return *c.Value, true
-}
-
-// HasValue returns a boolean if a field has been set.
-func (c *ConditionalFormat) HasValue() bool {
- if c != nil && c.Value != nil {
- return true
- }
-
- return false
-}
-
-// SetValue allocates a new c.Value and returns the pointer to it.
-func (c *ConditionalFormat) SetValue(v string) {
- c.Value = &v
-}
-
-// GetAccessRole returns the AccessRole field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetAccessRole() string {
- if c == nil || c.AccessRole == nil {
- return ""
- }
- return *c.AccessRole
-}
-
-// GetAccessRoleOk returns a tuple with the AccessRole field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetAccessRoleOk() (string, bool) {
- if c == nil || c.AccessRole == nil {
- return "", false
- }
- return *c.AccessRole, true
-}
-
-// HasAccessRole returns a boolean if a field has been set.
-func (c *CreatedBy) HasAccessRole() bool {
- if c != nil && c.AccessRole != nil {
- return true
- }
-
- return false
-}
-
-// SetAccessRole allocates a new c.AccessRole and returns the pointer to it.
-func (c *CreatedBy) SetAccessRole(v string) {
- c.AccessRole = &v
-}
-
-// GetDisabled returns the Disabled field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetDisabled() bool {
- if c == nil || c.Disabled == nil {
- return false
- }
- return *c.Disabled
-}
-
-// GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetDisabledOk() (bool, bool) {
- if c == nil || c.Disabled == nil {
- return false, false
- }
- return *c.Disabled, true
-}
-
-// HasDisabled returns a boolean if a field has been set.
-func (c *CreatedBy) HasDisabled() bool {
- if c != nil && c.Disabled != nil {
- return true
- }
-
- return false
-}
-
-// SetDisabled allocates a new c.Disabled and returns the pointer to it.
-func (c *CreatedBy) SetDisabled(v bool) {
- c.Disabled = &v
-}
-
-// GetEmail returns the Email field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetEmail() string {
- if c == nil || c.Email == nil {
- return ""
- }
- return *c.Email
-}
-
-// GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetEmailOk() (string, bool) {
- if c == nil || c.Email == nil {
- return "", false
- }
- return *c.Email, true
-}
-
-// HasEmail returns a boolean if a field has been set.
-func (c *CreatedBy) HasEmail() bool {
- if c != nil && c.Email != nil {
- return true
- }
-
- return false
-}
-
-// SetEmail allocates a new c.Email and returns the pointer to it.
-func (c *CreatedBy) SetEmail(v string) {
- c.Email = &v
-}
-
-// GetHandle returns the Handle field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetHandle() string {
- if c == nil || c.Handle == nil {
- return ""
- }
- return *c.Handle
-}
-
-// GetHandleOk returns a tuple with the Handle field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetHandleOk() (string, bool) {
- if c == nil || c.Handle == nil {
- return "", false
- }
- return *c.Handle, true
-}
-
-// HasHandle returns a boolean if a field has been set.
-func (c *CreatedBy) HasHandle() bool {
- if c != nil && c.Handle != nil {
- return true
- }
-
- return false
-}
-
-// SetHandle allocates a new c.Handle and returns the pointer to it.
-func (c *CreatedBy) SetHandle(v string) {
- c.Handle = &v
-}
-
-// GetIcon returns the Icon field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetIcon() string {
- if c == nil || c.Icon == nil {
- return ""
- }
- return *c.Icon
-}
-
-// GetIconOk returns a tuple with the Icon field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetIconOk() (string, bool) {
- if c == nil || c.Icon == nil {
- return "", false
- }
- return *c.Icon, true
-}
-
-// HasIcon returns a boolean if a field has been set.
-func (c *CreatedBy) HasIcon() bool {
- if c != nil && c.Icon != nil {
- return true
- }
-
- return false
-}
-
-// SetIcon allocates a new c.Icon and returns the pointer to it.
-func (c *CreatedBy) SetIcon(v string) {
- c.Icon = &v
-}
-
-// GetIsAdmin returns the IsAdmin field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetIsAdmin() bool {
- if c == nil || c.IsAdmin == nil {
- return false
- }
- return *c.IsAdmin
-}
-
-// GetIsAdminOk returns a tuple with the IsAdmin field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetIsAdminOk() (bool, bool) {
- if c == nil || c.IsAdmin == nil {
- return false, false
- }
- return *c.IsAdmin, true
-}
-
-// HasIsAdmin returns a boolean if a field has been set.
-func (c *CreatedBy) HasIsAdmin() bool {
- if c != nil && c.IsAdmin != nil {
- return true
- }
-
- return false
-}
-
-// SetIsAdmin allocates a new c.IsAdmin and returns the pointer to it.
-func (c *CreatedBy) SetIsAdmin(v bool) {
- c.IsAdmin = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetName() string {
- if c == nil || c.Name == nil {
- return ""
- }
- return *c.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetNameOk() (string, bool) {
- if c == nil || c.Name == nil {
- return "", false
- }
- return *c.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (c *CreatedBy) HasName() bool {
- if c != nil && c.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new c.Name and returns the pointer to it.
-func (c *CreatedBy) SetName(v string) {
- c.Name = &v
-}
-
-// GetRole returns the Role field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetRole() string {
- if c == nil || c.Role == nil {
- return ""
- }
- return *c.Role
-}
-
-// GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetRoleOk() (string, bool) {
- if c == nil || c.Role == nil {
- return "", false
- }
- return *c.Role, true
-}
-
-// HasRole returns a boolean if a field has been set.
-func (c *CreatedBy) HasRole() bool {
- if c != nil && c.Role != nil {
- return true
- }
-
- return false
-}
-
-// SetRole allocates a new c.Role and returns the pointer to it.
-func (c *CreatedBy) SetRole(v string) {
- c.Role = &v
-}
-
-// GetVerified returns the Verified field if non-nil, zero value otherwise.
-func (c *CreatedBy) GetVerified() bool {
- if c == nil || c.Verified == nil {
- return false
- }
- return *c.Verified
-}
-
-// GetVerifiedOk returns a tuple with the Verified field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *CreatedBy) GetVerifiedOk() (bool, bool) {
- if c == nil || c.Verified == nil {
- return false, false
- }
- return *c.Verified, true
-}
-
-// HasVerified returns a boolean if a field has been set.
-func (c *CreatedBy) HasVerified() bool {
- if c != nil && c.Verified != nil {
- return true
- }
-
- return false
-}
-
-// SetVerified allocates a new c.Verified and returns the pointer to it.
-func (c *CreatedBy) SetVerified(v bool) {
- c.Verified = &v
-}
-
-// GetEmail returns the Email field if non-nil, zero value otherwise.
-func (c *Creator) GetEmail() string {
- if c == nil || c.Email == nil {
- return ""
- }
- return *c.Email
-}
-
-// GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Creator) GetEmailOk() (string, bool) {
- if c == nil || c.Email == nil {
- return "", false
- }
- return *c.Email, true
-}
-
-// HasEmail returns a boolean if a field has been set.
-func (c *Creator) HasEmail() bool {
- if c != nil && c.Email != nil {
- return true
- }
-
- return false
-}
-
-// SetEmail allocates a new c.Email and returns the pointer to it.
-func (c *Creator) SetEmail(v string) {
- c.Email = &v
-}
-
-// GetHandle returns the Handle field if non-nil, zero value otherwise.
-func (c *Creator) GetHandle() string {
- if c == nil || c.Handle == nil {
- return ""
- }
- return *c.Handle
-}
-
-// GetHandleOk returns a tuple with the Handle field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Creator) GetHandleOk() (string, bool) {
- if c == nil || c.Handle == nil {
- return "", false
- }
- return *c.Handle, true
-}
-
-// HasHandle returns a boolean if a field has been set.
-func (c *Creator) HasHandle() bool {
- if c != nil && c.Handle != nil {
- return true
- }
-
- return false
-}
-
-// SetHandle allocates a new c.Handle and returns the pointer to it.
-func (c *Creator) SetHandle(v string) {
- c.Handle = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (c *Creator) GetId() int {
- if c == nil || c.Id == nil {
- return 0
- }
- return *c.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Creator) GetIdOk() (int, bool) {
- if c == nil || c.Id == nil {
- return 0, false
- }
- return *c.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (c *Creator) HasId() bool {
- if c != nil && c.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new c.Id and returns the pointer to it.
-func (c *Creator) SetId(v int) {
- c.Id = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (c *Creator) GetName() string {
- if c == nil || c.Name == nil {
- return ""
- }
- return *c.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (c *Creator) GetNameOk() (string, bool) {
- if c == nil || c.Name == nil {
- return "", false
- }
- return *c.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (c *Creator) HasName() bool {
- if c != nil && c.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new c.Name and returns the pointer to it.
-func (c *Creator) SetName(v string) {
- c.Name = &v
-}
-
-// GetDescription returns the Description field if non-nil, zero value otherwise.
-func (d *Dashboard) GetDescription() string {
- if d == nil || d.Description == nil {
- return ""
- }
- return *d.Description
-}
-
-// GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Dashboard) GetDescriptionOk() (string, bool) {
- if d == nil || d.Description == nil {
- return "", false
- }
- return *d.Description, true
-}
-
-// HasDescription returns a boolean if a field has been set.
-func (d *Dashboard) HasDescription() bool {
- if d != nil && d.Description != nil {
- return true
- }
-
- return false
-}
-
-// SetDescription allocates a new d.Description and returns the pointer to it.
-func (d *Dashboard) SetDescription(v string) {
- d.Description = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (d *Dashboard) GetId() int {
- if d == nil || d.Id == nil {
- return 0
- }
- return *d.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Dashboard) GetIdOk() (int, bool) {
- if d == nil || d.Id == nil {
- return 0, false
- }
- return *d.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (d *Dashboard) HasId() bool {
- if d != nil && d.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new d.Id and returns the pointer to it.
-func (d *Dashboard) SetId(v int) {
- d.Id = &v
-}
-
-// GetReadOnly returns the ReadOnly field if non-nil, zero value otherwise.
-func (d *Dashboard) GetReadOnly() bool {
- if d == nil || d.ReadOnly == nil {
- return false
- }
- return *d.ReadOnly
-}
-
-// GetReadOnlyOk returns a tuple with the ReadOnly field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Dashboard) GetReadOnlyOk() (bool, bool) {
- if d == nil || d.ReadOnly == nil {
- return false, false
- }
- return *d.ReadOnly, true
-}
-
-// HasReadOnly returns a boolean if a field has been set.
-func (d *Dashboard) HasReadOnly() bool {
- if d != nil && d.ReadOnly != nil {
- return true
- }
-
- return false
-}
-
-// SetReadOnly allocates a new d.ReadOnly and returns the pointer to it.
-func (d *Dashboard) SetReadOnly(v bool) {
- d.ReadOnly = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (d *Dashboard) GetTitle() string {
- if d == nil || d.Title == nil {
- return ""
- }
- return *d.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Dashboard) GetTitleOk() (string, bool) {
- if d == nil || d.Title == nil {
- return "", false
- }
- return *d.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (d *Dashboard) HasTitle() bool {
- if d != nil && d.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new d.Title and returns the pointer to it.
-func (d *Dashboard) SetTitle(v string) {
- d.Title = &v
-}
-
-// GetComparator returns the Comparator field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetComparator() string {
- if d == nil || d.Comparator == nil {
- return ""
- }
- return *d.Comparator
-}
-
-// GetComparatorOk returns a tuple with the Comparator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetComparatorOk() (string, bool) {
- if d == nil || d.Comparator == nil {
- return "", false
- }
- return *d.Comparator, true
-}
-
-// HasComparator returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasComparator() bool {
- if d != nil && d.Comparator != nil {
- return true
- }
-
- return false
-}
-
-// SetComparator allocates a new d.Comparator and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetComparator(v string) {
- d.Comparator = &v
-}
-
-// GetCustomBgColor returns the CustomBgColor field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetCustomBgColor() string {
- if d == nil || d.CustomBgColor == nil {
- return ""
- }
- return *d.CustomBgColor
-}
-
-// GetCustomBgColorOk returns a tuple with the CustomBgColor field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetCustomBgColorOk() (string, bool) {
- if d == nil || d.CustomBgColor == nil {
- return "", false
- }
- return *d.CustomBgColor, true
-}
-
-// HasCustomBgColor returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasCustomBgColor() bool {
- if d != nil && d.CustomBgColor != nil {
- return true
- }
-
- return false
-}
-
-// SetCustomBgColor allocates a new d.CustomBgColor and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetCustomBgColor(v string) {
- d.CustomBgColor = &v
-}
-
-// GetCustomFgColor returns the CustomFgColor field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetCustomFgColor() string {
- if d == nil || d.CustomFgColor == nil {
- return ""
- }
- return *d.CustomFgColor
-}
-
-// GetCustomFgColorOk returns a tuple with the CustomFgColor field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetCustomFgColorOk() (string, bool) {
- if d == nil || d.CustomFgColor == nil {
- return "", false
- }
- return *d.CustomFgColor, true
-}
-
-// HasCustomFgColor returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasCustomFgColor() bool {
- if d != nil && d.CustomFgColor != nil {
- return true
- }
-
- return false
-}
-
-// SetCustomFgColor allocates a new d.CustomFgColor and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetCustomFgColor(v string) {
- d.CustomFgColor = &v
-}
-
-// GetCustomImageUrl returns the CustomImageUrl field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetCustomImageUrl() string {
- if d == nil || d.CustomImageUrl == nil {
- return ""
- }
- return *d.CustomImageUrl
-}
-
-// GetCustomImageUrlOk returns a tuple with the CustomImageUrl field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetCustomImageUrlOk() (string, bool) {
- if d == nil || d.CustomImageUrl == nil {
- return "", false
- }
- return *d.CustomImageUrl, true
-}
-
-// HasCustomImageUrl returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasCustomImageUrl() bool {
- if d != nil && d.CustomImageUrl != nil {
- return true
- }
-
- return false
-}
-
-// SetCustomImageUrl allocates a new d.CustomImageUrl and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetCustomImageUrl(v string) {
- d.CustomImageUrl = &v
-}
-
-// GetInverted returns the Inverted field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetInverted() bool {
- if d == nil || d.Inverted == nil {
- return false
- }
- return *d.Inverted
-}
-
-// GetInvertedOk returns a tuple with the Inverted field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetInvertedOk() (bool, bool) {
- if d == nil || d.Inverted == nil {
- return false, false
- }
- return *d.Inverted, true
-}
-
-// HasInverted returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasInverted() bool {
- if d != nil && d.Inverted != nil {
- return true
- }
-
- return false
-}
-
-// SetInverted allocates a new d.Inverted and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetInverted(v bool) {
- d.Inverted = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetPalette() string {
- if d == nil || d.Palette == nil {
- return ""
- }
- return *d.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetPaletteOk() (string, bool) {
- if d == nil || d.Palette == nil {
- return "", false
- }
- return *d.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasPalette() bool {
- if d != nil && d.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new d.Palette and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetPalette(v string) {
- d.Palette = &v
-}
-
-// GetValue returns the Value field if non-nil, zero value otherwise.
-func (d *DashboardConditionalFormat) GetValue() json.Number {
- if d == nil || d.Value == nil {
- return ""
- }
- return *d.Value
-}
-
-// GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardConditionalFormat) GetValueOk() (json.Number, bool) {
- if d == nil || d.Value == nil {
- return "", false
- }
- return *d.Value, true
-}
-
-// HasValue returns a boolean if a field has been set.
-func (d *DashboardConditionalFormat) HasValue() bool {
- if d != nil && d.Value != nil {
- return true
- }
-
- return false
-}
-
-// SetValue allocates a new d.Value and returns the pointer to it.
-func (d *DashboardConditionalFormat) SetValue(v json.Number) {
- d.Value = &v
-}
-
-// GetDashboardCount returns the DashboardCount field if non-nil, zero value otherwise.
-func (d *DashboardList) GetDashboardCount() int {
- if d == nil || d.DashboardCount == nil {
- return 0
- }
- return *d.DashboardCount
-}
-
-// GetDashboardCountOk returns a tuple with the DashboardCount field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardList) GetDashboardCountOk() (int, bool) {
- if d == nil || d.DashboardCount == nil {
- return 0, false
- }
- return *d.DashboardCount, true
-}
-
-// HasDashboardCount returns a boolean if a field has been set.
-func (d *DashboardList) HasDashboardCount() bool {
- if d != nil && d.DashboardCount != nil {
- return true
- }
-
- return false
-}
-
-// SetDashboardCount allocates a new d.DashboardCount and returns the pointer to it.
-func (d *DashboardList) SetDashboardCount(v int) {
- d.DashboardCount = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (d *DashboardList) GetId() int {
- if d == nil || d.Id == nil {
- return 0
- }
- return *d.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardList) GetIdOk() (int, bool) {
- if d == nil || d.Id == nil {
- return 0, false
- }
- return *d.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (d *DashboardList) HasId() bool {
- if d != nil && d.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new d.Id and returns the pointer to it.
-func (d *DashboardList) SetId(v int) {
- d.Id = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (d *DashboardList) GetName() string {
- if d == nil || d.Name == nil {
- return ""
- }
- return *d.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardList) GetNameOk() (string, bool) {
- if d == nil || d.Name == nil {
- return "", false
- }
- return *d.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (d *DashboardList) HasName() bool {
- if d != nil && d.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new d.Name and returns the pointer to it.
-func (d *DashboardList) SetName(v string) {
- d.Name = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (d *DashboardListItem) GetId() int {
- if d == nil || d.Id == nil {
- return 0
- }
- return *d.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardListItem) GetIdOk() (int, bool) {
- if d == nil || d.Id == nil {
- return 0, false
- }
- return *d.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (d *DashboardListItem) HasId() bool {
- if d != nil && d.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new d.Id and returns the pointer to it.
-func (d *DashboardListItem) SetId(v int) {
- d.Id = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (d *DashboardListItem) GetType() string {
- if d == nil || d.Type == nil {
- return ""
- }
- return *d.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardListItem) GetTypeOk() (string, bool) {
- if d == nil || d.Type == nil {
- return "", false
- }
- return *d.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (d *DashboardListItem) HasType() bool {
- if d != nil && d.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new d.Type and returns the pointer to it.
-func (d *DashboardListItem) SetType(v string) {
- d.Type = &v
-}
-
-// GetCreated returns the Created field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetCreated() string {
- if d == nil || d.Created == nil {
- return ""
- }
- return *d.Created
-}
-
-// GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetCreatedOk() (string, bool) {
- if d == nil || d.Created == nil {
- return "", false
- }
- return *d.Created, true
-}
-
-// HasCreated returns a boolean if a field has been set.
-func (d *DashboardLite) HasCreated() bool {
- if d != nil && d.Created != nil {
- return true
- }
-
- return false
-}
-
-// SetCreated allocates a new d.Created and returns the pointer to it.
-func (d *DashboardLite) SetCreated(v string) {
- d.Created = &v
-}
-
-// GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetCreatedBy() CreatedBy {
- if d == nil || d.CreatedBy == nil {
- return CreatedBy{}
- }
- return *d.CreatedBy
-}
-
-// GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetCreatedByOk() (CreatedBy, bool) {
- if d == nil || d.CreatedBy == nil {
- return CreatedBy{}, false
- }
- return *d.CreatedBy, true
-}
-
-// HasCreatedBy returns a boolean if a field has been set.
-func (d *DashboardLite) HasCreatedBy() bool {
- if d != nil && d.CreatedBy != nil {
- return true
- }
-
- return false
-}
-
-// SetCreatedBy allocates a new d.CreatedBy and returns the pointer to it.
-func (d *DashboardLite) SetCreatedBy(v CreatedBy) {
- d.CreatedBy = &v
-}
-
-// GetDescription returns the Description field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetDescription() string {
- if d == nil || d.Description == nil {
- return ""
- }
- return *d.Description
-}
-
-// GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetDescriptionOk() (string, bool) {
- if d == nil || d.Description == nil {
- return "", false
- }
- return *d.Description, true
-}
-
-// HasDescription returns a boolean if a field has been set.
-func (d *DashboardLite) HasDescription() bool {
- if d != nil && d.Description != nil {
- return true
- }
-
- return false
-}
-
-// SetDescription allocates a new d.Description and returns the pointer to it.
-func (d *DashboardLite) SetDescription(v string) {
- d.Description = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetId() int {
- if d == nil || d.Id == nil {
- return 0
- }
- return *d.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetIdOk() (int, bool) {
- if d == nil || d.Id == nil {
- return 0, false
- }
- return *d.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (d *DashboardLite) HasId() bool {
- if d != nil && d.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new d.Id and returns the pointer to it.
-func (d *DashboardLite) SetId(v int) {
- d.Id = &v
-}
-
-// GetModified returns the Modified field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetModified() string {
- if d == nil || d.Modified == nil {
- return ""
- }
- return *d.Modified
-}
-
-// GetModifiedOk returns a tuple with the Modified field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetModifiedOk() (string, bool) {
- if d == nil || d.Modified == nil {
- return "", false
- }
- return *d.Modified, true
-}
-
-// HasModified returns a boolean if a field has been set.
-func (d *DashboardLite) HasModified() bool {
- if d != nil && d.Modified != nil {
- return true
- }
-
- return false
-}
-
-// SetModified allocates a new d.Modified and returns the pointer to it.
-func (d *DashboardLite) SetModified(v string) {
- d.Modified = &v
-}
-
-// GetReadOnly returns the ReadOnly field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetReadOnly() bool {
- if d == nil || d.ReadOnly == nil {
- return false
- }
- return *d.ReadOnly
-}
-
-// GetReadOnlyOk returns a tuple with the ReadOnly field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetReadOnlyOk() (bool, bool) {
- if d == nil || d.ReadOnly == nil {
- return false, false
- }
- return *d.ReadOnly, true
-}
-
-// HasReadOnly returns a boolean if a field has been set.
-func (d *DashboardLite) HasReadOnly() bool {
- if d != nil && d.ReadOnly != nil {
- return true
- }
-
- return false
-}
-
-// SetReadOnly allocates a new d.ReadOnly and returns the pointer to it.
-func (d *DashboardLite) SetReadOnly(v bool) {
- d.ReadOnly = &v
-}
-
-// GetResource returns the Resource field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetResource() string {
- if d == nil || d.Resource == nil {
- return ""
- }
- return *d.Resource
-}
-
-// GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetResourceOk() (string, bool) {
- if d == nil || d.Resource == nil {
- return "", false
- }
- return *d.Resource, true
-}
-
-// HasResource returns a boolean if a field has been set.
-func (d *DashboardLite) HasResource() bool {
- if d != nil && d.Resource != nil {
- return true
- }
-
- return false
-}
-
-// SetResource allocates a new d.Resource and returns the pointer to it.
-func (d *DashboardLite) SetResource(v string) {
- d.Resource = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (d *DashboardLite) GetTitle() string {
- if d == nil || d.Title == nil {
- return ""
- }
- return *d.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *DashboardLite) GetTitleOk() (string, bool) {
- if d == nil || d.Title == nil {
- return "", false
- }
- return *d.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (d *DashboardLite) HasTitle() bool {
- if d != nil && d.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new d.Title and returns the pointer to it.
-func (d *DashboardLite) SetTitle(v string) {
- d.Title = &v
-}
-
-// GetActive returns the Active field if non-nil, zero value otherwise.
-func (d *Downtime) GetActive() bool {
- if d == nil || d.Active == nil {
- return false
- }
- return *d.Active
-}
-
-// GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetActiveOk() (bool, bool) {
- if d == nil || d.Active == nil {
- return false, false
- }
- return *d.Active, true
-}
-
-// HasActive returns a boolean if a field has been set.
-func (d *Downtime) HasActive() bool {
- if d != nil && d.Active != nil {
- return true
- }
-
- return false
-}
-
-// SetActive allocates a new d.Active and returns the pointer to it.
-func (d *Downtime) SetActive(v bool) {
- d.Active = &v
-}
-
-// GetCanceled returns the Canceled field if non-nil, zero value otherwise.
-func (d *Downtime) GetCanceled() int {
- if d == nil || d.Canceled == nil {
- return 0
- }
- return *d.Canceled
-}
-
-// GetCanceledOk returns a tuple with the Canceled field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetCanceledOk() (int, bool) {
- if d == nil || d.Canceled == nil {
- return 0, false
- }
- return *d.Canceled, true
-}
-
-// HasCanceled returns a boolean if a field has been set.
-func (d *Downtime) HasCanceled() bool {
- if d != nil && d.Canceled != nil {
- return true
- }
-
- return false
-}
-
-// SetCanceled allocates a new d.Canceled and returns the pointer to it.
-func (d *Downtime) SetCanceled(v int) {
- d.Canceled = &v
-}
-
-// GetDisabled returns the Disabled field if non-nil, zero value otherwise.
-func (d *Downtime) GetDisabled() bool {
- if d == nil || d.Disabled == nil {
- return false
- }
- return *d.Disabled
-}
-
-// GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetDisabledOk() (bool, bool) {
- if d == nil || d.Disabled == nil {
- return false, false
- }
- return *d.Disabled, true
-}
-
-// HasDisabled returns a boolean if a field has been set.
-func (d *Downtime) HasDisabled() bool {
- if d != nil && d.Disabled != nil {
- return true
- }
-
- return false
-}
-
-// SetDisabled allocates a new d.Disabled and returns the pointer to it.
-func (d *Downtime) SetDisabled(v bool) {
- d.Disabled = &v
-}
-
-// GetEnd returns the End field if non-nil, zero value otherwise.
-func (d *Downtime) GetEnd() int {
- if d == nil || d.End == nil {
- return 0
- }
- return *d.End
-}
-
-// GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetEndOk() (int, bool) {
- if d == nil || d.End == nil {
- return 0, false
- }
- return *d.End, true
-}
-
-// HasEnd returns a boolean if a field has been set.
-func (d *Downtime) HasEnd() bool {
- if d != nil && d.End != nil {
- return true
- }
-
- return false
-}
-
-// SetEnd allocates a new d.End and returns the pointer to it.
-func (d *Downtime) SetEnd(v int) {
- d.End = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (d *Downtime) GetId() int {
- if d == nil || d.Id == nil {
- return 0
- }
- return *d.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetIdOk() (int, bool) {
- if d == nil || d.Id == nil {
- return 0, false
- }
- return *d.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (d *Downtime) HasId() bool {
- if d != nil && d.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new d.Id and returns the pointer to it.
-func (d *Downtime) SetId(v int) {
- d.Id = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (d *Downtime) GetMessage() string {
- if d == nil || d.Message == nil {
- return ""
- }
- return *d.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetMessageOk() (string, bool) {
- if d == nil || d.Message == nil {
- return "", false
- }
- return *d.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (d *Downtime) HasMessage() bool {
- if d != nil && d.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new d.Message and returns the pointer to it.
-func (d *Downtime) SetMessage(v string) {
- d.Message = &v
-}
-
-// GetMonitorId returns the MonitorId field if non-nil, zero value otherwise.
-func (d *Downtime) GetMonitorId() int {
- if d == nil || d.MonitorId == nil {
- return 0
- }
- return *d.MonitorId
-}
-
-// GetMonitorIdOk returns a tuple with the MonitorId field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetMonitorIdOk() (int, bool) {
- if d == nil || d.MonitorId == nil {
- return 0, false
- }
- return *d.MonitorId, true
-}
-
-// HasMonitorId returns a boolean if a field has been set.
-func (d *Downtime) HasMonitorId() bool {
- if d != nil && d.MonitorId != nil {
- return true
- }
-
- return false
-}
-
-// SetMonitorId allocates a new d.MonitorId and returns the pointer to it.
-func (d *Downtime) SetMonitorId(v int) {
- d.MonitorId = &v
-}
-
-// GetRecurrence returns the Recurrence field if non-nil, zero value otherwise.
-func (d *Downtime) GetRecurrence() Recurrence {
- if d == nil || d.Recurrence == nil {
- return Recurrence{}
- }
- return *d.Recurrence
-}
-
-// GetRecurrenceOk returns a tuple with the Recurrence field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetRecurrenceOk() (Recurrence, bool) {
- if d == nil || d.Recurrence == nil {
- return Recurrence{}, false
- }
- return *d.Recurrence, true
-}
-
-// HasRecurrence returns a boolean if a field has been set.
-func (d *Downtime) HasRecurrence() bool {
- if d != nil && d.Recurrence != nil {
- return true
- }
-
- return false
-}
-
-// SetRecurrence allocates a new d.Recurrence and returns the pointer to it.
-func (d *Downtime) SetRecurrence(v Recurrence) {
- d.Recurrence = &v
-}
-
-// GetStart returns the Start field if non-nil, zero value otherwise.
-func (d *Downtime) GetStart() int {
- if d == nil || d.Start == nil {
- return 0
- }
- return *d.Start
-}
-
-// GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (d *Downtime) GetStartOk() (int, bool) {
- if d == nil || d.Start == nil {
- return 0, false
- }
- return *d.Start, true
-}
-
-// HasStart returns a boolean if a field has been set.
-func (d *Downtime) HasStart() bool {
- if d != nil && d.Start != nil {
- return true
- }
-
- return false
-}
-
-// SetStart allocates a new d.Start and returns the pointer to it.
-func (d *Downtime) SetStart(v int) {
- d.Start = &v
-}
-
-// GetAggregation returns the Aggregation field if non-nil, zero value otherwise.
-func (e *Event) GetAggregation() string {
- if e == nil || e.Aggregation == nil {
- return ""
- }
- return *e.Aggregation
-}
-
-// GetAggregationOk returns a tuple with the Aggregation field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetAggregationOk() (string, bool) {
- if e == nil || e.Aggregation == nil {
- return "", false
- }
- return *e.Aggregation, true
-}
-
-// HasAggregation returns a boolean if a field has been set.
-func (e *Event) HasAggregation() bool {
- if e != nil && e.Aggregation != nil {
- return true
- }
-
- return false
-}
-
-// SetAggregation allocates a new e.Aggregation and returns the pointer to it.
-func (e *Event) SetAggregation(v string) {
- e.Aggregation = &v
-}
-
-// GetAlertType returns the AlertType field if non-nil, zero value otherwise.
-func (e *Event) GetAlertType() string {
- if e == nil || e.AlertType == nil {
- return ""
- }
- return *e.AlertType
-}
-
-// GetAlertTypeOk returns a tuple with the AlertType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetAlertTypeOk() (string, bool) {
- if e == nil || e.AlertType == nil {
- return "", false
- }
- return *e.AlertType, true
-}
-
-// HasAlertType returns a boolean if a field has been set.
-func (e *Event) HasAlertType() bool {
- if e != nil && e.AlertType != nil {
- return true
- }
-
- return false
-}
-
-// SetAlertType allocates a new e.AlertType and returns the pointer to it.
-func (e *Event) SetAlertType(v string) {
- e.AlertType = &v
-}
-
-// GetEventType returns the EventType field if non-nil, zero value otherwise.
-func (e *Event) GetEventType() string {
- if e == nil || e.EventType == nil {
- return ""
- }
- return *e.EventType
-}
-
-// GetEventTypeOk returns a tuple with the EventType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetEventTypeOk() (string, bool) {
- if e == nil || e.EventType == nil {
- return "", false
- }
- return *e.EventType, true
-}
-
-// HasEventType returns a boolean if a field has been set.
-func (e *Event) HasEventType() bool {
- if e != nil && e.EventType != nil {
- return true
- }
-
- return false
-}
-
-// SetEventType allocates a new e.EventType and returns the pointer to it.
-func (e *Event) SetEventType(v string) {
- e.EventType = &v
-}
-
-// GetHost returns the Host field if non-nil, zero value otherwise.
-func (e *Event) GetHost() string {
- if e == nil || e.Host == nil {
- return ""
- }
- return *e.Host
-}
-
-// GetHostOk returns a tuple with the Host field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetHostOk() (string, bool) {
- if e == nil || e.Host == nil {
- return "", false
- }
- return *e.Host, true
-}
-
-// HasHost returns a boolean if a field has been set.
-func (e *Event) HasHost() bool {
- if e != nil && e.Host != nil {
- return true
- }
-
- return false
-}
-
-// SetHost allocates a new e.Host and returns the pointer to it.
-func (e *Event) SetHost(v string) {
- e.Host = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (e *Event) GetId() int {
- if e == nil || e.Id == nil {
- return 0
- }
- return *e.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetIdOk() (int, bool) {
- if e == nil || e.Id == nil {
- return 0, false
- }
- return *e.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (e *Event) HasId() bool {
- if e != nil && e.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new e.Id and returns the pointer to it.
-func (e *Event) SetId(v int) {
- e.Id = &v
-}
-
-// GetPriority returns the Priority field if non-nil, zero value otherwise.
-func (e *Event) GetPriority() string {
- if e == nil || e.Priority == nil {
- return ""
- }
- return *e.Priority
-}
-
-// GetPriorityOk returns a tuple with the Priority field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetPriorityOk() (string, bool) {
- if e == nil || e.Priority == nil {
- return "", false
- }
- return *e.Priority, true
-}
-
-// HasPriority returns a boolean if a field has been set.
-func (e *Event) HasPriority() bool {
- if e != nil && e.Priority != nil {
- return true
- }
-
- return false
-}
-
-// SetPriority allocates a new e.Priority and returns the pointer to it.
-func (e *Event) SetPriority(v string) {
- e.Priority = &v
-}
-
-// GetResource returns the Resource field if non-nil, zero value otherwise.
-func (e *Event) GetResource() string {
- if e == nil || e.Resource == nil {
- return ""
- }
- return *e.Resource
-}
-
-// GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetResourceOk() (string, bool) {
- if e == nil || e.Resource == nil {
- return "", false
- }
- return *e.Resource, true
-}
-
-// HasResource returns a boolean if a field has been set.
-func (e *Event) HasResource() bool {
- if e != nil && e.Resource != nil {
- return true
- }
-
- return false
-}
-
-// SetResource allocates a new e.Resource and returns the pointer to it.
-func (e *Event) SetResource(v string) {
- e.Resource = &v
-}
-
-// GetSourceType returns the SourceType field if non-nil, zero value otherwise.
-func (e *Event) GetSourceType() string {
- if e == nil || e.SourceType == nil {
- return ""
- }
- return *e.SourceType
-}
-
-// GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetSourceTypeOk() (string, bool) {
- if e == nil || e.SourceType == nil {
- return "", false
- }
- return *e.SourceType, true
-}
-
-// HasSourceType returns a boolean if a field has been set.
-func (e *Event) HasSourceType() bool {
- if e != nil && e.SourceType != nil {
- return true
- }
-
- return false
-}
-
-// SetSourceType allocates a new e.SourceType and returns the pointer to it.
-func (e *Event) SetSourceType(v string) {
- e.SourceType = &v
-}
-
-// GetText returns the Text field if non-nil, zero value otherwise.
-func (e *Event) GetText() string {
- if e == nil || e.Text == nil {
- return ""
- }
- return *e.Text
-}
-
-// GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetTextOk() (string, bool) {
- if e == nil || e.Text == nil {
- return "", false
- }
- return *e.Text, true
-}
-
-// HasText returns a boolean if a field has been set.
-func (e *Event) HasText() bool {
- if e != nil && e.Text != nil {
- return true
- }
-
- return false
-}
-
-// SetText allocates a new e.Text and returns the pointer to it.
-func (e *Event) SetText(v string) {
- e.Text = &v
-}
-
-// GetTime returns the Time field if non-nil, zero value otherwise.
-func (e *Event) GetTime() int {
- if e == nil || e.Time == nil {
- return 0
- }
- return *e.Time
-}
-
-// GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetTimeOk() (int, bool) {
- if e == nil || e.Time == nil {
- return 0, false
- }
- return *e.Time, true
-}
-
-// HasTime returns a boolean if a field has been set.
-func (e *Event) HasTime() bool {
- if e != nil && e.Time != nil {
- return true
- }
-
- return false
-}
-
-// SetTime allocates a new e.Time and returns the pointer to it.
-func (e *Event) SetTime(v int) {
- e.Time = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (e *Event) GetTitle() string {
- if e == nil || e.Title == nil {
- return ""
- }
- return *e.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetTitleOk() (string, bool) {
- if e == nil || e.Title == nil {
- return "", false
- }
- return *e.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (e *Event) HasTitle() bool {
- if e != nil && e.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new e.Title and returns the pointer to it.
-func (e *Event) SetTitle(v string) {
- e.Title = &v
-}
-
-// GetUrl returns the Url field if non-nil, zero value otherwise.
-func (e *Event) GetUrl() string {
- if e == nil || e.Url == nil {
- return ""
- }
- return *e.Url
-}
-
-// GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (e *Event) GetUrlOk() (string, bool) {
- if e == nil || e.Url == nil {
- return "", false
- }
- return *e.Url, true
-}
-
-// HasUrl returns a boolean if a field has been set.
-func (e *Event) HasUrl() bool {
- if e != nil && e.Url != nil {
- return true
- }
-
- return false
-}
-
-// SetUrl allocates a new e.Url and returns the pointer to it.
-func (e *Event) SetUrl(v string) {
- e.Url = &v
-}
-
-// GetDefinition returns the Definition field if non-nil, zero value otherwise.
-func (g *Graph) GetDefinition() GraphDefinition {
- if g == nil || g.Definition == nil {
- return GraphDefinition{}
- }
- return *g.Definition
-}
-
-// GetDefinitionOk returns a tuple with the Definition field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *Graph) GetDefinitionOk() (GraphDefinition, bool) {
- if g == nil || g.Definition == nil {
- return GraphDefinition{}, false
- }
- return *g.Definition, true
-}
-
-// HasDefinition returns a boolean if a field has been set.
-func (g *Graph) HasDefinition() bool {
- if g != nil && g.Definition != nil {
- return true
- }
-
- return false
-}
-
-// SetDefinition allocates a new g.Definition and returns the pointer to it.
-func (g *Graph) SetDefinition(v GraphDefinition) {
- g.Definition = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (g *Graph) GetTitle() string {
- if g == nil || g.Title == nil {
- return ""
- }
- return *g.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *Graph) GetTitleOk() (string, bool) {
- if g == nil || g.Title == nil {
- return "", false
- }
- return *g.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (g *Graph) HasTitle() bool {
- if g != nil && g.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new g.Title and returns the pointer to it.
-func (g *Graph) SetTitle(v string) {
- g.Title = &v
-}
-
-// GetAutoscale returns the Autoscale field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetAutoscale() bool {
- if g == nil || g.Autoscale == nil {
- return false
- }
- return *g.Autoscale
-}
-
-// GetAutoscaleOk returns a tuple with the Autoscale field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetAutoscaleOk() (bool, bool) {
- if g == nil || g.Autoscale == nil {
- return false, false
- }
- return *g.Autoscale, true
-}
-
-// HasAutoscale returns a boolean if a field has been set.
-func (g *GraphDefinition) HasAutoscale() bool {
- if g != nil && g.Autoscale != nil {
- return true
- }
-
- return false
-}
-
-// SetAutoscale allocates a new g.Autoscale and returns the pointer to it.
-func (g *GraphDefinition) SetAutoscale(v bool) {
- g.Autoscale = &v
-}
-
-// GetCustomUnit returns the CustomUnit field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetCustomUnit() string {
- if g == nil || g.CustomUnit == nil {
- return ""
- }
- return *g.CustomUnit
-}
-
-// GetCustomUnitOk returns a tuple with the CustomUnit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetCustomUnitOk() (string, bool) {
- if g == nil || g.CustomUnit == nil {
- return "", false
- }
- return *g.CustomUnit, true
-}
-
-// HasCustomUnit returns a boolean if a field has been set.
-func (g *GraphDefinition) HasCustomUnit() bool {
- if g != nil && g.CustomUnit != nil {
- return true
- }
-
- return false
-}
-
-// SetCustomUnit allocates a new g.CustomUnit and returns the pointer to it.
-func (g *GraphDefinition) SetCustomUnit(v string) {
- g.CustomUnit = &v
-}
-
-// GetIncludeNoMetricHosts returns the IncludeNoMetricHosts field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetIncludeNoMetricHosts() bool {
- if g == nil || g.IncludeNoMetricHosts == nil {
- return false
- }
- return *g.IncludeNoMetricHosts
-}
-
-// GetIncludeNoMetricHostsOk returns a tuple with the IncludeNoMetricHosts field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetIncludeNoMetricHostsOk() (bool, bool) {
- if g == nil || g.IncludeNoMetricHosts == nil {
- return false, false
- }
- return *g.IncludeNoMetricHosts, true
-}
-
-// HasIncludeNoMetricHosts returns a boolean if a field has been set.
-func (g *GraphDefinition) HasIncludeNoMetricHosts() bool {
- if g != nil && g.IncludeNoMetricHosts != nil {
- return true
- }
-
- return false
-}
-
-// SetIncludeNoMetricHosts allocates a new g.IncludeNoMetricHosts and returns the pointer to it.
-func (g *GraphDefinition) SetIncludeNoMetricHosts(v bool) {
- g.IncludeNoMetricHosts = &v
-}
-
-// GetIncludeUngroupedHosts returns the IncludeUngroupedHosts field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetIncludeUngroupedHosts() bool {
- if g == nil || g.IncludeUngroupedHosts == nil {
- return false
- }
- return *g.IncludeUngroupedHosts
-}
-
-// GetIncludeUngroupedHostsOk returns a tuple with the IncludeUngroupedHosts field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetIncludeUngroupedHostsOk() (bool, bool) {
- if g == nil || g.IncludeUngroupedHosts == nil {
- return false, false
- }
- return *g.IncludeUngroupedHosts, true
-}
-
-// HasIncludeUngroupedHosts returns a boolean if a field has been set.
-func (g *GraphDefinition) HasIncludeUngroupedHosts() bool {
- if g != nil && g.IncludeUngroupedHosts != nil {
- return true
- }
-
- return false
-}
-
-// SetIncludeUngroupedHosts allocates a new g.IncludeUngroupedHosts and returns the pointer to it.
-func (g *GraphDefinition) SetIncludeUngroupedHosts(v bool) {
- g.IncludeUngroupedHosts = &v
-}
-
-// GetNodeType returns the NodeType field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetNodeType() string {
- if g == nil || g.NodeType == nil {
- return ""
- }
- return *g.NodeType
-}
-
-// GetNodeTypeOk returns a tuple with the NodeType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetNodeTypeOk() (string, bool) {
- if g == nil || g.NodeType == nil {
- return "", false
- }
- return *g.NodeType, true
-}
-
-// HasNodeType returns a boolean if a field has been set.
-func (g *GraphDefinition) HasNodeType() bool {
- if g != nil && g.NodeType != nil {
- return true
- }
-
- return false
-}
-
-// SetNodeType allocates a new g.NodeType and returns the pointer to it.
-func (g *GraphDefinition) SetNodeType(v string) {
- g.NodeType = &v
-}
-
-// GetPrecision returns the Precision field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetPrecision() json.Number {
- if g == nil || g.Precision == nil {
- return ""
- }
- return *g.Precision
-}
-
-// GetPrecisionOk returns a tuple with the Precision field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetPrecisionOk() (json.Number, bool) {
- if g == nil || g.Precision == nil {
- return "", false
- }
- return *g.Precision, true
-}
-
-// HasPrecision returns a boolean if a field has been set.
-func (g *GraphDefinition) HasPrecision() bool {
- if g != nil && g.Precision != nil {
- return true
- }
-
- return false
-}
-
-// SetPrecision allocates a new g.Precision and returns the pointer to it.
-func (g *GraphDefinition) SetPrecision(v json.Number) {
- g.Precision = &v
-}
-
-// GetStyle returns the Style field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetStyle() Style {
- if g == nil || g.Style == nil {
- return Style{}
- }
- return *g.Style
-}
-
-// GetStyleOk returns a tuple with the Style field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetStyleOk() (Style, bool) {
- if g == nil || g.Style == nil {
- return Style{}, false
- }
- return *g.Style, true
-}
-
-// HasStyle returns a boolean if a field has been set.
-func (g *GraphDefinition) HasStyle() bool {
- if g != nil && g.Style != nil {
- return true
- }
-
- return false
-}
-
-// SetStyle allocates a new g.Style and returns the pointer to it.
-func (g *GraphDefinition) SetStyle(v Style) {
- g.Style = &v
-}
-
-// GetTextAlign returns the TextAlign field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetTextAlign() string {
- if g == nil || g.TextAlign == nil {
- return ""
- }
- return *g.TextAlign
-}
-
-// GetTextAlignOk returns a tuple with the TextAlign field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetTextAlignOk() (string, bool) {
- if g == nil || g.TextAlign == nil {
- return "", false
- }
- return *g.TextAlign, true
-}
-
-// HasTextAlign returns a boolean if a field has been set.
-func (g *GraphDefinition) HasTextAlign() bool {
- if g != nil && g.TextAlign != nil {
- return true
- }
-
- return false
-}
-
-// SetTextAlign allocates a new g.TextAlign and returns the pointer to it.
-func (g *GraphDefinition) SetTextAlign(v string) {
- g.TextAlign = &v
-}
-
-// GetViz returns the Viz field if non-nil, zero value otherwise.
-func (g *GraphDefinition) GetViz() string {
- if g == nil || g.Viz == nil {
- return ""
- }
- return *g.Viz
-}
-
-// GetVizOk returns a tuple with the Viz field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinition) GetVizOk() (string, bool) {
- if g == nil || g.Viz == nil {
- return "", false
- }
- return *g.Viz, true
-}
-
-// HasViz returns a boolean if a field has been set.
-func (g *GraphDefinition) HasViz() bool {
- if g != nil && g.Viz != nil {
- return true
- }
-
- return false
-}
-
-// SetViz allocates a new g.Viz and returns the pointer to it.
-func (g *GraphDefinition) SetViz(v string) {
- g.Viz = &v
-}
-
-// GetLabel returns the Label field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetLabel() string {
- if g == nil || g.Label == nil {
- return ""
- }
- return *g.Label
-}
-
-// GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetLabelOk() (string, bool) {
- if g == nil || g.Label == nil {
- return "", false
- }
- return *g.Label, true
-}
-
-// HasLabel returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasLabel() bool {
- if g != nil && g.Label != nil {
- return true
- }
-
- return false
-}
-
-// SetLabel allocates a new g.Label and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetLabel(v string) {
- g.Label = &v
-}
-
-// GetMax returns the Max field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetMax() json.Number {
- if g == nil || g.Max == nil {
- return ""
- }
- return *g.Max
-}
-
-// GetMaxOk returns a tuple with the Max field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetMaxOk() (json.Number, bool) {
- if g == nil || g.Max == nil {
- return "", false
- }
- return *g.Max, true
-}
-
-// HasMax returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasMax() bool {
- if g != nil && g.Max != nil {
- return true
- }
-
- return false
-}
-
-// SetMax allocates a new g.Max and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetMax(v json.Number) {
- g.Max = &v
-}
-
-// GetMin returns the Min field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetMin() json.Number {
- if g == nil || g.Min == nil {
- return ""
- }
- return *g.Min
-}
-
-// GetMinOk returns a tuple with the Min field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetMinOk() (json.Number, bool) {
- if g == nil || g.Min == nil {
- return "", false
- }
- return *g.Min, true
-}
-
-// HasMin returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasMin() bool {
- if g != nil && g.Min != nil {
- return true
- }
-
- return false
-}
-
-// SetMin allocates a new g.Min and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetMin(v json.Number) {
- g.Min = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetType() string {
- if g == nil || g.Type == nil {
- return ""
- }
- return *g.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetTypeOk() (string, bool) {
- if g == nil || g.Type == nil {
- return "", false
- }
- return *g.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasType() bool {
- if g != nil && g.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new g.Type and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetType(v string) {
- g.Type = &v
-}
-
-// GetVal returns the Val field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetVal() json.Number {
- if g == nil || g.Val == nil {
- return ""
- }
- return *g.Val
-}
-
-// GetValOk returns a tuple with the Val field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetValOk() (json.Number, bool) {
- if g == nil || g.Val == nil {
- return "", false
- }
- return *g.Val, true
-}
-
-// HasVal returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasVal() bool {
- if g != nil && g.Val != nil {
- return true
- }
-
- return false
-}
-
-// SetVal allocates a new g.Val and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetVal(v json.Number) {
- g.Val = &v
-}
-
-// GetValue returns the Value field if non-nil, zero value otherwise.
-func (g *GraphDefinitionMarker) GetValue() string {
- if g == nil || g.Value == nil {
- return ""
- }
- return *g.Value
-}
-
-// GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionMarker) GetValueOk() (string, bool) {
- if g == nil || g.Value == nil {
- return "", false
- }
- return *g.Value, true
-}
-
-// HasValue returns a boolean if a field has been set.
-func (g *GraphDefinitionMarker) HasValue() bool {
- if g != nil && g.Value != nil {
- return true
- }
-
- return false
-}
-
-// SetValue allocates a new g.Value and returns the pointer to it.
-func (g *GraphDefinitionMarker) SetValue(v string) {
- g.Value = &v
-}
-
-// GetAggregator returns the Aggregator field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetAggregator() string {
- if g == nil || g.Aggregator == nil {
- return ""
- }
- return *g.Aggregator
-}
-
-// GetAggregatorOk returns a tuple with the Aggregator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetAggregatorOk() (string, bool) {
- if g == nil || g.Aggregator == nil {
- return "", false
- }
- return *g.Aggregator, true
-}
-
-// HasAggregator returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasAggregator() bool {
- if g != nil && g.Aggregator != nil {
- return true
- }
-
- return false
-}
-
-// SetAggregator allocates a new g.Aggregator and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetAggregator(v string) {
- g.Aggregator = &v
-}
-
-// GetChangeType returns the ChangeType field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetChangeType() string {
- if g == nil || g.ChangeType == nil {
- return ""
- }
- return *g.ChangeType
-}
-
-// GetChangeTypeOk returns a tuple with the ChangeType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetChangeTypeOk() (string, bool) {
- if g == nil || g.ChangeType == nil {
- return "", false
- }
- return *g.ChangeType, true
-}
-
-// HasChangeType returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasChangeType() bool {
- if g != nil && g.ChangeType != nil {
- return true
- }
-
- return false
-}
-
-// SetChangeType allocates a new g.ChangeType and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetChangeType(v string) {
- g.ChangeType = &v
-}
-
-// GetCompareTo returns the CompareTo field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetCompareTo() string {
- if g == nil || g.CompareTo == nil {
- return ""
- }
- return *g.CompareTo
-}
-
-// GetCompareToOk returns a tuple with the CompareTo field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetCompareToOk() (string, bool) {
- if g == nil || g.CompareTo == nil {
- return "", false
- }
- return *g.CompareTo, true
-}
-
-// HasCompareTo returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasCompareTo() bool {
- if g != nil && g.CompareTo != nil {
- return true
- }
-
- return false
-}
-
-// SetCompareTo allocates a new g.CompareTo and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetCompareTo(v string) {
- g.CompareTo = &v
-}
-
-// GetExtraCol returns the ExtraCol field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetExtraCol() string {
- if g == nil || g.ExtraCol == nil {
- return ""
- }
- return *g.ExtraCol
-}
-
-// GetExtraColOk returns a tuple with the ExtraCol field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetExtraColOk() (string, bool) {
- if g == nil || g.ExtraCol == nil {
- return "", false
- }
- return *g.ExtraCol, true
-}
-
-// HasExtraCol returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasExtraCol() bool {
- if g != nil && g.ExtraCol != nil {
- return true
- }
-
- return false
-}
-
-// SetExtraCol allocates a new g.ExtraCol and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetExtraCol(v string) {
- g.ExtraCol = &v
-}
-
-// GetIncreaseGood returns the IncreaseGood field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetIncreaseGood() bool {
- if g == nil || g.IncreaseGood == nil {
- return false
- }
- return *g.IncreaseGood
-}
-
-// GetIncreaseGoodOk returns a tuple with the IncreaseGood field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetIncreaseGoodOk() (bool, bool) {
- if g == nil || g.IncreaseGood == nil {
- return false, false
- }
- return *g.IncreaseGood, true
-}
-
-// HasIncreaseGood returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasIncreaseGood() bool {
- if g != nil && g.IncreaseGood != nil {
- return true
- }
-
- return false
-}
-
-// SetIncreaseGood allocates a new g.IncreaseGood and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetIncreaseGood(v bool) {
- g.IncreaseGood = &v
-}
-
-// GetOrderBy returns the OrderBy field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetOrderBy() string {
- if g == nil || g.OrderBy == nil {
- return ""
- }
- return *g.OrderBy
-}
-
-// GetOrderByOk returns a tuple with the OrderBy field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetOrderByOk() (string, bool) {
- if g == nil || g.OrderBy == nil {
- return "", false
- }
- return *g.OrderBy, true
-}
-
-// HasOrderBy returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasOrderBy() bool {
- if g != nil && g.OrderBy != nil {
- return true
- }
-
- return false
-}
-
-// SetOrderBy allocates a new g.OrderBy and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetOrderBy(v string) {
- g.OrderBy = &v
-}
-
-// GetOrderDirection returns the OrderDirection field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetOrderDirection() string {
- if g == nil || g.OrderDirection == nil {
- return ""
- }
- return *g.OrderDirection
-}
-
-// GetOrderDirectionOk returns a tuple with the OrderDirection field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetOrderDirectionOk() (string, bool) {
- if g == nil || g.OrderDirection == nil {
- return "", false
- }
- return *g.OrderDirection, true
-}
-
-// HasOrderDirection returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasOrderDirection() bool {
- if g != nil && g.OrderDirection != nil {
- return true
- }
-
- return false
-}
-
-// SetOrderDirection allocates a new g.OrderDirection and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetOrderDirection(v string) {
- g.OrderDirection = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetQuery() string {
- if g == nil || g.Query == nil {
- return ""
- }
- return *g.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetQueryOk() (string, bool) {
- if g == nil || g.Query == nil {
- return "", false
- }
- return *g.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasQuery() bool {
- if g != nil && g.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new g.Query and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetQuery(v string) {
- g.Query = &v
-}
-
-// GetStacked returns the Stacked field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetStacked() bool {
- if g == nil || g.Stacked == nil {
- return false
- }
- return *g.Stacked
-}
-
-// GetStackedOk returns a tuple with the Stacked field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetStackedOk() (bool, bool) {
- if g == nil || g.Stacked == nil {
- return false, false
- }
- return *g.Stacked, true
-}
-
-// HasStacked returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasStacked() bool {
- if g != nil && g.Stacked != nil {
- return true
- }
-
- return false
-}
-
-// SetStacked allocates a new g.Stacked and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetStacked(v bool) {
- g.Stacked = &v
-}
-
-// GetStyle returns the Style field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetStyle() GraphDefinitionRequestStyle {
- if g == nil || g.Style == nil {
- return GraphDefinitionRequestStyle{}
- }
- return *g.Style
-}
-
-// GetStyleOk returns a tuple with the Style field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetStyleOk() (GraphDefinitionRequestStyle, bool) {
- if g == nil || g.Style == nil {
- return GraphDefinitionRequestStyle{}, false
- }
- return *g.Style, true
-}
-
-// HasStyle returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasStyle() bool {
- if g != nil && g.Style != nil {
- return true
- }
-
- return false
-}
-
-// SetStyle allocates a new g.Style and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetStyle(v GraphDefinitionRequestStyle) {
- g.Style = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequest) GetType() string {
- if g == nil || g.Type == nil {
- return ""
- }
- return *g.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequest) GetTypeOk() (string, bool) {
- if g == nil || g.Type == nil {
- return "", false
- }
- return *g.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (g *GraphDefinitionRequest) HasType() bool {
- if g != nil && g.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new g.Type and returns the pointer to it.
-func (g *GraphDefinitionRequest) SetType(v string) {
- g.Type = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequestStyle) GetPalette() string {
- if g == nil || g.Palette == nil {
- return ""
- }
- return *g.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequestStyle) GetPaletteOk() (string, bool) {
- if g == nil || g.Palette == nil {
- return "", false
- }
- return *g.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (g *GraphDefinitionRequestStyle) HasPalette() bool {
- if g != nil && g.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new g.Palette and returns the pointer to it.
-func (g *GraphDefinitionRequestStyle) SetPalette(v string) {
- g.Palette = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequestStyle) GetType() string {
- if g == nil || g.Type == nil {
- return ""
- }
- return *g.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequestStyle) GetTypeOk() (string, bool) {
- if g == nil || g.Type == nil {
- return "", false
- }
- return *g.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (g *GraphDefinitionRequestStyle) HasType() bool {
- if g != nil && g.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new g.Type and returns the pointer to it.
-func (g *GraphDefinitionRequestStyle) SetType(v string) {
- g.Type = &v
-}
-
-// GetWidth returns the Width field if non-nil, zero value otherwise.
-func (g *GraphDefinitionRequestStyle) GetWidth() string {
- if g == nil || g.Width == nil {
- return ""
- }
- return *g.Width
-}
-
-// GetWidthOk returns a tuple with the Width field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphDefinitionRequestStyle) GetWidthOk() (string, bool) {
- if g == nil || g.Width == nil {
- return "", false
- }
- return *g.Width, true
-}
-
-// HasWidth returns a boolean if a field has been set.
-func (g *GraphDefinitionRequestStyle) HasWidth() bool {
- if g != nil && g.Width != nil {
- return true
- }
-
- return false
-}
-
-// SetWidth allocates a new g.Width and returns the pointer to it.
-func (g *GraphDefinitionRequestStyle) SetWidth(v string) {
- g.Width = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (g *GraphEvent) GetQuery() string {
- if g == nil || g.Query == nil {
- return ""
- }
- return *g.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GraphEvent) GetQueryOk() (string, bool) {
- if g == nil || g.Query == nil {
- return "", false
- }
- return *g.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (g *GraphEvent) HasQuery() bool {
- if g != nil && g.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new g.Query and returns the pointer to it.
-func (g *GraphEvent) SetQuery(v string) {
- g.Query = &v
-}
-
-// GetLastNoDataTs returns the LastNoDataTs field if non-nil, zero value otherwise.
-func (g *GroupData) GetLastNoDataTs() int {
- if g == nil || g.LastNoDataTs == nil {
- return 0
- }
- return *g.LastNoDataTs
-}
-
-// GetLastNoDataTsOk returns a tuple with the LastNoDataTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetLastNoDataTsOk() (int, bool) {
- if g == nil || g.LastNoDataTs == nil {
- return 0, false
- }
- return *g.LastNoDataTs, true
-}
-
-// HasLastNoDataTs returns a boolean if a field has been set.
-func (g *GroupData) HasLastNoDataTs() bool {
- if g != nil && g.LastNoDataTs != nil {
- return true
- }
-
- return false
-}
-
-// SetLastNoDataTs allocates a new g.LastNoDataTs and returns the pointer to it.
-func (g *GroupData) SetLastNoDataTs(v int) {
- g.LastNoDataTs = &v
-}
-
-// GetLastNotifiedTs returns the LastNotifiedTs field if non-nil, zero value otherwise.
-func (g *GroupData) GetLastNotifiedTs() int {
- if g == nil || g.LastNotifiedTs == nil {
- return 0
- }
- return *g.LastNotifiedTs
-}
-
-// GetLastNotifiedTsOk returns a tuple with the LastNotifiedTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetLastNotifiedTsOk() (int, bool) {
- if g == nil || g.LastNotifiedTs == nil {
- return 0, false
- }
- return *g.LastNotifiedTs, true
-}
-
-// HasLastNotifiedTs returns a boolean if a field has been set.
-func (g *GroupData) HasLastNotifiedTs() bool {
- if g != nil && g.LastNotifiedTs != nil {
- return true
- }
-
- return false
-}
-
-// SetLastNotifiedTs allocates a new g.LastNotifiedTs and returns the pointer to it.
-func (g *GroupData) SetLastNotifiedTs(v int) {
- g.LastNotifiedTs = &v
-}
-
-// GetLastResolvedTs returns the LastResolvedTs field if non-nil, zero value otherwise.
-func (g *GroupData) GetLastResolvedTs() int {
- if g == nil || g.LastResolvedTs == nil {
- return 0
- }
- return *g.LastResolvedTs
-}
-
-// GetLastResolvedTsOk returns a tuple with the LastResolvedTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetLastResolvedTsOk() (int, bool) {
- if g == nil || g.LastResolvedTs == nil {
- return 0, false
- }
- return *g.LastResolvedTs, true
-}
-
-// HasLastResolvedTs returns a boolean if a field has been set.
-func (g *GroupData) HasLastResolvedTs() bool {
- if g != nil && g.LastResolvedTs != nil {
- return true
- }
-
- return false
-}
-
-// SetLastResolvedTs allocates a new g.LastResolvedTs and returns the pointer to it.
-func (g *GroupData) SetLastResolvedTs(v int) {
- g.LastResolvedTs = &v
-}
-
-// GetLastTriggeredTs returns the LastTriggeredTs field if non-nil, zero value otherwise.
-func (g *GroupData) GetLastTriggeredTs() int {
- if g == nil || g.LastTriggeredTs == nil {
- return 0
- }
- return *g.LastTriggeredTs
-}
-
-// GetLastTriggeredTsOk returns a tuple with the LastTriggeredTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetLastTriggeredTsOk() (int, bool) {
- if g == nil || g.LastTriggeredTs == nil {
- return 0, false
- }
- return *g.LastTriggeredTs, true
-}
-
-// HasLastTriggeredTs returns a boolean if a field has been set.
-func (g *GroupData) HasLastTriggeredTs() bool {
- if g != nil && g.LastTriggeredTs != nil {
- return true
- }
-
- return false
-}
-
-// SetLastTriggeredTs allocates a new g.LastTriggeredTs and returns the pointer to it.
-func (g *GroupData) SetLastTriggeredTs(v int) {
- g.LastTriggeredTs = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (g *GroupData) GetName() string {
- if g == nil || g.Name == nil {
- return ""
- }
- return *g.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetNameOk() (string, bool) {
- if g == nil || g.Name == nil {
- return "", false
- }
- return *g.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (g *GroupData) HasName() bool {
- if g != nil && g.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new g.Name and returns the pointer to it.
-func (g *GroupData) SetName(v string) {
- g.Name = &v
-}
-
-// GetStatus returns the Status field if non-nil, zero value otherwise.
-func (g *GroupData) GetStatus() string {
- if g == nil || g.Status == nil {
- return ""
- }
- return *g.Status
-}
-
-// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetStatusOk() (string, bool) {
- if g == nil || g.Status == nil {
- return "", false
- }
- return *g.Status, true
-}
-
-// HasStatus returns a boolean if a field has been set.
-func (g *GroupData) HasStatus() bool {
- if g != nil && g.Status != nil {
- return true
- }
-
- return false
-}
-
-// SetStatus allocates a new g.Status and returns the pointer to it.
-func (g *GroupData) SetStatus(v string) {
- g.Status = &v
-}
-
-// GetTriggeringValue returns the TriggeringValue field if non-nil, zero value otherwise.
-func (g *GroupData) GetTriggeringValue() TriggeringValue {
- if g == nil || g.TriggeringValue == nil {
- return TriggeringValue{}
- }
- return *g.TriggeringValue
-}
-
-// GetTriggeringValueOk returns a tuple with the TriggeringValue field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (g *GroupData) GetTriggeringValueOk() (TriggeringValue, bool) {
- if g == nil || g.TriggeringValue == nil {
- return TriggeringValue{}, false
- }
- return *g.TriggeringValue, true
-}
-
-// HasTriggeringValue returns a boolean if a field has been set.
-func (g *GroupData) HasTriggeringValue() bool {
- if g != nil && g.TriggeringValue != nil {
- return true
- }
-
- return false
-}
-
-// SetTriggeringValue allocates a new g.TriggeringValue and returns the pointer to it.
-func (g *GroupData) SetTriggeringValue(v TriggeringValue) {
- g.TriggeringValue = &v
-}
-
-// GetEndTime returns the EndTime field if non-nil, zero value otherwise.
-func (h *HostActionMute) GetEndTime() string {
- if h == nil || h.EndTime == nil {
- return ""
- }
- return *h.EndTime
-}
-
-// GetEndTimeOk returns a tuple with the EndTime field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (h *HostActionMute) GetEndTimeOk() (string, bool) {
- if h == nil || h.EndTime == nil {
- return "", false
- }
- return *h.EndTime, true
-}
-
-// HasEndTime returns a boolean if a field has been set.
-func (h *HostActionMute) HasEndTime() bool {
- if h != nil && h.EndTime != nil {
- return true
- }
-
- return false
-}
-
-// SetEndTime allocates a new h.EndTime and returns the pointer to it.
-func (h *HostActionMute) SetEndTime(v string) {
- h.EndTime = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (h *HostActionMute) GetMessage() string {
- if h == nil || h.Message == nil {
- return ""
- }
- return *h.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (h *HostActionMute) GetMessageOk() (string, bool) {
- if h == nil || h.Message == nil {
- return "", false
- }
- return *h.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (h *HostActionMute) HasMessage() bool {
- if h != nil && h.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new h.Message and returns the pointer to it.
-func (h *HostActionMute) SetMessage(v string) {
- h.Message = &v
-}
-
-// GetOverride returns the Override field if non-nil, zero value otherwise.
-func (h *HostActionMute) GetOverride() bool {
- if h == nil || h.Override == nil {
- return false
- }
- return *h.Override
-}
-
-// GetOverrideOk returns a tuple with the Override field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (h *HostActionMute) GetOverrideOk() (bool, bool) {
- if h == nil || h.Override == nil {
- return false, false
- }
- return *h.Override, true
-}
-
-// HasOverride returns a boolean if a field has been set.
-func (h *HostActionMute) HasOverride() bool {
- if h != nil && h.Override != nil {
- return true
- }
-
- return false
-}
-
-// SetOverride allocates a new h.Override and returns the pointer to it.
-func (h *HostActionMute) SetOverride(v bool) {
- h.Override = &v
-}
-
-// GetAccountID returns the AccountID field if non-nil, zero value otherwise.
-func (i *IntegrationAWSAccount) GetAccountID() string {
- if i == nil || i.AccountID == nil {
- return ""
- }
- return *i.AccountID
-}
-
-// GetAccountIDOk returns a tuple with the AccountID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationAWSAccount) GetAccountIDOk() (string, bool) {
- if i == nil || i.AccountID == nil {
- return "", false
- }
- return *i.AccountID, true
-}
-
-// HasAccountID returns a boolean if a field has been set.
-func (i *IntegrationAWSAccount) HasAccountID() bool {
- if i != nil && i.AccountID != nil {
- return true
- }
-
- return false
-}
-
-// SetAccountID allocates a new i.AccountID and returns the pointer to it.
-func (i *IntegrationAWSAccount) SetAccountID(v string) {
- i.AccountID = &v
-}
-
-// GetRoleName returns the RoleName field if non-nil, zero value otherwise.
-func (i *IntegrationAWSAccount) GetRoleName() string {
- if i == nil || i.RoleName == nil {
- return ""
- }
- return *i.RoleName
-}
-
-// GetRoleNameOk returns a tuple with the RoleName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationAWSAccount) GetRoleNameOk() (string, bool) {
- if i == nil || i.RoleName == nil {
- return "", false
- }
- return *i.RoleName, true
-}
-
-// HasRoleName returns a boolean if a field has been set.
-func (i *IntegrationAWSAccount) HasRoleName() bool {
- if i != nil && i.RoleName != nil {
- return true
- }
-
- return false
-}
-
-// SetRoleName allocates a new i.RoleName and returns the pointer to it.
-func (i *IntegrationAWSAccount) SetRoleName(v string) {
- i.RoleName = &v
-}
-
-// GetAccountID returns the AccountID field if non-nil, zero value otherwise.
-func (i *IntegrationAWSAccountDeleteRequest) GetAccountID() string {
- if i == nil || i.AccountID == nil {
- return ""
- }
- return *i.AccountID
-}
-
-// GetAccountIDOk returns a tuple with the AccountID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationAWSAccountDeleteRequest) GetAccountIDOk() (string, bool) {
- if i == nil || i.AccountID == nil {
- return "", false
- }
- return *i.AccountID, true
-}
-
-// HasAccountID returns a boolean if a field has been set.
-func (i *IntegrationAWSAccountDeleteRequest) HasAccountID() bool {
- if i != nil && i.AccountID != nil {
- return true
- }
-
- return false
-}
-
-// SetAccountID allocates a new i.AccountID and returns the pointer to it.
-func (i *IntegrationAWSAccountDeleteRequest) SetAccountID(v string) {
- i.AccountID = &v
-}
-
-// GetRoleName returns the RoleName field if non-nil, zero value otherwise.
-func (i *IntegrationAWSAccountDeleteRequest) GetRoleName() string {
- if i == nil || i.RoleName == nil {
- return ""
- }
- return *i.RoleName
-}
-
-// GetRoleNameOk returns a tuple with the RoleName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationAWSAccountDeleteRequest) GetRoleNameOk() (string, bool) {
- if i == nil || i.RoleName == nil {
- return "", false
- }
- return *i.RoleName, true
-}
-
-// HasRoleName returns a boolean if a field has been set.
-func (i *IntegrationAWSAccountDeleteRequest) HasRoleName() bool {
- if i != nil && i.RoleName != nil {
- return true
- }
-
- return false
-}
-
-// SetRoleName allocates a new i.RoleName and returns the pointer to it.
-func (i *IntegrationAWSAccountDeleteRequest) SetRoleName(v string) {
- i.RoleName = &v
-}
-
-// GetClientEmail returns the ClientEmail field if non-nil, zero value otherwise.
-func (i *IntegrationGCP) GetClientEmail() string {
- if i == nil || i.ClientEmail == nil {
- return ""
- }
- return *i.ClientEmail
-}
-
-// GetClientEmailOk returns a tuple with the ClientEmail field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCP) GetClientEmailOk() (string, bool) {
- if i == nil || i.ClientEmail == nil {
- return "", false
- }
- return *i.ClientEmail, true
-}
-
-// HasClientEmail returns a boolean if a field has been set.
-func (i *IntegrationGCP) HasClientEmail() bool {
- if i != nil && i.ClientEmail != nil {
- return true
- }
-
- return false
-}
-
-// SetClientEmail allocates a new i.ClientEmail and returns the pointer to it.
-func (i *IntegrationGCP) SetClientEmail(v string) {
- i.ClientEmail = &v
-}
-
-// GetHostFilters returns the HostFilters field if non-nil, zero value otherwise.
-func (i *IntegrationGCP) GetHostFilters() string {
- if i == nil || i.HostFilters == nil {
- return ""
- }
- return *i.HostFilters
-}
-
-// GetHostFiltersOk returns a tuple with the HostFilters field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCP) GetHostFiltersOk() (string, bool) {
- if i == nil || i.HostFilters == nil {
- return "", false
- }
- return *i.HostFilters, true
-}
-
-// HasHostFilters returns a boolean if a field has been set.
-func (i *IntegrationGCP) HasHostFilters() bool {
- if i != nil && i.HostFilters != nil {
- return true
- }
-
- return false
-}
-
-// SetHostFilters allocates a new i.HostFilters and returns the pointer to it.
-func (i *IntegrationGCP) SetHostFilters(v string) {
- i.HostFilters = &v
-}
-
-// GetProjectID returns the ProjectID field if non-nil, zero value otherwise.
-func (i *IntegrationGCP) GetProjectID() string {
- if i == nil || i.ProjectID == nil {
- return ""
- }
- return *i.ProjectID
-}
-
-// GetProjectIDOk returns a tuple with the ProjectID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCP) GetProjectIDOk() (string, bool) {
- if i == nil || i.ProjectID == nil {
- return "", false
- }
- return *i.ProjectID, true
-}
-
-// HasProjectID returns a boolean if a field has been set.
-func (i *IntegrationGCP) HasProjectID() bool {
- if i != nil && i.ProjectID != nil {
- return true
- }
-
- return false
-}
-
-// SetProjectID allocates a new i.ProjectID and returns the pointer to it.
-func (i *IntegrationGCP) SetProjectID(v string) {
- i.ProjectID = &v
-}
-
-// GetAuthProviderX509CertURL returns the AuthProviderX509CertURL field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetAuthProviderX509CertURL() string {
- if i == nil || i.AuthProviderX509CertURL == nil {
- return ""
- }
- return *i.AuthProviderX509CertURL
-}
-
-// GetAuthProviderX509CertURLOk returns a tuple with the AuthProviderX509CertURL field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetAuthProviderX509CertURLOk() (string, bool) {
- if i == nil || i.AuthProviderX509CertURL == nil {
- return "", false
- }
- return *i.AuthProviderX509CertURL, true
-}
-
-// HasAuthProviderX509CertURL returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasAuthProviderX509CertURL() bool {
- if i != nil && i.AuthProviderX509CertURL != nil {
- return true
- }
-
- return false
-}
-
-// SetAuthProviderX509CertURL allocates a new i.AuthProviderX509CertURL and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetAuthProviderX509CertURL(v string) {
- i.AuthProviderX509CertURL = &v
-}
-
-// GetAuthURI returns the AuthURI field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetAuthURI() string {
- if i == nil || i.AuthURI == nil {
- return ""
- }
- return *i.AuthURI
-}
-
-// GetAuthURIOk returns a tuple with the AuthURI field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetAuthURIOk() (string, bool) {
- if i == nil || i.AuthURI == nil {
- return "", false
- }
- return *i.AuthURI, true
-}
-
-// HasAuthURI returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasAuthURI() bool {
- if i != nil && i.AuthURI != nil {
- return true
- }
-
- return false
-}
-
-// SetAuthURI allocates a new i.AuthURI and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetAuthURI(v string) {
- i.AuthURI = &v
-}
-
-// GetClientEmail returns the ClientEmail field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetClientEmail() string {
- if i == nil || i.ClientEmail == nil {
- return ""
- }
- return *i.ClientEmail
-}
-
-// GetClientEmailOk returns a tuple with the ClientEmail field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetClientEmailOk() (string, bool) {
- if i == nil || i.ClientEmail == nil {
- return "", false
- }
- return *i.ClientEmail, true
-}
-
-// HasClientEmail returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasClientEmail() bool {
- if i != nil && i.ClientEmail != nil {
- return true
- }
-
- return false
-}
-
-// SetClientEmail allocates a new i.ClientEmail and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetClientEmail(v string) {
- i.ClientEmail = &v
-}
-
-// GetClientID returns the ClientID field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetClientID() string {
- if i == nil || i.ClientID == nil {
- return ""
- }
- return *i.ClientID
-}
-
-// GetClientIDOk returns a tuple with the ClientID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetClientIDOk() (string, bool) {
- if i == nil || i.ClientID == nil {
- return "", false
- }
- return *i.ClientID, true
-}
-
-// HasClientID returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasClientID() bool {
- if i != nil && i.ClientID != nil {
- return true
- }
-
- return false
-}
-
-// SetClientID allocates a new i.ClientID and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetClientID(v string) {
- i.ClientID = &v
-}
-
-// GetClientX509CertURL returns the ClientX509CertURL field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetClientX509CertURL() string {
- if i == nil || i.ClientX509CertURL == nil {
- return ""
- }
- return *i.ClientX509CertURL
-}
-
-// GetClientX509CertURLOk returns a tuple with the ClientX509CertURL field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetClientX509CertURLOk() (string, bool) {
- if i == nil || i.ClientX509CertURL == nil {
- return "", false
- }
- return *i.ClientX509CertURL, true
-}
-
-// HasClientX509CertURL returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasClientX509CertURL() bool {
- if i != nil && i.ClientX509CertURL != nil {
- return true
- }
-
- return false
-}
-
-// SetClientX509CertURL allocates a new i.ClientX509CertURL and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetClientX509CertURL(v string) {
- i.ClientX509CertURL = &v
-}
-
-// GetHostFilters returns the HostFilters field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetHostFilters() string {
- if i == nil || i.HostFilters == nil {
- return ""
- }
- return *i.HostFilters
-}
-
-// GetHostFiltersOk returns a tuple with the HostFilters field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetHostFiltersOk() (string, bool) {
- if i == nil || i.HostFilters == nil {
- return "", false
- }
- return *i.HostFilters, true
-}
-
-// HasHostFilters returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasHostFilters() bool {
- if i != nil && i.HostFilters != nil {
- return true
- }
-
- return false
-}
-
-// SetHostFilters allocates a new i.HostFilters and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetHostFilters(v string) {
- i.HostFilters = &v
-}
-
-// GetPrivateKey returns the PrivateKey field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetPrivateKey() string {
- if i == nil || i.PrivateKey == nil {
- return ""
- }
- return *i.PrivateKey
-}
-
-// GetPrivateKeyOk returns a tuple with the PrivateKey field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetPrivateKeyOk() (string, bool) {
- if i == nil || i.PrivateKey == nil {
- return "", false
- }
- return *i.PrivateKey, true
-}
-
-// HasPrivateKey returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasPrivateKey() bool {
- if i != nil && i.PrivateKey != nil {
- return true
- }
-
- return false
-}
-
-// SetPrivateKey allocates a new i.PrivateKey and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetPrivateKey(v string) {
- i.PrivateKey = &v
-}
-
-// GetPrivateKeyID returns the PrivateKeyID field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetPrivateKeyID() string {
- if i == nil || i.PrivateKeyID == nil {
- return ""
- }
- return *i.PrivateKeyID
-}
-
-// GetPrivateKeyIDOk returns a tuple with the PrivateKeyID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetPrivateKeyIDOk() (string, bool) {
- if i == nil || i.PrivateKeyID == nil {
- return "", false
- }
- return *i.PrivateKeyID, true
-}
-
-// HasPrivateKeyID returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasPrivateKeyID() bool {
- if i != nil && i.PrivateKeyID != nil {
- return true
- }
-
- return false
-}
-
-// SetPrivateKeyID allocates a new i.PrivateKeyID and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetPrivateKeyID(v string) {
- i.PrivateKeyID = &v
-}
-
-// GetProjectID returns the ProjectID field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetProjectID() string {
- if i == nil || i.ProjectID == nil {
- return ""
- }
- return *i.ProjectID
-}
-
-// GetProjectIDOk returns a tuple with the ProjectID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetProjectIDOk() (string, bool) {
- if i == nil || i.ProjectID == nil {
- return "", false
- }
- return *i.ProjectID, true
-}
-
-// HasProjectID returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasProjectID() bool {
- if i != nil && i.ProjectID != nil {
- return true
- }
-
- return false
-}
-
-// SetProjectID allocates a new i.ProjectID and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetProjectID(v string) {
- i.ProjectID = &v
-}
-
-// GetTokenURI returns the TokenURI field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetTokenURI() string {
- if i == nil || i.TokenURI == nil {
- return ""
- }
- return *i.TokenURI
-}
-
-// GetTokenURIOk returns a tuple with the TokenURI field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetTokenURIOk() (string, bool) {
- if i == nil || i.TokenURI == nil {
- return "", false
- }
- return *i.TokenURI, true
-}
-
-// HasTokenURI returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasTokenURI() bool {
- if i != nil && i.TokenURI != nil {
- return true
- }
-
- return false
-}
-
-// SetTokenURI allocates a new i.TokenURI and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetTokenURI(v string) {
- i.TokenURI = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (i *IntegrationGCPCreateRequest) GetType() string {
- if i == nil || i.Type == nil {
- return ""
- }
- return *i.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPCreateRequest) GetTypeOk() (string, bool) {
- if i == nil || i.Type == nil {
- return "", false
- }
- return *i.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (i *IntegrationGCPCreateRequest) HasType() bool {
- if i != nil && i.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new i.Type and returns the pointer to it.
-func (i *IntegrationGCPCreateRequest) SetType(v string) {
- i.Type = &v
-}
-
-// GetClientEmail returns the ClientEmail field if non-nil, zero value otherwise.
-func (i *IntegrationGCPDeleteRequest) GetClientEmail() string {
- if i == nil || i.ClientEmail == nil {
- return ""
- }
- return *i.ClientEmail
-}
-
-// GetClientEmailOk returns a tuple with the ClientEmail field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPDeleteRequest) GetClientEmailOk() (string, bool) {
- if i == nil || i.ClientEmail == nil {
- return "", false
- }
- return *i.ClientEmail, true
-}
-
-// HasClientEmail returns a boolean if a field has been set.
-func (i *IntegrationGCPDeleteRequest) HasClientEmail() bool {
- if i != nil && i.ClientEmail != nil {
- return true
- }
-
- return false
-}
-
-// SetClientEmail allocates a new i.ClientEmail and returns the pointer to it.
-func (i *IntegrationGCPDeleteRequest) SetClientEmail(v string) {
- i.ClientEmail = &v
-}
-
-// GetProjectID returns the ProjectID field if non-nil, zero value otherwise.
-func (i *IntegrationGCPDeleteRequest) GetProjectID() string {
- if i == nil || i.ProjectID == nil {
- return ""
- }
- return *i.ProjectID
-}
-
-// GetProjectIDOk returns a tuple with the ProjectID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPDeleteRequest) GetProjectIDOk() (string, bool) {
- if i == nil || i.ProjectID == nil {
- return "", false
- }
- return *i.ProjectID, true
-}
-
-// HasProjectID returns a boolean if a field has been set.
-func (i *IntegrationGCPDeleteRequest) HasProjectID() bool {
- if i != nil && i.ProjectID != nil {
- return true
- }
-
- return false
-}
-
-// SetProjectID allocates a new i.ProjectID and returns the pointer to it.
-func (i *IntegrationGCPDeleteRequest) SetProjectID(v string) {
- i.ProjectID = &v
-}
-
-// GetClientEmail returns the ClientEmail field if non-nil, zero value otherwise.
-func (i *IntegrationGCPUpdateRequest) GetClientEmail() string {
- if i == nil || i.ClientEmail == nil {
- return ""
- }
- return *i.ClientEmail
-}
-
-// GetClientEmailOk returns a tuple with the ClientEmail field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPUpdateRequest) GetClientEmailOk() (string, bool) {
- if i == nil || i.ClientEmail == nil {
- return "", false
- }
- return *i.ClientEmail, true
-}
-
-// HasClientEmail returns a boolean if a field has been set.
-func (i *IntegrationGCPUpdateRequest) HasClientEmail() bool {
- if i != nil && i.ClientEmail != nil {
- return true
- }
-
- return false
-}
-
-// SetClientEmail allocates a new i.ClientEmail and returns the pointer to it.
-func (i *IntegrationGCPUpdateRequest) SetClientEmail(v string) {
- i.ClientEmail = &v
-}
-
-// GetHostFilters returns the HostFilters field if non-nil, zero value otherwise.
-func (i *IntegrationGCPUpdateRequest) GetHostFilters() string {
- if i == nil || i.HostFilters == nil {
- return ""
- }
- return *i.HostFilters
-}
-
-// GetHostFiltersOk returns a tuple with the HostFilters field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPUpdateRequest) GetHostFiltersOk() (string, bool) {
- if i == nil || i.HostFilters == nil {
- return "", false
- }
- return *i.HostFilters, true
-}
-
-// HasHostFilters returns a boolean if a field has been set.
-func (i *IntegrationGCPUpdateRequest) HasHostFilters() bool {
- if i != nil && i.HostFilters != nil {
- return true
- }
-
- return false
-}
-
-// SetHostFilters allocates a new i.HostFilters and returns the pointer to it.
-func (i *IntegrationGCPUpdateRequest) SetHostFilters(v string) {
- i.HostFilters = &v
-}
-
-// GetProjectID returns the ProjectID field if non-nil, zero value otherwise.
-func (i *IntegrationGCPUpdateRequest) GetProjectID() string {
- if i == nil || i.ProjectID == nil {
- return ""
- }
- return *i.ProjectID
-}
-
-// GetProjectIDOk returns a tuple with the ProjectID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationGCPUpdateRequest) GetProjectIDOk() (string, bool) {
- if i == nil || i.ProjectID == nil {
- return "", false
- }
- return *i.ProjectID, true
-}
-
-// HasProjectID returns a boolean if a field has been set.
-func (i *IntegrationGCPUpdateRequest) HasProjectID() bool {
- if i != nil && i.ProjectID != nil {
- return true
- }
-
- return false
-}
-
-// SetProjectID allocates a new i.ProjectID and returns the pointer to it.
-func (i *IntegrationGCPUpdateRequest) SetProjectID(v string) {
- i.ProjectID = &v
-}
-
-// GetAPIToken returns the APIToken field if non-nil, zero value otherwise.
-func (i *integrationPD) GetAPIToken() string {
- if i == nil || i.APIToken == nil {
- return ""
- }
- return *i.APIToken
-}
-
-// GetAPITokenOk returns a tuple with the APIToken field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *integrationPD) GetAPITokenOk() (string, bool) {
- if i == nil || i.APIToken == nil {
- return "", false
- }
- return *i.APIToken, true
-}
-
-// HasAPIToken returns a boolean if a field has been set.
-func (i *integrationPD) HasAPIToken() bool {
- if i != nil && i.APIToken != nil {
- return true
- }
-
- return false
-}
-
-// SetAPIToken allocates a new i.APIToken and returns the pointer to it.
-func (i *integrationPD) SetAPIToken(v string) {
- i.APIToken = &v
-}
-
-// GetSubdomain returns the Subdomain field if non-nil, zero value otherwise.
-func (i *integrationPD) GetSubdomain() string {
- if i == nil || i.Subdomain == nil {
- return ""
- }
- return *i.Subdomain
-}
-
-// GetSubdomainOk returns a tuple with the Subdomain field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *integrationPD) GetSubdomainOk() (string, bool) {
- if i == nil || i.Subdomain == nil {
- return "", false
- }
- return *i.Subdomain, true
-}
-
-// HasSubdomain returns a boolean if a field has been set.
-func (i *integrationPD) HasSubdomain() bool {
- if i != nil && i.Subdomain != nil {
- return true
- }
-
- return false
-}
-
-// SetSubdomain allocates a new i.Subdomain and returns the pointer to it.
-func (i *integrationPD) SetSubdomain(v string) {
- i.Subdomain = &v
-}
-
-// GetAPIToken returns the APIToken field if non-nil, zero value otherwise.
-func (i *IntegrationPDRequest) GetAPIToken() string {
- if i == nil || i.APIToken == nil {
- return ""
- }
- return *i.APIToken
-}
-
-// GetAPITokenOk returns a tuple with the APIToken field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationPDRequest) GetAPITokenOk() (string, bool) {
- if i == nil || i.APIToken == nil {
- return "", false
- }
- return *i.APIToken, true
-}
-
-// HasAPIToken returns a boolean if a field has been set.
-func (i *IntegrationPDRequest) HasAPIToken() bool {
- if i != nil && i.APIToken != nil {
- return true
- }
-
- return false
-}
-
-// SetAPIToken allocates a new i.APIToken and returns the pointer to it.
-func (i *IntegrationPDRequest) SetAPIToken(v string) {
- i.APIToken = &v
-}
-
-// GetRunCheck returns the RunCheck field if non-nil, zero value otherwise.
-func (i *IntegrationPDRequest) GetRunCheck() bool {
- if i == nil || i.RunCheck == nil {
- return false
- }
- return *i.RunCheck
-}
-
-// GetRunCheckOk returns a tuple with the RunCheck field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationPDRequest) GetRunCheckOk() (bool, bool) {
- if i == nil || i.RunCheck == nil {
- return false, false
- }
- return *i.RunCheck, true
-}
-
-// HasRunCheck returns a boolean if a field has been set.
-func (i *IntegrationPDRequest) HasRunCheck() bool {
- if i != nil && i.RunCheck != nil {
- return true
- }
-
- return false
-}
-
-// SetRunCheck allocates a new i.RunCheck and returns the pointer to it.
-func (i *IntegrationPDRequest) SetRunCheck(v bool) {
- i.RunCheck = &v
-}
-
-// GetSubdomain returns the Subdomain field if non-nil, zero value otherwise.
-func (i *IntegrationPDRequest) GetSubdomain() string {
- if i == nil || i.Subdomain == nil {
- return ""
- }
- return *i.Subdomain
-}
-
-// GetSubdomainOk returns a tuple with the Subdomain field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationPDRequest) GetSubdomainOk() (string, bool) {
- if i == nil || i.Subdomain == nil {
- return "", false
- }
- return *i.Subdomain, true
-}
-
-// HasSubdomain returns a boolean if a field has been set.
-func (i *IntegrationPDRequest) HasSubdomain() bool {
- if i != nil && i.Subdomain != nil {
- return true
- }
-
- return false
-}
-
-// SetSubdomain allocates a new i.Subdomain and returns the pointer to it.
-func (i *IntegrationPDRequest) SetSubdomain(v string) {
- i.Subdomain = &v
-}
-
-// GetRunCheck returns the RunCheck field if non-nil, zero value otherwise.
-func (i *IntegrationSlackRequest) GetRunCheck() bool {
- if i == nil || i.RunCheck == nil {
- return false
- }
- return *i.RunCheck
-}
-
-// GetRunCheckOk returns a tuple with the RunCheck field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (i *IntegrationSlackRequest) GetRunCheckOk() (bool, bool) {
- if i == nil || i.RunCheck == nil {
- return false, false
- }
- return *i.RunCheck, true
-}
-
-// HasRunCheck returns a boolean if a field has been set.
-func (i *IntegrationSlackRequest) HasRunCheck() bool {
- if i != nil && i.RunCheck != nil {
- return true
- }
-
- return false
-}
-
-// SetRunCheck allocates a new i.RunCheck and returns the pointer to it.
-func (i *IntegrationSlackRequest) SetRunCheck(v bool) {
- i.RunCheck = &v
-}
-
-// GetHost returns the Host field if non-nil, zero value otherwise.
-func (m *Metric) GetHost() string {
- if m == nil || m.Host == nil {
- return ""
- }
- return *m.Host
-}
-
-// GetHostOk returns a tuple with the Host field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Metric) GetHostOk() (string, bool) {
- if m == nil || m.Host == nil {
- return "", false
- }
- return *m.Host, true
-}
-
-// HasHost returns a boolean if a field has been set.
-func (m *Metric) HasHost() bool {
- if m != nil && m.Host != nil {
- return true
- }
-
- return false
-}
-
-// SetHost allocates a new m.Host and returns the pointer to it.
-func (m *Metric) SetHost(v string) {
- m.Host = &v
-}
-
-// GetMetric returns the Metric field if non-nil, zero value otherwise.
-func (m *Metric) GetMetric() string {
- if m == nil || m.Metric == nil {
- return ""
- }
- return *m.Metric
-}
-
-// GetMetricOk returns a tuple with the Metric field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Metric) GetMetricOk() (string, bool) {
- if m == nil || m.Metric == nil {
- return "", false
- }
- return *m.Metric, true
-}
-
-// HasMetric returns a boolean if a field has been set.
-func (m *Metric) HasMetric() bool {
- if m != nil && m.Metric != nil {
- return true
- }
-
- return false
-}
-
-// SetMetric allocates a new m.Metric and returns the pointer to it.
-func (m *Metric) SetMetric(v string) {
- m.Metric = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (m *Metric) GetType() string {
- if m == nil || m.Type == nil {
- return ""
- }
- return *m.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Metric) GetTypeOk() (string, bool) {
- if m == nil || m.Type == nil {
- return "", false
- }
- return *m.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (m *Metric) HasType() bool {
- if m != nil && m.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new m.Type and returns the pointer to it.
-func (m *Metric) SetType(v string) {
- m.Type = &v
-}
-
-// GetUnit returns the Unit field if non-nil, zero value otherwise.
-func (m *Metric) GetUnit() string {
- if m == nil || m.Unit == nil {
- return ""
- }
- return *m.Unit
-}
-
-// GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Metric) GetUnitOk() (string, bool) {
- if m == nil || m.Unit == nil {
- return "", false
- }
- return *m.Unit, true
-}
-
-// HasUnit returns a boolean if a field has been set.
-func (m *Metric) HasUnit() bool {
- if m != nil && m.Unit != nil {
- return true
- }
-
- return false
-}
-
-// SetUnit allocates a new m.Unit and returns the pointer to it.
-func (m *Metric) SetUnit(v string) {
- m.Unit = &v
-}
-
-// GetDescription returns the Description field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetDescription() string {
- if m == nil || m.Description == nil {
- return ""
- }
- return *m.Description
-}
-
-// GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetDescriptionOk() (string, bool) {
- if m == nil || m.Description == nil {
- return "", false
- }
- return *m.Description, true
-}
-
-// HasDescription returns a boolean if a field has been set.
-func (m *MetricMetadata) HasDescription() bool {
- if m != nil && m.Description != nil {
- return true
- }
-
- return false
-}
-
-// SetDescription allocates a new m.Description and returns the pointer to it.
-func (m *MetricMetadata) SetDescription(v string) {
- m.Description = &v
-}
-
-// GetPerUnit returns the PerUnit field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetPerUnit() string {
- if m == nil || m.PerUnit == nil {
- return ""
- }
- return *m.PerUnit
-}
-
-// GetPerUnitOk returns a tuple with the PerUnit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetPerUnitOk() (string, bool) {
- if m == nil || m.PerUnit == nil {
- return "", false
- }
- return *m.PerUnit, true
-}
-
-// HasPerUnit returns a boolean if a field has been set.
-func (m *MetricMetadata) HasPerUnit() bool {
- if m != nil && m.PerUnit != nil {
- return true
- }
-
- return false
-}
-
-// SetPerUnit allocates a new m.PerUnit and returns the pointer to it.
-func (m *MetricMetadata) SetPerUnit(v string) {
- m.PerUnit = &v
-}
-
-// GetShortName returns the ShortName field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetShortName() string {
- if m == nil || m.ShortName == nil {
- return ""
- }
- return *m.ShortName
-}
-
-// GetShortNameOk returns a tuple with the ShortName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetShortNameOk() (string, bool) {
- if m == nil || m.ShortName == nil {
- return "", false
- }
- return *m.ShortName, true
-}
-
-// HasShortName returns a boolean if a field has been set.
-func (m *MetricMetadata) HasShortName() bool {
- if m != nil && m.ShortName != nil {
- return true
- }
-
- return false
-}
-
-// SetShortName allocates a new m.ShortName and returns the pointer to it.
-func (m *MetricMetadata) SetShortName(v string) {
- m.ShortName = &v
-}
-
-// GetStatsdInterval returns the StatsdInterval field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetStatsdInterval() int {
- if m == nil || m.StatsdInterval == nil {
- return 0
- }
- return *m.StatsdInterval
-}
-
-// GetStatsdIntervalOk returns a tuple with the StatsdInterval field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetStatsdIntervalOk() (int, bool) {
- if m == nil || m.StatsdInterval == nil {
- return 0, false
- }
- return *m.StatsdInterval, true
-}
-
-// HasStatsdInterval returns a boolean if a field has been set.
-func (m *MetricMetadata) HasStatsdInterval() bool {
- if m != nil && m.StatsdInterval != nil {
- return true
- }
-
- return false
-}
-
-// SetStatsdInterval allocates a new m.StatsdInterval and returns the pointer to it.
-func (m *MetricMetadata) SetStatsdInterval(v int) {
- m.StatsdInterval = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetType() string {
- if m == nil || m.Type == nil {
- return ""
- }
- return *m.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetTypeOk() (string, bool) {
- if m == nil || m.Type == nil {
- return "", false
- }
- return *m.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (m *MetricMetadata) HasType() bool {
- if m != nil && m.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new m.Type and returns the pointer to it.
-func (m *MetricMetadata) SetType(v string) {
- m.Type = &v
-}
-
-// GetUnit returns the Unit field if non-nil, zero value otherwise.
-func (m *MetricMetadata) GetUnit() string {
- if m == nil || m.Unit == nil {
- return ""
- }
- return *m.Unit
-}
-
-// GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *MetricMetadata) GetUnitOk() (string, bool) {
- if m == nil || m.Unit == nil {
- return "", false
- }
- return *m.Unit, true
-}
-
-// HasUnit returns a boolean if a field has been set.
-func (m *MetricMetadata) HasUnit() bool {
- if m != nil && m.Unit != nil {
- return true
- }
-
- return false
-}
-
-// SetUnit allocates a new m.Unit and returns the pointer to it.
-func (m *MetricMetadata) SetUnit(v string) {
- m.Unit = &v
-}
-
-// GetCreator returns the Creator field if non-nil, zero value otherwise.
-func (m *Monitor) GetCreator() Creator {
- if m == nil || m.Creator == nil {
- return Creator{}
- }
- return *m.Creator
-}
-
-// GetCreatorOk returns a tuple with the Creator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetCreatorOk() (Creator, bool) {
- if m == nil || m.Creator == nil {
- return Creator{}, false
- }
- return *m.Creator, true
-}
-
-// HasCreator returns a boolean if a field has been set.
-func (m *Monitor) HasCreator() bool {
- if m != nil && m.Creator != nil {
- return true
- }
-
- return false
-}
-
-// SetCreator allocates a new m.Creator and returns the pointer to it.
-func (m *Monitor) SetCreator(v Creator) {
- m.Creator = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (m *Monitor) GetId() int {
- if m == nil || m.Id == nil {
- return 0
- }
- return *m.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetIdOk() (int, bool) {
- if m == nil || m.Id == nil {
- return 0, false
- }
- return *m.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (m *Monitor) HasId() bool {
- if m != nil && m.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new m.Id and returns the pointer to it.
-func (m *Monitor) SetId(v int) {
- m.Id = &v
-}
-
-// GetMessage returns the Message field if non-nil, zero value otherwise.
-func (m *Monitor) GetMessage() string {
- if m == nil || m.Message == nil {
- return ""
- }
- return *m.Message
-}
-
-// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetMessageOk() (string, bool) {
- if m == nil || m.Message == nil {
- return "", false
- }
- return *m.Message, true
-}
-
-// HasMessage returns a boolean if a field has been set.
-func (m *Monitor) HasMessage() bool {
- if m != nil && m.Message != nil {
- return true
- }
-
- return false
-}
-
-// SetMessage allocates a new m.Message and returns the pointer to it.
-func (m *Monitor) SetMessage(v string) {
- m.Message = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (m *Monitor) GetName() string {
- if m == nil || m.Name == nil {
- return ""
- }
- return *m.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetNameOk() (string, bool) {
- if m == nil || m.Name == nil {
- return "", false
- }
- return *m.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (m *Monitor) HasName() bool {
- if m != nil && m.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new m.Name and returns the pointer to it.
-func (m *Monitor) SetName(v string) {
- m.Name = &v
-}
-
-// GetOptions returns the Options field if non-nil, zero value otherwise.
-func (m *Monitor) GetOptions() Options {
- if m == nil || m.Options == nil {
- return Options{}
- }
- return *m.Options
-}
-
-// GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetOptionsOk() (Options, bool) {
- if m == nil || m.Options == nil {
- return Options{}, false
- }
- return *m.Options, true
-}
-
-// HasOptions returns a boolean if a field has been set.
-func (m *Monitor) HasOptions() bool {
- if m != nil && m.Options != nil {
- return true
- }
-
- return false
-}
-
-// SetOptions allocates a new m.Options and returns the pointer to it.
-func (m *Monitor) SetOptions(v Options) {
- m.Options = &v
-}
-
-// GetOverallState returns the OverallState field if non-nil, zero value otherwise.
-func (m *Monitor) GetOverallState() string {
- if m == nil || m.OverallState == nil {
- return ""
- }
- return *m.OverallState
-}
-
-// GetOverallStateOk returns a tuple with the OverallState field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetOverallStateOk() (string, bool) {
- if m == nil || m.OverallState == nil {
- return "", false
- }
- return *m.OverallState, true
-}
-
-// HasOverallState returns a boolean if a field has been set.
-func (m *Monitor) HasOverallState() bool {
- if m != nil && m.OverallState != nil {
- return true
- }
-
- return false
-}
-
-// SetOverallState allocates a new m.OverallState and returns the pointer to it.
-func (m *Monitor) SetOverallState(v string) {
- m.OverallState = &v
-}
-
-// GetOverallStateModified returns the OverallStateModified field if non-nil, zero value otherwise.
-func (m *Monitor) GetOverallStateModified() string {
- if m == nil || m.OverallStateModified == nil {
- return ""
- }
- return *m.OverallStateModified
-}
-
-// GetOverallStateModifiedOk returns a tuple with the OverallStateModified field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetOverallStateModifiedOk() (string, bool) {
- if m == nil || m.OverallStateModified == nil {
- return "", false
- }
- return *m.OverallStateModified, true
-}
-
-// HasOverallStateModified returns a boolean if a field has been set.
-func (m *Monitor) HasOverallStateModified() bool {
- if m != nil && m.OverallStateModified != nil {
- return true
- }
-
- return false
-}
-
-// SetOverallStateModified allocates a new m.OverallStateModified and returns the pointer to it.
-func (m *Monitor) SetOverallStateModified(v string) {
- m.OverallStateModified = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (m *Monitor) GetQuery() string {
- if m == nil || m.Query == nil {
- return ""
- }
- return *m.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetQueryOk() (string, bool) {
- if m == nil || m.Query == nil {
- return "", false
- }
- return *m.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (m *Monitor) HasQuery() bool {
- if m != nil && m.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new m.Query and returns the pointer to it.
-func (m *Monitor) SetQuery(v string) {
- m.Query = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (m *Monitor) GetType() string {
- if m == nil || m.Type == nil {
- return ""
- }
- return *m.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (m *Monitor) GetTypeOk() (string, bool) {
- if m == nil || m.Type == nil {
- return "", false
- }
- return *m.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (m *Monitor) HasType() bool {
- if m != nil && m.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new m.Type and returns the pointer to it.
-func (m *Monitor) SetType(v string) {
- m.Type = &v
-}
-
-// GetEscalationMessage returns the EscalationMessage field if non-nil, zero value otherwise.
-func (o *Options) GetEscalationMessage() string {
- if o == nil || o.EscalationMessage == nil {
- return ""
- }
- return *o.EscalationMessage
-}
-
-// GetEscalationMessageOk returns a tuple with the EscalationMessage field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetEscalationMessageOk() (string, bool) {
- if o == nil || o.EscalationMessage == nil {
- return "", false
- }
- return *o.EscalationMessage, true
-}
-
-// HasEscalationMessage returns a boolean if a field has been set.
-func (o *Options) HasEscalationMessage() bool {
- if o != nil && o.EscalationMessage != nil {
- return true
- }
-
- return false
-}
-
-// SetEscalationMessage allocates a new o.EscalationMessage and returns the pointer to it.
-func (o *Options) SetEscalationMessage(v string) {
- o.EscalationMessage = &v
-}
-
-// GetEvaluationDelay returns the EvaluationDelay field if non-nil, zero value otherwise.
-func (o *Options) GetEvaluationDelay() int {
- if o == nil || o.EvaluationDelay == nil {
- return 0
- }
- return *o.EvaluationDelay
-}
-
-// GetEvaluationDelayOk returns a tuple with the EvaluationDelay field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetEvaluationDelayOk() (int, bool) {
- if o == nil || o.EvaluationDelay == nil {
- return 0, false
- }
- return *o.EvaluationDelay, true
-}
-
-// HasEvaluationDelay returns a boolean if a field has been set.
-func (o *Options) HasEvaluationDelay() bool {
- if o != nil && o.EvaluationDelay != nil {
- return true
- }
-
- return false
-}
-
-// SetEvaluationDelay allocates a new o.EvaluationDelay and returns the pointer to it.
-func (o *Options) SetEvaluationDelay(v int) {
- o.EvaluationDelay = &v
-}
-
-// GetIncludeTags returns the IncludeTags field if non-nil, zero value otherwise.
-func (o *Options) GetIncludeTags() bool {
- if o == nil || o.IncludeTags == nil {
- return false
- }
- return *o.IncludeTags
-}
-
-// GetIncludeTagsOk returns a tuple with the IncludeTags field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetIncludeTagsOk() (bool, bool) {
- if o == nil || o.IncludeTags == nil {
- return false, false
- }
- return *o.IncludeTags, true
-}
-
-// HasIncludeTags returns a boolean if a field has been set.
-func (o *Options) HasIncludeTags() bool {
- if o != nil && o.IncludeTags != nil {
- return true
- }
-
- return false
-}
-
-// SetIncludeTags allocates a new o.IncludeTags and returns the pointer to it.
-func (o *Options) SetIncludeTags(v bool) {
- o.IncludeTags = &v
-}
-
-// GetLocked returns the Locked field if non-nil, zero value otherwise.
-func (o *Options) GetLocked() bool {
- if o == nil || o.Locked == nil {
- return false
- }
- return *o.Locked
-}
-
-// GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetLockedOk() (bool, bool) {
- if o == nil || o.Locked == nil {
- return false, false
- }
- return *o.Locked, true
-}
-
-// HasLocked returns a boolean if a field has been set.
-func (o *Options) HasLocked() bool {
- if o != nil && o.Locked != nil {
- return true
- }
-
- return false
-}
-
-// SetLocked allocates a new o.Locked and returns the pointer to it.
-func (o *Options) SetLocked(v bool) {
- o.Locked = &v
-}
-
-// GetNewHostDelay returns the NewHostDelay field if non-nil, zero value otherwise.
-func (o *Options) GetNewHostDelay() int {
- if o == nil || o.NewHostDelay == nil {
- return 0
- }
- return *o.NewHostDelay
-}
-
-// GetNewHostDelayOk returns a tuple with the NewHostDelay field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetNewHostDelayOk() (int, bool) {
- if o == nil || o.NewHostDelay == nil {
- return 0, false
- }
- return *o.NewHostDelay, true
-}
-
-// HasNewHostDelay returns a boolean if a field has been set.
-func (o *Options) HasNewHostDelay() bool {
- if o != nil && o.NewHostDelay != nil {
- return true
- }
-
- return false
-}
-
-// SetNewHostDelay allocates a new o.NewHostDelay and returns the pointer to it.
-func (o *Options) SetNewHostDelay(v int) {
- o.NewHostDelay = &v
-}
-
-// GetNotifyAudit returns the NotifyAudit field if non-nil, zero value otherwise.
-func (o *Options) GetNotifyAudit() bool {
- if o == nil || o.NotifyAudit == nil {
- return false
- }
- return *o.NotifyAudit
-}
-
-// GetNotifyAuditOk returns a tuple with the NotifyAudit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetNotifyAuditOk() (bool, bool) {
- if o == nil || o.NotifyAudit == nil {
- return false, false
- }
- return *o.NotifyAudit, true
-}
-
-// HasNotifyAudit returns a boolean if a field has been set.
-func (o *Options) HasNotifyAudit() bool {
- if o != nil && o.NotifyAudit != nil {
- return true
- }
-
- return false
-}
-
-// SetNotifyAudit allocates a new o.NotifyAudit and returns the pointer to it.
-func (o *Options) SetNotifyAudit(v bool) {
- o.NotifyAudit = &v
-}
-
-// GetNotifyNoData returns the NotifyNoData field if non-nil, zero value otherwise.
-func (o *Options) GetNotifyNoData() bool {
- if o == nil || o.NotifyNoData == nil {
- return false
- }
- return *o.NotifyNoData
-}
-
-// GetNotifyNoDataOk returns a tuple with the NotifyNoData field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetNotifyNoDataOk() (bool, bool) {
- if o == nil || o.NotifyNoData == nil {
- return false, false
- }
- return *o.NotifyNoData, true
-}
-
-// HasNotifyNoData returns a boolean if a field has been set.
-func (o *Options) HasNotifyNoData() bool {
- if o != nil && o.NotifyNoData != nil {
- return true
- }
-
- return false
-}
-
-// SetNotifyNoData allocates a new o.NotifyNoData and returns the pointer to it.
-func (o *Options) SetNotifyNoData(v bool) {
- o.NotifyNoData = &v
-}
-
-// GetRenotifyInterval returns the RenotifyInterval field if non-nil, zero value otherwise.
-func (o *Options) GetRenotifyInterval() int {
- if o == nil || o.RenotifyInterval == nil {
- return 0
- }
- return *o.RenotifyInterval
-}
-
-// GetRenotifyIntervalOk returns a tuple with the RenotifyInterval field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetRenotifyIntervalOk() (int, bool) {
- if o == nil || o.RenotifyInterval == nil {
- return 0, false
- }
- return *o.RenotifyInterval, true
-}
-
-// HasRenotifyInterval returns a boolean if a field has been set.
-func (o *Options) HasRenotifyInterval() bool {
- if o != nil && o.RenotifyInterval != nil {
- return true
- }
-
- return false
-}
-
-// SetRenotifyInterval allocates a new o.RenotifyInterval and returns the pointer to it.
-func (o *Options) SetRenotifyInterval(v int) {
- o.RenotifyInterval = &v
-}
-
-// GetRequireFullWindow returns the RequireFullWindow field if non-nil, zero value otherwise.
-func (o *Options) GetRequireFullWindow() bool {
- if o == nil || o.RequireFullWindow == nil {
- return false
- }
- return *o.RequireFullWindow
-}
-
-// GetRequireFullWindowOk returns a tuple with the RequireFullWindow field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetRequireFullWindowOk() (bool, bool) {
- if o == nil || o.RequireFullWindow == nil {
- return false, false
- }
- return *o.RequireFullWindow, true
-}
-
-// HasRequireFullWindow returns a boolean if a field has been set.
-func (o *Options) HasRequireFullWindow() bool {
- if o != nil && o.RequireFullWindow != nil {
- return true
- }
-
- return false
-}
-
-// SetRequireFullWindow allocates a new o.RequireFullWindow and returns the pointer to it.
-func (o *Options) SetRequireFullWindow(v bool) {
- o.RequireFullWindow = &v
-}
-
-// GetThresholds returns the Thresholds field if non-nil, zero value otherwise.
-func (o *Options) GetThresholds() ThresholdCount {
- if o == nil || o.Thresholds == nil {
- return ThresholdCount{}
- }
- return *o.Thresholds
-}
-
-// GetThresholdsOk returns a tuple with the Thresholds field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetThresholdsOk() (ThresholdCount, bool) {
- if o == nil || o.Thresholds == nil {
- return ThresholdCount{}, false
- }
- return *o.Thresholds, true
-}
-
-// HasThresholds returns a boolean if a field has been set.
-func (o *Options) HasThresholds() bool {
- if o != nil && o.Thresholds != nil {
- return true
- }
-
- return false
-}
-
-// SetThresholds allocates a new o.Thresholds and returns the pointer to it.
-func (o *Options) SetThresholds(v ThresholdCount) {
- o.Thresholds = &v
-}
-
-// GetThresholdWindows returns the ThresholdWindows field if non-nil, zero value otherwise.
-func (o *Options) GetThresholdWindows() ThresholdWindows {
- if o == nil || o.ThresholdWindows == nil {
- return ThresholdWindows{}
- }
- return *o.ThresholdWindows
-}
-
-// GetThresholdWindowsOk returns a tuple with the ThresholdWindows field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetThresholdWindowsOk() (ThresholdWindows, bool) {
- if o == nil || o.ThresholdWindows == nil {
- return ThresholdWindows{}, false
- }
- return *o.ThresholdWindows, true
-}
-
-// HasThresholdWindows returns a boolean if a field has been set.
-func (o *Options) HasThresholdWindows() bool {
- if o != nil && o.ThresholdWindows != nil {
- return true
- }
-
- return false
-}
-
-// SetThresholdWindows allocates a new o.ThresholdWindows and returns the pointer to it.
-func (o *Options) SetThresholdWindows(v ThresholdWindows) {
- o.ThresholdWindows = &v
-}
-
-// GetTimeoutH returns the TimeoutH field if non-nil, zero value otherwise.
-func (o *Options) GetTimeoutH() int {
- if o == nil || o.TimeoutH == nil {
- return 0
- }
- return *o.TimeoutH
-}
-
-// GetTimeoutHOk returns a tuple with the TimeoutH field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (o *Options) GetTimeoutHOk() (int, bool) {
- if o == nil || o.TimeoutH == nil {
- return 0, false
- }
- return *o.TimeoutH, true
-}
-
-// HasTimeoutH returns a boolean if a field has been set.
-func (o *Options) HasTimeoutH() bool {
- if o != nil && o.TimeoutH != nil {
- return true
- }
-
- return false
-}
-
-// SetTimeoutH allocates a new o.TimeoutH and returns the pointer to it.
-func (o *Options) SetTimeoutH(v int) {
- o.TimeoutH = &v
-}
-
-// GetCount returns the Count field if non-nil, zero value otherwise.
-func (p *Params) GetCount() string {
- if p == nil || p.Count == nil {
- return ""
- }
- return *p.Count
-}
-
-// GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (p *Params) GetCountOk() (string, bool) {
- if p == nil || p.Count == nil {
- return "", false
- }
- return *p.Count, true
-}
-
-// HasCount returns a boolean if a field has been set.
-func (p *Params) HasCount() bool {
- if p != nil && p.Count != nil {
- return true
- }
-
- return false
-}
-
-// SetCount allocates a new p.Count and returns the pointer to it.
-func (p *Params) SetCount(v string) {
- p.Count = &v
-}
-
-// GetSort returns the Sort field if non-nil, zero value otherwise.
-func (p *Params) GetSort() string {
- if p == nil || p.Sort == nil {
- return ""
- }
- return *p.Sort
-}
-
-// GetSortOk returns a tuple with the Sort field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (p *Params) GetSortOk() (string, bool) {
- if p == nil || p.Sort == nil {
- return "", false
- }
- return *p.Sort, true
-}
-
-// HasSort returns a boolean if a field has been set.
-func (p *Params) HasSort() bool {
- if p != nil && p.Sort != nil {
- return true
- }
-
- return false
-}
-
-// SetSort allocates a new p.Sort and returns the pointer to it.
-func (p *Params) SetSort(v string) {
- p.Sort = &v
-}
-
-// GetStart returns the Start field if non-nil, zero value otherwise.
-func (p *Params) GetStart() string {
- if p == nil || p.Start == nil {
- return ""
- }
- return *p.Start
-}
-
-// GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (p *Params) GetStartOk() (string, bool) {
- if p == nil || p.Start == nil {
- return "", false
- }
- return *p.Start, true
-}
-
-// HasStart returns a boolean if a field has been set.
-func (p *Params) HasStart() bool {
- if p != nil && p.Start != nil {
- return true
- }
-
- return false
-}
-
-// SetStart allocates a new p.Start and returns the pointer to it.
-func (p *Params) SetStart(v string) {
- p.Start = &v
-}
-
-// GetText returns the Text field if non-nil, zero value otherwise.
-func (p *Params) GetText() string {
- if p == nil || p.Text == nil {
- return ""
- }
- return *p.Text
-}
-
-// GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (p *Params) GetTextOk() (string, bool) {
- if p == nil || p.Text == nil {
- return "", false
- }
- return *p.Text, true
-}
-
-// HasText returns a boolean if a field has been set.
-func (p *Params) HasText() bool {
- if p != nil && p.Text != nil {
- return true
- }
-
- return false
-}
-
-// SetText allocates a new p.Text and returns the pointer to it.
-func (p *Params) SetText(v string) {
- p.Text = &v
-}
-
-// GetPeriod returns the Period field if non-nil, zero value otherwise.
-func (r *Recurrence) GetPeriod() int {
- if r == nil || r.Period == nil {
- return 0
- }
- return *r.Period
-}
-
-// GetPeriodOk returns a tuple with the Period field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Recurrence) GetPeriodOk() (int, bool) {
- if r == nil || r.Period == nil {
- return 0, false
- }
- return *r.Period, true
-}
-
-// HasPeriod returns a boolean if a field has been set.
-func (r *Recurrence) HasPeriod() bool {
- if r != nil && r.Period != nil {
- return true
- }
-
- return false
-}
-
-// SetPeriod allocates a new r.Period and returns the pointer to it.
-func (r *Recurrence) SetPeriod(v int) {
- r.Period = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (r *Recurrence) GetType() string {
- if r == nil || r.Type == nil {
- return ""
- }
- return *r.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Recurrence) GetTypeOk() (string, bool) {
- if r == nil || r.Type == nil {
- return "", false
- }
- return *r.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (r *Recurrence) HasType() bool {
- if r != nil && r.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new r.Type and returns the pointer to it.
-func (r *Recurrence) SetType(v string) {
- r.Type = &v
-}
-
-// GetUntilDate returns the UntilDate field if non-nil, zero value otherwise.
-func (r *Recurrence) GetUntilDate() int {
- if r == nil || r.UntilDate == nil {
- return 0
- }
- return *r.UntilDate
-}
-
-// GetUntilDateOk returns a tuple with the UntilDate field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Recurrence) GetUntilDateOk() (int, bool) {
- if r == nil || r.UntilDate == nil {
- return 0, false
- }
- return *r.UntilDate, true
-}
-
-// HasUntilDate returns a boolean if a field has been set.
-func (r *Recurrence) HasUntilDate() bool {
- if r != nil && r.UntilDate != nil {
- return true
- }
-
- return false
-}
-
-// SetUntilDate allocates a new r.UntilDate and returns the pointer to it.
-func (r *Recurrence) SetUntilDate(v int) {
- r.UntilDate = &v
-}
-
-// GetUntilOccurrences returns the UntilOccurrences field if non-nil, zero value otherwise.
-func (r *Recurrence) GetUntilOccurrences() int {
- if r == nil || r.UntilOccurrences == nil {
- return 0
- }
- return *r.UntilOccurrences
-}
-
-// GetUntilOccurrencesOk returns a tuple with the UntilOccurrences field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Recurrence) GetUntilOccurrencesOk() (int, bool) {
- if r == nil || r.UntilOccurrences == nil {
- return 0, false
- }
- return *r.UntilOccurrences, true
-}
-
-// HasUntilOccurrences returns a boolean if a field has been set.
-func (r *Recurrence) HasUntilOccurrences() bool {
- if r != nil && r.UntilOccurrences != nil {
- return true
- }
-
- return false
-}
-
-// SetUntilOccurrences allocates a new r.UntilOccurrences and returns the pointer to it.
-func (r *Recurrence) SetUntilOccurrences(v int) {
- r.UntilOccurrences = &v
-}
-
-// GetComment returns the Comment field if non-nil, zero value otherwise.
-func (r *reqComment) GetComment() Comment {
- if r == nil || r.Comment == nil {
- return Comment{}
- }
- return *r.Comment
-}
-
-// GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqComment) GetCommentOk() (Comment, bool) {
- if r == nil || r.Comment == nil {
- return Comment{}, false
- }
- return *r.Comment, true
-}
-
-// HasComment returns a boolean if a field has been set.
-func (r *reqComment) HasComment() bool {
- if r != nil && r.Comment != nil {
- return true
- }
-
- return false
-}
-
-// SetComment allocates a new r.Comment and returns the pointer to it.
-func (r *reqComment) SetComment(v Comment) {
- r.Comment = &v
-}
-
-// GetDashboard returns the Dashboard field if non-nil, zero value otherwise.
-func (r *reqGetDashboard) GetDashboard() Dashboard {
- if r == nil || r.Dashboard == nil {
- return Dashboard{}
- }
- return *r.Dashboard
-}
-
-// GetDashboardOk returns a tuple with the Dashboard field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqGetDashboard) GetDashboardOk() (Dashboard, bool) {
- if r == nil || r.Dashboard == nil {
- return Dashboard{}, false
- }
- return *r.Dashboard, true
-}
-
-// HasDashboard returns a boolean if a field has been set.
-func (r *reqGetDashboard) HasDashboard() bool {
- if r != nil && r.Dashboard != nil {
- return true
- }
-
- return false
-}
-
-// SetDashboard allocates a new r.Dashboard and returns the pointer to it.
-func (r *reqGetDashboard) SetDashboard(v Dashboard) {
- r.Dashboard = &v
-}
-
-// GetResource returns the Resource field if non-nil, zero value otherwise.
-func (r *reqGetDashboard) GetResource() string {
- if r == nil || r.Resource == nil {
- return ""
- }
- return *r.Resource
-}
-
-// GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqGetDashboard) GetResourceOk() (string, bool) {
- if r == nil || r.Resource == nil {
- return "", false
- }
- return *r.Resource, true
-}
-
-// HasResource returns a boolean if a field has been set.
-func (r *reqGetDashboard) HasResource() bool {
- if r != nil && r.Resource != nil {
- return true
- }
-
- return false
-}
-
-// SetResource allocates a new r.Resource and returns the pointer to it.
-func (r *reqGetDashboard) SetResource(v string) {
- r.Resource = &v
-}
-
-// GetUrl returns the Url field if non-nil, zero value otherwise.
-func (r *reqGetDashboard) GetUrl() string {
- if r == nil || r.Url == nil {
- return ""
- }
- return *r.Url
-}
-
-// GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqGetDashboard) GetUrlOk() (string, bool) {
- if r == nil || r.Url == nil {
- return "", false
- }
- return *r.Url, true
-}
-
-// HasUrl returns a boolean if a field has been set.
-func (r *reqGetDashboard) HasUrl() bool {
- if r != nil && r.Url != nil {
- return true
- }
-
- return false
-}
-
-// SetUrl allocates a new r.Url and returns the pointer to it.
-func (r *reqGetDashboard) SetUrl(v string) {
- r.Url = &v
-}
-
-// GetEvent returns the Event field if non-nil, zero value otherwise.
-func (r *reqGetEvent) GetEvent() Event {
- if r == nil || r.Event == nil {
- return Event{}
- }
- return *r.Event
-}
-
-// GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqGetEvent) GetEventOk() (Event, bool) {
- if r == nil || r.Event == nil {
- return Event{}, false
- }
- return *r.Event, true
-}
-
-// HasEvent returns a boolean if a field has been set.
-func (r *reqGetEvent) HasEvent() bool {
- if r != nil && r.Event != nil {
- return true
- }
-
- return false
-}
-
-// SetEvent allocates a new r.Event and returns the pointer to it.
-func (r *reqGetEvent) SetEvent(v Event) {
- r.Event = &v
-}
-
-// GetTags returns the Tags field if non-nil, zero value otherwise.
-func (r *reqGetTags) GetTags() TagMap {
- if r == nil || r.Tags == nil {
- return TagMap{}
- }
- return *r.Tags
-}
-
-// GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *reqGetTags) GetTagsOk() (TagMap, bool) {
- if r == nil || r.Tags == nil {
- return TagMap{}, false
- }
- return *r.Tags, true
-}
-
-// HasTags returns a boolean if a field has been set.
-func (r *reqGetTags) HasTags() bool {
- if r != nil && r.Tags != nil {
- return true
- }
-
- return false
-}
-
-// SetTags allocates a new r.Tags and returns the pointer to it.
-func (r *reqGetTags) SetTags(v TagMap) {
- r.Tags = &v
-}
-
-// GetColor returns the Color field if non-nil, zero value otherwise.
-func (r *Rule) GetColor() string {
- if r == nil || r.Color == nil {
- return ""
- }
- return *r.Color
-}
-
-// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Rule) GetColorOk() (string, bool) {
- if r == nil || r.Color == nil {
- return "", false
- }
- return *r.Color, true
-}
-
-// HasColor returns a boolean if a field has been set.
-func (r *Rule) HasColor() bool {
- if r != nil && r.Color != nil {
- return true
- }
-
- return false
-}
-
-// SetColor allocates a new r.Color and returns the pointer to it.
-func (r *Rule) SetColor(v string) {
- r.Color = &v
-}
-
-// GetThreshold returns the Threshold field if non-nil, zero value otherwise.
-func (r *Rule) GetThreshold() json.Number {
- if r == nil || r.Threshold == nil {
- return ""
- }
- return *r.Threshold
-}
-
-// GetThresholdOk returns a tuple with the Threshold field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Rule) GetThresholdOk() (json.Number, bool) {
- if r == nil || r.Threshold == nil {
- return "", false
- }
- return *r.Threshold, true
-}
-
-// HasThreshold returns a boolean if a field has been set.
-func (r *Rule) HasThreshold() bool {
- if r != nil && r.Threshold != nil {
- return true
- }
-
- return false
-}
-
-// SetThreshold allocates a new r.Threshold and returns the pointer to it.
-func (r *Rule) SetThreshold(v json.Number) {
- r.Threshold = &v
-}
-
-// GetTimeframe returns the Timeframe field if non-nil, zero value otherwise.
-func (r *Rule) GetTimeframe() string {
- if r == nil || r.Timeframe == nil {
- return ""
- }
- return *r.Timeframe
-}
-
-// GetTimeframeOk returns a tuple with the Timeframe field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (r *Rule) GetTimeframeOk() (string, bool) {
- if r == nil || r.Timeframe == nil {
- return "", false
- }
- return *r.Timeframe, true
-}
-
-// HasTimeframe returns a boolean if a field has been set.
-func (r *Rule) HasTimeframe() bool {
- if r != nil && r.Timeframe != nil {
- return true
- }
-
- return false
-}
-
-// SetTimeframe allocates a new r.Timeframe and returns the pointer to it.
-func (r *Rule) SetTimeframe(v string) {
- r.Timeframe = &v
-}
-
-// GetHeight returns the Height field if non-nil, zero value otherwise.
-func (s *Screenboard) GetHeight() int {
- if s == nil || s.Height == nil {
- return 0
- }
- return *s.Height
-}
-
-// GetHeightOk returns a tuple with the Height field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetHeightOk() (int, bool) {
- if s == nil || s.Height == nil {
- return 0, false
- }
- return *s.Height, true
-}
-
-// HasHeight returns a boolean if a field has been set.
-func (s *Screenboard) HasHeight() bool {
- if s != nil && s.Height != nil {
- return true
- }
-
- return false
-}
-
-// SetHeight allocates a new s.Height and returns the pointer to it.
-func (s *Screenboard) SetHeight(v int) {
- s.Height = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (s *Screenboard) GetId() int {
- if s == nil || s.Id == nil {
- return 0
- }
- return *s.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetIdOk() (int, bool) {
- if s == nil || s.Id == nil {
- return 0, false
- }
- return *s.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (s *Screenboard) HasId() bool {
- if s != nil && s.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new s.Id and returns the pointer to it.
-func (s *Screenboard) SetId(v int) {
- s.Id = &v
-}
-
-// GetReadOnly returns the ReadOnly field if non-nil, zero value otherwise.
-func (s *Screenboard) GetReadOnly() bool {
- if s == nil || s.ReadOnly == nil {
- return false
- }
- return *s.ReadOnly
-}
-
-// GetReadOnlyOk returns a tuple with the ReadOnly field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetReadOnlyOk() (bool, bool) {
- if s == nil || s.ReadOnly == nil {
- return false, false
- }
- return *s.ReadOnly, true
-}
-
-// HasReadOnly returns a boolean if a field has been set.
-func (s *Screenboard) HasReadOnly() bool {
- if s != nil && s.ReadOnly != nil {
- return true
- }
-
- return false
-}
-
-// SetReadOnly allocates a new s.ReadOnly and returns the pointer to it.
-func (s *Screenboard) SetReadOnly(v bool) {
- s.ReadOnly = &v
-}
-
-// GetShared returns the Shared field if non-nil, zero value otherwise.
-func (s *Screenboard) GetShared() bool {
- if s == nil || s.Shared == nil {
- return false
- }
- return *s.Shared
-}
-
-// GetSharedOk returns a tuple with the Shared field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetSharedOk() (bool, bool) {
- if s == nil || s.Shared == nil {
- return false, false
- }
- return *s.Shared, true
-}
-
-// HasShared returns a boolean if a field has been set.
-func (s *Screenboard) HasShared() bool {
- if s != nil && s.Shared != nil {
- return true
- }
-
- return false
-}
-
-// SetShared allocates a new s.Shared and returns the pointer to it.
-func (s *Screenboard) SetShared(v bool) {
- s.Shared = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (s *Screenboard) GetTitle() string {
- if s == nil || s.Title == nil {
- return ""
- }
- return *s.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetTitleOk() (string, bool) {
- if s == nil || s.Title == nil {
- return "", false
- }
- return *s.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (s *Screenboard) HasTitle() bool {
- if s != nil && s.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new s.Title and returns the pointer to it.
-func (s *Screenboard) SetTitle(v string) {
- s.Title = &v
-}
-
-// GetWidth returns the Width field if non-nil, zero value otherwise.
-func (s *Screenboard) GetWidth() int {
- if s == nil || s.Width == nil {
- return 0
- }
- return *s.Width
-}
-
-// GetWidthOk returns a tuple with the Width field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Screenboard) GetWidthOk() (int, bool) {
- if s == nil || s.Width == nil {
- return 0, false
- }
- return *s.Width, true
-}
-
-// HasWidth returns a boolean if a field has been set.
-func (s *Screenboard) HasWidth() bool {
- if s != nil && s.Width != nil {
- return true
- }
-
- return false
-}
-
-// SetWidth allocates a new s.Width and returns the pointer to it.
-func (s *Screenboard) SetWidth(v int) {
- s.Width = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (s *ScreenboardLite) GetId() int {
- if s == nil || s.Id == nil {
- return 0
- }
- return *s.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ScreenboardLite) GetIdOk() (int, bool) {
- if s == nil || s.Id == nil {
- return 0, false
- }
- return *s.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (s *ScreenboardLite) HasId() bool {
- if s != nil && s.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new s.Id and returns the pointer to it.
-func (s *ScreenboardLite) SetId(v int) {
- s.Id = &v
-}
-
-// GetResource returns the Resource field if non-nil, zero value otherwise.
-func (s *ScreenboardLite) GetResource() string {
- if s == nil || s.Resource == nil {
- return ""
- }
- return *s.Resource
-}
-
-// GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ScreenboardLite) GetResourceOk() (string, bool) {
- if s == nil || s.Resource == nil {
- return "", false
- }
- return *s.Resource, true
-}
-
-// HasResource returns a boolean if a field has been set.
-func (s *ScreenboardLite) HasResource() bool {
- if s != nil && s.Resource != nil {
- return true
- }
-
- return false
-}
-
-// SetResource allocates a new s.Resource and returns the pointer to it.
-func (s *ScreenboardLite) SetResource(v string) {
- s.Resource = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (s *ScreenboardLite) GetTitle() string {
- if s == nil || s.Title == nil {
- return ""
- }
- return *s.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ScreenboardLite) GetTitleOk() (string, bool) {
- if s == nil || s.Title == nil {
- return "", false
- }
- return *s.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (s *ScreenboardLite) HasTitle() bool {
- if s != nil && s.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new s.Title and returns the pointer to it.
-func (s *ScreenboardLite) SetTitle(v string) {
- s.Title = &v
-}
-
-// GetId returns the Id field if non-nil, zero value otherwise.
-func (s *ScreenboardMonitor) GetId() int {
- if s == nil || s.Id == nil {
- return 0
- }
- return *s.Id
-}
-
-// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ScreenboardMonitor) GetIdOk() (int, bool) {
- if s == nil || s.Id == nil {
- return 0, false
- }
- return *s.Id, true
-}
-
-// HasId returns a boolean if a field has been set.
-func (s *ScreenboardMonitor) HasId() bool {
- if s != nil && s.Id != nil {
- return true
- }
-
- return false
-}
-
-// SetId allocates a new s.Id and returns the pointer to it.
-func (s *ScreenboardMonitor) SetId(v int) {
- s.Id = &v
-}
-
-// GetAggr returns the Aggr field if non-nil, zero value otherwise.
-func (s *Series) GetAggr() string {
- if s == nil || s.Aggr == nil {
- return ""
- }
- return *s.Aggr
-}
-
-// GetAggrOk returns a tuple with the Aggr field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetAggrOk() (string, bool) {
- if s == nil || s.Aggr == nil {
- return "", false
- }
- return *s.Aggr, true
-}
-
-// HasAggr returns a boolean if a field has been set.
-func (s *Series) HasAggr() bool {
- if s != nil && s.Aggr != nil {
- return true
- }
-
- return false
-}
-
-// SetAggr allocates a new s.Aggr and returns the pointer to it.
-func (s *Series) SetAggr(v string) {
- s.Aggr = &v
-}
-
-// GetDisplayName returns the DisplayName field if non-nil, zero value otherwise.
-func (s *Series) GetDisplayName() string {
- if s == nil || s.DisplayName == nil {
- return ""
- }
- return *s.DisplayName
-}
-
-// GetDisplayNameOk returns a tuple with the DisplayName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetDisplayNameOk() (string, bool) {
- if s == nil || s.DisplayName == nil {
- return "", false
- }
- return *s.DisplayName, true
-}
-
-// HasDisplayName returns a boolean if a field has been set.
-func (s *Series) HasDisplayName() bool {
- if s != nil && s.DisplayName != nil {
- return true
- }
-
- return false
-}
-
-// SetDisplayName allocates a new s.DisplayName and returns the pointer to it.
-func (s *Series) SetDisplayName(v string) {
- s.DisplayName = &v
-}
-
-// GetEnd returns the End field if non-nil, zero value otherwise.
-func (s *Series) GetEnd() float64 {
- if s == nil || s.End == nil {
- return 0
- }
- return *s.End
-}
-
-// GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetEndOk() (float64, bool) {
- if s == nil || s.End == nil {
- return 0, false
- }
- return *s.End, true
-}
-
-// HasEnd returns a boolean if a field has been set.
-func (s *Series) HasEnd() bool {
- if s != nil && s.End != nil {
- return true
- }
-
- return false
-}
-
-// SetEnd allocates a new s.End and returns the pointer to it.
-func (s *Series) SetEnd(v float64) {
- s.End = &v
-}
-
-// GetExpression returns the Expression field if non-nil, zero value otherwise.
-func (s *Series) GetExpression() string {
- if s == nil || s.Expression == nil {
- return ""
- }
- return *s.Expression
-}
-
-// GetExpressionOk returns a tuple with the Expression field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetExpressionOk() (string, bool) {
- if s == nil || s.Expression == nil {
- return "", false
- }
- return *s.Expression, true
-}
-
-// HasExpression returns a boolean if a field has been set.
-func (s *Series) HasExpression() bool {
- if s != nil && s.Expression != nil {
- return true
- }
-
- return false
-}
-
-// SetExpression allocates a new s.Expression and returns the pointer to it.
-func (s *Series) SetExpression(v string) {
- s.Expression = &v
-}
-
-// GetInterval returns the Interval field if non-nil, zero value otherwise.
-func (s *Series) GetInterval() int {
- if s == nil || s.Interval == nil {
- return 0
- }
- return *s.Interval
-}
-
-// GetIntervalOk returns a tuple with the Interval field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetIntervalOk() (int, bool) {
- if s == nil || s.Interval == nil {
- return 0, false
- }
- return *s.Interval, true
-}
-
-// HasInterval returns a boolean if a field has been set.
-func (s *Series) HasInterval() bool {
- if s != nil && s.Interval != nil {
- return true
- }
-
- return false
-}
-
-// SetInterval allocates a new s.Interval and returns the pointer to it.
-func (s *Series) SetInterval(v int) {
- s.Interval = &v
-}
-
-// GetLength returns the Length field if non-nil, zero value otherwise.
-func (s *Series) GetLength() int {
- if s == nil || s.Length == nil {
- return 0
- }
- return *s.Length
-}
-
-// GetLengthOk returns a tuple with the Length field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetLengthOk() (int, bool) {
- if s == nil || s.Length == nil {
- return 0, false
- }
- return *s.Length, true
-}
-
-// HasLength returns a boolean if a field has been set.
-func (s *Series) HasLength() bool {
- if s != nil && s.Length != nil {
- return true
- }
-
- return false
-}
-
-// SetLength allocates a new s.Length and returns the pointer to it.
-func (s *Series) SetLength(v int) {
- s.Length = &v
-}
-
-// GetMetric returns the Metric field if non-nil, zero value otherwise.
-func (s *Series) GetMetric() string {
- if s == nil || s.Metric == nil {
- return ""
- }
- return *s.Metric
-}
-
-// GetMetricOk returns a tuple with the Metric field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetMetricOk() (string, bool) {
- if s == nil || s.Metric == nil {
- return "", false
- }
- return *s.Metric, true
-}
-
-// HasMetric returns a boolean if a field has been set.
-func (s *Series) HasMetric() bool {
- if s != nil && s.Metric != nil {
- return true
- }
-
- return false
-}
-
-// SetMetric allocates a new s.Metric and returns the pointer to it.
-func (s *Series) SetMetric(v string) {
- s.Metric = &v
-}
-
-// GetScope returns the Scope field if non-nil, zero value otherwise.
-func (s *Series) GetScope() string {
- if s == nil || s.Scope == nil {
- return ""
- }
- return *s.Scope
-}
-
-// GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetScopeOk() (string, bool) {
- if s == nil || s.Scope == nil {
- return "", false
- }
- return *s.Scope, true
-}
-
-// HasScope returns a boolean if a field has been set.
-func (s *Series) HasScope() bool {
- if s != nil && s.Scope != nil {
- return true
- }
-
- return false
-}
-
-// SetScope allocates a new s.Scope and returns the pointer to it.
-func (s *Series) SetScope(v string) {
- s.Scope = &v
-}
-
-// GetStart returns the Start field if non-nil, zero value otherwise.
-func (s *Series) GetStart() float64 {
- if s == nil || s.Start == nil {
- return 0
- }
- return *s.Start
-}
-
-// GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetStartOk() (float64, bool) {
- if s == nil || s.Start == nil {
- return 0, false
- }
- return *s.Start, true
-}
-
-// HasStart returns a boolean if a field has been set.
-func (s *Series) HasStart() bool {
- if s != nil && s.Start != nil {
- return true
- }
-
- return false
-}
-
-// SetStart allocates a new s.Start and returns the pointer to it.
-func (s *Series) SetStart(v float64) {
- s.Start = &v
-}
-
-// GetUnits returns the Units field if non-nil, zero value otherwise.
-func (s *Series) GetUnits() UnitPair {
- if s == nil || s.Units == nil {
- return UnitPair{}
- }
- return *s.Units
-}
-
-// GetUnitsOk returns a tuple with the Units field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Series) GetUnitsOk() (UnitPair, bool) {
- if s == nil || s.Units == nil {
- return UnitPair{}, false
- }
- return *s.Units, true
-}
-
-// HasUnits returns a boolean if a field has been set.
-func (s *Series) HasUnits() bool {
- if s != nil && s.Units != nil {
- return true
- }
-
- return false
-}
-
-// SetUnits allocates a new s.Units and returns the pointer to it.
-func (s *Series) SetUnits(v UnitPair) {
- s.Units = &v
-}
-
-// GetAccount returns the Account field if non-nil, zero value otherwise.
-func (s *ServiceHookSlackRequest) GetAccount() string {
- if s == nil || s.Account == nil {
- return ""
- }
- return *s.Account
-}
-
-// GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ServiceHookSlackRequest) GetAccountOk() (string, bool) {
- if s == nil || s.Account == nil {
- return "", false
- }
- return *s.Account, true
-}
-
-// HasAccount returns a boolean if a field has been set.
-func (s *ServiceHookSlackRequest) HasAccount() bool {
- if s != nil && s.Account != nil {
- return true
- }
-
- return false
-}
-
-// SetAccount allocates a new s.Account and returns the pointer to it.
-func (s *ServiceHookSlackRequest) SetAccount(v string) {
- s.Account = &v
-}
-
-// GetUrl returns the Url field if non-nil, zero value otherwise.
-func (s *ServiceHookSlackRequest) GetUrl() string {
- if s == nil || s.Url == nil {
- return ""
- }
- return *s.Url
-}
-
-// GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ServiceHookSlackRequest) GetUrlOk() (string, bool) {
- if s == nil || s.Url == nil {
- return "", false
- }
- return *s.Url, true
-}
-
-// HasUrl returns a boolean if a field has been set.
-func (s *ServiceHookSlackRequest) HasUrl() bool {
- if s != nil && s.Url != nil {
- return true
- }
-
- return false
-}
-
-// SetUrl allocates a new s.Url and returns the pointer to it.
-func (s *ServiceHookSlackRequest) SetUrl(v string) {
- s.Url = &v
-}
-
-// GetServiceKey returns the ServiceKey field if non-nil, zero value otherwise.
-func (s *servicePD) GetServiceKey() string {
- if s == nil || s.ServiceKey == nil {
- return ""
- }
- return *s.ServiceKey
-}
-
-// GetServiceKeyOk returns a tuple with the ServiceKey field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *servicePD) GetServiceKeyOk() (string, bool) {
- if s == nil || s.ServiceKey == nil {
- return "", false
- }
- return *s.ServiceKey, true
-}
-
-// HasServiceKey returns a boolean if a field has been set.
-func (s *servicePD) HasServiceKey() bool {
- if s != nil && s.ServiceKey != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceKey allocates a new s.ServiceKey and returns the pointer to it.
-func (s *servicePD) SetServiceKey(v string) {
- s.ServiceKey = &v
-}
-
-// GetServiceName returns the ServiceName field if non-nil, zero value otherwise.
-func (s *servicePD) GetServiceName() string {
- if s == nil || s.ServiceName == nil {
- return ""
- }
- return *s.ServiceName
-}
-
-// GetServiceNameOk returns a tuple with the ServiceName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *servicePD) GetServiceNameOk() (string, bool) {
- if s == nil || s.ServiceName == nil {
- return "", false
- }
- return *s.ServiceName, true
-}
-
-// HasServiceName returns a boolean if a field has been set.
-func (s *servicePD) HasServiceName() bool {
- if s != nil && s.ServiceName != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceName allocates a new s.ServiceName and returns the pointer to it.
-func (s *servicePD) SetServiceName(v string) {
- s.ServiceName = &v
-}
-
-// GetServiceKey returns the ServiceKey field if non-nil, zero value otherwise.
-func (s *ServicePDRequest) GetServiceKey() string {
- if s == nil || s.ServiceKey == nil {
- return ""
- }
- return *s.ServiceKey
-}
-
-// GetServiceKeyOk returns a tuple with the ServiceKey field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ServicePDRequest) GetServiceKeyOk() (string, bool) {
- if s == nil || s.ServiceKey == nil {
- return "", false
- }
- return *s.ServiceKey, true
-}
-
-// HasServiceKey returns a boolean if a field has been set.
-func (s *ServicePDRequest) HasServiceKey() bool {
- if s != nil && s.ServiceKey != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceKey allocates a new s.ServiceKey and returns the pointer to it.
-func (s *ServicePDRequest) SetServiceKey(v string) {
- s.ServiceKey = &v
-}
-
-// GetServiceName returns the ServiceName field if non-nil, zero value otherwise.
-func (s *ServicePDRequest) GetServiceName() string {
- if s == nil || s.ServiceName == nil {
- return ""
- }
- return *s.ServiceName
-}
-
-// GetServiceNameOk returns a tuple with the ServiceName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *ServicePDRequest) GetServiceNameOk() (string, bool) {
- if s == nil || s.ServiceName == nil {
- return "", false
- }
- return *s.ServiceName, true
-}
-
-// HasServiceName returns a boolean if a field has been set.
-func (s *ServicePDRequest) HasServiceName() bool {
- if s != nil && s.ServiceName != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceName allocates a new s.ServiceName and returns the pointer to it.
-func (s *ServicePDRequest) SetServiceName(v string) {
- s.ServiceName = &v
-}
-
-// GetFillMax returns the FillMax field if non-nil, zero value otherwise.
-func (s *Style) GetFillMax() json.Number {
- if s == nil || s.FillMax == nil {
- return ""
- }
- return *s.FillMax
-}
-
-// GetFillMaxOk returns a tuple with the FillMax field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Style) GetFillMaxOk() (json.Number, bool) {
- if s == nil || s.FillMax == nil {
- return "", false
- }
- return *s.FillMax, true
-}
-
-// HasFillMax returns a boolean if a field has been set.
-func (s *Style) HasFillMax() bool {
- if s != nil && s.FillMax != nil {
- return true
- }
-
- return false
-}
-
-// SetFillMax allocates a new s.FillMax and returns the pointer to it.
-func (s *Style) SetFillMax(v json.Number) {
- s.FillMax = &v
-}
-
-// GetFillMin returns the FillMin field if non-nil, zero value otherwise.
-func (s *Style) GetFillMin() json.Number {
- if s == nil || s.FillMin == nil {
- return ""
- }
- return *s.FillMin
-}
-
-// GetFillMinOk returns a tuple with the FillMin field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Style) GetFillMinOk() (json.Number, bool) {
- if s == nil || s.FillMin == nil {
- return "", false
- }
- return *s.FillMin, true
-}
-
-// HasFillMin returns a boolean if a field has been set.
-func (s *Style) HasFillMin() bool {
- if s != nil && s.FillMin != nil {
- return true
- }
-
- return false
-}
-
-// SetFillMin allocates a new s.FillMin and returns the pointer to it.
-func (s *Style) SetFillMin(v json.Number) {
- s.FillMin = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (s *Style) GetPalette() string {
- if s == nil || s.Palette == nil {
- return ""
- }
- return *s.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Style) GetPaletteOk() (string, bool) {
- if s == nil || s.Palette == nil {
- return "", false
- }
- return *s.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (s *Style) HasPalette() bool {
- if s != nil && s.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new s.Palette and returns the pointer to it.
-func (s *Style) SetPalette(v string) {
- s.Palette = &v
-}
-
-// GetPaletteFlip returns the PaletteFlip field if non-nil, zero value otherwise.
-func (s *Style) GetPaletteFlip() bool {
- if s == nil || s.PaletteFlip == nil {
- return false
- }
- return *s.PaletteFlip
-}
-
-// GetPaletteFlipOk returns a tuple with the PaletteFlip field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (s *Style) GetPaletteFlipOk() (bool, bool) {
- if s == nil || s.PaletteFlip == nil {
- return false, false
- }
- return *s.PaletteFlip, true
-}
-
-// HasPaletteFlip returns a boolean if a field has been set.
-func (s *Style) HasPaletteFlip() bool {
- if s != nil && s.PaletteFlip != nil {
- return true
- }
-
- return false
-}
-
-// SetPaletteFlip allocates a new s.PaletteFlip and returns the pointer to it.
-func (s *Style) SetPaletteFlip(v bool) {
- s.PaletteFlip = &v
-}
-
-// GetDefault returns the Default field if non-nil, zero value otherwise.
-func (t *TemplateVariable) GetDefault() string {
- if t == nil || t.Default == nil {
- return ""
- }
- return *t.Default
-}
-
-// GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TemplateVariable) GetDefaultOk() (string, bool) {
- if t == nil || t.Default == nil {
- return "", false
- }
- return *t.Default, true
-}
-
-// HasDefault returns a boolean if a field has been set.
-func (t *TemplateVariable) HasDefault() bool {
- if t != nil && t.Default != nil {
- return true
- }
-
- return false
-}
-
-// SetDefault allocates a new t.Default and returns the pointer to it.
-func (t *TemplateVariable) SetDefault(v string) {
- t.Default = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (t *TemplateVariable) GetName() string {
- if t == nil || t.Name == nil {
- return ""
- }
- return *t.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TemplateVariable) GetNameOk() (string, bool) {
- if t == nil || t.Name == nil {
- return "", false
- }
- return *t.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (t *TemplateVariable) HasName() bool {
- if t != nil && t.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new t.Name and returns the pointer to it.
-func (t *TemplateVariable) SetName(v string) {
- t.Name = &v
-}
-
-// GetPrefix returns the Prefix field if non-nil, zero value otherwise.
-func (t *TemplateVariable) GetPrefix() string {
- if t == nil || t.Prefix == nil {
- return ""
- }
- return *t.Prefix
-}
-
-// GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TemplateVariable) GetPrefixOk() (string, bool) {
- if t == nil || t.Prefix == nil {
- return "", false
- }
- return *t.Prefix, true
-}
-
-// HasPrefix returns a boolean if a field has been set.
-func (t *TemplateVariable) HasPrefix() bool {
- if t != nil && t.Prefix != nil {
- return true
- }
-
- return false
-}
-
-// SetPrefix allocates a new t.Prefix and returns the pointer to it.
-func (t *TemplateVariable) SetPrefix(v string) {
- t.Prefix = &v
-}
-
-// GetCritical returns the Critical field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetCritical() json.Number {
- if t == nil || t.Critical == nil {
- return ""
- }
- return *t.Critical
-}
-
-// GetCriticalOk returns a tuple with the Critical field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetCriticalOk() (json.Number, bool) {
- if t == nil || t.Critical == nil {
- return "", false
- }
- return *t.Critical, true
-}
-
-// HasCritical returns a boolean if a field has been set.
-func (t *ThresholdCount) HasCritical() bool {
- if t != nil && t.Critical != nil {
- return true
- }
-
- return false
-}
-
-// SetCritical allocates a new t.Critical and returns the pointer to it.
-func (t *ThresholdCount) SetCritical(v json.Number) {
- t.Critical = &v
-}
-
-// GetCriticalRecovery returns the CriticalRecovery field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetCriticalRecovery() json.Number {
- if t == nil || t.CriticalRecovery == nil {
- return ""
- }
- return *t.CriticalRecovery
-}
-
-// GetCriticalRecoveryOk returns a tuple with the CriticalRecovery field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetCriticalRecoveryOk() (json.Number, bool) {
- if t == nil || t.CriticalRecovery == nil {
- return "", false
- }
- return *t.CriticalRecovery, true
-}
-
-// HasCriticalRecovery returns a boolean if a field has been set.
-func (t *ThresholdCount) HasCriticalRecovery() bool {
- if t != nil && t.CriticalRecovery != nil {
- return true
- }
-
- return false
-}
-
-// SetCriticalRecovery allocates a new t.CriticalRecovery and returns the pointer to it.
-func (t *ThresholdCount) SetCriticalRecovery(v json.Number) {
- t.CriticalRecovery = &v
-}
-
-// GetOk returns the Ok field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetOk() json.Number {
- if t == nil || t.Ok == nil {
- return ""
- }
- return *t.Ok
-}
-
-// GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetOkOk() (json.Number, bool) {
- if t == nil || t.Ok == nil {
- return "", false
- }
- return *t.Ok, true
-}
-
-// HasOk returns a boolean if a field has been set.
-func (t *ThresholdCount) HasOk() bool {
- if t != nil && t.Ok != nil {
- return true
- }
-
- return false
-}
-
-// SetOk allocates a new t.Ok and returns the pointer to it.
-func (t *ThresholdCount) SetOk(v json.Number) {
- t.Ok = &v
-}
-
-// GetUnknown returns the Unknown field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetUnknown() json.Number {
- if t == nil || t.Unknown == nil {
- return ""
- }
- return *t.Unknown
-}
-
-// GetUnknownOk returns a tuple with the Unknown field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetUnknownOk() (json.Number, bool) {
- if t == nil || t.Unknown == nil {
- return "", false
- }
- return *t.Unknown, true
-}
-
-// HasUnknown returns a boolean if a field has been set.
-func (t *ThresholdCount) HasUnknown() bool {
- if t != nil && t.Unknown != nil {
- return true
- }
-
- return false
-}
-
-// SetUnknown allocates a new t.Unknown and returns the pointer to it.
-func (t *ThresholdCount) SetUnknown(v json.Number) {
- t.Unknown = &v
-}
-
-// GetWarning returns the Warning field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetWarning() json.Number {
- if t == nil || t.Warning == nil {
- return ""
- }
- return *t.Warning
-}
-
-// GetWarningOk returns a tuple with the Warning field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetWarningOk() (json.Number, bool) {
- if t == nil || t.Warning == nil {
- return "", false
- }
- return *t.Warning, true
-}
-
-// HasWarning returns a boolean if a field has been set.
-func (t *ThresholdCount) HasWarning() bool {
- if t != nil && t.Warning != nil {
- return true
- }
-
- return false
-}
-
-// SetWarning allocates a new t.Warning and returns the pointer to it.
-func (t *ThresholdCount) SetWarning(v json.Number) {
- t.Warning = &v
-}
-
-// GetWarningRecovery returns the WarningRecovery field if non-nil, zero value otherwise.
-func (t *ThresholdCount) GetWarningRecovery() json.Number {
- if t == nil || t.WarningRecovery == nil {
- return ""
- }
- return *t.WarningRecovery
-}
-
-// GetWarningRecoveryOk returns a tuple with the WarningRecovery field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdCount) GetWarningRecoveryOk() (json.Number, bool) {
- if t == nil || t.WarningRecovery == nil {
- return "", false
- }
- return *t.WarningRecovery, true
-}
-
-// HasWarningRecovery returns a boolean if a field has been set.
-func (t *ThresholdCount) HasWarningRecovery() bool {
- if t != nil && t.WarningRecovery != nil {
- return true
- }
-
- return false
-}
-
-// SetWarningRecovery allocates a new t.WarningRecovery and returns the pointer to it.
-func (t *ThresholdCount) SetWarningRecovery(v json.Number) {
- t.WarningRecovery = &v
-}
-
-// GetRecoveryWindow returns the RecoveryWindow field if non-nil, zero value otherwise.
-func (t *ThresholdWindows) GetRecoveryWindow() string {
- if t == nil || t.RecoveryWindow == nil {
- return ""
- }
- return *t.RecoveryWindow
-}
-
-// GetRecoveryWindowOk returns a tuple with the RecoveryWindow field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdWindows) GetRecoveryWindowOk() (string, bool) {
- if t == nil || t.RecoveryWindow == nil {
- return "", false
- }
- return *t.RecoveryWindow, true
-}
-
-// HasRecoveryWindow returns a boolean if a field has been set.
-func (t *ThresholdWindows) HasRecoveryWindow() bool {
- if t != nil && t.RecoveryWindow != nil {
- return true
- }
-
- return false
-}
-
-// SetRecoveryWindow allocates a new t.RecoveryWindow and returns the pointer to it.
-func (t *ThresholdWindows) SetRecoveryWindow(v string) {
- t.RecoveryWindow = &v
-}
-
-// GetTriggerWindow returns the TriggerWindow field if non-nil, zero value otherwise.
-func (t *ThresholdWindows) GetTriggerWindow() string {
- if t == nil || t.TriggerWindow == nil {
- return ""
- }
- return *t.TriggerWindow
-}
-
-// GetTriggerWindowOk returns a tuple with the TriggerWindow field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *ThresholdWindows) GetTriggerWindowOk() (string, bool) {
- if t == nil || t.TriggerWindow == nil {
- return "", false
- }
- return *t.TriggerWindow, true
-}
-
-// HasTriggerWindow returns a boolean if a field has been set.
-func (t *ThresholdWindows) HasTriggerWindow() bool {
- if t != nil && t.TriggerWindow != nil {
- return true
- }
-
- return false
-}
-
-// SetTriggerWindow allocates a new t.TriggerWindow and returns the pointer to it.
-func (t *ThresholdWindows) SetTriggerWindow(v string) {
- t.TriggerWindow = &v
-}
-
-// GetAutoscale returns the Autoscale field if non-nil, zero value otherwise.
-func (t *TileDef) GetAutoscale() bool {
- if t == nil || t.Autoscale == nil {
- return false
- }
- return *t.Autoscale
-}
-
-// GetAutoscaleOk returns a tuple with the Autoscale field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetAutoscaleOk() (bool, bool) {
- if t == nil || t.Autoscale == nil {
- return false, false
- }
- return *t.Autoscale, true
-}
-
-// HasAutoscale returns a boolean if a field has been set.
-func (t *TileDef) HasAutoscale() bool {
- if t != nil && t.Autoscale != nil {
- return true
- }
-
- return false
-}
-
-// SetAutoscale allocates a new t.Autoscale and returns the pointer to it.
-func (t *TileDef) SetAutoscale(v bool) {
- t.Autoscale = &v
-}
-
-// GetCustomUnit returns the CustomUnit field if non-nil, zero value otherwise.
-func (t *TileDef) GetCustomUnit() string {
- if t == nil || t.CustomUnit == nil {
- return ""
- }
- return *t.CustomUnit
-}
-
-// GetCustomUnitOk returns a tuple with the CustomUnit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetCustomUnitOk() (string, bool) {
- if t == nil || t.CustomUnit == nil {
- return "", false
- }
- return *t.CustomUnit, true
-}
-
-// HasCustomUnit returns a boolean if a field has been set.
-func (t *TileDef) HasCustomUnit() bool {
- if t != nil && t.CustomUnit != nil {
- return true
- }
-
- return false
-}
-
-// SetCustomUnit allocates a new t.CustomUnit and returns the pointer to it.
-func (t *TileDef) SetCustomUnit(v string) {
- t.CustomUnit = &v
-}
-
-// GetNodeType returns the NodeType field if non-nil, zero value otherwise.
-func (t *TileDef) GetNodeType() string {
- if t == nil || t.NodeType == nil {
- return ""
- }
- return *t.NodeType
-}
-
-// GetNodeTypeOk returns a tuple with the NodeType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetNodeTypeOk() (string, bool) {
- if t == nil || t.NodeType == nil {
- return "", false
- }
- return *t.NodeType, true
-}
-
-// HasNodeType returns a boolean if a field has been set.
-func (t *TileDef) HasNodeType() bool {
- if t != nil && t.NodeType != nil {
- return true
- }
-
- return false
-}
-
-// SetNodeType allocates a new t.NodeType and returns the pointer to it.
-func (t *TileDef) SetNodeType(v string) {
- t.NodeType = &v
-}
-
-// GetNoGroupHosts returns the NoGroupHosts field if non-nil, zero value otherwise.
-func (t *TileDef) GetNoGroupHosts() bool {
- if t == nil || t.NoGroupHosts == nil {
- return false
- }
- return *t.NoGroupHosts
-}
-
-// GetNoGroupHostsOk returns a tuple with the NoGroupHosts field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetNoGroupHostsOk() (bool, bool) {
- if t == nil || t.NoGroupHosts == nil {
- return false, false
- }
- return *t.NoGroupHosts, true
-}
-
-// HasNoGroupHosts returns a boolean if a field has been set.
-func (t *TileDef) HasNoGroupHosts() bool {
- if t != nil && t.NoGroupHosts != nil {
- return true
- }
-
- return false
-}
-
-// SetNoGroupHosts allocates a new t.NoGroupHosts and returns the pointer to it.
-func (t *TileDef) SetNoGroupHosts(v bool) {
- t.NoGroupHosts = &v
-}
-
-// GetNoMetricHosts returns the NoMetricHosts field if non-nil, zero value otherwise.
-func (t *TileDef) GetNoMetricHosts() bool {
- if t == nil || t.NoMetricHosts == nil {
- return false
- }
- return *t.NoMetricHosts
-}
-
-// GetNoMetricHostsOk returns a tuple with the NoMetricHosts field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetNoMetricHostsOk() (bool, bool) {
- if t == nil || t.NoMetricHosts == nil {
- return false, false
- }
- return *t.NoMetricHosts, true
-}
-
-// HasNoMetricHosts returns a boolean if a field has been set.
-func (t *TileDef) HasNoMetricHosts() bool {
- if t != nil && t.NoMetricHosts != nil {
- return true
- }
-
- return false
-}
-
-// SetNoMetricHosts allocates a new t.NoMetricHosts and returns the pointer to it.
-func (t *TileDef) SetNoMetricHosts(v bool) {
- t.NoMetricHosts = &v
-}
-
-// GetPrecision returns the Precision field if non-nil, zero value otherwise.
-func (t *TileDef) GetPrecision() json.Number {
- if t == nil || t.Precision == nil {
- return ""
- }
- return *t.Precision
-}
-
-// GetPrecisionOk returns a tuple with the Precision field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetPrecisionOk() (json.Number, bool) {
- if t == nil || t.Precision == nil {
- return "", false
- }
- return *t.Precision, true
-}
-
-// HasPrecision returns a boolean if a field has been set.
-func (t *TileDef) HasPrecision() bool {
- if t != nil && t.Precision != nil {
- return true
- }
-
- return false
-}
-
-// SetPrecision allocates a new t.Precision and returns the pointer to it.
-func (t *TileDef) SetPrecision(v json.Number) {
- t.Precision = &v
-}
-
-// GetStyle returns the Style field if non-nil, zero value otherwise.
-func (t *TileDef) GetStyle() TileDefStyle {
- if t == nil || t.Style == nil {
- return TileDefStyle{}
- }
- return *t.Style
-}
-
-// GetStyleOk returns a tuple with the Style field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetStyleOk() (TileDefStyle, bool) {
- if t == nil || t.Style == nil {
- return TileDefStyle{}, false
- }
- return *t.Style, true
-}
-
-// HasStyle returns a boolean if a field has been set.
-func (t *TileDef) HasStyle() bool {
- if t != nil && t.Style != nil {
- return true
- }
-
- return false
-}
-
-// SetStyle allocates a new t.Style and returns the pointer to it.
-func (t *TileDef) SetStyle(v TileDefStyle) {
- t.Style = &v
-}
-
-// GetTextAlign returns the TextAlign field if non-nil, zero value otherwise.
-func (t *TileDef) GetTextAlign() string {
- if t == nil || t.TextAlign == nil {
- return ""
- }
- return *t.TextAlign
-}
-
-// GetTextAlignOk returns a tuple with the TextAlign field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetTextAlignOk() (string, bool) {
- if t == nil || t.TextAlign == nil {
- return "", false
- }
- return *t.TextAlign, true
-}
-
-// HasTextAlign returns a boolean if a field has been set.
-func (t *TileDef) HasTextAlign() bool {
- if t != nil && t.TextAlign != nil {
- return true
- }
-
- return false
-}
-
-// SetTextAlign allocates a new t.TextAlign and returns the pointer to it.
-func (t *TileDef) SetTextAlign(v string) {
- t.TextAlign = &v
-}
-
-// GetViz returns the Viz field if non-nil, zero value otherwise.
-func (t *TileDef) GetViz() string {
- if t == nil || t.Viz == nil {
- return ""
- }
- return *t.Viz
-}
-
-// GetVizOk returns a tuple with the Viz field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDef) GetVizOk() (string, bool) {
- if t == nil || t.Viz == nil {
- return "", false
- }
- return *t.Viz, true
-}
-
-// HasViz returns a boolean if a field has been set.
-func (t *TileDef) HasViz() bool {
- if t != nil && t.Viz != nil {
- return true
- }
-
- return false
-}
-
-// SetViz allocates a new t.Viz and returns the pointer to it.
-func (t *TileDef) SetViz(v string) {
- t.Viz = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (t *TileDefEvent) GetQuery() string {
- if t == nil || t.Query == nil {
- return ""
- }
- return *t.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefEvent) GetQueryOk() (string, bool) {
- if t == nil || t.Query == nil {
- return "", false
- }
- return *t.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (t *TileDefEvent) HasQuery() bool {
- if t != nil && t.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new t.Query and returns the pointer to it.
-func (t *TileDefEvent) SetQuery(v string) {
- t.Query = &v
-}
-
-// GetLabel returns the Label field if non-nil, zero value otherwise.
-func (t *TileDefMarker) GetLabel() string {
- if t == nil || t.Label == nil {
- return ""
- }
- return *t.Label
-}
-
-// GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefMarker) GetLabelOk() (string, bool) {
- if t == nil || t.Label == nil {
- return "", false
- }
- return *t.Label, true
-}
-
-// HasLabel returns a boolean if a field has been set.
-func (t *TileDefMarker) HasLabel() bool {
- if t != nil && t.Label != nil {
- return true
- }
-
- return false
-}
-
-// SetLabel allocates a new t.Label and returns the pointer to it.
-func (t *TileDefMarker) SetLabel(v string) {
- t.Label = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (t *TileDefMarker) GetType() string {
- if t == nil || t.Type == nil {
- return ""
- }
- return *t.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefMarker) GetTypeOk() (string, bool) {
- if t == nil || t.Type == nil {
- return "", false
- }
- return *t.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (t *TileDefMarker) HasType() bool {
- if t != nil && t.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new t.Type and returns the pointer to it.
-func (t *TileDefMarker) SetType(v string) {
- t.Type = &v
-}
-
-// GetValue returns the Value field if non-nil, zero value otherwise.
-func (t *TileDefMarker) GetValue() string {
- if t == nil || t.Value == nil {
- return ""
- }
- return *t.Value
-}
-
-// GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefMarker) GetValueOk() (string, bool) {
- if t == nil || t.Value == nil {
- return "", false
- }
- return *t.Value, true
-}
-
-// HasValue returns a boolean if a field has been set.
-func (t *TileDefMarker) HasValue() bool {
- if t != nil && t.Value != nil {
- return true
- }
-
- return false
-}
-
-// SetValue allocates a new t.Value and returns the pointer to it.
-func (t *TileDefMarker) SetValue(v string) {
- t.Value = &v
-}
-
-// GetAggregator returns the Aggregator field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetAggregator() string {
- if t == nil || t.Aggregator == nil {
- return ""
- }
- return *t.Aggregator
-}
-
-// GetAggregatorOk returns a tuple with the Aggregator field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetAggregatorOk() (string, bool) {
- if t == nil || t.Aggregator == nil {
- return "", false
- }
- return *t.Aggregator, true
-}
-
-// HasAggregator returns a boolean if a field has been set.
-func (t *TileDefRequest) HasAggregator() bool {
- if t != nil && t.Aggregator != nil {
- return true
- }
-
- return false
-}
-
-// SetAggregator allocates a new t.Aggregator and returns the pointer to it.
-func (t *TileDefRequest) SetAggregator(v string) {
- t.Aggregator = &v
-}
-
-// GetChangeType returns the ChangeType field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetChangeType() string {
- if t == nil || t.ChangeType == nil {
- return ""
- }
- return *t.ChangeType
-}
-
-// GetChangeTypeOk returns a tuple with the ChangeType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetChangeTypeOk() (string, bool) {
- if t == nil || t.ChangeType == nil {
- return "", false
- }
- return *t.ChangeType, true
-}
-
-// HasChangeType returns a boolean if a field has been set.
-func (t *TileDefRequest) HasChangeType() bool {
- if t != nil && t.ChangeType != nil {
- return true
- }
-
- return false
-}
-
-// SetChangeType allocates a new t.ChangeType and returns the pointer to it.
-func (t *TileDefRequest) SetChangeType(v string) {
- t.ChangeType = &v
-}
-
-// GetCompareTo returns the CompareTo field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetCompareTo() string {
- if t == nil || t.CompareTo == nil {
- return ""
- }
- return *t.CompareTo
-}
-
-// GetCompareToOk returns a tuple with the CompareTo field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetCompareToOk() (string, bool) {
- if t == nil || t.CompareTo == nil {
- return "", false
- }
- return *t.CompareTo, true
-}
-
-// HasCompareTo returns a boolean if a field has been set.
-func (t *TileDefRequest) HasCompareTo() bool {
- if t != nil && t.CompareTo != nil {
- return true
- }
-
- return false
-}
-
-// SetCompareTo allocates a new t.CompareTo and returns the pointer to it.
-func (t *TileDefRequest) SetCompareTo(v string) {
- t.CompareTo = &v
-}
-
-// GetExtraCol returns the ExtraCol field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetExtraCol() string {
- if t == nil || t.ExtraCol == nil {
- return ""
- }
- return *t.ExtraCol
-}
-
-// GetExtraColOk returns a tuple with the ExtraCol field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetExtraColOk() (string, bool) {
- if t == nil || t.ExtraCol == nil {
- return "", false
- }
- return *t.ExtraCol, true
-}
-
-// HasExtraCol returns a boolean if a field has been set.
-func (t *TileDefRequest) HasExtraCol() bool {
- if t != nil && t.ExtraCol != nil {
- return true
- }
-
- return false
-}
-
-// SetExtraCol allocates a new t.ExtraCol and returns the pointer to it.
-func (t *TileDefRequest) SetExtraCol(v string) {
- t.ExtraCol = &v
-}
-
-// GetIncreaseGood returns the IncreaseGood field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetIncreaseGood() bool {
- if t == nil || t.IncreaseGood == nil {
- return false
- }
- return *t.IncreaseGood
-}
-
-// GetIncreaseGoodOk returns a tuple with the IncreaseGood field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetIncreaseGoodOk() (bool, bool) {
- if t == nil || t.IncreaseGood == nil {
- return false, false
- }
- return *t.IncreaseGood, true
-}
-
-// HasIncreaseGood returns a boolean if a field has been set.
-func (t *TileDefRequest) HasIncreaseGood() bool {
- if t != nil && t.IncreaseGood != nil {
- return true
- }
-
- return false
-}
-
-// SetIncreaseGood allocates a new t.IncreaseGood and returns the pointer to it.
-func (t *TileDefRequest) SetIncreaseGood(v bool) {
- t.IncreaseGood = &v
-}
-
-// GetLimit returns the Limit field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetLimit() int {
- if t == nil || t.Limit == nil {
- return 0
- }
- return *t.Limit
-}
-
-// GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetLimitOk() (int, bool) {
- if t == nil || t.Limit == nil {
- return 0, false
- }
- return *t.Limit, true
-}
-
-// HasLimit returns a boolean if a field has been set.
-func (t *TileDefRequest) HasLimit() bool {
- if t != nil && t.Limit != nil {
- return true
- }
-
- return false
-}
-
-// SetLimit allocates a new t.Limit and returns the pointer to it.
-func (t *TileDefRequest) SetLimit(v int) {
- t.Limit = &v
-}
-
-// GetMetric returns the Metric field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetMetric() string {
- if t == nil || t.Metric == nil {
- return ""
- }
- return *t.Metric
-}
-
-// GetMetricOk returns a tuple with the Metric field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetMetricOk() (string, bool) {
- if t == nil || t.Metric == nil {
- return "", false
- }
- return *t.Metric, true
-}
-
-// HasMetric returns a boolean if a field has been set.
-func (t *TileDefRequest) HasMetric() bool {
- if t != nil && t.Metric != nil {
- return true
- }
-
- return false
-}
-
-// SetMetric allocates a new t.Metric and returns the pointer to it.
-func (t *TileDefRequest) SetMetric(v string) {
- t.Metric = &v
-}
-
-// GetOrderBy returns the OrderBy field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetOrderBy() string {
- if t == nil || t.OrderBy == nil {
- return ""
- }
- return *t.OrderBy
-}
-
-// GetOrderByOk returns a tuple with the OrderBy field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetOrderByOk() (string, bool) {
- if t == nil || t.OrderBy == nil {
- return "", false
- }
- return *t.OrderBy, true
-}
-
-// HasOrderBy returns a boolean if a field has been set.
-func (t *TileDefRequest) HasOrderBy() bool {
- if t != nil && t.OrderBy != nil {
- return true
- }
-
- return false
-}
-
-// SetOrderBy allocates a new t.OrderBy and returns the pointer to it.
-func (t *TileDefRequest) SetOrderBy(v string) {
- t.OrderBy = &v
-}
-
-// GetOrderDir returns the OrderDir field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetOrderDir() string {
- if t == nil || t.OrderDir == nil {
- return ""
- }
- return *t.OrderDir
-}
-
-// GetOrderDirOk returns a tuple with the OrderDir field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetOrderDirOk() (string, bool) {
- if t == nil || t.OrderDir == nil {
- return "", false
- }
- return *t.OrderDir, true
-}
-
-// HasOrderDir returns a boolean if a field has been set.
-func (t *TileDefRequest) HasOrderDir() bool {
- if t != nil && t.OrderDir != nil {
- return true
- }
-
- return false
-}
-
-// SetOrderDir allocates a new t.OrderDir and returns the pointer to it.
-func (t *TileDefRequest) SetOrderDir(v string) {
- t.OrderDir = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetQuery() string {
- if t == nil || t.Query == nil {
- return ""
- }
- return *t.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetQueryOk() (string, bool) {
- if t == nil || t.Query == nil {
- return "", false
- }
- return *t.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (t *TileDefRequest) HasQuery() bool {
- if t != nil && t.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new t.Query and returns the pointer to it.
-func (t *TileDefRequest) SetQuery(v string) {
- t.Query = &v
-}
-
-// GetQueryType returns the QueryType field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetQueryType() string {
- if t == nil || t.QueryType == nil {
- return ""
- }
- return *t.QueryType
-}
-
-// GetQueryTypeOk returns a tuple with the QueryType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetQueryTypeOk() (string, bool) {
- if t == nil || t.QueryType == nil {
- return "", false
- }
- return *t.QueryType, true
-}
-
-// HasQueryType returns a boolean if a field has been set.
-func (t *TileDefRequest) HasQueryType() bool {
- if t != nil && t.QueryType != nil {
- return true
- }
-
- return false
-}
-
-// SetQueryType allocates a new t.QueryType and returns the pointer to it.
-func (t *TileDefRequest) SetQueryType(v string) {
- t.QueryType = &v
-}
-
-// GetStyle returns the Style field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetStyle() TileDefRequestStyle {
- if t == nil || t.Style == nil {
- return TileDefRequestStyle{}
- }
- return *t.Style
-}
-
-// GetStyleOk returns a tuple with the Style field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetStyleOk() (TileDefRequestStyle, bool) {
- if t == nil || t.Style == nil {
- return TileDefRequestStyle{}, false
- }
- return *t.Style, true
-}
-
-// HasStyle returns a boolean if a field has been set.
-func (t *TileDefRequest) HasStyle() bool {
- if t != nil && t.Style != nil {
- return true
- }
-
- return false
-}
-
-// SetStyle allocates a new t.Style and returns the pointer to it.
-func (t *TileDefRequest) SetStyle(v TileDefRequestStyle) {
- t.Style = &v
-}
-
-// GetTextFilter returns the TextFilter field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetTextFilter() string {
- if t == nil || t.TextFilter == nil {
- return ""
- }
- return *t.TextFilter
-}
-
-// GetTextFilterOk returns a tuple with the TextFilter field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetTextFilterOk() (string, bool) {
- if t == nil || t.TextFilter == nil {
- return "", false
- }
- return *t.TextFilter, true
-}
-
-// HasTextFilter returns a boolean if a field has been set.
-func (t *TileDefRequest) HasTextFilter() bool {
- if t != nil && t.TextFilter != nil {
- return true
- }
-
- return false
-}
-
-// SetTextFilter allocates a new t.TextFilter and returns the pointer to it.
-func (t *TileDefRequest) SetTextFilter(v string) {
- t.TextFilter = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (t *TileDefRequest) GetType() string {
- if t == nil || t.Type == nil {
- return ""
- }
- return *t.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequest) GetTypeOk() (string, bool) {
- if t == nil || t.Type == nil {
- return "", false
- }
- return *t.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (t *TileDefRequest) HasType() bool {
- if t != nil && t.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new t.Type and returns the pointer to it.
-func (t *TileDefRequest) SetType(v string) {
- t.Type = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (t *TileDefRequestStyle) GetPalette() string {
- if t == nil || t.Palette == nil {
- return ""
- }
- return *t.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequestStyle) GetPaletteOk() (string, bool) {
- if t == nil || t.Palette == nil {
- return "", false
- }
- return *t.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (t *TileDefRequestStyle) HasPalette() bool {
- if t != nil && t.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new t.Palette and returns the pointer to it.
-func (t *TileDefRequestStyle) SetPalette(v string) {
- t.Palette = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (t *TileDefRequestStyle) GetType() string {
- if t == nil || t.Type == nil {
- return ""
- }
- return *t.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequestStyle) GetTypeOk() (string, bool) {
- if t == nil || t.Type == nil {
- return "", false
- }
- return *t.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (t *TileDefRequestStyle) HasType() bool {
- if t != nil && t.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new t.Type and returns the pointer to it.
-func (t *TileDefRequestStyle) SetType(v string) {
- t.Type = &v
-}
-
-// GetWidth returns the Width field if non-nil, zero value otherwise.
-func (t *TileDefRequestStyle) GetWidth() string {
- if t == nil || t.Width == nil {
- return ""
- }
- return *t.Width
-}
-
-// GetWidthOk returns a tuple with the Width field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefRequestStyle) GetWidthOk() (string, bool) {
- if t == nil || t.Width == nil {
- return "", false
- }
- return *t.Width, true
-}
-
-// HasWidth returns a boolean if a field has been set.
-func (t *TileDefRequestStyle) HasWidth() bool {
- if t != nil && t.Width != nil {
- return true
- }
-
- return false
-}
-
-// SetWidth allocates a new t.Width and returns the pointer to it.
-func (t *TileDefRequestStyle) SetWidth(v string) {
- t.Width = &v
-}
-
-// GetFillMax returns the FillMax field if non-nil, zero value otherwise.
-func (t *TileDefStyle) GetFillMax() string {
- if t == nil || t.FillMax == nil {
- return ""
- }
- return *t.FillMax
-}
-
-// GetFillMaxOk returns a tuple with the FillMax field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefStyle) GetFillMaxOk() (string, bool) {
- if t == nil || t.FillMax == nil {
- return "", false
- }
- return *t.FillMax, true
-}
-
-// HasFillMax returns a boolean if a field has been set.
-func (t *TileDefStyle) HasFillMax() bool {
- if t != nil && t.FillMax != nil {
- return true
- }
-
- return false
-}
-
-// SetFillMax allocates a new t.FillMax and returns the pointer to it.
-func (t *TileDefStyle) SetFillMax(v string) {
- t.FillMax = &v
-}
-
-// GetFillMin returns the FillMin field if non-nil, zero value otherwise.
-func (t *TileDefStyle) GetFillMin() string {
- if t == nil || t.FillMin == nil {
- return ""
- }
- return *t.FillMin
-}
-
-// GetFillMinOk returns a tuple with the FillMin field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefStyle) GetFillMinOk() (string, bool) {
- if t == nil || t.FillMin == nil {
- return "", false
- }
- return *t.FillMin, true
-}
-
-// HasFillMin returns a boolean if a field has been set.
-func (t *TileDefStyle) HasFillMin() bool {
- if t != nil && t.FillMin != nil {
- return true
- }
-
- return false
-}
-
-// SetFillMin allocates a new t.FillMin and returns the pointer to it.
-func (t *TileDefStyle) SetFillMin(v string) {
- t.FillMin = &v
-}
-
-// GetPalette returns the Palette field if non-nil, zero value otherwise.
-func (t *TileDefStyle) GetPalette() string {
- if t == nil || t.Palette == nil {
- return ""
- }
- return *t.Palette
-}
-
-// GetPaletteOk returns a tuple with the Palette field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefStyle) GetPaletteOk() (string, bool) {
- if t == nil || t.Palette == nil {
- return "", false
- }
- return *t.Palette, true
-}
-
-// HasPalette returns a boolean if a field has been set.
-func (t *TileDefStyle) HasPalette() bool {
- if t != nil && t.Palette != nil {
- return true
- }
-
- return false
-}
-
-// SetPalette allocates a new t.Palette and returns the pointer to it.
-func (t *TileDefStyle) SetPalette(v string) {
- t.Palette = &v
-}
-
-// GetPaletteFlip returns the PaletteFlip field if non-nil, zero value otherwise.
-func (t *TileDefStyle) GetPaletteFlip() string {
- if t == nil || t.PaletteFlip == nil {
- return ""
- }
- return *t.PaletteFlip
-}
-
-// GetPaletteFlipOk returns a tuple with the PaletteFlip field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TileDefStyle) GetPaletteFlipOk() (string, bool) {
- if t == nil || t.PaletteFlip == nil {
- return "", false
- }
- return *t.PaletteFlip, true
-}
-
-// HasPaletteFlip returns a boolean if a field has been set.
-func (t *TileDefStyle) HasPaletteFlip() bool {
- if t != nil && t.PaletteFlip != nil {
- return true
- }
-
- return false
-}
-
-// SetPaletteFlip allocates a new t.PaletteFlip and returns the pointer to it.
-func (t *TileDefStyle) SetPaletteFlip(v string) {
- t.PaletteFlip = &v
-}
-
-// GetLiveSpan returns the LiveSpan field if non-nil, zero value otherwise.
-func (t *Time) GetLiveSpan() string {
- if t == nil || t.LiveSpan == nil {
- return ""
- }
- return *t.LiveSpan
-}
-
-// GetLiveSpanOk returns a tuple with the LiveSpan field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *Time) GetLiveSpanOk() (string, bool) {
- if t == nil || t.LiveSpan == nil {
- return "", false
- }
- return *t.LiveSpan, true
-}
-
-// HasLiveSpan returns a boolean if a field has been set.
-func (t *Time) HasLiveSpan() bool {
- if t != nil && t.LiveSpan != nil {
- return true
- }
-
- return false
-}
-
-// SetLiveSpan allocates a new t.LiveSpan and returns the pointer to it.
-func (t *Time) SetLiveSpan(v string) {
- t.LiveSpan = &v
-}
-
-// GetFromTs returns the FromTs field if non-nil, zero value otherwise.
-func (t *TriggeringValue) GetFromTs() int {
- if t == nil || t.FromTs == nil {
- return 0
- }
- return *t.FromTs
-}
-
-// GetFromTsOk returns a tuple with the FromTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TriggeringValue) GetFromTsOk() (int, bool) {
- if t == nil || t.FromTs == nil {
- return 0, false
- }
- return *t.FromTs, true
-}
-
-// HasFromTs returns a boolean if a field has been set.
-func (t *TriggeringValue) HasFromTs() bool {
- if t != nil && t.FromTs != nil {
- return true
- }
-
- return false
-}
-
-// SetFromTs allocates a new t.FromTs and returns the pointer to it.
-func (t *TriggeringValue) SetFromTs(v int) {
- t.FromTs = &v
-}
-
-// GetToTs returns the ToTs field if non-nil, zero value otherwise.
-func (t *TriggeringValue) GetToTs() int {
- if t == nil || t.ToTs == nil {
- return 0
- }
- return *t.ToTs
-}
-
-// GetToTsOk returns a tuple with the ToTs field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TriggeringValue) GetToTsOk() (int, bool) {
- if t == nil || t.ToTs == nil {
- return 0, false
- }
- return *t.ToTs, true
-}
-
-// HasToTs returns a boolean if a field has been set.
-func (t *TriggeringValue) HasToTs() bool {
- if t != nil && t.ToTs != nil {
- return true
- }
-
- return false
-}
-
-// SetToTs allocates a new t.ToTs and returns the pointer to it.
-func (t *TriggeringValue) SetToTs(v int) {
- t.ToTs = &v
-}
-
-// GetValue returns the Value field if non-nil, zero value otherwise.
-func (t *TriggeringValue) GetValue() int {
- if t == nil || t.Value == nil {
- return 0
- }
- return *t.Value
-}
-
-// GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (t *TriggeringValue) GetValueOk() (int, bool) {
- if t == nil || t.Value == nil {
- return 0, false
- }
- return *t.Value, true
-}
-
-// HasValue returns a boolean if a field has been set.
-func (t *TriggeringValue) HasValue() bool {
- if t != nil && t.Value != nil {
- return true
- }
-
- return false
-}
-
-// SetValue allocates a new t.Value and returns the pointer to it.
-func (t *TriggeringValue) SetValue(v int) {
- t.Value = &v
-}
-
-// GetAccessRole returns the AccessRole field if non-nil, zero value otherwise.
-func (u *User) GetAccessRole() string {
- if u == nil || u.AccessRole == nil {
- return ""
- }
- return *u.AccessRole
-}
-
-// GetAccessRoleOk returns a tuple with the AccessRole field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetAccessRoleOk() (string, bool) {
- if u == nil || u.AccessRole == nil {
- return "", false
- }
- return *u.AccessRole, true
-}
-
-// HasAccessRole returns a boolean if a field has been set.
-func (u *User) HasAccessRole() bool {
- if u != nil && u.AccessRole != nil {
- return true
- }
-
- return false
-}
-
-// SetAccessRole allocates a new u.AccessRole and returns the pointer to it.
-func (u *User) SetAccessRole(v string) {
- u.AccessRole = &v
-}
-
-// GetDisabled returns the Disabled field if non-nil, zero value otherwise.
-func (u *User) GetDisabled() bool {
- if u == nil || u.Disabled == nil {
- return false
- }
- return *u.Disabled
-}
-
-// GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetDisabledOk() (bool, bool) {
- if u == nil || u.Disabled == nil {
- return false, false
- }
- return *u.Disabled, true
-}
-
-// HasDisabled returns a boolean if a field has been set.
-func (u *User) HasDisabled() bool {
- if u != nil && u.Disabled != nil {
- return true
- }
-
- return false
-}
-
-// SetDisabled allocates a new u.Disabled and returns the pointer to it.
-func (u *User) SetDisabled(v bool) {
- u.Disabled = &v
-}
-
-// GetEmail returns the Email field if non-nil, zero value otherwise.
-func (u *User) GetEmail() string {
- if u == nil || u.Email == nil {
- return ""
- }
- return *u.Email
-}
-
-// GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetEmailOk() (string, bool) {
- if u == nil || u.Email == nil {
- return "", false
- }
- return *u.Email, true
-}
-
-// HasEmail returns a boolean if a field has been set.
-func (u *User) HasEmail() bool {
- if u != nil && u.Email != nil {
- return true
- }
-
- return false
-}
-
-// SetEmail allocates a new u.Email and returns the pointer to it.
-func (u *User) SetEmail(v string) {
- u.Email = &v
-}
-
-// GetHandle returns the Handle field if non-nil, zero value otherwise.
-func (u *User) GetHandle() string {
- if u == nil || u.Handle == nil {
- return ""
- }
- return *u.Handle
-}
-
-// GetHandleOk returns a tuple with the Handle field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetHandleOk() (string, bool) {
- if u == nil || u.Handle == nil {
- return "", false
- }
- return *u.Handle, true
-}
-
-// HasHandle returns a boolean if a field has been set.
-func (u *User) HasHandle() bool {
- if u != nil && u.Handle != nil {
- return true
- }
-
- return false
-}
-
-// SetHandle allocates a new u.Handle and returns the pointer to it.
-func (u *User) SetHandle(v string) {
- u.Handle = &v
-}
-
-// GetIsAdmin returns the IsAdmin field if non-nil, zero value otherwise.
-func (u *User) GetIsAdmin() bool {
- if u == nil || u.IsAdmin == nil {
- return false
- }
- return *u.IsAdmin
-}
-
-// GetIsAdminOk returns a tuple with the IsAdmin field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetIsAdminOk() (bool, bool) {
- if u == nil || u.IsAdmin == nil {
- return false, false
- }
- return *u.IsAdmin, true
-}
-
-// HasIsAdmin returns a boolean if a field has been set.
-func (u *User) HasIsAdmin() bool {
- if u != nil && u.IsAdmin != nil {
- return true
- }
-
- return false
-}
-
-// SetIsAdmin allocates a new u.IsAdmin and returns the pointer to it.
-func (u *User) SetIsAdmin(v bool) {
- u.IsAdmin = &v
-}
-
-// GetName returns the Name field if non-nil, zero value otherwise.
-func (u *User) GetName() string {
- if u == nil || u.Name == nil {
- return ""
- }
- return *u.Name
-}
-
-// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetNameOk() (string, bool) {
- if u == nil || u.Name == nil {
- return "", false
- }
- return *u.Name, true
-}
-
-// HasName returns a boolean if a field has been set.
-func (u *User) HasName() bool {
- if u != nil && u.Name != nil {
- return true
- }
-
- return false
-}
-
-// SetName allocates a new u.Name and returns the pointer to it.
-func (u *User) SetName(v string) {
- u.Name = &v
-}
-
-// GetRole returns the Role field if non-nil, zero value otherwise.
-func (u *User) GetRole() string {
- if u == nil || u.Role == nil {
- return ""
- }
- return *u.Role
-}
-
-// GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetRoleOk() (string, bool) {
- if u == nil || u.Role == nil {
- return "", false
- }
- return *u.Role, true
-}
-
-// HasRole returns a boolean if a field has been set.
-func (u *User) HasRole() bool {
- if u != nil && u.Role != nil {
- return true
- }
-
- return false
-}
-
-// SetRole allocates a new u.Role and returns the pointer to it.
-func (u *User) SetRole(v string) {
- u.Role = &v
-}
-
-// GetVerified returns the Verified field if non-nil, zero value otherwise.
-func (u *User) GetVerified() bool {
- if u == nil || u.Verified == nil {
- return false
- }
- return *u.Verified
-}
-
-// GetVerifiedOk returns a tuple with the Verified field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (u *User) GetVerifiedOk() (bool, bool) {
- if u == nil || u.Verified == nil {
- return false, false
- }
- return *u.Verified, true
-}
-
-// HasVerified returns a boolean if a field has been set.
-func (u *User) HasVerified() bool {
- if u != nil && u.Verified != nil {
- return true
- }
-
- return false
-}
-
-// SetVerified allocates a new u.Verified and returns the pointer to it.
-func (u *User) SetVerified(v bool) {
- u.Verified = &v
-}
-
-// GetAlertID returns the AlertID field if non-nil, zero value otherwise.
-func (w *Widget) GetAlertID() int {
- if w == nil || w.AlertID == nil {
- return 0
- }
- return *w.AlertID
-}
-
-// GetAlertIDOk returns a tuple with the AlertID field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetAlertIDOk() (int, bool) {
- if w == nil || w.AlertID == nil {
- return 0, false
- }
- return *w.AlertID, true
-}
-
-// HasAlertID returns a boolean if a field has been set.
-func (w *Widget) HasAlertID() bool {
- if w != nil && w.AlertID != nil {
- return true
- }
-
- return false
-}
-
-// SetAlertID allocates a new w.AlertID and returns the pointer to it.
-func (w *Widget) SetAlertID(v int) {
- w.AlertID = &v
-}
-
-// GetAutoRefresh returns the AutoRefresh field if non-nil, zero value otherwise.
-func (w *Widget) GetAutoRefresh() bool {
- if w == nil || w.AutoRefresh == nil {
- return false
- }
- return *w.AutoRefresh
-}
-
-// GetAutoRefreshOk returns a tuple with the AutoRefresh field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetAutoRefreshOk() (bool, bool) {
- if w == nil || w.AutoRefresh == nil {
- return false, false
- }
- return *w.AutoRefresh, true
-}
-
-// HasAutoRefresh returns a boolean if a field has been set.
-func (w *Widget) HasAutoRefresh() bool {
- if w != nil && w.AutoRefresh != nil {
- return true
- }
-
- return false
-}
-
-// SetAutoRefresh allocates a new w.AutoRefresh and returns the pointer to it.
-func (w *Widget) SetAutoRefresh(v bool) {
- w.AutoRefresh = &v
-}
-
-// GetBgcolor returns the Bgcolor field if non-nil, zero value otherwise.
-func (w *Widget) GetBgcolor() string {
- if w == nil || w.Bgcolor == nil {
- return ""
- }
- return *w.Bgcolor
-}
-
-// GetBgcolorOk returns a tuple with the Bgcolor field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetBgcolorOk() (string, bool) {
- if w == nil || w.Bgcolor == nil {
- return "", false
- }
- return *w.Bgcolor, true
-}
-
-// HasBgcolor returns a boolean if a field has been set.
-func (w *Widget) HasBgcolor() bool {
- if w != nil && w.Bgcolor != nil {
- return true
- }
-
- return false
-}
-
-// SetBgcolor allocates a new w.Bgcolor and returns the pointer to it.
-func (w *Widget) SetBgcolor(v string) {
- w.Bgcolor = &v
-}
-
-// GetCheck returns the Check field if non-nil, zero value otherwise.
-func (w *Widget) GetCheck() string {
- if w == nil || w.Check == nil {
- return ""
- }
- return *w.Check
-}
-
-// GetCheckOk returns a tuple with the Check field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetCheckOk() (string, bool) {
- if w == nil || w.Check == nil {
- return "", false
- }
- return *w.Check, true
-}
-
-// HasCheck returns a boolean if a field has been set.
-func (w *Widget) HasCheck() bool {
- if w != nil && w.Check != nil {
- return true
- }
-
- return false
-}
-
-// SetCheck allocates a new w.Check and returns the pointer to it.
-func (w *Widget) SetCheck(v string) {
- w.Check = &v
-}
-
-// GetColor returns the Color field if non-nil, zero value otherwise.
-func (w *Widget) GetColor() string {
- if w == nil || w.Color == nil {
- return ""
- }
- return *w.Color
-}
-
-// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetColorOk() (string, bool) {
- if w == nil || w.Color == nil {
- return "", false
- }
- return *w.Color, true
-}
-
-// HasColor returns a boolean if a field has been set.
-func (w *Widget) HasColor() bool {
- if w != nil && w.Color != nil {
- return true
- }
-
- return false
-}
-
-// SetColor allocates a new w.Color and returns the pointer to it.
-func (w *Widget) SetColor(v string) {
- w.Color = &v
-}
-
-// GetColorPreference returns the ColorPreference field if non-nil, zero value otherwise.
-func (w *Widget) GetColorPreference() string {
- if w == nil || w.ColorPreference == nil {
- return ""
- }
- return *w.ColorPreference
-}
-
-// GetColorPreferenceOk returns a tuple with the ColorPreference field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetColorPreferenceOk() (string, bool) {
- if w == nil || w.ColorPreference == nil {
- return "", false
- }
- return *w.ColorPreference, true
-}
-
-// HasColorPreference returns a boolean if a field has been set.
-func (w *Widget) HasColorPreference() bool {
- if w != nil && w.ColorPreference != nil {
- return true
- }
-
- return false
-}
-
-// SetColorPreference allocates a new w.ColorPreference and returns the pointer to it.
-func (w *Widget) SetColorPreference(v string) {
- w.ColorPreference = &v
-}
-
-// GetColumns returns the Columns field if non-nil, zero value otherwise.
-func (w *Widget) GetColumns() string {
- if w == nil || w.Columns == nil {
- return ""
- }
- return *w.Columns
-}
-
-// GetColumnsOk returns a tuple with the Columns field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetColumnsOk() (string, bool) {
- if w == nil || w.Columns == nil {
- return "", false
- }
- return *w.Columns, true
-}
-
-// HasColumns returns a boolean if a field has been set.
-func (w *Widget) HasColumns() bool {
- if w != nil && w.Columns != nil {
- return true
- }
-
- return false
-}
-
-// SetColumns allocates a new w.Columns and returns the pointer to it.
-func (w *Widget) SetColumns(v string) {
- w.Columns = &v
-}
-
-// GetDisplayFormat returns the DisplayFormat field if non-nil, zero value otherwise.
-func (w *Widget) GetDisplayFormat() string {
- if w == nil || w.DisplayFormat == nil {
- return ""
- }
- return *w.DisplayFormat
-}
-
-// GetDisplayFormatOk returns a tuple with the DisplayFormat field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetDisplayFormatOk() (string, bool) {
- if w == nil || w.DisplayFormat == nil {
- return "", false
- }
- return *w.DisplayFormat, true
-}
-
-// HasDisplayFormat returns a boolean if a field has been set.
-func (w *Widget) HasDisplayFormat() bool {
- if w != nil && w.DisplayFormat != nil {
- return true
- }
-
- return false
-}
-
-// SetDisplayFormat allocates a new w.DisplayFormat and returns the pointer to it.
-func (w *Widget) SetDisplayFormat(v string) {
- w.DisplayFormat = &v
-}
-
-// GetEnv returns the Env field if non-nil, zero value otherwise.
-func (w *Widget) GetEnv() string {
- if w == nil || w.Env == nil {
- return ""
- }
- return *w.Env
-}
-
-// GetEnvOk returns a tuple with the Env field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetEnvOk() (string, bool) {
- if w == nil || w.Env == nil {
- return "", false
- }
- return *w.Env, true
-}
-
-// HasEnv returns a boolean if a field has been set.
-func (w *Widget) HasEnv() bool {
- if w != nil && w.Env != nil {
- return true
- }
-
- return false
-}
-
-// SetEnv allocates a new w.Env and returns the pointer to it.
-func (w *Widget) SetEnv(v string) {
- w.Env = &v
-}
-
-// GetEventSize returns the EventSize field if non-nil, zero value otherwise.
-func (w *Widget) GetEventSize() string {
- if w == nil || w.EventSize == nil {
- return ""
- }
- return *w.EventSize
-}
-
-// GetEventSizeOk returns a tuple with the EventSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetEventSizeOk() (string, bool) {
- if w == nil || w.EventSize == nil {
- return "", false
- }
- return *w.EventSize, true
-}
-
-// HasEventSize returns a boolean if a field has been set.
-func (w *Widget) HasEventSize() bool {
- if w != nil && w.EventSize != nil {
- return true
- }
-
- return false
-}
-
-// SetEventSize allocates a new w.EventSize and returns the pointer to it.
-func (w *Widget) SetEventSize(v string) {
- w.EventSize = &v
-}
-
-// GetFontSize returns the FontSize field if non-nil, zero value otherwise.
-func (w *Widget) GetFontSize() string {
- if w == nil || w.FontSize == nil {
- return ""
- }
- return *w.FontSize
-}
-
-// GetFontSizeOk returns a tuple with the FontSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetFontSizeOk() (string, bool) {
- if w == nil || w.FontSize == nil {
- return "", false
- }
- return *w.FontSize, true
-}
-
-// HasFontSize returns a boolean if a field has been set.
-func (w *Widget) HasFontSize() bool {
- if w != nil && w.FontSize != nil {
- return true
- }
-
- return false
-}
-
-// SetFontSize allocates a new w.FontSize and returns the pointer to it.
-func (w *Widget) SetFontSize(v string) {
- w.FontSize = &v
-}
-
-// GetGroup returns the Group field if non-nil, zero value otherwise.
-func (w *Widget) GetGroup() string {
- if w == nil || w.Group == nil {
- return ""
- }
- return *w.Group
-}
-
-// GetGroupOk returns a tuple with the Group field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetGroupOk() (string, bool) {
- if w == nil || w.Group == nil {
- return "", false
- }
- return *w.Group, true
-}
-
-// HasGroup returns a boolean if a field has been set.
-func (w *Widget) HasGroup() bool {
- if w != nil && w.Group != nil {
- return true
- }
-
- return false
-}
-
-// SetGroup allocates a new w.Group and returns the pointer to it.
-func (w *Widget) SetGroup(v string) {
- w.Group = &v
-}
-
-// GetGrouping returns the Grouping field if non-nil, zero value otherwise.
-func (w *Widget) GetGrouping() string {
- if w == nil || w.Grouping == nil {
- return ""
- }
- return *w.Grouping
-}
-
-// GetGroupingOk returns a tuple with the Grouping field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetGroupingOk() (string, bool) {
- if w == nil || w.Grouping == nil {
- return "", false
- }
- return *w.Grouping, true
-}
-
-// HasGrouping returns a boolean if a field has been set.
-func (w *Widget) HasGrouping() bool {
- if w != nil && w.Grouping != nil {
- return true
- }
-
- return false
-}
-
-// SetGrouping allocates a new w.Grouping and returns the pointer to it.
-func (w *Widget) SetGrouping(v string) {
- w.Grouping = &v
-}
-
-// GetHeight returns the Height field if non-nil, zero value otherwise.
-func (w *Widget) GetHeight() int {
- if w == nil || w.Height == nil {
- return 0
- }
- return *w.Height
-}
-
-// GetHeightOk returns a tuple with the Height field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetHeightOk() (int, bool) {
- if w == nil || w.Height == nil {
- return 0, false
- }
- return *w.Height, true
-}
-
-// HasHeight returns a boolean if a field has been set.
-func (w *Widget) HasHeight() bool {
- if w != nil && w.Height != nil {
- return true
- }
-
- return false
-}
-
-// SetHeight allocates a new w.Height and returns the pointer to it.
-func (w *Widget) SetHeight(v int) {
- w.Height = &v
-}
-
-// GetHideZeroCounts returns the HideZeroCounts field if non-nil, zero value otherwise.
-func (w *Widget) GetHideZeroCounts() bool {
- if w == nil || w.HideZeroCounts == nil {
- return false
- }
- return *w.HideZeroCounts
-}
-
-// GetHideZeroCountsOk returns a tuple with the HideZeroCounts field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetHideZeroCountsOk() (bool, bool) {
- if w == nil || w.HideZeroCounts == nil {
- return false, false
- }
- return *w.HideZeroCounts, true
-}
-
-// HasHideZeroCounts returns a boolean if a field has been set.
-func (w *Widget) HasHideZeroCounts() bool {
- if w != nil && w.HideZeroCounts != nil {
- return true
- }
-
- return false
-}
-
-// SetHideZeroCounts allocates a new w.HideZeroCounts and returns the pointer to it.
-func (w *Widget) SetHideZeroCounts(v bool) {
- w.HideZeroCounts = &v
-}
-
-// GetHTML returns the HTML field if non-nil, zero value otherwise.
-func (w *Widget) GetHTML() string {
- if w == nil || w.HTML == nil {
- return ""
- }
- return *w.HTML
-}
-
-// GetHTMLOk returns a tuple with the HTML field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetHTMLOk() (string, bool) {
- if w == nil || w.HTML == nil {
- return "", false
- }
- return *w.HTML, true
-}
-
-// HasHTML returns a boolean if a field has been set.
-func (w *Widget) HasHTML() bool {
- if w != nil && w.HTML != nil {
- return true
- }
-
- return false
-}
-
-// SetHTML allocates a new w.HTML and returns the pointer to it.
-func (w *Widget) SetHTML(v string) {
- w.HTML = &v
-}
-
-// GetLayoutVersion returns the LayoutVersion field if non-nil, zero value otherwise.
-func (w *Widget) GetLayoutVersion() string {
- if w == nil || w.LayoutVersion == nil {
- return ""
- }
- return *w.LayoutVersion
-}
-
-// GetLayoutVersionOk returns a tuple with the LayoutVersion field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetLayoutVersionOk() (string, bool) {
- if w == nil || w.LayoutVersion == nil {
- return "", false
- }
- return *w.LayoutVersion, true
-}
-
-// HasLayoutVersion returns a boolean if a field has been set.
-func (w *Widget) HasLayoutVersion() bool {
- if w != nil && w.LayoutVersion != nil {
- return true
- }
-
- return false
-}
-
-// SetLayoutVersion allocates a new w.LayoutVersion and returns the pointer to it.
-func (w *Widget) SetLayoutVersion(v string) {
- w.LayoutVersion = &v
-}
-
-// GetLegend returns the Legend field if non-nil, zero value otherwise.
-func (w *Widget) GetLegend() bool {
- if w == nil || w.Legend == nil {
- return false
- }
- return *w.Legend
-}
-
-// GetLegendOk returns a tuple with the Legend field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetLegendOk() (bool, bool) {
- if w == nil || w.Legend == nil {
- return false, false
- }
- return *w.Legend, true
-}
-
-// HasLegend returns a boolean if a field has been set.
-func (w *Widget) HasLegend() bool {
- if w != nil && w.Legend != nil {
- return true
- }
-
- return false
-}
-
-// SetLegend allocates a new w.Legend and returns the pointer to it.
-func (w *Widget) SetLegend(v bool) {
- w.Legend = &v
-}
-
-// GetLegendSize returns the LegendSize field if non-nil, zero value otherwise.
-func (w *Widget) GetLegendSize() string {
- if w == nil || w.LegendSize == nil {
- return ""
- }
- return *w.LegendSize
-}
-
-// GetLegendSizeOk returns a tuple with the LegendSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetLegendSizeOk() (string, bool) {
- if w == nil || w.LegendSize == nil {
- return "", false
- }
- return *w.LegendSize, true
-}
-
-// HasLegendSize returns a boolean if a field has been set.
-func (w *Widget) HasLegendSize() bool {
- if w != nil && w.LegendSize != nil {
- return true
- }
-
- return false
-}
-
-// SetLegendSize allocates a new w.LegendSize and returns the pointer to it.
-func (w *Widget) SetLegendSize(v string) {
- w.LegendSize = &v
-}
-
-// GetLogset returns the Logset field if non-nil, zero value otherwise.
-func (w *Widget) GetLogset() string {
- if w == nil || w.Logset == nil {
- return ""
- }
- return *w.Logset
-}
-
-// GetLogsetOk returns a tuple with the Logset field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetLogsetOk() (string, bool) {
- if w == nil || w.Logset == nil {
- return "", false
- }
- return *w.Logset, true
-}
-
-// HasLogset returns a boolean if a field has been set.
-func (w *Widget) HasLogset() bool {
- if w != nil && w.Logset != nil {
- return true
- }
-
- return false
-}
-
-// SetLogset allocates a new w.Logset and returns the pointer to it.
-func (w *Widget) SetLogset(v string) {
- w.Logset = &v
-}
-
-// GetManageStatusShowTitle returns the ManageStatusShowTitle field if non-nil, zero value otherwise.
-func (w *Widget) GetManageStatusShowTitle() bool {
- if w == nil || w.ManageStatusShowTitle == nil {
- return false
- }
- return *w.ManageStatusShowTitle
-}
-
-// GetManageStatusShowTitleOk returns a tuple with the ManageStatusShowTitle field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetManageStatusShowTitleOk() (bool, bool) {
- if w == nil || w.ManageStatusShowTitle == nil {
- return false, false
- }
- return *w.ManageStatusShowTitle, true
-}
-
-// HasManageStatusShowTitle returns a boolean if a field has been set.
-func (w *Widget) HasManageStatusShowTitle() bool {
- if w != nil && w.ManageStatusShowTitle != nil {
- return true
- }
-
- return false
-}
-
-// SetManageStatusShowTitle allocates a new w.ManageStatusShowTitle and returns the pointer to it.
-func (w *Widget) SetManageStatusShowTitle(v bool) {
- w.ManageStatusShowTitle = &v
-}
-
-// GetManageStatusTitleAlign returns the ManageStatusTitleAlign field if non-nil, zero value otherwise.
-func (w *Widget) GetManageStatusTitleAlign() string {
- if w == nil || w.ManageStatusTitleAlign == nil {
- return ""
- }
- return *w.ManageStatusTitleAlign
-}
-
-// GetManageStatusTitleAlignOk returns a tuple with the ManageStatusTitleAlign field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetManageStatusTitleAlignOk() (string, bool) {
- if w == nil || w.ManageStatusTitleAlign == nil {
- return "", false
- }
- return *w.ManageStatusTitleAlign, true
-}
-
-// HasManageStatusTitleAlign returns a boolean if a field has been set.
-func (w *Widget) HasManageStatusTitleAlign() bool {
- if w != nil && w.ManageStatusTitleAlign != nil {
- return true
- }
-
- return false
-}
-
-// SetManageStatusTitleAlign allocates a new w.ManageStatusTitleAlign and returns the pointer to it.
-func (w *Widget) SetManageStatusTitleAlign(v string) {
- w.ManageStatusTitleAlign = &v
-}
-
-// GetManageStatusTitleSize returns the ManageStatusTitleSize field if non-nil, zero value otherwise.
-func (w *Widget) GetManageStatusTitleSize() string {
- if w == nil || w.ManageStatusTitleSize == nil {
- return ""
- }
- return *w.ManageStatusTitleSize
-}
-
-// GetManageStatusTitleSizeOk returns a tuple with the ManageStatusTitleSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetManageStatusTitleSizeOk() (string, bool) {
- if w == nil || w.ManageStatusTitleSize == nil {
- return "", false
- }
- return *w.ManageStatusTitleSize, true
-}
-
-// HasManageStatusTitleSize returns a boolean if a field has been set.
-func (w *Widget) HasManageStatusTitleSize() bool {
- if w != nil && w.ManageStatusTitleSize != nil {
- return true
- }
-
- return false
-}
-
-// SetManageStatusTitleSize allocates a new w.ManageStatusTitleSize and returns the pointer to it.
-func (w *Widget) SetManageStatusTitleSize(v string) {
- w.ManageStatusTitleSize = &v
-}
-
-// GetManageStatusTitleText returns the ManageStatusTitleText field if non-nil, zero value otherwise.
-func (w *Widget) GetManageStatusTitleText() string {
- if w == nil || w.ManageStatusTitleText == nil {
- return ""
- }
- return *w.ManageStatusTitleText
-}
-
-// GetManageStatusTitleTextOk returns a tuple with the ManageStatusTitleText field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetManageStatusTitleTextOk() (string, bool) {
- if w == nil || w.ManageStatusTitleText == nil {
- return "", false
- }
- return *w.ManageStatusTitleText, true
-}
-
-// HasManageStatusTitleText returns a boolean if a field has been set.
-func (w *Widget) HasManageStatusTitleText() bool {
- if w != nil && w.ManageStatusTitleText != nil {
- return true
- }
-
- return false
-}
-
-// SetManageStatusTitleText allocates a new w.ManageStatusTitleText and returns the pointer to it.
-func (w *Widget) SetManageStatusTitleText(v string) {
- w.ManageStatusTitleText = &v
-}
-
-// GetMargin returns the Margin field if non-nil, zero value otherwise.
-func (w *Widget) GetMargin() string {
- if w == nil || w.Margin == nil {
- return ""
- }
- return *w.Margin
-}
-
-// GetMarginOk returns a tuple with the Margin field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMarginOk() (string, bool) {
- if w == nil || w.Margin == nil {
- return "", false
- }
- return *w.Margin, true
-}
-
-// HasMargin returns a boolean if a field has been set.
-func (w *Widget) HasMargin() bool {
- if w != nil && w.Margin != nil {
- return true
- }
-
- return false
-}
-
-// SetMargin allocates a new w.Margin and returns the pointer to it.
-func (w *Widget) SetMargin(v string) {
- w.Margin = &v
-}
-
-// GetMonitor returns the Monitor field if non-nil, zero value otherwise.
-func (w *Widget) GetMonitor() ScreenboardMonitor {
- if w == nil || w.Monitor == nil {
- return ScreenboardMonitor{}
- }
- return *w.Monitor
-}
-
-// GetMonitorOk returns a tuple with the Monitor field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMonitorOk() (ScreenboardMonitor, bool) {
- if w == nil || w.Monitor == nil {
- return ScreenboardMonitor{}, false
- }
- return *w.Monitor, true
-}
-
-// HasMonitor returns a boolean if a field has been set.
-func (w *Widget) HasMonitor() bool {
- if w != nil && w.Monitor != nil {
- return true
- }
-
- return false
-}
-
-// SetMonitor allocates a new w.Monitor and returns the pointer to it.
-func (w *Widget) SetMonitor(v ScreenboardMonitor) {
- w.Monitor = &v
-}
-
-// GetMustShowBreakdown returns the MustShowBreakdown field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowBreakdown() bool {
- if w == nil || w.MustShowBreakdown == nil {
- return false
- }
- return *w.MustShowBreakdown
-}
-
-// GetMustShowBreakdownOk returns a tuple with the MustShowBreakdown field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowBreakdownOk() (bool, bool) {
- if w == nil || w.MustShowBreakdown == nil {
- return false, false
- }
- return *w.MustShowBreakdown, true
-}
-
-// HasMustShowBreakdown returns a boolean if a field has been set.
-func (w *Widget) HasMustShowBreakdown() bool {
- if w != nil && w.MustShowBreakdown != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowBreakdown allocates a new w.MustShowBreakdown and returns the pointer to it.
-func (w *Widget) SetMustShowBreakdown(v bool) {
- w.MustShowBreakdown = &v
-}
-
-// GetMustShowDistribution returns the MustShowDistribution field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowDistribution() bool {
- if w == nil || w.MustShowDistribution == nil {
- return false
- }
- return *w.MustShowDistribution
-}
-
-// GetMustShowDistributionOk returns a tuple with the MustShowDistribution field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowDistributionOk() (bool, bool) {
- if w == nil || w.MustShowDistribution == nil {
- return false, false
- }
- return *w.MustShowDistribution, true
-}
-
-// HasMustShowDistribution returns a boolean if a field has been set.
-func (w *Widget) HasMustShowDistribution() bool {
- if w != nil && w.MustShowDistribution != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowDistribution allocates a new w.MustShowDistribution and returns the pointer to it.
-func (w *Widget) SetMustShowDistribution(v bool) {
- w.MustShowDistribution = &v
-}
-
-// GetMustShowErrors returns the MustShowErrors field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowErrors() bool {
- if w == nil || w.MustShowErrors == nil {
- return false
- }
- return *w.MustShowErrors
-}
-
-// GetMustShowErrorsOk returns a tuple with the MustShowErrors field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowErrorsOk() (bool, bool) {
- if w == nil || w.MustShowErrors == nil {
- return false, false
- }
- return *w.MustShowErrors, true
-}
-
-// HasMustShowErrors returns a boolean if a field has been set.
-func (w *Widget) HasMustShowErrors() bool {
- if w != nil && w.MustShowErrors != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowErrors allocates a new w.MustShowErrors and returns the pointer to it.
-func (w *Widget) SetMustShowErrors(v bool) {
- w.MustShowErrors = &v
-}
-
-// GetMustShowHits returns the MustShowHits field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowHits() bool {
- if w == nil || w.MustShowHits == nil {
- return false
- }
- return *w.MustShowHits
-}
-
-// GetMustShowHitsOk returns a tuple with the MustShowHits field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowHitsOk() (bool, bool) {
- if w == nil || w.MustShowHits == nil {
- return false, false
- }
- return *w.MustShowHits, true
-}
-
-// HasMustShowHits returns a boolean if a field has been set.
-func (w *Widget) HasMustShowHits() bool {
- if w != nil && w.MustShowHits != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowHits allocates a new w.MustShowHits and returns the pointer to it.
-func (w *Widget) SetMustShowHits(v bool) {
- w.MustShowHits = &v
-}
-
-// GetMustShowLatency returns the MustShowLatency field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowLatency() bool {
- if w == nil || w.MustShowLatency == nil {
- return false
- }
- return *w.MustShowLatency
-}
-
-// GetMustShowLatencyOk returns a tuple with the MustShowLatency field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowLatencyOk() (bool, bool) {
- if w == nil || w.MustShowLatency == nil {
- return false, false
- }
- return *w.MustShowLatency, true
-}
-
-// HasMustShowLatency returns a boolean if a field has been set.
-func (w *Widget) HasMustShowLatency() bool {
- if w != nil && w.MustShowLatency != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowLatency allocates a new w.MustShowLatency and returns the pointer to it.
-func (w *Widget) SetMustShowLatency(v bool) {
- w.MustShowLatency = &v
-}
-
-// GetMustShowResourceList returns the MustShowResourceList field if non-nil, zero value otherwise.
-func (w *Widget) GetMustShowResourceList() bool {
- if w == nil || w.MustShowResourceList == nil {
- return false
- }
- return *w.MustShowResourceList
-}
-
-// GetMustShowResourceListOk returns a tuple with the MustShowResourceList field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetMustShowResourceListOk() (bool, bool) {
- if w == nil || w.MustShowResourceList == nil {
- return false, false
- }
- return *w.MustShowResourceList, true
-}
-
-// HasMustShowResourceList returns a boolean if a field has been set.
-func (w *Widget) HasMustShowResourceList() bool {
- if w != nil && w.MustShowResourceList != nil {
- return true
- }
-
- return false
-}
-
-// SetMustShowResourceList allocates a new w.MustShowResourceList and returns the pointer to it.
-func (w *Widget) SetMustShowResourceList(v bool) {
- w.MustShowResourceList = &v
-}
-
-// GetParams returns the Params field if non-nil, zero value otherwise.
-func (w *Widget) GetParams() Params {
- if w == nil || w.Params == nil {
- return Params{}
- }
- return *w.Params
-}
-
-// GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetParamsOk() (Params, bool) {
- if w == nil || w.Params == nil {
- return Params{}, false
- }
- return *w.Params, true
-}
-
-// HasParams returns a boolean if a field has been set.
-func (w *Widget) HasParams() bool {
- if w != nil && w.Params != nil {
- return true
- }
-
- return false
-}
-
-// SetParams allocates a new w.Params and returns the pointer to it.
-func (w *Widget) SetParams(v Params) {
- w.Params = &v
-}
-
-// GetPrecision returns the Precision field if non-nil, zero value otherwise.
-func (w *Widget) GetPrecision() string {
- if w == nil || w.Precision == nil {
- return ""
- }
- return *w.Precision
-}
-
-// GetPrecisionOk returns a tuple with the Precision field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetPrecisionOk() (string, bool) {
- if w == nil || w.Precision == nil {
- return "", false
- }
- return *w.Precision, true
-}
-
-// HasPrecision returns a boolean if a field has been set.
-func (w *Widget) HasPrecision() bool {
- if w != nil && w.Precision != nil {
- return true
- }
-
- return false
-}
-
-// SetPrecision allocates a new w.Precision and returns the pointer to it.
-func (w *Widget) SetPrecision(v string) {
- w.Precision = &v
-}
-
-// GetQuery returns the Query field if non-nil, zero value otherwise.
-func (w *Widget) GetQuery() string {
- if w == nil || w.Query == nil {
- return ""
- }
- return *w.Query
-}
-
-// GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetQueryOk() (string, bool) {
- if w == nil || w.Query == nil {
- return "", false
- }
- return *w.Query, true
-}
-
-// HasQuery returns a boolean if a field has been set.
-func (w *Widget) HasQuery() bool {
- if w != nil && w.Query != nil {
- return true
- }
-
- return false
-}
-
-// SetQuery allocates a new w.Query and returns the pointer to it.
-func (w *Widget) SetQuery(v string) {
- w.Query = &v
-}
-
-// GetServiceName returns the ServiceName field if non-nil, zero value otherwise.
-func (w *Widget) GetServiceName() string {
- if w == nil || w.ServiceName == nil {
- return ""
- }
- return *w.ServiceName
-}
-
-// GetServiceNameOk returns a tuple with the ServiceName field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetServiceNameOk() (string, bool) {
- if w == nil || w.ServiceName == nil {
- return "", false
- }
- return *w.ServiceName, true
-}
-
-// HasServiceName returns a boolean if a field has been set.
-func (w *Widget) HasServiceName() bool {
- if w != nil && w.ServiceName != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceName allocates a new w.ServiceName and returns the pointer to it.
-func (w *Widget) SetServiceName(v string) {
- w.ServiceName = &v
-}
-
-// GetServiceService returns the ServiceService field if non-nil, zero value otherwise.
-func (w *Widget) GetServiceService() string {
- if w == nil || w.ServiceService == nil {
- return ""
- }
- return *w.ServiceService
-}
-
-// GetServiceServiceOk returns a tuple with the ServiceService field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetServiceServiceOk() (string, bool) {
- if w == nil || w.ServiceService == nil {
- return "", false
- }
- return *w.ServiceService, true
-}
-
-// HasServiceService returns a boolean if a field has been set.
-func (w *Widget) HasServiceService() bool {
- if w != nil && w.ServiceService != nil {
- return true
- }
-
- return false
-}
-
-// SetServiceService allocates a new w.ServiceService and returns the pointer to it.
-func (w *Widget) SetServiceService(v string) {
- w.ServiceService = &v
-}
-
-// GetSizeVersion returns the SizeVersion field if non-nil, zero value otherwise.
-func (w *Widget) GetSizeVersion() string {
- if w == nil || w.SizeVersion == nil {
- return ""
- }
- return *w.SizeVersion
-}
-
-// GetSizeVersionOk returns a tuple with the SizeVersion field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetSizeVersionOk() (string, bool) {
- if w == nil || w.SizeVersion == nil {
- return "", false
- }
- return *w.SizeVersion, true
-}
-
-// HasSizeVersion returns a boolean if a field has been set.
-func (w *Widget) HasSizeVersion() bool {
- if w != nil && w.SizeVersion != nil {
- return true
- }
-
- return false
-}
-
-// SetSizeVersion allocates a new w.SizeVersion and returns the pointer to it.
-func (w *Widget) SetSizeVersion(v string) {
- w.SizeVersion = &v
-}
-
-// GetSizing returns the Sizing field if non-nil, zero value otherwise.
-func (w *Widget) GetSizing() string {
- if w == nil || w.Sizing == nil {
- return ""
- }
- return *w.Sizing
-}
-
-// GetSizingOk returns a tuple with the Sizing field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetSizingOk() (string, bool) {
- if w == nil || w.Sizing == nil {
- return "", false
- }
- return *w.Sizing, true
-}
-
-// HasSizing returns a boolean if a field has been set.
-func (w *Widget) HasSizing() bool {
- if w != nil && w.Sizing != nil {
- return true
- }
-
- return false
-}
-
-// SetSizing allocates a new w.Sizing and returns the pointer to it.
-func (w *Widget) SetSizing(v string) {
- w.Sizing = &v
-}
-
-// GetText returns the Text field if non-nil, zero value otherwise.
-func (w *Widget) GetText() string {
- if w == nil || w.Text == nil {
- return ""
- }
- return *w.Text
-}
-
-// GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTextOk() (string, bool) {
- if w == nil || w.Text == nil {
- return "", false
- }
- return *w.Text, true
-}
-
-// HasText returns a boolean if a field has been set.
-func (w *Widget) HasText() bool {
- if w != nil && w.Text != nil {
- return true
- }
-
- return false
-}
-
-// SetText allocates a new w.Text and returns the pointer to it.
-func (w *Widget) SetText(v string) {
- w.Text = &v
-}
-
-// GetTextAlign returns the TextAlign field if non-nil, zero value otherwise.
-func (w *Widget) GetTextAlign() string {
- if w == nil || w.TextAlign == nil {
- return ""
- }
- return *w.TextAlign
-}
-
-// GetTextAlignOk returns a tuple with the TextAlign field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTextAlignOk() (string, bool) {
- if w == nil || w.TextAlign == nil {
- return "", false
- }
- return *w.TextAlign, true
-}
-
-// HasTextAlign returns a boolean if a field has been set.
-func (w *Widget) HasTextAlign() bool {
- if w != nil && w.TextAlign != nil {
- return true
- }
-
- return false
-}
-
-// SetTextAlign allocates a new w.TextAlign and returns the pointer to it.
-func (w *Widget) SetTextAlign(v string) {
- w.TextAlign = &v
-}
-
-// GetTextSize returns the TextSize field if non-nil, zero value otherwise.
-func (w *Widget) GetTextSize() string {
- if w == nil || w.TextSize == nil {
- return ""
- }
- return *w.TextSize
-}
-
-// GetTextSizeOk returns a tuple with the TextSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTextSizeOk() (string, bool) {
- if w == nil || w.TextSize == nil {
- return "", false
- }
- return *w.TextSize, true
-}
-
-// HasTextSize returns a boolean if a field has been set.
-func (w *Widget) HasTextSize() bool {
- if w != nil && w.TextSize != nil {
- return true
- }
-
- return false
-}
-
-// SetTextSize allocates a new w.TextSize and returns the pointer to it.
-func (w *Widget) SetTextSize(v string) {
- w.TextSize = &v
-}
-
-// GetTick returns the Tick field if non-nil, zero value otherwise.
-func (w *Widget) GetTick() bool {
- if w == nil || w.Tick == nil {
- return false
- }
- return *w.Tick
-}
-
-// GetTickOk returns a tuple with the Tick field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTickOk() (bool, bool) {
- if w == nil || w.Tick == nil {
- return false, false
- }
- return *w.Tick, true
-}
-
-// HasTick returns a boolean if a field has been set.
-func (w *Widget) HasTick() bool {
- if w != nil && w.Tick != nil {
- return true
- }
-
- return false
-}
-
-// SetTick allocates a new w.Tick and returns the pointer to it.
-func (w *Widget) SetTick(v bool) {
- w.Tick = &v
-}
-
-// GetTickEdge returns the TickEdge field if non-nil, zero value otherwise.
-func (w *Widget) GetTickEdge() string {
- if w == nil || w.TickEdge == nil {
- return ""
- }
- return *w.TickEdge
-}
-
-// GetTickEdgeOk returns a tuple with the TickEdge field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTickEdgeOk() (string, bool) {
- if w == nil || w.TickEdge == nil {
- return "", false
- }
- return *w.TickEdge, true
-}
-
-// HasTickEdge returns a boolean if a field has been set.
-func (w *Widget) HasTickEdge() bool {
- if w != nil && w.TickEdge != nil {
- return true
- }
-
- return false
-}
-
-// SetTickEdge allocates a new w.TickEdge and returns the pointer to it.
-func (w *Widget) SetTickEdge(v string) {
- w.TickEdge = &v
-}
-
-// GetTickPos returns the TickPos field if non-nil, zero value otherwise.
-func (w *Widget) GetTickPos() string {
- if w == nil || w.TickPos == nil {
- return ""
- }
- return *w.TickPos
-}
-
-// GetTickPosOk returns a tuple with the TickPos field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTickPosOk() (string, bool) {
- if w == nil || w.TickPos == nil {
- return "", false
- }
- return *w.TickPos, true
-}
-
-// HasTickPos returns a boolean if a field has been set.
-func (w *Widget) HasTickPos() bool {
- if w != nil && w.TickPos != nil {
- return true
- }
-
- return false
-}
-
-// SetTickPos allocates a new w.TickPos and returns the pointer to it.
-func (w *Widget) SetTickPos(v string) {
- w.TickPos = &v
-}
-
-// GetTileDef returns the TileDef field if non-nil, zero value otherwise.
-func (w *Widget) GetTileDef() TileDef {
- if w == nil || w.TileDef == nil {
- return TileDef{}
- }
- return *w.TileDef
-}
-
-// GetTileDefOk returns a tuple with the TileDef field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTileDefOk() (TileDef, bool) {
- if w == nil || w.TileDef == nil {
- return TileDef{}, false
- }
- return *w.TileDef, true
-}
-
-// HasTileDef returns a boolean if a field has been set.
-func (w *Widget) HasTileDef() bool {
- if w != nil && w.TileDef != nil {
- return true
- }
-
- return false
-}
-
-// SetTileDef allocates a new w.TileDef and returns the pointer to it.
-func (w *Widget) SetTileDef(v TileDef) {
- w.TileDef = &v
-}
-
-// GetTime returns the Time field if non-nil, zero value otherwise.
-func (w *Widget) GetTime() Time {
- if w == nil || w.Time == nil {
- return Time{}
- }
- return *w.Time
-}
-
-// GetTimeOk returns a tuple with the Time field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTimeOk() (Time, bool) {
- if w == nil || w.Time == nil {
- return Time{}, false
- }
- return *w.Time, true
-}
-
-// HasTime returns a boolean if a field has been set.
-func (w *Widget) HasTime() bool {
- if w != nil && w.Time != nil {
- return true
- }
-
- return false
-}
-
-// SetTime allocates a new w.Time and returns the pointer to it.
-func (w *Widget) SetTime(v Time) {
- w.Time = &v
-}
-
-// GetTitle returns the Title field if non-nil, zero value otherwise.
-func (w *Widget) GetTitle() bool {
- if w == nil || w.Title == nil {
- return false
- }
- return *w.Title
-}
-
-// GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTitleOk() (bool, bool) {
- if w == nil || w.Title == nil {
- return false, false
- }
- return *w.Title, true
-}
-
-// HasTitle returns a boolean if a field has been set.
-func (w *Widget) HasTitle() bool {
- if w != nil && w.Title != nil {
- return true
- }
-
- return false
-}
-
-// SetTitle allocates a new w.Title and returns the pointer to it.
-func (w *Widget) SetTitle(v bool) {
- w.Title = &v
-}
-
-// GetTitleAlign returns the TitleAlign field if non-nil, zero value otherwise.
-func (w *Widget) GetTitleAlign() string {
- if w == nil || w.TitleAlign == nil {
- return ""
- }
- return *w.TitleAlign
-}
-
-// GetTitleAlignOk returns a tuple with the TitleAlign field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTitleAlignOk() (string, bool) {
- if w == nil || w.TitleAlign == nil {
- return "", false
- }
- return *w.TitleAlign, true
-}
-
-// HasTitleAlign returns a boolean if a field has been set.
-func (w *Widget) HasTitleAlign() bool {
- if w != nil && w.TitleAlign != nil {
- return true
- }
-
- return false
-}
-
-// SetTitleAlign allocates a new w.TitleAlign and returns the pointer to it.
-func (w *Widget) SetTitleAlign(v string) {
- w.TitleAlign = &v
-}
-
-// GetTitleSize returns the TitleSize field if non-nil, zero value otherwise.
-func (w *Widget) GetTitleSize() int {
- if w == nil || w.TitleSize == nil {
- return 0
- }
- return *w.TitleSize
-}
-
-// GetTitleSizeOk returns a tuple with the TitleSize field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTitleSizeOk() (int, bool) {
- if w == nil || w.TitleSize == nil {
- return 0, false
- }
- return *w.TitleSize, true
-}
-
-// HasTitleSize returns a boolean if a field has been set.
-func (w *Widget) HasTitleSize() bool {
- if w != nil && w.TitleSize != nil {
- return true
- }
-
- return false
-}
-
-// SetTitleSize allocates a new w.TitleSize and returns the pointer to it.
-func (w *Widget) SetTitleSize(v int) {
- w.TitleSize = &v
-}
-
-// GetTitleText returns the TitleText field if non-nil, zero value otherwise.
-func (w *Widget) GetTitleText() string {
- if w == nil || w.TitleText == nil {
- return ""
- }
- return *w.TitleText
-}
-
-// GetTitleTextOk returns a tuple with the TitleText field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTitleTextOk() (string, bool) {
- if w == nil || w.TitleText == nil {
- return "", false
- }
- return *w.TitleText, true
-}
-
-// HasTitleText returns a boolean if a field has been set.
-func (w *Widget) HasTitleText() bool {
- if w != nil && w.TitleText != nil {
- return true
- }
-
- return false
-}
-
-// SetTitleText allocates a new w.TitleText and returns the pointer to it.
-func (w *Widget) SetTitleText(v string) {
- w.TitleText = &v
-}
-
-// GetType returns the Type field if non-nil, zero value otherwise.
-func (w *Widget) GetType() string {
- if w == nil || w.Type == nil {
- return ""
- }
- return *w.Type
-}
-
-// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetTypeOk() (string, bool) {
- if w == nil || w.Type == nil {
- return "", false
- }
- return *w.Type, true
-}
-
-// HasType returns a boolean if a field has been set.
-func (w *Widget) HasType() bool {
- if w != nil && w.Type != nil {
- return true
- }
-
- return false
-}
-
-// SetType allocates a new w.Type and returns the pointer to it.
-func (w *Widget) SetType(v string) {
- w.Type = &v
-}
-
-// GetUnit returns the Unit field if non-nil, zero value otherwise.
-func (w *Widget) GetUnit() string {
- if w == nil || w.Unit == nil {
- return ""
- }
- return *w.Unit
-}
-
-// GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetUnitOk() (string, bool) {
- if w == nil || w.Unit == nil {
- return "", false
- }
- return *w.Unit, true
-}
-
-// HasUnit returns a boolean if a field has been set.
-func (w *Widget) HasUnit() bool {
- if w != nil && w.Unit != nil {
- return true
- }
-
- return false
-}
-
-// SetUnit allocates a new w.Unit and returns the pointer to it.
-func (w *Widget) SetUnit(v string) {
- w.Unit = &v
-}
-
-// GetURL returns the URL field if non-nil, zero value otherwise.
-func (w *Widget) GetURL() string {
- if w == nil || w.URL == nil {
- return ""
- }
- return *w.URL
-}
-
-// GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetURLOk() (string, bool) {
- if w == nil || w.URL == nil {
- return "", false
- }
- return *w.URL, true
-}
-
-// HasURL returns a boolean if a field has been set.
-func (w *Widget) HasURL() bool {
- if w != nil && w.URL != nil {
- return true
- }
-
- return false
-}
-
-// SetURL allocates a new w.URL and returns the pointer to it.
-func (w *Widget) SetURL(v string) {
- w.URL = &v
-}
-
-// GetVizType returns the VizType field if non-nil, zero value otherwise.
-func (w *Widget) GetVizType() string {
- if w == nil || w.VizType == nil {
- return ""
- }
- return *w.VizType
-}
-
-// GetVizTypeOk returns a tuple with the VizType field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetVizTypeOk() (string, bool) {
- if w == nil || w.VizType == nil {
- return "", false
- }
- return *w.VizType, true
-}
-
-// HasVizType returns a boolean if a field has been set.
-func (w *Widget) HasVizType() bool {
- if w != nil && w.VizType != nil {
- return true
- }
-
- return false
-}
-
-// SetVizType allocates a new w.VizType and returns the pointer to it.
-func (w *Widget) SetVizType(v string) {
- w.VizType = &v
-}
-
-// GetWidth returns the Width field if non-nil, zero value otherwise.
-func (w *Widget) GetWidth() int {
- if w == nil || w.Width == nil {
- return 0
- }
- return *w.Width
-}
-
-// GetWidthOk returns a tuple with the Width field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetWidthOk() (int, bool) {
- if w == nil || w.Width == nil {
- return 0, false
- }
- return *w.Width, true
-}
-
-// HasWidth returns a boolean if a field has been set.
-func (w *Widget) HasWidth() bool {
- if w != nil && w.Width != nil {
- return true
- }
-
- return false
-}
-
-// SetWidth allocates a new w.Width and returns the pointer to it.
-func (w *Widget) SetWidth(v int) {
- w.Width = &v
-}
-
-// GetX returns the X field if non-nil, zero value otherwise.
-func (w *Widget) GetX() int {
- if w == nil || w.X == nil {
- return 0
- }
- return *w.X
-}
-
-// GetXOk returns a tuple with the X field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetXOk() (int, bool) {
- if w == nil || w.X == nil {
- return 0, false
- }
- return *w.X, true
-}
-
-// HasX returns a boolean if a field has been set.
-func (w *Widget) HasX() bool {
- if w != nil && w.X != nil {
- return true
- }
-
- return false
-}
-
-// SetX allocates a new w.X and returns the pointer to it.
-func (w *Widget) SetX(v int) {
- w.X = &v
-}
-
-// GetY returns the Y field if non-nil, zero value otherwise.
-func (w *Widget) GetY() int {
- if w == nil || w.Y == nil {
- return 0
- }
- return *w.Y
-}
-
-// GetYOk returns a tuple with the Y field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (w *Widget) GetYOk() (int, bool) {
- if w == nil || w.Y == nil {
- return 0, false
- }
- return *w.Y, true
-}
-
-// HasY returns a boolean if a field has been set.
-func (w *Widget) HasY() bool {
- if w != nil && w.Y != nil {
- return true
- }
-
- return false
-}
-
-// SetY allocates a new w.Y and returns the pointer to it.
-func (w *Widget) SetY(v int) {
- w.Y = &v
-}
-
-// GetIncludeUnits returns the IncludeUnits field if non-nil, zero value otherwise.
-func (y *Yaxis) GetIncludeUnits() bool {
- if y == nil || y.IncludeUnits == nil {
- return false
- }
- return *y.IncludeUnits
-}
-
-// GetIncludeUnitsOk returns a tuple with the IncludeUnits field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (y *Yaxis) GetIncludeUnitsOk() (bool, bool) {
- if y == nil || y.IncludeUnits == nil {
- return false, false
- }
- return *y.IncludeUnits, true
-}
-
-// HasIncludeUnits returns a boolean if a field has been set.
-func (y *Yaxis) HasIncludeUnits() bool {
- if y != nil && y.IncludeUnits != nil {
- return true
- }
-
- return false
-}
-
-// SetIncludeUnits allocates a new y.IncludeUnits and returns the pointer to it.
-func (y *Yaxis) SetIncludeUnits(v bool) {
- y.IncludeUnits = &v
-}
-
-// GetIncludeZero returns the IncludeZero field if non-nil, zero value otherwise.
-func (y *Yaxis) GetIncludeZero() bool {
- if y == nil || y.IncludeZero == nil {
- return false
- }
- return *y.IncludeZero
-}
-
-// GetIncludeZeroOk returns a tuple with the IncludeZero field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (y *Yaxis) GetIncludeZeroOk() (bool, bool) {
- if y == nil || y.IncludeZero == nil {
- return false, false
- }
- return *y.IncludeZero, true
-}
-
-// HasIncludeZero returns a boolean if a field has been set.
-func (y *Yaxis) HasIncludeZero() bool {
- if y != nil && y.IncludeZero != nil {
- return true
- }
-
- return false
-}
-
-// SetIncludeZero allocates a new y.IncludeZero and returns the pointer to it.
-func (y *Yaxis) SetIncludeZero(v bool) {
- y.IncludeZero = &v
-}
-
-// GetMax returns the Max field if non-nil, zero value otherwise.
-func (y *Yaxis) GetMax() float64 {
- if y == nil || y.Max == nil {
- return 0
- }
- return *y.Max
-}
-
-// GetMaxOk returns a tuple with the Max field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (y *Yaxis) GetMaxOk() (float64, bool) {
- if y == nil || y.Max == nil {
- return 0, false
- }
- return *y.Max, true
-}
-
-// HasMax returns a boolean if a field has been set.
-func (y *Yaxis) HasMax() bool {
- if y != nil && y.Max != nil {
- return true
- }
-
- return false
-}
-
-// SetMax allocates a new y.Max and returns the pointer to it.
-func (y *Yaxis) SetMax(v float64) {
- y.Max = &v
-}
-
-// GetMin returns the Min field if non-nil, zero value otherwise.
-func (y *Yaxis) GetMin() float64 {
- if y == nil || y.Min == nil {
- return 0
- }
- return *y.Min
-}
-
-// GetMinOk returns a tuple with the Min field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (y *Yaxis) GetMinOk() (float64, bool) {
- if y == nil || y.Min == nil {
- return 0, false
- }
- return *y.Min, true
-}
-
-// HasMin returns a boolean if a field has been set.
-func (y *Yaxis) HasMin() bool {
- if y != nil && y.Min != nil {
- return true
- }
-
- return false
-}
-
-// SetMin allocates a new y.Min and returns the pointer to it.
-func (y *Yaxis) SetMin(v float64) {
- y.Min = &v
-}
-
-// GetScale returns the Scale field if non-nil, zero value otherwise.
-func (y *Yaxis) GetScale() string {
- if y == nil || y.Scale == nil {
- return ""
- }
- return *y.Scale
-}
-
-// GetScaleOk returns a tuple with the Scale field if it's non-nil, zero value otherwise
-// and a boolean to check if the value has been set.
-func (y *Yaxis) GetScaleOk() (string, bool) {
- if y == nil || y.Scale == nil {
- return "", false
- }
- return *y.Scale, true
-}
-
-// HasScale returns a boolean if a field has been set.
-func (y *Yaxis) HasScale() bool {
- if y != nil && y.Scale != nil {
- return true
- }
-
- return false
-}
-
-// SetScale allocates a new y.Scale and returns the pointer to it.
-func (y *Yaxis) SetScale(v string) {
- y.Scale = &v
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/downtimes.go b/vendor/github.com/zorkian/go-datadog-api/downtimes.go
deleted file mode 100644
index 0e11b57..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/downtimes.go
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
-)
-
-type Recurrence struct {
- Period *int `json:"period,omitempty"`
- Type *string `json:"type,omitempty"`
- UntilDate *int `json:"until_date,omitempty"`
- UntilOccurrences *int `json:"until_occurrences,omitempty"`
- WeekDays []string `json:"week_days,omitempty"`
-}
-
-type Downtime struct {
- Active *bool `json:"active,omitempty"`
- Canceled *int `json:"canceled,omitempty"`
- Disabled *bool `json:"disabled,omitempty"`
- End *int `json:"end,omitempty"`
- Id *int `json:"id,omitempty"`
- MonitorId *int `json:"monitor_id,omitempty"`
- Message *string `json:"message,omitempty"`
- Recurrence *Recurrence `json:"recurrence,omitempty"`
- Scope []string `json:"scope,omitempty"`
- Start *int `json:"start,omitempty"`
-}
-
-// reqDowntimes retrieves a slice of all Downtimes.
-type reqDowntimes struct {
- Downtimes []Downtime `json:"downtimes,omitempty"`
-}
-
-// CreateDowntime adds a new downtme to the system. This returns a pointer
-// to a Downtime so you can pass that to UpdateDowntime or CancelDowntime
-// later if needed.
-func (client *Client) CreateDowntime(downtime *Downtime) (*Downtime, error) {
- var out Downtime
- if err := client.doJsonRequest("POST", "/v1/downtime", downtime, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// UpdateDowntime takes a downtime that was previously retrieved through some method
-// and sends it back to the server.
-func (client *Client) UpdateDowntime(downtime *Downtime) error {
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/downtime/%d", *downtime.Id),
- downtime, nil)
-}
-
-// Getdowntime retrieves an downtime by identifier.
-func (client *Client) GetDowntime(id int) (*Downtime, error) {
- var out Downtime
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/downtime/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// DeleteDowntime removes an downtime from the system.
-func (client *Client) DeleteDowntime(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/downtime/%d", id),
- nil, nil)
-}
-
-// GetDowntimes returns a slice of all downtimes.
-func (client *Client) GetDowntimes() ([]Downtime, error) {
- var out reqDowntimes
- if err := client.doJsonRequest("GET", "/v1/downtime", nil, &out.Downtimes); err != nil {
- return nil, err
- }
- return out.Downtimes, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/events.go b/vendor/github.com/zorkian/go-datadog-api/events.go
deleted file mode 100644
index 0aeedef..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/events.go
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
- "net/url"
- "strconv"
-)
-
-// Event is a single event. If this is being used to post an event, then not
-// all fields will be filled out.
-type Event struct {
- Id *int `json:"id,omitempty"`
- Title *string `json:"title,omitempty"`
- Text *string `json:"text,omitempty"`
- Time *int `json:"date_happened,omitempty"` // UNIX time.
- Priority *string `json:"priority,omitempty"`
- AlertType *string `json:"alert_type,omitempty"`
- Host *string `json:"host,omitempty"`
- Aggregation *string `json:"aggregation_key,omitempty"`
- SourceType *string `json:"source_type_name,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Url *string `json:"url,omitempty"`
- Resource *string `json:"resource,omitempty"`
- EventType *string `json:"event_type,omitempty"`
-}
-
-// reqGetEvent is the container for receiving a single event.
-type reqGetEvent struct {
- Event *Event `json:"event,omitempty"`
-}
-
-// reqGetEvents is for returning many events.
-type reqGetEvents struct {
- Events []Event `json:"events,omitempty"`
-}
-
-// PostEvent takes as input an event and then posts it to the server.
-func (client *Client) PostEvent(event *Event) (*Event, error) {
- var out reqGetEvent
- if err := client.doJsonRequest("POST", "/v1/events", event, &out); err != nil {
- return nil, err
- }
- return out.Event, nil
-}
-
-// GetEvent gets a single event given an identifier.
-func (client *Client) GetEvent(id int) (*Event, error) {
- var out reqGetEvent
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/events/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return out.Event, nil
-}
-
-// QueryEvents returns a slice of events from the query stream.
-func (client *Client) GetEvents(start, end int,
- priority, sources, tags string) ([]Event, error) {
- // Since this is a GET request, we need to build a query string.
- vals := url.Values{}
- vals.Add("start", strconv.Itoa(start))
- vals.Add("end", strconv.Itoa(end))
- if priority != "" {
- vals.Add("priority", priority)
- }
- if sources != "" {
- vals.Add("sources", sources)
- }
- if tags != "" {
- vals.Add("tags", tags)
- }
-
- // Now the request and response.
- var out reqGetEvents
- if err := client.doJsonRequest("GET",
- fmt.Sprintf("/v1/events?%s", vals.Encode()), nil, &out); err != nil {
- return nil, err
- }
- return out.Events, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/generate.go b/vendor/github.com/zorkian/go-datadog-api/generate.go
deleted file mode 100644
index a2bf2ff..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/generate.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package datadog
-
-//go:generate go run cmd/tools/gen-accessors.go -v
diff --git a/vendor/github.com/zorkian/go-datadog-api/helpers.go b/vendor/github.com/zorkian/go-datadog-api/helpers.go
deleted file mode 100644
index 866cdc5..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/helpers.go
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2017 by authors and contributors.
- */
-
-package datadog
-
-import "encoding/json"
-
-// Bool is a helper routine that allocates a new bool value
-// to store v and returns a pointer to it.
-func Bool(v bool) *bool { return &v }
-
-// GetBool is a helper routine that returns a boolean representing
-// if a value was set, and if so, dereferences the pointer to it.
-func GetBool(v *bool) (bool, bool) {
- if v != nil {
- return *v, true
- }
-
- return false, false
-}
-
-// Int is a helper routine that allocates a new int value
-// to store v and returns a pointer to it.
-func Int(v int) *int { return &v }
-
-// GetInt is a helper routine that returns a boolean representing
-// if a value was set, and if so, dereferences the pointer to it.
-func GetIntOk(v *int) (int, bool) {
- if v != nil {
- return *v, true
- }
-
- return 0, false
-}
-
-// String is a helper routine that allocates a new string value
-// to store v and returns a pointer to it.
-func String(v string) *string { return &v }
-
-// GetString is a helper routine that returns a boolean representing
-// if a value was set, and if so, dereferences the pointer to it.
-func GetStringOk(v *string) (string, bool) {
- if v != nil {
- return *v, true
- }
-
- return "", false
-}
-
-// JsonNumber is a helper routine that allocates a new string value
-// to store v and returns a pointer to it.
-func JsonNumber(v json.Number) *json.Number { return &v }
-
-// GetJsonNumber is a helper routine that returns a boolean representing
-// if a value was set, and if so, dereferences the pointer to it.
-func GetJsonNumberOk(v *json.Number) (json.Number, bool) {
- if v != nil {
- return *v, true
- }
-
- return "", false
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/hosts.go b/vendor/github.com/zorkian/go-datadog-api/hosts.go
deleted file mode 100644
index fed7ef0..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/hosts.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package datadog
-
-type HostActionResp struct {
- Action string `json:"action"`
- Hostname string `json:"hostname"`
- Message string `json:"message,omitempty"`
-}
-
-type HostActionMute struct {
- Message *string `json:"message,omitempty"`
- EndTime *string `json:"end,omitempty"`
- Override *bool `json:"override,omitempty"`
-}
-
-// MuteHost mutes all monitors for the given host
-func (client *Client) MuteHost(host string, action *HostActionMute) (*HostActionResp, error) {
- var out HostActionResp
- uri := "/v1/host/" + host + "/mute"
- if err := client.doJsonRequest("POST", uri, action, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// UnmuteHost unmutes all monitors for the given host
-func (client *Client) UnmuteHost(host string) (*HostActionResp, error) {
- var out HostActionResp
- uri := "/v1/host/" + host + "/unmute"
- if err := client.doJsonRequest("POST", uri, nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/integrations.go b/vendor/github.com/zorkian/go-datadog-api/integrations.go
deleted file mode 100644
index a79223e..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/integrations.go
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2018 by authors and contributors.
- */
-
-package datadog
-
-/*
- PagerDuty Integration
-*/
-
-type servicePD struct {
- ServiceName *string `json:"service_name"`
- ServiceKey *string `json:"service_key"`
-}
-
-type integrationPD struct {
- Services []servicePD `json:"services"`
- Subdomain *string `json:"subdomain"`
- Schedules []string `json:"schedules"`
- APIToken *string `json:"api_token"`
-}
-
-// ServicePDRequest defines the Services struct that is part of the IntegrationPDRequest.
-type ServicePDRequest struct {
- ServiceName *string `json:"service_name"`
- ServiceKey *string `json:"service_key"`
-}
-
-// IntegrationPDRequest defines the request payload for
-// creating & updating Datadog-PagerDuty integration.
-type IntegrationPDRequest struct {
- Services []ServicePDRequest `json:"services,omitempty"`
- Subdomain *string `json:"subdomain,omitempty"`
- Schedules []string `json:"schedules,omitempty"`
- APIToken *string `json:"api_token,omitempty"`
- RunCheck *bool `json:"run_check,omitempty"`
-}
-
-// CreateIntegrationPD creates new PagerDuty Integrations.
-// Use this if you want to setup the integration for the first time
-// or to add more services/schedules.
-func (client *Client) CreateIntegrationPD(pdIntegration *IntegrationPDRequest) error {
- return client.doJsonRequest("POST", "/v1/integration/pagerduty", pdIntegration, nil)
-}
-
-// UpdateIntegrationPD updates the PagerDuty Integration.
-// This will replace the existing values with the new values.
-func (client *Client) UpdateIntegrationPD(pdIntegration *IntegrationPDRequest) error {
- return client.doJsonRequest("PUT", "/v1/integration/pagerduty", pdIntegration, nil)
-}
-
-// GetIntegrationPD gets all the PagerDuty Integrations from the system.
-func (client *Client) GetIntegrationPD() (*integrationPD, error) {
- var out integrationPD
- if err := client.doJsonRequest("GET", "/v1/integration/pagerduty", nil, &out); err != nil {
- return nil, err
- }
-
- return &out, nil
-}
-
-// DeleteIntegrationPD removes the PagerDuty Integration from the system.
-func (client *Client) DeleteIntegrationPD() error {
- return client.doJsonRequest("DELETE", "/v1/integration/pagerduty", nil, nil)
-}
-
-/*
- Slack Integration
-*/
-
-// ServiceHookSlackRequest defines the ServiceHooks struct that is part of the IntegrationSlackRequest.
-type ServiceHookSlackRequest struct {
- Account *string `json:"account"`
- Url *string `json:"url"`
-}
-
-// ChannelSlackRequest defines the Channels struct that is part of the IntegrationSlackRequest.
-type ChannelSlackRequest struct {
- ChannelName *string `json:"channel_name"`
- TransferAllUserComments *bool `json:"transfer_all_user_comments,omitempty,string"`
- Account *string `json:"account"`
-}
-
-// IntegrationSlackRequest defines the request payload for
-// creating & updating Datadog-Slack integration.
-type IntegrationSlackRequest struct {
- ServiceHooks []ServiceHookSlackRequest `json:"service_hooks,omitempty"`
- Channels []ChannelSlackRequest `json:"channels,omitempty"`
- RunCheck *bool `json:"run_check,omitempty,string"`
-}
-
-// CreateIntegrationSlack creates new Slack Integrations.
-// Use this if you want to setup the integration for the first time
-// or to add more channels.
-func (client *Client) CreateIntegrationSlack(slackIntegration *IntegrationSlackRequest) error {
- return client.doJsonRequest("POST", "/v1/integration/slack", slackIntegration, nil)
-}
-
-// UpdateIntegrationSlack updates the Slack Integration.
-// This will replace the existing values with the new values.
-func (client *Client) UpdateIntegrationSlack(slackIntegration *IntegrationSlackRequest) error {
- return client.doJsonRequest("PUT", "/v1/integration/slack", slackIntegration, nil)
-}
-
-// GetIntegrationSlack gets all the Slack Integrations from the system.
-func (client *Client) GetIntegrationSlack() (*IntegrationSlackRequest, error) {
- var out IntegrationSlackRequest
- if err := client.doJsonRequest("GET", "/v1/integration/slack", nil, &out); err != nil {
- return nil, err
- }
-
- return &out, nil
-}
-
-// DeleteIntegrationSlack removes the Slack Integration from the system.
-func (client *Client) DeleteIntegrationSlack() error {
- return client.doJsonRequest("DELETE", "/v1/integration/slack", nil, nil)
-}
-
-/*
- AWS Integration
-*/
-
-// IntegrationAWSAccount defines the request payload for
-// creating & updating Datadog-AWS integration.
-type IntegrationAWSAccount struct {
- AccountID *string `json:"account_id"`
- RoleName *string `json:"role_name"`
- FilterTags []string `json:"filter_tags"`
- HostTags []string `json:"host_tags"`
- AccountSpecificNamespaceRules map[string]bool `json:"account_specific_namespace_rules"`
-}
-
-// IntegrationAWSAccountCreateResponse defines the response payload for
-// creating & updating Datadog-AWS integration.
-type IntegrationAWSAccountCreateResponse struct {
- ExternalID string `json:"external_id"`
-}
-
-type IntegrationAWSAccountGetResponse struct {
- Accounts []IntegrationAWSAccount `json:"accounts"`
-}
-
-type IntegrationAWSAccountDeleteRequest struct {
- AccountID *string `json:"account_id"`
- RoleName *string `json:"role_name"`
-}
-
-// CreateIntegrationAWS adds a new AWS Account in the AWS Integrations.
-// Use this if you want to setup the integration for the first time
-// or to add more accounts.
-func (client *Client) CreateIntegrationAWS(awsAccount *IntegrationAWSAccount) (*IntegrationAWSAccountCreateResponse, error) {
- var out IntegrationAWSAccountCreateResponse
- if err := client.doJsonRequest("POST", "/v1/integration/aws", awsAccount, &out); err != nil {
- return nil, err
- }
-
- return &out, nil
-}
-
-// GetIntegrationAWS gets all the AWS Accounts in the AWS Integrations from Datadog.
-func (client *Client) GetIntegrationAWS() (*[]IntegrationAWSAccount, error) {
- var response IntegrationAWSAccountGetResponse
- if err := client.doJsonRequest("GET", "/v1/integration/aws", nil, &response); err != nil {
- return nil, err
- }
-
- return &response.Accounts, nil
-}
-
-// DeleteIntegrationAWS removes a specific AWS Account from the AWS Integration.
-func (client *Client) DeleteIntegrationAWS(awsAccount *IntegrationAWSAccountDeleteRequest) error {
- return client.doJsonRequest("DELETE", "/v1/integration/aws", awsAccount, nil)
-}
-
-/*
- Google Cloud Platform Integration
-*/
-
-// IntegrationGCP defines the response for listing Datadog-Google CloudPlatform integration.
-type IntegrationGCP struct {
- ProjectID *string `json:"project_id"`
- ClientEmail *string `json:"client_email"`
- HostFilters *string `json:"host_filters"`
-}
-
-// IntegrationGCPCreateRequest defines the request payload for creating Datadog-Google CloudPlatform integration.
-type IntegrationGCPCreateRequest struct {
- Type *string `json:"type"` // Should be service_account
- ProjectID *string `json:"project_id"`
- PrivateKeyID *string `json:"private_key_id"`
- PrivateKey *string `json:"private_key"`
- ClientEmail *string `json:"client_email"`
- ClientID *string `json:"client_id"`
- AuthURI *string `json:"auth_uri"` // Should be https://accounts.google.com/o/oauth2/auth
- TokenURI *string `json:"token_uri"` // Should be https://accounts.google.com/o/oauth2/token
- AuthProviderX509CertURL *string `json:"auth_provider_x509_cert_url"` // Should be https://www.googleapis.com/oauth2/v1/certs
- ClientX509CertURL *string `json:"client_x509_cert_url"` // https://www.googleapis.com/robot/v1/metadata/x509/
- HostFilters *string `json:"host_filters,omitempty"`
-}
-
-// IntegrationGCPUpdateRequest defines the request payload for updating Datadog-Google CloudPlatform integration.
-type IntegrationGCPUpdateRequest struct {
- ProjectID *string `json:"project_id"`
- ClientEmail *string `json:"client_email"`
- HostFilters *string `json:"host_filters,omitempty"`
-}
-
-// IntegrationGCPDeleteRequest defines the request payload for deleting Datadog-Google CloudPlatform integration.
-type IntegrationGCPDeleteRequest struct {
- ProjectID *string `json:"project_id"`
- ClientEmail *string `json:"client_email"`
-}
-
-// ListIntegrationGCP gets all Google Cloud Platform Integrations.
-func (client *Client) ListIntegrationGCP() ([]*IntegrationGCP, error) {
- var list []*IntegrationGCP
- if err := client.doJsonRequest("GET", "/v1/integration/gcp", nil, &list); err != nil {
- return nil, err
- }
- return list, nil
-}
-
-// CreateIntegrationGCP creates a new Google Cloud Platform Integration.
-func (client *Client) CreateIntegrationGCP(cir *IntegrationGCPCreateRequest) error {
- return client.doJsonRequest("POST", "/v1/integration/gcp", cir, nil)
-}
-
-// UpdateIntegrationGCP updates a Google Cloud Platform Integration.
-func (client *Client) UpdateIntegrationGCP(cir *IntegrationGCPUpdateRequest) error {
- return client.doJsonRequest("POST", "/v1/integration/gcp/host_filters", cir, nil)
-}
-
-// DeleteIntegrationGCP deletes a Google Cloud Platform Integration.
-func (client *Client) DeleteIntegrationGCP(cir *IntegrationGCPDeleteRequest) error {
- return client.doJsonRequest("DELETE", "/v1/integration/gcp", cir, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/metric_metadata.go b/vendor/github.com/zorkian/go-datadog-api/metric_metadata.go
deleted file mode 100644
index af203a5..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/metric_metadata.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import "fmt"
-
-// MetricMetadata allows you to edit fields of a metric's metadata.
-type MetricMetadata struct {
- Type *string `json:"type,omitempty"`
- Description *string `json:"description,omitempty"`
- ShortName *string `json:"short_name,omitempty"`
- Unit *string `json:"unit,omitempty"`
- PerUnit *string `json:"per_unit,omitempty"`
- StatsdInterval *int `json:"statsd_interval,omitempty"`
-}
-
-// ViewMetricMetadata allows you to get metadata about a specific metric.
-func (client *Client) ViewMetricMetadata(mn string) (*MetricMetadata, error) {
- var out MetricMetadata
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/metrics/%s", mn), nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// EditMetricMetadata edits the metadata for the given metric.
-func (client *Client) EditMetricMetadata(mn string, mm *MetricMetadata) (*MetricMetadata, error) {
- var out MetricMetadata
- if err := client.doJsonRequest("PUT", fmt.Sprintf("/v1/metrics/%s", mn), mm, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/monitors.go b/vendor/github.com/zorkian/go-datadog-api/monitors.go
deleted file mode 100644
index 2f6e2cc..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/monitors.go
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "strconv"
- "strings"
-)
-
-type ThresholdCount struct {
- Ok *json.Number `json:"ok,omitempty"`
- Critical *json.Number `json:"critical,omitempty"`
- Warning *json.Number `json:"warning,omitempty"`
- Unknown *json.Number `json:"unknown,omitempty"`
- CriticalRecovery *json.Number `json:"critical_recovery,omitempty"`
- WarningRecovery *json.Number `json:"warning_recovery,omitempty"`
-}
-
-type ThresholdWindows struct {
- RecoveryWindow *string `json:"recovery_window,omitempty"`
- TriggerWindow *string `json:"trigger_window,omitempty"`
-}
-
-type NoDataTimeframe int
-
-func (tf *NoDataTimeframe) UnmarshalJSON(data []byte) error {
- s := string(data)
- if s == "false" || s == "null" {
- *tf = 0
- } else {
- i, err := strconv.ParseInt(s, 10, 32)
- if err != nil {
- return err
- }
- *tf = NoDataTimeframe(i)
- }
- return nil
-}
-
-type Options struct {
- NoDataTimeframe NoDataTimeframe `json:"no_data_timeframe,omitempty"`
- NotifyAudit *bool `json:"notify_audit,omitempty"`
- NotifyNoData *bool `json:"notify_no_data,omitempty"`
- RenotifyInterval *int `json:"renotify_interval,omitempty"`
- NewHostDelay *int `json:"new_host_delay,omitempty"`
- EvaluationDelay *int `json:"evaluation_delay,omitempty"`
- Silenced map[string]int `json:"silenced,omitempty"`
- TimeoutH *int `json:"timeout_h,omitempty"`
- EscalationMessage *string `json:"escalation_message,omitempty"`
- Thresholds *ThresholdCount `json:"thresholds,omitempty"`
- ThresholdWindows *ThresholdWindows `json:"threshold_windows,omitempty"`
- IncludeTags *bool `json:"include_tags,omitempty"`
- RequireFullWindow *bool `json:"require_full_window,omitempty"`
- Locked *bool `json:"locked,omitempty"`
-}
-
-type TriggeringValue struct {
- FromTs *int `json:"from_ts,omitempty"`
- ToTs *int `json:"to_ts,omitempty"`
- Value *int `json:"value,omitempty"`
-}
-
-type GroupData struct {
- LastNoDataTs *int `json:"last_nodata_ts,omitempty"`
- LastNotifiedTs *int `json:"last_notified_ts,omitempty"`
- LastResolvedTs *int `json:"last_resolved_ts,omitempty"`
- LastTriggeredTs *int `json:"last_triggered_ts,omitempty"`
- Name *string `json:"name,omitempty"`
- Status *string `json:"status,omitempty"`
- TriggeringValue *TriggeringValue `json:"triggering_value,omitempty"`
-}
-
-type State struct {
- Groups map[string]GroupData `json:"groups,omitempty"`
-}
-
-// Monitor allows watching a metric or check that you care about,
-// notifying your team when some defined threshold is exceeded
-type Monitor struct {
- Creator *Creator `json:"creator,omitempty"`
- Id *int `json:"id,omitempty"`
- Type *string `json:"type,omitempty"`
- Query *string `json:"query,omitempty"`
- Name *string `json:"name,omitempty"`
- Message *string `json:"message,omitempty"`
- OverallState *string `json:"overall_state,omitempty"`
- OverallStateModified *string `json:"overall_state_modified,omitempty"`
- Tags []string `json:"tags"`
- Options *Options `json:"options,omitempty"`
- State State `json:"state,omitempty"`
-}
-
-// Creator contains the creator of the monitor
-type Creator struct {
- Email *string `json:"email,omitempty"`
- Handle *string `json:"handle,omitempty"`
- Id *int `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
-}
-
-// reqMonitors receives a slice of all monitors
-type reqMonitors struct {
- Monitors []Monitor `json:"monitors,omitempty"`
-}
-
-// CreateMonitor adds a new monitor to the system. This returns a pointer to a
-// monitor so you can pass that to UpdateMonitor later if needed
-func (client *Client) CreateMonitor(monitor *Monitor) (*Monitor, error) {
- var out Monitor
- // TODO: is this more pretty of frowned upon?
- if err := client.doJsonRequest("POST", "/v1/monitor", monitor, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// UpdateMonitor takes a monitor that was previously retrieved through some method
-// and sends it back to the server
-func (client *Client) UpdateMonitor(monitor *Monitor) error {
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/monitor/%d", *monitor.Id),
- monitor, nil)
-}
-
-// GetMonitor retrieves a monitor by identifier
-func (client *Client) GetMonitor(id int) (*Monitor, error) {
- var out Monitor
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/monitor/%d", id), nil, &out); err != nil {
- return nil, err
- }
- return &out, nil
-}
-
-// GetMonitor retrieves monitors by name
-func (self *Client) GetMonitorsByName(name string) ([]Monitor, error) {
- var out reqMonitors
- query, err := url.ParseQuery(fmt.Sprintf("name=%v", name))
- if err != nil {
- return nil, err
- }
-
- err = self.doJsonRequest("GET", fmt.Sprintf("/v1/monitor?%v", query.Encode()), nil, &out.Monitors)
- if err != nil {
- return nil, err
- }
- return out.Monitors, nil
-}
-
-// GetMonitor retrieves monitors by a slice of tags
-func (self *Client) GetMonitorsByTags(tags []string) ([]Monitor, error) {
- var out reqMonitors
- query, err := url.ParseQuery(fmt.Sprintf("monitor_tags=%v", strings.Join(tags, ",")))
- if err != nil {
- return nil, err
- }
-
- err = self.doJsonRequest("GET", fmt.Sprintf("/v1/monitor?%v", query.Encode()), nil, &out.Monitors)
- if err != nil {
- return nil, err
- }
- return out.Monitors, nil
-}
-
-// DeleteMonitor removes a monitor from the system
-func (client *Client) DeleteMonitor(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/monitor/%d", id),
- nil, nil)
-}
-
-// GetMonitors returns a slice of all monitors
-func (client *Client) GetMonitors() ([]Monitor, error) {
- var out reqMonitors
- if err := client.doJsonRequest("GET", "/v1/monitor", nil, &out.Monitors); err != nil {
- return nil, err
- }
- return out.Monitors, nil
-}
-
-// MuteMonitors turns off monitoring notifications
-func (client *Client) MuteMonitors() error {
- return client.doJsonRequest("POST", "/v1/monitor/mute_all", nil, nil)
-}
-
-// UnmuteMonitors turns on monitoring notifications
-func (client *Client) UnmuteMonitors() error {
- return client.doJsonRequest("POST", "/v1/monitor/unmute_all", nil, nil)
-}
-
-// MuteMonitor turns off monitoring notifications for a monitor
-func (client *Client) MuteMonitor(id int) error {
- return client.doJsonRequest("POST", fmt.Sprintf("/v1/monitor/%d/mute", id), nil, nil)
-}
-
-// UnmuteMonitor turns on monitoring notifications for a monitor
-func (client *Client) UnmuteMonitor(id int) error {
- return client.doJsonRequest("POST", fmt.Sprintf("/v1/monitor/%d/unmute", id), nil, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/request.go b/vendor/github.com/zorkian/go-datadog-api/request.go
deleted file mode 100644
index a89ed42..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/request.go
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
- "time"
-
- "github.com/cenkalti/backoff"
-)
-
-// Response contains common fields that might be present in any API response.
-type Response struct {
- Status string `json:"status"`
- Error string `json:"error"`
-}
-
-// uriForAPI is to be called with something like "/v1/events" and it will give
-// the proper request URI to be posted to.
-func (client *Client) uriForAPI(api string) (string, error) {
- apiBase, err := url.Parse(client.baseUrl + "/api" + api)
- if err != nil {
- return "", err
- }
- q := apiBase.Query()
- q.Add("api_key", client.apiKey)
- q.Add("application_key", client.appKey)
- apiBase.RawQuery = q.Encode()
- return apiBase.String(), nil
-}
-
-// redactError removes api and application keys from error strings
-func (client *Client) redactError(err error) error {
- if err == nil {
- return nil
- }
- errString := err.Error()
-
- if len(client.apiKey) > 0 {
- errString = strings.Replace(errString, client.apiKey, "redacted", -1)
- }
- if len(client.appKey) > 0 {
- errString = strings.Replace(errString, client.appKey, "redacted", -1)
- }
-
- // Return original error if no replacements were made to keep the original,
- // probably more useful error type information.
- if errString == err.Error() {
- return err
- }
- return fmt.Errorf("%s", errString)
-}
-
-// doJsonRequest is the simplest type of request: a method on a URI that
-// returns some JSON result which we unmarshal into the passed interface. It
-// wraps doJsonRequestUnredacted to redact api and application keys from
-// errors.
-func (client *Client) doJsonRequest(method, api string,
- reqbody, out interface{}) error {
- if err := client.doJsonRequestUnredacted(method, api, reqbody, out); err != nil {
- return client.redactError(err)
- }
- return nil
-}
-
-// doJsonRequestUnredacted is the simplest type of request: a method on a URI that returns
-// some JSON result which we unmarshal into the passed interface.
-func (client *Client) doJsonRequestUnredacted(method, api string,
- reqbody, out interface{}) error {
- req, err := client.createRequest(method, api, reqbody)
- if err != nil {
- return err
- }
-
- // Perform the request and retry it if it's not a POST or PUT request
- var resp *http.Response
- if method == "POST" || method == "PUT" {
- resp, err = client.HttpClient.Do(req)
- } else {
- resp, err = client.doRequestWithRetries(req, client.RetryTimeout)
- }
- if err != nil {
- return err
- }
- defer resp.Body.Close()
-
- if resp.StatusCode < 200 || resp.StatusCode > 299 {
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return err
- }
- return fmt.Errorf("API error %s: %s", resp.Status, body)
- }
-
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return err
- }
-
- // If we got no body, by default let's just make an empty JSON dict. This
- // saves us some work in other parts of the code.
- if len(body) == 0 {
- body = []byte{'{', '}'}
- }
-
- // Try to parse common response fields to check whether there's an error reported in a response.
- var common *Response
- err = json.Unmarshal(body, &common)
- if err != nil {
- // UnmarshalTypeError errors are ignored, because in some cases API response is an array that cannot be
- // unmarshalled into a struct.
- _, ok := err.(*json.UnmarshalTypeError)
- if !ok {
- return err
- }
- }
- if common != nil && common.Status == "error" {
- return fmt.Errorf("API returned error: %s", common.Error)
- }
-
- // If they don't care about the body, then we don't care to give them one,
- // so bail out because we're done.
- if out == nil {
- return nil
- }
-
- return json.Unmarshal(body, &out)
-}
-
-// doRequestWithRetries performs an HTTP request repeatedly for maxTime or until
-// no error and no acceptable HTTP response code was returned.
-func (client *Client) doRequestWithRetries(req *http.Request, maxTime time.Duration) (*http.Response, error) {
- var (
- err error
- resp *http.Response
- bo = backoff.NewExponentialBackOff()
- body []byte
- )
-
- bo.MaxElapsedTime = maxTime
-
- // Save the body for retries
- if req.Body != nil {
- body, err = ioutil.ReadAll(req.Body)
- if err != nil {
- return resp, err
- }
- }
-
- operation := func() error {
- if body != nil {
- r := bytes.NewReader(body)
- req.Body = ioutil.NopCloser(r)
- }
-
- resp, err = client.HttpClient.Do(req)
- if err != nil {
- return err
- }
-
- if resp.StatusCode >= 200 && resp.StatusCode < 300 {
- // 2xx all done
- return nil
- } else if resp.StatusCode >= 400 && resp.StatusCode < 500 {
- // 4xx are not retryable
- return nil
- }
-
- return fmt.Errorf("Received HTTP status code %d", resp.StatusCode)
- }
-
- err = backoff.Retry(operation, bo)
-
- return resp, err
-}
-
-func (client *Client) createRequest(method, api string, reqbody interface{}) (*http.Request, error) {
- // Handle the body if they gave us one.
- var bodyReader io.Reader
- if method != "GET" && reqbody != nil {
- bjson, err := json.Marshal(reqbody)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(bjson)
- }
-
- apiUrlStr, err := client.uriForAPI(api)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest(method, apiUrlStr, bodyReader)
- if err != nil {
- return nil, err
- }
- if bodyReader != nil {
- req.Header.Add("Content-Type", "application/json")
- }
- return req, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/screen_widgets.go b/vendor/github.com/zorkian/go-datadog-api/screen_widgets.go
deleted file mode 100644
index 282e00e..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/screen_widgets.go
+++ /dev/null
@@ -1,204 +0,0 @@
-package datadog
-
-import "encoding/json"
-
-type TileDef struct {
- Events []TileDefEvent `json:"events,omitempty"`
- Markers []TileDefMarker `json:"markers,omitempty"`
- Requests []TileDefRequest `json:"requests,omitempty"`
- Viz *string `json:"viz,omitempty"`
- CustomUnit *string `json:"custom_unit,omitempty"`
- Autoscale *bool `json:"autoscale,omitempty"`
- Precision *json.Number `json:"precision,omitempty"`
- TextAlign *string `json:"text_align,omitempty"`
-
- // For hostmap
- NodeType *string `json:"nodeType,omitempty"`
- Scope []*string `json:"scope,omitempty"`
- Group []*string `json:"group,omitempty"`
- NoGroupHosts *bool `json:"noGroupHosts,omitempty"`
- NoMetricHosts *bool `json:"noMetricHosts,omitempty"`
- Style *TileDefStyle `json:"style,omitempty"`
-}
-
-type TileDefEvent struct {
- Query *string `json:"q"`
-}
-
-type TileDefMarker struct {
- Label *string `json:"label,omitempty"`
- Type *string `json:"type,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-type TileDefRequest struct {
- Query *string `json:"q,omitempty"`
-
- // For Hostmap
- Type *string `json:"type,omitempty"`
-
- // For Process
- QueryType *string `json:"query_type,omitempty"`
- Metric *string `json:"metric,omitempty"`
- TextFilter *string `json:"text_filter,omitempty"`
- TagFilters []*string `json:"tag_filters"`
- Limit *int `json:"limit,omitempty"`
-
- ConditionalFormats []ConditionalFormat `json:"conditional_formats,omitempty"`
- Style *TileDefRequestStyle `json:"style,omitempty"`
- Aggregator *string `json:"aggregator,omitempty"`
- CompareTo *string `json:"compare_to,omitempty"`
- ChangeType *string `json:"change_type,omitempty"`
- OrderBy *string `json:"order_by,omitempty"`
- OrderDir *string `json:"order_dir,omitempty"`
- ExtraCol *string `json:"extra_col,omitempty"`
- IncreaseGood *bool `json:"increase_good,omitempty"`
-}
-
-type ConditionalFormat struct {
- Color *string `json:"color,omitempty"`
- Palette *string `json:"palette,omitempty"`
- Comparator *string `json:"comparator,omitempty"`
- Invert *bool `json:"invert,omitempty"`
- Value *string `json:"value,omitempty"`
- ImageURL *string `json:"image_url,omitempty"`
-}
-
-type TileDefRequestStyle struct {
- Palette *string `json:"palette,omitempty"`
- Type *string `json:"type,omitempty"`
- Width *string `json:"width,omitempty"`
-}
-
-type TileDefStyle struct {
- Palette *string `json:"palette,omitempty"`
- PaletteFlip *string `json:"paletteFlip,omitempty"`
- FillMin *string `json:"fillMin,omitempty"`
- FillMax *string `json:"fillMax,omitempty"`
-}
-
-type Time struct {
- LiveSpan *string `json:"live_span,omitempty"`
-}
-
-type Widget struct {
- // Common attributes
- Type *string `json:"type,omitempty"`
- Title *bool `json:"title,omitempty"`
- TitleText *string `json:"title_text,omitempty"`
- TitleAlign *string `json:"title_align,omitempty"`
- TitleSize *int `json:"title_size,omitempty"`
- Height *int `json:"height,omitempty"`
- Width *int `json:"width,omitempty"`
- X *int `json:"x,omitempty"`
- Y *int `json:"y,omitempty"`
-
- // For Timeseries, TopList, EventTimeline, EvenStream, AlertGraph, CheckStatus, ServiceSummary, LogStream widgets
- Time *Time `json:"time,omitempty"`
-
- // For Timeseries, QueryValue, HostMap, Change, Toplist, Process widgets
- TileDef *TileDef `json:"tile_def,omitempty"`
-
- // For FreeText widget
- Text *string `json:"text,omitempty"`
- Color *string `json:"color,omitempty"`
-
- // For AlertValue widget
- TextSize *string `json:"text_size,omitempty"`
- Unit *string `json:"unit,omitempty"`
- Precision *string `json:"precision,omitempty"`
-
- // AlertGraph widget
- VizType *string `json:"viz_type,omitempty"`
-
- // For AlertValue, QueryValue, FreeText, Note widgets
- TextAlign *string `json:"text_align,omitempty"`
-
- // For FreeText, Note widgets
- FontSize *string `json:"font_size,omitempty"`
-
- // For AlertValue, AlertGraph widgets
- AlertID *int `json:"alert_id,omitempty"`
- AutoRefresh *bool `json:"auto_refresh,omitempty"`
-
- // For Timeseries, QueryValue, Toplist widgets
- Legend *bool `json:"legend,omitempty"`
- LegendSize *string `json:"legend_size,omitempty"`
-
- // For EventTimeline, EventStream, Hostmap, LogStream widgets
- Query *string `json:"query,omitempty"`
-
- // For Image, IFrame widgets
- URL *string `json:"url,omitempty"`
-
- // For CheckStatus widget
- Tags []*string `json:"tags,omitempty"`
- Check *string `json:"check,omitempty"`
- Grouping *string `json:"grouping,omitempty"`
- GroupBy []*string `json:"group_by,omitempty"`
- Group *string `json:"group,omitempty"`
-
- // Note widget
- TickPos *string `json:"tick_pos,omitempty"`
- TickEdge *string `json:"tick_edge,omitempty"`
- HTML *string `json:"html,omitempty"`
- Tick *bool `json:"tick,omitempty"`
- Bgcolor *string `json:"bgcolor,omitempty"`
-
- // EventStream widget
- EventSize *string `json:"event_size,omitempty"`
-
- // Image widget
- Sizing *string `json:"sizing,omitempty"`
- Margin *string `json:"margin,omitempty"`
-
- // For ServiceSummary (trace_service) widget
- Env *string `json:"env,omitempty"`
- ServiceService *string `json:"serviceService,omitempty"`
- ServiceName *string `json:"serviceName,omitempty"`
- SizeVersion *string `json:"sizeVersion,omitempty"`
- LayoutVersion *string `json:"layoutVersion,omitempty"`
- MustShowHits *bool `json:"mustShowHits,omitempty"`
- MustShowErrors *bool `json:"mustShowErrors,omitempty"`
- MustShowLatency *bool `json:"mustShowLatency,omitempty"`
- MustShowBreakdown *bool `json:"mustShowBreakdown,omitempty"`
- MustShowDistribution *bool `json:"mustShowDistribution,omitempty"`
- MustShowResourceList *bool `json:"mustShowResourceList,omitempty"`
-
- // For MonitorSummary (manage_status) widget
- DisplayFormat *string `json:"displayFormat,omitempty"`
- ColorPreference *string `json:"colorPreference,omitempty"`
- HideZeroCounts *bool `json:"hideZeroCounts,omitempty"`
- ManageStatusShowTitle *bool `json:"showTitle,omitempty"`
- ManageStatusTitleText *string `json:"titleText,omitempty"`
- ManageStatusTitleSize *string `json:"titleSize,omitempty"`
- ManageStatusTitleAlign *string `json:"titleAlign,omitempty"`
- Params *Params `json:"params,omitempty"`
-
- // For LogStream widget
- Columns *string `json:"columns,omitempty"`
- Logset *string `json:"logset,omitempty"`
-
- // For Uptime
- // Widget is undocumented, subject to breaking API changes, and without customer support
- Timeframes []*string `json:"timeframes,omitempty"`
- Rules map[string]*Rule `json:"rules,omitempty"`
- Monitor *ScreenboardMonitor `json:"monitor,omitempty"`
-}
-
-type Params struct {
- Sort *string `json:"sort,omitempty"`
- Text *string `json:"text,omitempty"`
- Count *string `json:"count,omitempty"`
- Start *string `json:"start,omitempty"`
-}
-
-type Rule struct {
- Threshold *json.Number `json:"threshold,omitempty"`
- Timeframe *string `json:"timeframe,omitempty"`
- Color *string `json:"color,omitempty"`
-}
-
-type ScreenboardMonitor struct {
- Id *int `json:"id,omitempty"`
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/screenboards.go b/vendor/github.com/zorkian/go-datadog-api/screenboards.go
deleted file mode 100644
index 2786c96..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/screenboards.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
-)
-
-// Screenboard represents a user created screenboard. This is the full screenboard
-// struct when we load a screenboard in detail.
-type Screenboard struct {
- Id *int `json:"id,omitempty"`
- Title *string `json:"board_title,omitempty"`
- Height *int `json:"height,omitempty"`
- Width *int `json:"width,omitempty"`
- Shared *bool `json:"shared,omitempty"`
- TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
- Widgets []Widget `json:"widgets"`
- ReadOnly *bool `json:"read_only,omitempty"`
-}
-
-// ScreenboardLite represents a user created screenboard. This is the mini
-// struct when we load the summaries.
-type ScreenboardLite struct {
- Id *int `json:"id,omitempty"`
- Resource *string `json:"resource,omitempty"`
- Title *string `json:"title,omitempty"`
-}
-
-// reqGetScreenboards from /api/v1/screen
-type reqGetScreenboards struct {
- Screenboards []*ScreenboardLite `json:"screenboards,omitempty"`
-}
-
-// GetScreenboard returns a single screenboard created on this account.
-func (client *Client) GetScreenboard(id int) (*Screenboard, error) {
- out := &Screenboard{}
- if err := client.doJsonRequest("GET", fmt.Sprintf("/v1/screen/%d", id), nil, out); err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// GetScreenboards returns a list of all screenboards created on this account.
-func (client *Client) GetScreenboards() ([]*ScreenboardLite, error) {
- var out reqGetScreenboards
- if err := client.doJsonRequest("GET", "/v1/screen", nil, &out); err != nil {
- return nil, err
- }
- return out.Screenboards, nil
-}
-
-// DeleteScreenboard deletes a screenboard by the identifier.
-func (client *Client) DeleteScreenboard(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/screen/%d", id), nil, nil)
-}
-
-// CreateScreenboard creates a new screenboard when given a Screenboard struct. Note
-// that the Id, Resource, Url and similar elements are not used in creation.
-func (client *Client) CreateScreenboard(board *Screenboard) (*Screenboard, error) {
- out := &Screenboard{}
- if err := client.doJsonRequest("POST", "/v1/screen", board, out); err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// UpdateScreenboard in essence takes a Screenboard struct and persists it back to
-// the server. Use this if you've updated your local and need to push it back.
-func (client *Client) UpdateScreenboard(board *Screenboard) error {
- return client.doJsonRequest("PUT", fmt.Sprintf("/v1/screen/%d", *board.Id), board, nil)
-}
-
-type ScreenShareResponse struct {
- BoardId int `json:"board_id"`
- PublicUrl string `json:"public_url"`
-}
-
-// ShareScreenboard shares an existing screenboard, it takes and updates ScreenShareResponse
-func (client *Client) ShareScreenboard(id int, response *ScreenShareResponse) error {
- return client.doJsonRequest("POST", fmt.Sprintf("/v1/screen/share/%d", id), nil, response)
-}
-
-// RevokeScreenboard revokes a currently shared screenboard
-func (client *Client) RevokeScreenboard(id int) error {
- return client.doJsonRequest("DELETE", fmt.Sprintf("/v1/screen/share/%d", id), nil, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/search.go b/vendor/github.com/zorkian/go-datadog-api/search.go
deleted file mode 100644
index a0348e4..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/search.go
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-// reqSearch is the container for receiving search results.
-type reqSearch struct {
- Results struct {
- Hosts []string `json:"hosts,omitempty"`
- Metrics []string `json:"metrics,omitempty"`
- } `json:"results"`
-}
-
-// SearchHosts searches through the hosts facet, returning matching hostnames.
-func (client *Client) SearchHosts(search string) ([]string, error) {
- var out reqSearch
- if err := client.doJsonRequest("GET", "/v1/search?q=hosts:"+search, nil, &out); err != nil {
- return nil, err
- }
- return out.Results.Hosts, nil
-}
-
-// SearchMetrics searches through the metrics facet, returning matching ones.
-func (client *Client) SearchMetrics(search string) ([]string, error) {
- var out reqSearch
- if err := client.doJsonRequest("GET", "/v1/search?q=metrics:"+search, nil, &out); err != nil {
- return nil, err
- }
- return out.Results.Metrics, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/series.go b/vendor/github.com/zorkian/go-datadog-api/series.go
deleted file mode 100644
index 024a68b..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/series.go
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-import (
- "net/url"
- "strconv"
-)
-
-// DataPoint is a tuple of [UNIX timestamp, value]. This has to use floats
-// because the value could be non-integer.
-type DataPoint [2]*float64
-
-// Metric represents a collection of data points that we might send or receive
-// on one single metric line.
-type Metric struct {
- Metric *string `json:"metric,omitempty"`
- Points []DataPoint `json:"points,omitempty"`
- Type *string `json:"type,omitempty"`
- Host *string `json:"host,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Unit *string `json:"unit,omitempty"`
-}
-
-// Unit represents a unit definition that we might receive when query for timeseries data.
-type Unit struct {
- Family string `json:"family"`
- ScaleFactor float32 `json:"scale_factor"`
- Name string `json:"name"`
- ShortName string `json:"short_name"`
- Plural string `json:"plural"`
- Id int `json:"id"`
-}
-
-// A Series is characterized by 2 units as: x per y
-// One or both could be missing
-type UnitPair []*Unit
-
-// Series represents a collection of data points we get when we query for timeseries data
-type Series struct {
- Metric *string `json:"metric,omitempty"`
- DisplayName *string `json:"display_name,omitempty"`
- Points []DataPoint `json:"pointlist,omitempty"`
- Start *float64 `json:"start,omitempty"`
- End *float64 `json:"end,omitempty"`
- Interval *int `json:"interval,omitempty"`
- Aggr *string `json:"aggr,omitempty"`
- Length *int `json:"length,omitempty"`
- Scope *string `json:"scope,omitempty"`
- Expression *string `json:"expression,omitempty"`
- Units *UnitPair `json:"unit,omitempty"`
-}
-
-// reqPostSeries from /api/v1/series
-type reqPostSeries struct {
- Series []Metric `json:"series,omitempty"`
-}
-
-// reqMetrics is the container for receiving metric results.
-type reqMetrics struct {
- Series []Series `json:"series,omitempty"`
-}
-
-// PostMetrics takes as input a slice of metrics and then posts them up to the
-// server for posting data.
-func (client *Client) PostMetrics(series []Metric) error {
- return client.doJsonRequest("POST", "/v1/series",
- reqPostSeries{Series: series}, nil)
-}
-
-// QueryMetrics takes as input from, to (seconds from Unix Epoch) and query string and then requests
-// timeseries data for that time peried
-func (client *Client) QueryMetrics(from, to int64, query string) ([]Series, error) {
- v := url.Values{}
- v.Add("from", strconv.FormatInt(from, 10))
- v.Add("to", strconv.FormatInt(to, 10))
- v.Add("query", query)
-
- var out reqMetrics
- err := client.doJsonRequest("GET", "/v1/query?"+v.Encode(), nil, &out)
- if err != nil {
- return nil, err
- }
- return out.Series, nil
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/snapshot.go b/vendor/github.com/zorkian/go-datadog-api/snapshot.go
deleted file mode 100644
index cdc5e62..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/snapshot.go
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2016 by authors and contributors.
- */
-
-package datadog
-
-import (
- "fmt"
- "net/url"
- "time"
-)
-
-func (client *Client) doSnapshotRequest(values url.Values) (string, error) {
- out := struct {
- SnapshotURL string `json:"snapshot_url,omitempty"`
- }{}
- if err := client.doJsonRequest("GET", "/v1/graph/snapshot?"+values.Encode(), nil, &out); err != nil {
- return "", err
- }
- return out.SnapshotURL, nil
-}
-
-// Snapshot creates an image from a graph and returns the URL of the image.
-func (client *Client) Snapshot(query string, start, end time.Time, eventQuery string) (string, error) {
- options := map[string]string{"metric_query": query, "event_query": eventQuery}
-
- return client.SnapshotGeneric(options, start, end)
-}
-
-// Generic function for snapshots, use map[string]string to create url.Values() instead of pre-defined params
-func (client *Client) SnapshotGeneric(options map[string]string, start, end time.Time) (string, error) {
- v := url.Values{}
- v.Add("start", fmt.Sprintf("%d", start.Unix()))
- v.Add("end", fmt.Sprintf("%d", end.Unix()))
-
- for opt, val := range options {
- v.Add(opt, val)
- }
-
- return client.doSnapshotRequest(v)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/tags.go b/vendor/github.com/zorkian/go-datadog-api/tags.go
deleted file mode 100644
index 54daa35..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/tags.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-// TagMap is used to receive the format given to us by the API.
-type TagMap map[string][]string
-
-// reqGetTags is the container for receiving tags.
-type reqGetTags struct {
- Tags *TagMap `json:"tags,omitempty"`
-}
-
-// regGetHostTags is for receiving a slice of tags.
-type reqGetHostTags struct {
- Tags []string `json:"tags,omitempty"`
-}
-
-// GetTags returns a map of tags.
-func (client *Client) GetTags(source string) (TagMap, error) {
- var out reqGetTags
- uri := "/v1/tags/hosts"
- if source != "" {
- uri += "?source=" + source
- }
- if err := client.doJsonRequest("GET", uri, nil, &out); err != nil {
- return nil, err
- }
- return *out.Tags, nil
-}
-
-// GetHostTags returns a slice of tags for a given host and source.
-func (client *Client) GetHostTags(host, source string) ([]string, error) {
- var out reqGetHostTags
- uri := "/v1/tags/hosts/" + host
- if source != "" {
- uri += "?source=" + source
- }
- if err := client.doJsonRequest("GET", uri, nil, &out); err != nil {
- return nil, err
- }
- return out.Tags, nil
-}
-
-// GetHostTagsBySource is a different way of viewing the tags. It returns a map
-// of source:[tag,tag].
-func (client *Client) GetHostTagsBySource(host, source string) (TagMap, error) {
- var out reqGetTags
- uri := "/v1/tags/hosts/" + host + "?by_source=true"
- if source != "" {
- uri += "&source=" + source
- }
- if err := client.doJsonRequest("GET", uri, nil, &out); err != nil {
- return nil, err
- }
- return *out.Tags, nil
-}
-
-// AddTagsToHost does exactly what it says on the tin. Given a list of tags,
-// add them to the host. The source is optionally specified, and defaults to
-// "users" as per the API documentation.
-func (client *Client) AddTagsToHost(host, source string, tags []string) error {
- uri := "/v1/tags/hosts/" + host
- if source != "" {
- uri += "?source=" + source
- }
- return client.doJsonRequest("POST", uri, reqGetHostTags{Tags: tags}, nil)
-}
-
-// UpdateHostTags overwrites existing tags for a host, allowing you to specify
-// a new set of tags for the given source. This defaults to "users".
-func (client *Client) UpdateHostTags(host, source string, tags []string) error {
- uri := "/v1/tags/hosts/" + host
- if source != "" {
- uri += "?source=" + source
- }
- return client.doJsonRequest("PUT", uri, reqGetHostTags{Tags: tags}, nil)
-}
-
-// RemoveHostTags removes all tags from a host for the given source. If none is
-// given, the API defaults to "users".
-func (client *Client) RemoveHostTags(host, source string) error {
- uri := "/v1/tags/hosts/" + host
- if source != "" {
- uri += "?source=" + source
- }
- return client.doJsonRequest("DELETE", uri, nil, nil)
-}
diff --git a/vendor/github.com/zorkian/go-datadog-api/users.go b/vendor/github.com/zorkian/go-datadog-api/users.go
deleted file mode 100644
index 0a90402..0000000
--- a/vendor/github.com/zorkian/go-datadog-api/users.go
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Datadog API for Go
- *
- * Please see the included LICENSE file for licensing information.
- *
- * Copyright 2013 by authors and contributors.
- */
-
-package datadog
-
-type User struct {
- Handle *string `json:"handle,omitempty"`
- Email *string `json:"email,omitempty"`
- Name *string `json:"name,omitempty"`
- Role *string `json:"role,omitempty"`
- AccessRole *string `json:"access_role,omitempty"`
- Verified *bool `json:"verified,omitempty"`
- Disabled *bool `json:"disabled,omitempty"`
-
- // DEPRECATED: IsAdmin is deprecated and will be removed in the next major
- // revision. For more info on why it is being removed, see discussion on
- // https://github.com/zorkian/go-datadog-api/issues/126.
- IsAdmin *bool `json:"is_admin,omitempty"`
-}
-
-// reqInviteUsers contains email addresses to send invitations to.
-type reqInviteUsers struct {
- Emails []string `json:"emails,omitempty"`
-}
-
-// InviteUsers takes a slice of email addresses and sends invitations to them.
-func (client *Client) InviteUsers(emails []string) error {
- return client.doJsonRequest("POST", "/v1/invite_users",
- reqInviteUsers{Emails: emails}, nil)
-}
-
-// CreateUser creates an user account for an email address
-func (self *Client) CreateUser(handle, name *string) (*User, error) {
- in := struct {
- Handle *string `json:"handle"`
- Name *string `json:"name"`
- }{
- Handle: handle,
- Name: name,
- }
-
- out := struct {
- *User `json:"user"`
- }{}
- if err := self.doJsonRequest("POST", "/v1/user", in, &out); err != nil {
- return nil, err
- }
- return out.User, nil
-}
-
-// internal type to retrieve users from the api
-type usersData struct {
- Users []User `json:"users,omitempty"`
-}
-
-// GetUsers returns all user, or an error if not found
-func (client *Client) GetUsers() (users []User, err error) {
- var udata usersData
- uri := "/v1/user"
- err = client.doJsonRequest("GET", uri, nil, &udata)
- users = udata.Users
- return
-}
-
-// internal type to retrieve single user from the api
-type userData struct {
- User User `json:"user"`
-}
-
-// GetUser returns the user that match a handle, or an error if not found
-func (client *Client) GetUser(handle string) (user User, err error) {
- var udata userData
- uri := "/v1/user/" + handle
- err = client.doJsonRequest("GET", uri, nil, &udata)
- user = udata.User
- return
-}
-
-// UpdateUser updates a user with the content of `user`,
-// and returns an error if the update failed
-func (client *Client) UpdateUser(user User) error {
- uri := "/v1/user/" + *user.Handle
- return client.doJsonRequest("PUT", uri, user, nil)
-}
-
-// DeleteUser deletes a user and returns an error if deletion failed
-func (client *Client) DeleteUser(handle string) error {
- uri := "/v1/user/" + handle
- return client.doJsonRequest("DELETE", uri, nil, nil)
-}
diff --git a/vendor/golang.org/x/crypto/AUTHORS b/vendor/golang.org/x/crypto/AUTHORS
deleted file mode 100644
index 2b00ddb..0000000
--- a/vendor/golang.org/x/crypto/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code refers to The Go Authors for copyright purposes.
-# The master list of authors is in the main Go distribution,
-# visible at https://tip.golang.org/AUTHORS.
diff --git a/vendor/golang.org/x/crypto/CONTRIBUTORS b/vendor/golang.org/x/crypto/CONTRIBUTORS
deleted file mode 100644
index 1fbd3e9..0000000
--- a/vendor/golang.org/x/crypto/CONTRIBUTORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code was written by the Go contributors.
-# The master list of contributors is in the main Go distribution,
-# visible at https://tip.golang.org/CONTRIBUTORS.
diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE
deleted file mode 100644
index 6a66aea..0000000
--- a/vendor/golang.org/x/crypto/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2009 The 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.
diff --git a/vendor/golang.org/x/crypto/PATENTS b/vendor/golang.org/x/crypto/PATENTS
deleted file mode 100644
index 7330990..0000000
--- a/vendor/golang.org/x/crypto/PATENTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Additional IP Rights Grant (Patents)
-
-"This implementation" means the copyrightable works distributed by
-Google as part of the Go project.
-
-Google 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,
-transfer and otherwise run, modify and propagate the contents of this
-implementation of Go, where such license applies only to those patent
-claims, both currently owned or controlled by Google and acquired in
-the future, licensable by Google that are necessarily infringed by this
-implementation of Go. This grant does not include claims that would be
-infringed only as a consequence of further modification of this
-implementation. If you or your agent or exclusive licensee institute or
-order or agree to the institution of patent litigation against any
-entity (including a cross-claim or counterclaim in a lawsuit) alleging
-that this implementation of Go or any code incorporated within this
-implementation of Go constitutes direct or contributory patent
-infringement, or inducement of patent infringement, then any patent
-rights granted to you under this License for this implementation of Go
-shall terminate as of the date such litigation is filed.
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
deleted file mode 100644
index 9a88759..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
+++ /dev/null
@@ -1,951 +0,0 @@
-// Copyright 2011 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.
-
-package terminal
-
-import (
- "bytes"
- "io"
- "sync"
- "unicode/utf8"
-)
-
-// EscapeCodes contains escape sequences that can be written to the terminal in
-// order to achieve different styles of text.
-type EscapeCodes struct {
- // Foreground colors
- Black, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte
-
- // Reset all attributes
- Reset []byte
-}
-
-var vt100EscapeCodes = EscapeCodes{
- Black: []byte{keyEscape, '[', '3', '0', 'm'},
- Red: []byte{keyEscape, '[', '3', '1', 'm'},
- Green: []byte{keyEscape, '[', '3', '2', 'm'},
- Yellow: []byte{keyEscape, '[', '3', '3', 'm'},
- Blue: []byte{keyEscape, '[', '3', '4', 'm'},
- Magenta: []byte{keyEscape, '[', '3', '5', 'm'},
- Cyan: []byte{keyEscape, '[', '3', '6', 'm'},
- White: []byte{keyEscape, '[', '3', '7', 'm'},
-
- Reset: []byte{keyEscape, '[', '0', 'm'},
-}
-
-// Terminal contains the state for running a VT100 terminal that is capable of
-// reading lines of input.
-type Terminal struct {
- // AutoCompleteCallback, if non-null, is called for each keypress with
- // the full input line and the current position of the cursor (in
- // bytes, as an index into |line|). If it returns ok=false, the key
- // press is processed normally. Otherwise it returns a replacement line
- // and the new cursor position.
- AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool)
-
- // Escape contains a pointer to the escape codes for this terminal.
- // It's always a valid pointer, although the escape codes themselves
- // may be empty if the terminal doesn't support them.
- Escape *EscapeCodes
-
- // lock protects the terminal and the state in this object from
- // concurrent processing of a key press and a Write() call.
- lock sync.Mutex
-
- c io.ReadWriter
- prompt []rune
-
- // line is the current line being entered.
- line []rune
- // pos is the logical position of the cursor in line
- pos int
- // echo is true if local echo is enabled
- echo bool
- // pasteActive is true iff there is a bracketed paste operation in
- // progress.
- pasteActive bool
-
- // cursorX contains the current X value of the cursor where the left
- // edge is 0. cursorY contains the row number where the first row of
- // the current line is 0.
- cursorX, cursorY int
- // maxLine is the greatest value of cursorY so far.
- maxLine int
-
- termWidth, termHeight int
-
- // outBuf contains the terminal data to be sent.
- outBuf []byte
- // remainder contains the remainder of any partial key sequences after
- // a read. It aliases into inBuf.
- remainder []byte
- inBuf [256]byte
-
- // history contains previously entered commands so that they can be
- // accessed with the up and down keys.
- history stRingBuffer
- // historyIndex stores the currently accessed history entry, where zero
- // means the immediately previous entry.
- historyIndex int
- // When navigating up and down the history it's possible to return to
- // the incomplete, initial line. That value is stored in
- // historyPending.
- historyPending string
-}
-
-// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is
-// a local terminal, that terminal must first have been put into raw mode.
-// prompt is a string that is written at the start of each input line (i.e.
-// "> ").
-func NewTerminal(c io.ReadWriter, prompt string) *Terminal {
- return &Terminal{
- Escape: &vt100EscapeCodes,
- c: c,
- prompt: []rune(prompt),
- termWidth: 80,
- termHeight: 24,
- echo: true,
- historyIndex: -1,
- }
-}
-
-const (
- keyCtrlD = 4
- keyCtrlU = 21
- keyEnter = '\r'
- keyEscape = 27
- keyBackspace = 127
- keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota
- keyUp
- keyDown
- keyLeft
- keyRight
- keyAltLeft
- keyAltRight
- keyHome
- keyEnd
- keyDeleteWord
- keyDeleteLine
- keyClearScreen
- keyPasteStart
- keyPasteEnd
-)
-
-var (
- crlf = []byte{'\r', '\n'}
- pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'}
- pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'}
-)
-
-// bytesToKey tries to parse a key sequence from b. If successful, it returns
-// the key and the remainder of the input. Otherwise it returns utf8.RuneError.
-func bytesToKey(b []byte, pasteActive bool) (rune, []byte) {
- if len(b) == 0 {
- return utf8.RuneError, nil
- }
-
- if !pasteActive {
- switch b[0] {
- case 1: // ^A
- return keyHome, b[1:]
- case 5: // ^E
- return keyEnd, b[1:]
- case 8: // ^H
- return keyBackspace, b[1:]
- case 11: // ^K
- return keyDeleteLine, b[1:]
- case 12: // ^L
- return keyClearScreen, b[1:]
- case 23: // ^W
- return keyDeleteWord, b[1:]
- }
- }
-
- if b[0] != keyEscape {
- if !utf8.FullRune(b) {
- return utf8.RuneError, b
- }
- r, l := utf8.DecodeRune(b)
- return r, b[l:]
- }
-
- if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' {
- switch b[2] {
- case 'A':
- return keyUp, b[3:]
- case 'B':
- return keyDown, b[3:]
- case 'C':
- return keyRight, b[3:]
- case 'D':
- return keyLeft, b[3:]
- case 'H':
- return keyHome, b[3:]
- case 'F':
- return keyEnd, b[3:]
- }
- }
-
- if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' {
- switch b[5] {
- case 'C':
- return keyAltRight, b[6:]
- case 'D':
- return keyAltLeft, b[6:]
- }
- }
-
- if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) {
- return keyPasteStart, b[6:]
- }
-
- if pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) {
- return keyPasteEnd, b[6:]
- }
-
- // If we get here then we have a key that we don't recognise, or a
- // partial sequence. It's not clear how one should find the end of a
- // sequence without knowing them all, but it seems that [a-zA-Z~] only
- // appears at the end of a sequence.
- for i, c := range b[0:] {
- if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' {
- return keyUnknown, b[i+1:]
- }
- }
-
- return utf8.RuneError, b
-}
-
-// queue appends data to the end of t.outBuf
-func (t *Terminal) queue(data []rune) {
- t.outBuf = append(t.outBuf, []byte(string(data))...)
-}
-
-var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'}
-var space = []rune{' '}
-
-func isPrintable(key rune) bool {
- isInSurrogateArea := key >= 0xd800 && key <= 0xdbff
- return key >= 32 && !isInSurrogateArea
-}
-
-// moveCursorToPos appends data to t.outBuf which will move the cursor to the
-// given, logical position in the text.
-func (t *Terminal) moveCursorToPos(pos int) {
- if !t.echo {
- return
- }
-
- x := visualLength(t.prompt) + pos
- y := x / t.termWidth
- x = x % t.termWidth
-
- up := 0
- if y < t.cursorY {
- up = t.cursorY - y
- }
-
- down := 0
- if y > t.cursorY {
- down = y - t.cursorY
- }
-
- left := 0
- if x < t.cursorX {
- left = t.cursorX - x
- }
-
- right := 0
- if x > t.cursorX {
- right = x - t.cursorX
- }
-
- t.cursorX = x
- t.cursorY = y
- t.move(up, down, left, right)
-}
-
-func (t *Terminal) move(up, down, left, right int) {
- movement := make([]rune, 3*(up+down+left+right))
- m := movement
- for i := 0; i < up; i++ {
- m[0] = keyEscape
- m[1] = '['
- m[2] = 'A'
- m = m[3:]
- }
- for i := 0; i < down; i++ {
- m[0] = keyEscape
- m[1] = '['
- m[2] = 'B'
- m = m[3:]
- }
- for i := 0; i < left; i++ {
- m[0] = keyEscape
- m[1] = '['
- m[2] = 'D'
- m = m[3:]
- }
- for i := 0; i < right; i++ {
- m[0] = keyEscape
- m[1] = '['
- m[2] = 'C'
- m = m[3:]
- }
-
- t.queue(movement)
-}
-
-func (t *Terminal) clearLineToRight() {
- op := []rune{keyEscape, '[', 'K'}
- t.queue(op)
-}
-
-const maxLineLength = 4096
-
-func (t *Terminal) setLine(newLine []rune, newPos int) {
- if t.echo {
- t.moveCursorToPos(0)
- t.writeLine(newLine)
- for i := len(newLine); i < len(t.line); i++ {
- t.writeLine(space)
- }
- t.moveCursorToPos(newPos)
- }
- t.line = newLine
- t.pos = newPos
-}
-
-func (t *Terminal) advanceCursor(places int) {
- t.cursorX += places
- t.cursorY += t.cursorX / t.termWidth
- if t.cursorY > t.maxLine {
- t.maxLine = t.cursorY
- }
- t.cursorX = t.cursorX % t.termWidth
-
- if places > 0 && t.cursorX == 0 {
- // Normally terminals will advance the current position
- // when writing a character. But that doesn't happen
- // for the last character in a line. However, when
- // writing a character (except a new line) that causes
- // a line wrap, the position will be advanced two
- // places.
- //
- // So, if we are stopping at the end of a line, we
- // need to write a newline so that our cursor can be
- // advanced to the next line.
- t.outBuf = append(t.outBuf, '\r', '\n')
- }
-}
-
-func (t *Terminal) eraseNPreviousChars(n int) {
- if n == 0 {
- return
- }
-
- if t.pos < n {
- n = t.pos
- }
- t.pos -= n
- t.moveCursorToPos(t.pos)
-
- copy(t.line[t.pos:], t.line[n+t.pos:])
- t.line = t.line[:len(t.line)-n]
- if t.echo {
- t.writeLine(t.line[t.pos:])
- for i := 0; i < n; i++ {
- t.queue(space)
- }
- t.advanceCursor(n)
- t.moveCursorToPos(t.pos)
- }
-}
-
-// countToLeftWord returns then number of characters from the cursor to the
-// start of the previous word.
-func (t *Terminal) countToLeftWord() int {
- if t.pos == 0 {
- return 0
- }
-
- pos := t.pos - 1
- for pos > 0 {
- if t.line[pos] != ' ' {
- break
- }
- pos--
- }
- for pos > 0 {
- if t.line[pos] == ' ' {
- pos++
- break
- }
- pos--
- }
-
- return t.pos - pos
-}
-
-// countToRightWord returns then number of characters from the cursor to the
-// start of the next word.
-func (t *Terminal) countToRightWord() int {
- pos := t.pos
- for pos < len(t.line) {
- if t.line[pos] == ' ' {
- break
- }
- pos++
- }
- for pos < len(t.line) {
- if t.line[pos] != ' ' {
- break
- }
- pos++
- }
- return pos - t.pos
-}
-
-// visualLength returns the number of visible glyphs in s.
-func visualLength(runes []rune) int {
- inEscapeSeq := false
- length := 0
-
- for _, r := range runes {
- switch {
- case inEscapeSeq:
- if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {
- inEscapeSeq = false
- }
- case r == '\x1b':
- inEscapeSeq = true
- default:
- length++
- }
- }
-
- return length
-}
-
-// handleKey processes the given key and, optionally, returns a line of text
-// that the user has entered.
-func (t *Terminal) handleKey(key rune) (line string, ok bool) {
- if t.pasteActive && key != keyEnter {
- t.addKeyToLine(key)
- return
- }
-
- switch key {
- case keyBackspace:
- if t.pos == 0 {
- return
- }
- t.eraseNPreviousChars(1)
- case keyAltLeft:
- // move left by a word.
- t.pos -= t.countToLeftWord()
- t.moveCursorToPos(t.pos)
- case keyAltRight:
- // move right by a word.
- t.pos += t.countToRightWord()
- t.moveCursorToPos(t.pos)
- case keyLeft:
- if t.pos == 0 {
- return
- }
- t.pos--
- t.moveCursorToPos(t.pos)
- case keyRight:
- if t.pos == len(t.line) {
- return
- }
- t.pos++
- t.moveCursorToPos(t.pos)
- case keyHome:
- if t.pos == 0 {
- return
- }
- t.pos = 0
- t.moveCursorToPos(t.pos)
- case keyEnd:
- if t.pos == len(t.line) {
- return
- }
- t.pos = len(t.line)
- t.moveCursorToPos(t.pos)
- case keyUp:
- entry, ok := t.history.NthPreviousEntry(t.historyIndex + 1)
- if !ok {
- return "", false
- }
- if t.historyIndex == -1 {
- t.historyPending = string(t.line)
- }
- t.historyIndex++
- runes := []rune(entry)
- t.setLine(runes, len(runes))
- case keyDown:
- switch t.historyIndex {
- case -1:
- return
- case 0:
- runes := []rune(t.historyPending)
- t.setLine(runes, len(runes))
- t.historyIndex--
- default:
- entry, ok := t.history.NthPreviousEntry(t.historyIndex - 1)
- if ok {
- t.historyIndex--
- runes := []rune(entry)
- t.setLine(runes, len(runes))
- }
- }
- case keyEnter:
- t.moveCursorToPos(len(t.line))
- t.queue([]rune("\r\n"))
- line = string(t.line)
- ok = true
- t.line = t.line[:0]
- t.pos = 0
- t.cursorX = 0
- t.cursorY = 0
- t.maxLine = 0
- case keyDeleteWord:
- // Delete zero or more spaces and then one or more characters.
- t.eraseNPreviousChars(t.countToLeftWord())
- case keyDeleteLine:
- // Delete everything from the current cursor position to the
- // end of line.
- for i := t.pos; i < len(t.line); i++ {
- t.queue(space)
- t.advanceCursor(1)
- }
- t.line = t.line[:t.pos]
- t.moveCursorToPos(t.pos)
- case keyCtrlD:
- // Erase the character under the current position.
- // The EOF case when the line is empty is handled in
- // readLine().
- if t.pos < len(t.line) {
- t.pos++
- t.eraseNPreviousChars(1)
- }
- case keyCtrlU:
- t.eraseNPreviousChars(t.pos)
- case keyClearScreen:
- // Erases the screen and moves the cursor to the home position.
- t.queue([]rune("\x1b[2J\x1b[H"))
- t.queue(t.prompt)
- t.cursorX, t.cursorY = 0, 0
- t.advanceCursor(visualLength(t.prompt))
- t.setLine(t.line, t.pos)
- default:
- if t.AutoCompleteCallback != nil {
- prefix := string(t.line[:t.pos])
- suffix := string(t.line[t.pos:])
-
- t.lock.Unlock()
- newLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key)
- t.lock.Lock()
-
- if completeOk {
- t.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos]))
- return
- }
- }
- if !isPrintable(key) {
- return
- }
- if len(t.line) == maxLineLength {
- return
- }
- t.addKeyToLine(key)
- }
- return
-}
-
-// addKeyToLine inserts the given key at the current position in the current
-// line.
-func (t *Terminal) addKeyToLine(key rune) {
- if len(t.line) == cap(t.line) {
- newLine := make([]rune, len(t.line), 2*(1+len(t.line)))
- copy(newLine, t.line)
- t.line = newLine
- }
- t.line = t.line[:len(t.line)+1]
- copy(t.line[t.pos+1:], t.line[t.pos:])
- t.line[t.pos] = key
- if t.echo {
- t.writeLine(t.line[t.pos:])
- }
- t.pos++
- t.moveCursorToPos(t.pos)
-}
-
-func (t *Terminal) writeLine(line []rune) {
- for len(line) != 0 {
- remainingOnLine := t.termWidth - t.cursorX
- todo := len(line)
- if todo > remainingOnLine {
- todo = remainingOnLine
- }
- t.queue(line[:todo])
- t.advanceCursor(visualLength(line[:todo]))
- line = line[todo:]
- }
-}
-
-// writeWithCRLF writes buf to w but replaces all occurrences of \n with \r\n.
-func writeWithCRLF(w io.Writer, buf []byte) (n int, err error) {
- for len(buf) > 0 {
- i := bytes.IndexByte(buf, '\n')
- todo := len(buf)
- if i >= 0 {
- todo = i
- }
-
- var nn int
- nn, err = w.Write(buf[:todo])
- n += nn
- if err != nil {
- return n, err
- }
- buf = buf[todo:]
-
- if i >= 0 {
- if _, err = w.Write(crlf); err != nil {
- return n, err
- }
- n++
- buf = buf[1:]
- }
- }
-
- return n, nil
-}
-
-func (t *Terminal) Write(buf []byte) (n int, err error) {
- t.lock.Lock()
- defer t.lock.Unlock()
-
- if t.cursorX == 0 && t.cursorY == 0 {
- // This is the easy case: there's nothing on the screen that we
- // have to move out of the way.
- return writeWithCRLF(t.c, buf)
- }
-
- // We have a prompt and possibly user input on the screen. We
- // have to clear it first.
- t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */)
- t.cursorX = 0
- t.clearLineToRight()
-
- for t.cursorY > 0 {
- t.move(1 /* up */, 0, 0, 0)
- t.cursorY--
- t.clearLineToRight()
- }
-
- if _, err = t.c.Write(t.outBuf); err != nil {
- return
- }
- t.outBuf = t.outBuf[:0]
-
- if n, err = writeWithCRLF(t.c, buf); err != nil {
- return
- }
-
- t.writeLine(t.prompt)
- if t.echo {
- t.writeLine(t.line)
- }
-
- t.moveCursorToPos(t.pos)
-
- if _, err = t.c.Write(t.outBuf); err != nil {
- return
- }
- t.outBuf = t.outBuf[:0]
- return
-}
-
-// ReadPassword temporarily changes the prompt and reads a password, without
-// echo, from the terminal.
-func (t *Terminal) ReadPassword(prompt string) (line string, err error) {
- t.lock.Lock()
- defer t.lock.Unlock()
-
- oldPrompt := t.prompt
- t.prompt = []rune(prompt)
- t.echo = false
-
- line, err = t.readLine()
-
- t.prompt = oldPrompt
- t.echo = true
-
- return
-}
-
-// ReadLine returns a line of input from the terminal.
-func (t *Terminal) ReadLine() (line string, err error) {
- t.lock.Lock()
- defer t.lock.Unlock()
-
- return t.readLine()
-}
-
-func (t *Terminal) readLine() (line string, err error) {
- // t.lock must be held at this point
-
- if t.cursorX == 0 && t.cursorY == 0 {
- t.writeLine(t.prompt)
- t.c.Write(t.outBuf)
- t.outBuf = t.outBuf[:0]
- }
-
- lineIsPasted := t.pasteActive
-
- for {
- rest := t.remainder
- lineOk := false
- for !lineOk {
- var key rune
- key, rest = bytesToKey(rest, t.pasteActive)
- if key == utf8.RuneError {
- break
- }
- if !t.pasteActive {
- if key == keyCtrlD {
- if len(t.line) == 0 {
- return "", io.EOF
- }
- }
- if key == keyPasteStart {
- t.pasteActive = true
- if len(t.line) == 0 {
- lineIsPasted = true
- }
- continue
- }
- } else if key == keyPasteEnd {
- t.pasteActive = false
- continue
- }
- if !t.pasteActive {
- lineIsPasted = false
- }
- line, lineOk = t.handleKey(key)
- }
- if len(rest) > 0 {
- n := copy(t.inBuf[:], rest)
- t.remainder = t.inBuf[:n]
- } else {
- t.remainder = nil
- }
- t.c.Write(t.outBuf)
- t.outBuf = t.outBuf[:0]
- if lineOk {
- if t.echo {
- t.historyIndex = -1
- t.history.Add(line)
- }
- if lineIsPasted {
- err = ErrPasteIndicator
- }
- return
- }
-
- // t.remainder is a slice at the beginning of t.inBuf
- // containing a partial key sequence
- readBuf := t.inBuf[len(t.remainder):]
- var n int
-
- t.lock.Unlock()
- n, err = t.c.Read(readBuf)
- t.lock.Lock()
-
- if err != nil {
- return
- }
-
- t.remainder = t.inBuf[:n+len(t.remainder)]
- }
-}
-
-// SetPrompt sets the prompt to be used when reading subsequent lines.
-func (t *Terminal) SetPrompt(prompt string) {
- t.lock.Lock()
- defer t.lock.Unlock()
-
- t.prompt = []rune(prompt)
-}
-
-func (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) {
- // Move cursor to column zero at the start of the line.
- t.move(t.cursorY, 0, t.cursorX, 0)
- t.cursorX, t.cursorY = 0, 0
- t.clearLineToRight()
- for t.cursorY < numPrevLines {
- // Move down a line
- t.move(0, 1, 0, 0)
- t.cursorY++
- t.clearLineToRight()
- }
- // Move back to beginning.
- t.move(t.cursorY, 0, 0, 0)
- t.cursorX, t.cursorY = 0, 0
-
- t.queue(t.prompt)
- t.advanceCursor(visualLength(t.prompt))
- t.writeLine(t.line)
- t.moveCursorToPos(t.pos)
-}
-
-func (t *Terminal) SetSize(width, height int) error {
- t.lock.Lock()
- defer t.lock.Unlock()
-
- if width == 0 {
- width = 1
- }
-
- oldWidth := t.termWidth
- t.termWidth, t.termHeight = width, height
-
- switch {
- case width == oldWidth:
- // If the width didn't change then nothing else needs to be
- // done.
- return nil
- case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0:
- // If there is nothing on current line and no prompt printed,
- // just do nothing
- return nil
- case width < oldWidth:
- // Some terminals (e.g. xterm) will truncate lines that were
- // too long when shinking. Others, (e.g. gnome-terminal) will
- // attempt to wrap them. For the former, repainting t.maxLine
- // works great, but that behaviour goes badly wrong in the case
- // of the latter because they have doubled every full line.
-
- // We assume that we are working on a terminal that wraps lines
- // and adjust the cursor position based on every previous line
- // wrapping and turning into two. This causes the prompt on
- // xterms to move upwards, which isn't great, but it avoids a
- // huge mess with gnome-terminal.
- if t.cursorX >= t.termWidth {
- t.cursorX = t.termWidth - 1
- }
- t.cursorY *= 2
- t.clearAndRepaintLinePlusNPrevious(t.maxLine * 2)
- case width > oldWidth:
- // If the terminal expands then our position calculations will
- // be wrong in the future because we think the cursor is
- // |t.pos| chars into the string, but there will be a gap at
- // the end of any wrapped line.
- //
- // But the position will actually be correct until we move, so
- // we can move back to the beginning and repaint everything.
- t.clearAndRepaintLinePlusNPrevious(t.maxLine)
- }
-
- _, err := t.c.Write(t.outBuf)
- t.outBuf = t.outBuf[:0]
- return err
-}
-
-type pasteIndicatorError struct{}
-
-func (pasteIndicatorError) Error() string {
- return "terminal: ErrPasteIndicator not correctly handled"
-}
-
-// ErrPasteIndicator may be returned from ReadLine as the error, in addition
-// to valid line data. It indicates that bracketed paste mode is enabled and
-// that the returned line consists only of pasted data. Programs may wish to
-// interpret pasted data more literally than typed data.
-var ErrPasteIndicator = pasteIndicatorError{}
-
-// SetBracketedPasteMode requests that the terminal bracket paste operations
-// with markers. Not all terminals support this but, if it is supported, then
-// enabling this mode will stop any autocomplete callback from running due to
-// pastes. Additionally, any lines that are completely pasted will be returned
-// from ReadLine with the error set to ErrPasteIndicator.
-func (t *Terminal) SetBracketedPasteMode(on bool) {
- if on {
- io.WriteString(t.c, "\x1b[?2004h")
- } else {
- io.WriteString(t.c, "\x1b[?2004l")
- }
-}
-
-// stRingBuffer is a ring buffer of strings.
-type stRingBuffer struct {
- // entries contains max elements.
- entries []string
- max int
- // head contains the index of the element most recently added to the ring.
- head int
- // size contains the number of elements in the ring.
- size int
-}
-
-func (s *stRingBuffer) Add(a string) {
- if s.entries == nil {
- const defaultNumEntries = 100
- s.entries = make([]string, defaultNumEntries)
- s.max = defaultNumEntries
- }
-
- s.head = (s.head + 1) % s.max
- s.entries[s.head] = a
- if s.size < s.max {
- s.size++
- }
-}
-
-// NthPreviousEntry returns the value passed to the nth previous call to Add.
-// If n is zero then the immediately prior value is returned, if one, then the
-// next most recent, and so on. If such an element doesn't exist then ok is
-// false.
-func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {
- if n >= s.size {
- return "", false
- }
- index := s.head - n
- if index < 0 {
- index += s.max
- }
- return s.entries[index], true
-}
-
-// readPasswordLine reads from reader until it finds \n or io.EOF.
-// The slice returned does not include the \n.
-// readPasswordLine also ignores any \r it finds.
-func readPasswordLine(reader io.Reader) ([]byte, error) {
- var buf [1]byte
- var ret []byte
-
- for {
- n, err := reader.Read(buf[:])
- if n > 0 {
- switch buf[0] {
- case '\n':
- return ret, nil
- case '\r':
- // remove \r from passwords on Windows
- default:
- ret = append(ret, buf[0])
- }
- continue
- }
- if err != nil {
- if err == io.EOF && len(ret) > 0 {
- return ret, nil
- }
- return ret, err
- }
- }
-}
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util.go b/vendor/golang.org/x/crypto/ssh/terminal/util.go
deleted file mode 100644
index 3911040..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2011 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 aix darwin dragonfly freebsd linux,!appengine netbsd openbsd
-
-// Package terminal provides support functions for dealing with terminals, as
-// commonly found on UNIX systems.
-//
-// Putting a terminal into raw mode is the most common requirement:
-//
-// oldState, err := terminal.MakeRaw(0)
-// if err != nil {
-// panic(err)
-// }
-// defer terminal.Restore(0, oldState)
-package terminal // import "golang.org/x/crypto/ssh/terminal"
-
-import (
- "golang.org/x/sys/unix"
-)
-
-// State contains the state of a terminal.
-type State struct {
- termios unix.Termios
-}
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- _, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
- return err == nil
-}
-
-// MakeRaw put the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-func MakeRaw(fd int) (*State, error) {
- termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
- if err != nil {
- return nil, err
- }
-
- oldState := State{termios: *termios}
-
- // This attempts to replicate the behaviour documented for cfmakeraw in
- // the termios(3) manpage.
- termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON
- termios.Oflag &^= unix.OPOST
- termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN
- termios.Cflag &^= unix.CSIZE | unix.PARENB
- termios.Cflag |= unix.CS8
- termios.Cc[unix.VMIN] = 1
- termios.Cc[unix.VTIME] = 0
- if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, termios); err != nil {
- return nil, err
- }
-
- return &oldState, nil
-}
-
-// GetState returns the current state of a terminal which may be useful to
-// restore the terminal after a signal.
-func GetState(fd int) (*State, error) {
- termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
- if err != nil {
- return nil, err
- }
-
- return &State{termios: *termios}, nil
-}
-
-// Restore restores the terminal connected to the given file descriptor to a
-// previous state.
-func Restore(fd int, state *State) error {
- return unix.IoctlSetTermios(fd, ioctlWriteTermios, &state.termios)
-}
-
-// GetSize returns the dimensions of the given terminal.
-func GetSize(fd int) (width, height int, err error) {
- ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ)
- if err != nil {
- return -1, -1, err
- }
- return int(ws.Col), int(ws.Row), nil
-}
-
-// passwordReader is an io.Reader that reads from a specific file descriptor.
-type passwordReader int
-
-func (r passwordReader) Read(buf []byte) (int, error) {
- return unix.Read(int(r), buf)
-}
-
-// ReadPassword reads a line of input from a terminal without local echo. This
-// is commonly used for inputting passwords and other sensitive data. The slice
-// returned does not include the \n.
-func ReadPassword(fd int) ([]byte, error) {
- termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
- if err != nil {
- return nil, err
- }
-
- newState := *termios
- newState.Lflag &^= unix.ECHO
- newState.Lflag |= unix.ICANON | unix.ISIG
- newState.Iflag |= unix.ICRNL
- if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, &newState); err != nil {
- return nil, err
- }
-
- defer unix.IoctlSetTermios(fd, ioctlWriteTermios, termios)
-
- return readPasswordLine(passwordReader(fd))
-}
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_aix.go b/vendor/golang.org/x/crypto/ssh/terminal/util_aix.go
deleted file mode 100644
index dfcd627..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_aix.go
+++ /dev/null
@@ -1,12 +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 aix
-
-package terminal
-
-import "golang.org/x/sys/unix"
-
-const ioctlReadTermios = unix.TCGETS
-const ioctlWriteTermios = unix.TCSETS
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go b/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go
deleted file mode 100644
index cb23a59..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go
+++ /dev/null
@@ -1,12 +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 darwin dragonfly freebsd netbsd openbsd
-
-package terminal
-
-import "golang.org/x/sys/unix"
-
-const ioctlReadTermios = unix.TIOCGETA
-const ioctlWriteTermios = unix.TIOCSETA
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go b/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go
deleted file mode 100644
index 5fadfe8..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go
+++ /dev/null
@@ -1,10 +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.
-
-package terminal
-
-import "golang.org/x/sys/unix"
-
-const ioctlReadTermios = unix.TCGETS
-const ioctlWriteTermios = unix.TCSETS
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go b/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go
deleted file mode 100644
index 9317ac7..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go
+++ /dev/null
@@ -1,58 +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.
-
-// Package terminal provides support functions for dealing with terminals, as
-// commonly found on UNIX systems.
-//
-// Putting a terminal into raw mode is the most common requirement:
-//
-// oldState, err := terminal.MakeRaw(0)
-// if err != nil {
-// panic(err)
-// }
-// defer terminal.Restore(0, oldState)
-package terminal
-
-import (
- "fmt"
- "runtime"
-)
-
-type State struct{}
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- return false
-}
-
-// MakeRaw put the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-func MakeRaw(fd int) (*State, error) {
- return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
-}
-
-// GetState returns the current state of a terminal which may be useful to
-// restore the terminal after a signal.
-func GetState(fd int) (*State, error) {
- return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
-}
-
-// Restore restores the terminal connected to the given file descriptor to a
-// previous state.
-func Restore(fd int, state *State) error {
- return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
-}
-
-// GetSize returns the dimensions of the given terminal.
-func GetSize(fd int) (width, height int, err error) {
- return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
-}
-
-// ReadPassword reads a line of input from a terminal without local echo. This
-// is commonly used for inputting passwords and other sensitive data. The slice
-// returned does not include the \n.
-func ReadPassword(fd int) ([]byte, error) {
- return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
-}
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go
deleted file mode 100644
index 3d5f06a..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2015 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 solaris
-
-package terminal // import "golang.org/x/crypto/ssh/terminal"
-
-import (
- "golang.org/x/sys/unix"
- "io"
- "syscall"
-)
-
-// State contains the state of a terminal.
-type State struct {
- termios unix.Termios
-}
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- _, err := unix.IoctlGetTermio(fd, unix.TCGETA)
- return err == nil
-}
-
-// ReadPassword reads a line of input from a terminal without local echo. This
-// is commonly used for inputting passwords and other sensitive data. The slice
-// returned does not include the \n.
-func ReadPassword(fd int) ([]byte, error) {
- // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c
- val, err := unix.IoctlGetTermios(fd, unix.TCGETS)
- if err != nil {
- return nil, err
- }
- oldState := *val
-
- newState := oldState
- newState.Lflag &^= syscall.ECHO
- newState.Lflag |= syscall.ICANON | syscall.ISIG
- newState.Iflag |= syscall.ICRNL
- err = unix.IoctlSetTermios(fd, unix.TCSETS, &newState)
- if err != nil {
- return nil, err
- }
-
- defer unix.IoctlSetTermios(fd, unix.TCSETS, &oldState)
-
- var buf [16]byte
- var ret []byte
- for {
- n, err := syscall.Read(fd, buf[:])
- if err != nil {
- return nil, err
- }
- if n == 0 {
- if len(ret) == 0 {
- return nil, io.EOF
- }
- break
- }
- if buf[n-1] == '\n' {
- n--
- }
- ret = append(ret, buf[:n]...)
- if n < len(buf) {
- break
- }
- }
-
- return ret, nil
-}
-
-// MakeRaw puts the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-// see http://cr.illumos.org/~webrev/andy_js/1060/
-func MakeRaw(fd int) (*State, error) {
- termios, err := unix.IoctlGetTermios(fd, unix.TCGETS)
- if err != nil {
- return nil, err
- }
-
- oldState := State{termios: *termios}
-
- termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON
- termios.Oflag &^= unix.OPOST
- termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN
- termios.Cflag &^= unix.CSIZE | unix.PARENB
- termios.Cflag |= unix.CS8
- termios.Cc[unix.VMIN] = 1
- termios.Cc[unix.VTIME] = 0
-
- if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil {
- return nil, err
- }
-
- return &oldState, nil
-}
-
-// Restore restores the terminal connected to the given file descriptor to a
-// previous state.
-func Restore(fd int, oldState *State) error {
- return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios)
-}
-
-// GetState returns the current state of a terminal which may be useful to
-// restore the terminal after a signal.
-func GetState(fd int) (*State, error) {
- termios, err := unix.IoctlGetTermios(fd, unix.TCGETS)
- if err != nil {
- return nil, err
- }
-
- return &State{termios: *termios}, nil
-}
-
-// GetSize returns the dimensions of the given terminal.
-func GetSize(fd int) (width, height int, err error) {
- ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ)
- if err != nil {
- return 0, 0, err
- }
- return int(ws.Col), int(ws.Row), nil
-}
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
deleted file mode 100644
index 6cb8a95..0000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2011 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 windows
-
-// Package terminal provides support functions for dealing with terminals, as
-// commonly found on UNIX systems.
-//
-// Putting a terminal into raw mode is the most common requirement:
-//
-// oldState, err := terminal.MakeRaw(0)
-// if err != nil {
-// panic(err)
-// }
-// defer terminal.Restore(0, oldState)
-package terminal
-
-import (
- "os"
-
- "golang.org/x/sys/windows"
-)
-
-type State struct {
- mode uint32
-}
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- var st uint32
- err := windows.GetConsoleMode(windows.Handle(fd), &st)
- return err == nil
-}
-
-// MakeRaw put the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-func MakeRaw(fd int) (*State, error) {
- var st uint32
- if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {
- return nil, err
- }
- raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
- if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil {
- return nil, err
- }
- return &State{st}, nil
-}
-
-// GetState returns the current state of a terminal which may be useful to
-// restore the terminal after a signal.
-func GetState(fd int) (*State, error) {
- var st uint32
- if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {
- return nil, err
- }
- return &State{st}, nil
-}
-
-// Restore restores the terminal connected to the given file descriptor to a
-// previous state.
-func Restore(fd int, state *State) error {
- return windows.SetConsoleMode(windows.Handle(fd), state.mode)
-}
-
-// GetSize returns the dimensions of the given terminal.
-func GetSize(fd int) (width, height int, err error) {
- var info windows.ConsoleScreenBufferInfo
- if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil {
- return 0, 0, err
- }
- return int(info.Size.X), int(info.Size.Y), nil
-}
-
-// ReadPassword reads a line of input from a terminal without local echo. This
-// is commonly used for inputting passwords and other sensitive data. The slice
-// returned does not include the \n.
-func ReadPassword(fd int) ([]byte, error) {
- var st uint32
- if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {
- return nil, err
- }
- old := st
-
- st &^= (windows.ENABLE_ECHO_INPUT)
- st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
- if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
- return nil, err
- }
-
- defer windows.SetConsoleMode(windows.Handle(fd), old)
-
- var h windows.Handle
- p, _ := windows.GetCurrentProcess()
- if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
- return nil, err
- }
-
- f := os.NewFile(uintptr(h), "stdin")
- defer f.Close()
- return readPasswordLine(f)
-}
diff --git a/vendor/golang.org/x/sys/AUTHORS b/vendor/golang.org/x/sys/AUTHORS
deleted file mode 100644
index 15167cd..0000000
--- a/vendor/golang.org/x/sys/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code refers to The Go Authors for copyright purposes.
-# The master list of authors is in the main Go distribution,
-# visible at http://tip.golang.org/AUTHORS.
diff --git a/vendor/golang.org/x/sys/CONTRIBUTORS b/vendor/golang.org/x/sys/CONTRIBUTORS
deleted file mode 100644
index 1c4577e..0000000
--- a/vendor/golang.org/x/sys/CONTRIBUTORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# 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.
diff --git a/vendor/golang.org/x/sys/LICENSE b/vendor/golang.org/x/sys/LICENSE
deleted file mode 100644
index 6a66aea..0000000
--- a/vendor/golang.org/x/sys/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2009 The 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.
diff --git a/vendor/golang.org/x/sys/PATENTS b/vendor/golang.org/x/sys/PATENTS
deleted file mode 100644
index 7330990..0000000
--- a/vendor/golang.org/x/sys/PATENTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Additional IP Rights Grant (Patents)
-
-"This implementation" means the copyrightable works distributed by
-Google as part of the Go project.
-
-Google 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,
-transfer and otherwise run, modify and propagate the contents of this
-implementation of Go, where such license applies only to those patent
-claims, both currently owned or controlled by Google and acquired in
-the future, licensable by Google that are necessarily infringed by this
-implementation of Go. This grant does not include claims that would be
-infringed only as a consequence of further modification of this
-implementation. If you or your agent or exclusive licensee institute or
-order or agree to the institution of patent litigation against any
-entity (including a cross-claim or counterclaim in a lawsuit) alleging
-that this implementation of Go or any code incorporated within this
-implementation of Go constitutes direct or contributory patent
-infringement, or inducement of patent infringement, then any patent
-rights granted to you under this License for this implementation of Go
-shall terminate as of the date such litigation is filed.
diff --git a/vendor/golang.org/x/sys/unix/.gitignore b/vendor/golang.org/x/sys/unix/.gitignore
deleted file mode 100644
index e3e0fc6..0000000
--- a/vendor/golang.org/x/sys/unix/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-_obj/
-unix.test
diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md
deleted file mode 100644
index 2bf415f..0000000
--- a/vendor/golang.org/x/sys/unix/README.md
+++ /dev/null
@@ -1,173 +0,0 @@
-# Building `sys/unix`
-
-The sys/unix package provides access to the raw system call interface of the
-underlying operating system. See: https://godoc.org/golang.org/x/sys/unix
-
-Porting Go to a new architecture/OS combination or adding syscalls, types, or
-constants to an existing architecture/OS pair requires some manual effort;
-however, there are tools that automate much of the process.
-
-## Build Systems
-
-There are currently two ways we generate the necessary files. We are currently
-migrating the build system to use containers so the builds are reproducible.
-This is being done on an OS-by-OS basis. Please update this documentation as
-components of the build system change.
-
-### Old Build System (currently for `GOOS != "linux"`)
-
-The old build system generates the Go files based on the C header files
-present on your system. This means that files
-for a given GOOS/GOARCH pair must be generated on a system with that OS and
-architecture. This also means that the generated code can differ from system
-to system, based on differences in the header files.
-
-To avoid this, if you are using the old build system, only generate the Go
-files on an installation with unmodified header files. It is also important to
-keep track of which version of the OS the files were generated from (ex.
-Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes
-and have each OS upgrade correspond to a single change.
-
-To build the files for your current OS and architecture, make sure GOOS and
-GOARCH are set correctly and run `mkall.sh`. This will generate the files for
-your specific system. Running `mkall.sh -n` shows the commands that will be run.
-
-Requirements: bash, perl, go
-
-### New Build System (currently for `GOOS == "linux"`)
-
-The new build system uses a Docker container to generate the go files directly
-from source checkouts of the kernel and various system libraries. This means
-that on any platform that supports Docker, all the files using the new build
-system can be generated at once, and generated files will not change based on
-what the person running the scripts has installed on their computer.
-
-The OS specific files for the new build system are located in the `${GOOS}`
-directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When
-the kernel or system library updates, modify the Dockerfile at
-`${GOOS}/Dockerfile` to checkout the new release of the source.
-
-To build all the files under the new build system, you must be on an amd64/Linux
-system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will
-then generate all of the files for all of the GOOS/GOARCH pairs in the new build
-system. Running `mkall.sh -n` shows the commands that will be run.
-
-Requirements: bash, perl, go, docker
-
-## Component files
-
-This section describes the various files used in the code generation process.
-It also contains instructions on how to modify these files to add a new
-architecture/OS or to add additional syscalls, types, or constants. Note that
-if you are using the new build system, the scripts cannot be called normally.
-They must be called from within the docker container.
-
-### asm files
-
-The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system
-call dispatch. There are three entry points:
-```
- func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
- func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
- func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
-```
-The first and second are the standard ones; they differ only in how many
-arguments can be passed to the kernel. The third is for low-level use by the
-ForkExec wrapper. Unlike the first two, it does not call into the scheduler to
-let it know that a system call is running.
-
-When porting Go to an new architecture/OS, this file must be implemented for
-each GOOS/GOARCH pair.
-
-### mksysnum
-
-Mksysnum is a script located at `${GOOS}/mksysnum.pl` (or `mksysnum_${GOOS}.pl`
-for the old system). This script takes in a list of header files containing the
-syscall number declarations and parses them to produce the corresponding list of
-Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated
-constants.
-
-Adding new syscall numbers is mostly done by running the build on a sufficiently
-new installation of the target OS (or updating the source checkouts for the
-new build system). However, depending on the OS, you make need to update the
-parsing in mksysnum.
-
-### mksyscall.pl
-
-The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are
-hand-written Go files which implement system calls (for unix, the specific OS,
-or the specific OS/Architecture pair respectively) that need special handling
-and list `//sys` comments giving prototypes for ones that can be generated.
-
-The mksyscall.pl script takes the `//sys` and `//sysnb` comments and converts
-them into syscalls. This requires the name of the prototype in the comment to
-match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function
-prototype can be exported (capitalized) or not.
-
-Adding a new syscall often just requires adding a new `//sys` function prototype
-with the desired arguments and a capitalized name so it is exported. However, if
-you want the interface to the syscall to be different, often one will make an
-unexported `//sys` prototype, an then write a custom wrapper in
-`syscall_${GOOS}.go`.
-
-### types files
-
-For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or
-`types_${GOOS}.go` on the old system). This file includes standard C headers and
-creates Go type aliases to the corresponding C types. The file is then fed
-through godef to get the Go compatible definitions. Finally, the generated code
-is fed though mkpost.go to format the code correctly and remove any hidden or
-private identifiers. This cleaned-up code is written to
-`ztypes_${GOOS}_${GOARCH}.go`.
-
-The hardest part about preparing this file is figuring out which headers to
-include and which symbols need to be `#define`d to get the actual data
-structures that pass through to the kernel system calls. Some C libraries
-preset alternate versions for binary compatibility and translate them on the
-way in and out of system calls, but there is almost always a `#define` that can
-get the real ones.
-See `types_darwin.go` and `linux/types.go` for examples.
-
-To add a new type, add in the necessary include statement at the top of the
-file (if it is not already there) and add in a type alias line. Note that if
-your type is significantly different on different architectures, you may need
-some `#if/#elif` macros in your include statements.
-
-### mkerrors.sh
-
-This script is used to generate the system's various constants. This doesn't
-just include the error numbers and error strings, but also the signal numbers
-an a wide variety of miscellaneous constants. The constants come from the list
-of include files in the `includes_${uname}` variable. A regex then picks out
-the desired `#define` statements, and generates the corresponding Go constants.
-The error numbers and strings are generated from `#include `, and the
-signal numbers and strings are generated from `#include `. All of
-these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program,
-`_errors.c`, which prints out all the constants.
-
-To add a constant, add the header that includes it to the appropriate variable.
-Then, edit the regex (if necessary) to match the desired constant. Avoid making
-the regex too broad to avoid matching unintended constants.
-
-
-## Generated files
-
-### `zerror_${GOOS}_${GOARCH}.go`
-
-A file containing all of the system's generated error numbers, error strings,
-signal numbers, and constants. Generated by `mkerrors.sh` (see above).
-
-### `zsyscall_${GOOS}_${GOARCH}.go`
-
-A file containing all the generated syscalls for a specific GOOS and GOARCH.
-Generated by `mksyscall.pl` (see above).
-
-### `zsysnum_${GOOS}_${GOARCH}.go`
-
-A list of numeric constants for all the syscall number of the specific GOOS
-and GOARCH. Generated by mksysnum (see above).
-
-### `ztypes_${GOOS}_${GOARCH}.go`
-
-A file containing Go types for passing into (or returning from) syscalls.
-Generated by godefs and the types file (see above).
diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go
deleted file mode 100644
index 72afe33..0000000
--- a/vendor/golang.org/x/sys/unix/affinity_linux.go
+++ /dev/null
@@ -1,124 +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.
-
-// CPU affinity functions
-
-package unix
-
-import (
- "unsafe"
-)
-
-const cpuSetSize = _CPU_SETSIZE / _NCPUBITS
-
-// CPUSet represents a CPU affinity mask.
-type CPUSet [cpuSetSize]cpuMask
-
-func schedAffinity(trap uintptr, pid int, set *CPUSet) error {
- _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set)))
- if e != 0 {
- return errnoErr(e)
- }
- return nil
-}
-
-// SchedGetaffinity gets the CPU affinity mask of the thread specified by pid.
-// If pid is 0 the calling thread is used.
-func SchedGetaffinity(pid int, set *CPUSet) error {
- return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set)
-}
-
-// SchedSetaffinity sets the CPU affinity mask of the thread specified by pid.
-// If pid is 0 the calling thread is used.
-func SchedSetaffinity(pid int, set *CPUSet) error {
- return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set)
-}
-
-// Zero clears the set s, so that it contains no CPUs.
-func (s *CPUSet) Zero() {
- for i := range s {
- s[i] = 0
- }
-}
-
-func cpuBitsIndex(cpu int) int {
- return cpu / _NCPUBITS
-}
-
-func cpuBitsMask(cpu int) cpuMask {
- return cpuMask(1 << (uint(cpu) % _NCPUBITS))
-}
-
-// Set adds cpu to the set s.
-func (s *CPUSet) Set(cpu int) {
- i := cpuBitsIndex(cpu)
- if i < len(s) {
- s[i] |= cpuBitsMask(cpu)
- }
-}
-
-// Clear removes cpu from the set s.
-func (s *CPUSet) Clear(cpu int) {
- i := cpuBitsIndex(cpu)
- if i < len(s) {
- s[i] &^= cpuBitsMask(cpu)
- }
-}
-
-// IsSet reports whether cpu is in the set s.
-func (s *CPUSet) IsSet(cpu int) bool {
- i := cpuBitsIndex(cpu)
- if i < len(s) {
- return s[i]&cpuBitsMask(cpu) != 0
- }
- return false
-}
-
-// Count returns the number of CPUs in the set s.
-func (s *CPUSet) Count() int {
- c := 0
- for _, b := range s {
- c += onesCount64(uint64(b))
- }
- return c
-}
-
-// onesCount64 is a copy of Go 1.9's math/bits.OnesCount64.
-// Once this package can require Go 1.9, we can delete this
-// and update the caller to use bits.OnesCount64.
-func onesCount64(x uint64) int {
- const m0 = 0x5555555555555555 // 01010101 ...
- const m1 = 0x3333333333333333 // 00110011 ...
- const m2 = 0x0f0f0f0f0f0f0f0f // 00001111 ...
- const m3 = 0x00ff00ff00ff00ff // etc.
- const m4 = 0x0000ffff0000ffff
-
- // Implementation: Parallel summing of adjacent bits.
- // See "Hacker's Delight", Chap. 5: Counting Bits.
- // The following pattern shows the general approach:
- //
- // x = x>>1&(m0&m) + x&(m0&m)
- // x = x>>2&(m1&m) + x&(m1&m)
- // x = x>>4&(m2&m) + x&(m2&m)
- // x = x>>8&(m3&m) + x&(m3&m)
- // x = x>>16&(m4&m) + x&(m4&m)
- // x = x>>32&(m5&m) + x&(m5&m)
- // return int(x)
- //
- // Masking (& operations) can be left away when there's no
- // danger that a field's sum will carry over into the next
- // field: Since the result cannot be > 64, 8 bits is enough
- // and we can ignore the masks for the shifts by 8 and up.
- // Per "Hacker's Delight", the first line can be simplified
- // more, but it saves at best one instruction, so we leave
- // it alone for clarity.
- const m = 1<<64 - 1
- x = x>>1&(m0&m) + x&(m0&m)
- x = x>>2&(m1&m) + x&(m1&m)
- x = (x>>4 + x) & (m2 & m)
- x += x >> 8
- x += x >> 16
- x += x >> 32
- return int(x) & (1<<7 - 1)
-}
diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/vendor/golang.org/x/sys/unix/aliases.go
deleted file mode 100644
index 951fce4..0000000
--- a/vendor/golang.org/x/sys/unix/aliases.go
+++ /dev/null
@@ -1,14 +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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-// +build go1.9
-
-package unix
-
-import "syscall"
-
-type Signal = syscall.Signal
-type Errno = syscall.Errno
-type SysProcAttr = syscall.SysProcAttr
diff --git a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
deleted file mode 100644
index 06f84b8..0000000
--- a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
+++ /dev/null
@@ -1,17 +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 !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for ppc64, AIX are implemented in runtime/syscall_aix.go
-//
-
-TEXT ·syscall6(SB),NOSPLIT,$0-88
- JMP syscall·syscall6(SB)
-
-TEXT ·rawSyscall6(SB),NOSPLIT,$0-88
- JMP syscall·rawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_386.s b/vendor/golang.org/x/sys/unix/asm_darwin_386.s
deleted file mode 100644
index 8a72783..0000000
--- a/vendor/golang.org/x/sys/unix/asm_darwin_386.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for 386, Darwin
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s b/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s
deleted file mode 100644
index 6321421..0000000
--- a/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, Darwin
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_arm.s b/vendor/golang.org/x/sys/unix/asm_darwin_arm.s
deleted file mode 100644
index 333242d..0000000
--- a/vendor/golang.org/x/sys/unix/asm_darwin_arm.s
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 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 !gccgo
-// +build arm,darwin
-
-#include "textflag.h"
-
-//
-// System call support for ARM, Darwin
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- B syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- B syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- B syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s b/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s
deleted file mode 100644
index 97e0174..0000000
--- a/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 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 !gccgo
-// +build arm64,darwin
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, Darwin
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- B syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- B syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- B syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
deleted file mode 100644
index 603dd57..0000000
--- a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, DragonFly
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_386.s b/vendor/golang.org/x/sys/unix/asm_freebsd_386.s
deleted file mode 100644
index c9a0a26..0000000
--- a/vendor/golang.org/x/sys/unix/asm_freebsd_386.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for 386, FreeBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s
deleted file mode 100644
index 3517247..0000000
--- a/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, FreeBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s b/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s
deleted file mode 100644
index 9227c87..0000000
--- a/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for ARM, FreeBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- B syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- B syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- B syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s b/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
deleted file mode 100644
index d9318cb..0000000
--- a/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
+++ /dev/null
@@ -1,29 +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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for ARM64, FreeBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_386.s b/vendor/golang.org/x/sys/unix/asm_linux_386.s
deleted file mode 100644
index 448bebb..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_386.s
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for 386, Linux
-//
-
-// See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
-// instead of the glibc-specific "CALL 0x10(GS)".
-#define INVOKE_SYSCALL INT $0x80
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
- CALL runtime·entersyscall(SB)
- MOVL trap+0(FP), AX // syscall entry
- MOVL a1+4(FP), BX
- MOVL a2+8(FP), CX
- MOVL a3+12(FP), DX
- MOVL $0, SI
- MOVL $0, DI
- INVOKE_SYSCALL
- MOVL AX, r1+16(FP)
- MOVL DX, r2+20(FP)
- CALL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
- MOVL trap+0(FP), AX // syscall entry
- MOVL a1+4(FP), BX
- MOVL a2+8(FP), CX
- MOVL a3+12(FP), DX
- MOVL $0, SI
- MOVL $0, DI
- INVOKE_SYSCALL
- MOVL AX, r1+16(FP)
- MOVL DX, r2+20(FP)
- RET
-
-TEXT ·socketcall(SB),NOSPLIT,$0-36
- JMP syscall·socketcall(SB)
-
-TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
- JMP syscall·rawsocketcall(SB)
-
-TEXT ·seek(SB),NOSPLIT,$0-28
- JMP syscall·seek(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
deleted file mode 100644
index c6468a9..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for AMD64, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
- CALL runtime·entersyscall(SB)
- MOVQ a1+8(FP), DI
- MOVQ a2+16(FP), SI
- MOVQ a3+24(FP), DX
- MOVQ $0, R10
- MOVQ $0, R8
- MOVQ $0, R9
- MOVQ trap+0(FP), AX // syscall entry
- SYSCALL
- MOVQ AX, r1+32(FP)
- MOVQ DX, r2+40(FP)
- CALL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
- MOVQ a1+8(FP), DI
- MOVQ a2+16(FP), SI
- MOVQ a3+24(FP), DX
- MOVQ $0, R10
- MOVQ $0, R8
- MOVQ $0, R9
- MOVQ trap+0(FP), AX // syscall entry
- SYSCALL
- MOVQ AX, r1+32(FP)
- MOVQ DX, r2+40(FP)
- RET
-
-TEXT ·gettimeofday(SB),NOSPLIT,$0-16
- JMP syscall·gettimeofday(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/vendor/golang.org/x/sys/unix/asm_linux_arm.s
deleted file mode 100644
index cf0f357..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_arm.s
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for arm, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- B syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
- BL runtime·entersyscall(SB)
- MOVW trap+0(FP), R7
- MOVW a1+4(FP), R0
- MOVW a2+8(FP), R1
- MOVW a3+12(FP), R2
- MOVW $0, R3
- MOVW $0, R4
- MOVW $0, R5
- SWI $0
- MOVW R0, r1+16(FP)
- MOVW $0, R0
- MOVW R0, r2+20(FP)
- BL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- B syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
- MOVW trap+0(FP), R7 // syscall entry
- MOVW a1+4(FP), R0
- MOVW a2+8(FP), R1
- MOVW a3+12(FP), R2
- SWI $0
- MOVW R0, r1+16(FP)
- MOVW $0, R0
- MOVW R0, r2+20(FP)
- RET
-
-TEXT ·seek(SB),NOSPLIT,$0-28
- B syscall·seek(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
deleted file mode 100644
index afe6fdf..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015 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 linux
-// +build arm64
-// +build !gccgo
-
-#include "textflag.h"
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- B syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R0
- MOVD a2+16(FP), R1
- MOVD a3+24(FP), R2
- MOVD $0, R3
- MOVD $0, R4
- MOVD $0, R5
- MOVD trap+0(FP), R8 // syscall entry
- SVC
- MOVD R0, r1+32(FP) // r1
- MOVD R1, r2+40(FP) // r2
- BL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- B syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
- MOVD a1+8(FP), R0
- MOVD a2+16(FP), R1
- MOVD a3+24(FP), R2
- MOVD $0, R3
- MOVD $0, R4
- MOVD $0, R5
- MOVD trap+0(FP), R8 // syscall entry
- SVC
- MOVD R0, r1+32(FP)
- MOVD R1, r2+40(FP)
- RET
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
deleted file mode 100644
index ab9d638..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015 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 linux
-// +build mips64 mips64le
-// +build !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for mips64, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
- JAL runtime·entersyscall(SB)
- MOVV a1+8(FP), R4
- MOVV a2+16(FP), R5
- MOVV a3+24(FP), R6
- MOVV R0, R7
- MOVV R0, R8
- MOVV R0, R9
- MOVV trap+0(FP), R2 // syscall entry
- SYSCALL
- MOVV R2, r1+32(FP)
- MOVV R3, r2+40(FP)
- JAL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
- MOVV a1+8(FP), R4
- MOVV a2+16(FP), R5
- MOVV a3+24(FP), R6
- MOVV R0, R7
- MOVV R0, R8
- MOVV R0, R9
- MOVV trap+0(FP), R2 // syscall entry
- SYSCALL
- MOVV R2, r1+32(FP)
- MOVV R3, r2+40(FP)
- RET
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
deleted file mode 100644
index 99e5399..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
+++ /dev/null
@@ -1,54 +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 linux
-// +build mips mipsle
-// +build !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for mips, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- JMP syscall·Syscall9(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
- JAL runtime·entersyscall(SB)
- MOVW a1+4(FP), R4
- MOVW a2+8(FP), R5
- MOVW a3+12(FP), R6
- MOVW R0, R7
- MOVW trap+0(FP), R2 // syscall entry
- SYSCALL
- MOVW R2, r1+16(FP) // r1
- MOVW R3, r2+20(FP) // r2
- JAL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
- MOVW a1+4(FP), R4
- MOVW a2+8(FP), R5
- MOVW a3+12(FP), R6
- MOVW trap+0(FP), R2 // syscall entry
- SYSCALL
- MOVW R2, r1+16(FP)
- MOVW R3, r2+20(FP)
- RET
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
deleted file mode 100644
index 88f7125..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2014 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 linux
-// +build ppc64 ppc64le
-// +build !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for ppc64, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R3
- MOVD a2+16(FP), R4
- MOVD a3+24(FP), R5
- MOVD R0, R6
- MOVD R0, R7
- MOVD R0, R8
- MOVD trap+0(FP), R9 // syscall entry
- SYSCALL R9
- MOVD R3, r1+32(FP)
- MOVD R4, r2+40(FP)
- BL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
- MOVD a1+8(FP), R3
- MOVD a2+16(FP), R4
- MOVD a3+24(FP), R5
- MOVD R0, R6
- MOVD R0, R7
- MOVD R0, R8
- MOVD trap+0(FP), R9 // syscall entry
- SYSCALL R9
- MOVD R3, r1+32(FP)
- MOVD R4, r2+40(FP)
- RET
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
deleted file mode 100644
index a5a863c..0000000
--- a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
+++ /dev/null
@@ -1,56 +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 s390x
-// +build linux
-// +build !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for s390x, Linux
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- BR syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- BR syscall·Syscall6(SB)
-
-TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R2
- MOVD a2+16(FP), R3
- MOVD a3+24(FP), R4
- MOVD $0, R5
- MOVD $0, R6
- MOVD $0, R7
- MOVD trap+0(FP), R1 // syscall entry
- SYSCALL
- MOVD R2, r1+32(FP)
- MOVD R3, r2+40(FP)
- BL runtime·exitsyscall(SB)
- RET
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- BR syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- BR syscall·RawSyscall6(SB)
-
-TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
- MOVD a1+8(FP), R2
- MOVD a2+16(FP), R3
- MOVD a3+24(FP), R4
- MOVD $0, R5
- MOVD $0, R6
- MOVD $0, R7
- MOVD trap+0(FP), R1 // syscall entry
- SYSCALL
- MOVD R2, r1+32(FP)
- MOVD R3, r2+40(FP)
- RET
diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_386.s b/vendor/golang.org/x/sys/unix/asm_netbsd_386.s
deleted file mode 100644
index 48bdcd7..0000000
--- a/vendor/golang.org/x/sys/unix/asm_netbsd_386.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for 386, NetBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s
deleted file mode 100644
index 2ede05c..0000000
--- a/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, NetBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s b/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s
deleted file mode 100644
index e892857..0000000
--- a/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s
+++ /dev/null
@@ -1,29 +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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for ARM, NetBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- B syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- B syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- B syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_386.s b/vendor/golang.org/x/sys/unix/asm_openbsd_386.s
deleted file mode 100644
index 00576f3..0000000
--- a/vendor/golang.org/x/sys/unix/asm_openbsd_386.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for 386, OpenBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s
deleted file mode 100644
index 790ef77..0000000
--- a/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2009 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for AMD64, OpenBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-56
- JMP syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
- JMP syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-104
- JMP syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
- JMP syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
- JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s b/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
deleted file mode 100644
index 469bfa1..0000000
--- a/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System call support for ARM, OpenBSD
-//
-
-// Just jump to package syscall's implementation for all these functions.
-// The runtime may know about them.
-
-TEXT ·Syscall(SB),NOSPLIT,$0-28
- B syscall·Syscall(SB)
-
-TEXT ·Syscall6(SB),NOSPLIT,$0-40
- B syscall·Syscall6(SB)
-
-TEXT ·Syscall9(SB),NOSPLIT,$0-52
- B syscall·Syscall9(SB)
-
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- B syscall·RawSyscall(SB)
-
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- B syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
deleted file mode 100644
index ded8260..0000000
--- a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2014 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 !gccgo
-
-#include "textflag.h"
-
-//
-// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
-//
-
-TEXT ·sysvicall6(SB),NOSPLIT,$0-88
- JMP syscall·sysvicall6(SB)
-
-TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
- JMP syscall·rawSysvicall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/bluetooth_linux.go b/vendor/golang.org/x/sys/unix/bluetooth_linux.go
deleted file mode 100644
index 6e32296..0000000
--- a/vendor/golang.org/x/sys/unix/bluetooth_linux.go
+++ /dev/null
@@ -1,35 +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.
-
-// Bluetooth sockets and messages
-
-package unix
-
-// Bluetooth Protocols
-const (
- BTPROTO_L2CAP = 0
- BTPROTO_HCI = 1
- BTPROTO_SCO = 2
- BTPROTO_RFCOMM = 3
- BTPROTO_BNEP = 4
- BTPROTO_CMTP = 5
- BTPROTO_HIDP = 6
- BTPROTO_AVDTP = 7
-)
-
-const (
- HCI_CHANNEL_RAW = 0
- HCI_CHANNEL_USER = 1
- HCI_CHANNEL_MONITOR = 2
- HCI_CHANNEL_CONTROL = 3
-)
-
-// Socketoption Level
-const (
- SOL_BLUETOOTH = 0x112
- SOL_HCI = 0x0
- SOL_L2CAP = 0x6
- SOL_RFCOMM = 0x12
- SOL_SCO = 0x11
-)
diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go
deleted file mode 100644
index df52048..0000000
--- a/vendor/golang.org/x/sys/unix/cap_freebsd.go
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright 2017 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 freebsd
-
-package unix
-
-import (
- "errors"
- "fmt"
-)
-
-// Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c
-
-const (
- // This is the version of CapRights this package understands. See C implementation for parallels.
- capRightsGoVersion = CAP_RIGHTS_VERSION_00
- capArSizeMin = CAP_RIGHTS_VERSION_00 + 2
- capArSizeMax = capRightsGoVersion + 2
-)
-
-var (
- bit2idx = []int{
- -1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
- 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- }
-)
-
-func capidxbit(right uint64) int {
- return int((right >> 57) & 0x1f)
-}
-
-func rightToIndex(right uint64) (int, error) {
- idx := capidxbit(right)
- if idx < 0 || idx >= len(bit2idx) {
- return -2, fmt.Errorf("index for right 0x%x out of range", right)
- }
- return bit2idx[idx], nil
-}
-
-func caprver(right uint64) int {
- return int(right >> 62)
-}
-
-func capver(rights *CapRights) int {
- return caprver(rights.Rights[0])
-}
-
-func caparsize(rights *CapRights) int {
- return capver(rights) + 2
-}
-
-// CapRightsSet sets the permissions in setrights in rights.
-func CapRightsSet(rights *CapRights, setrights []uint64) error {
- // This is essentially a copy of cap_rights_vset()
- if capver(rights) != CAP_RIGHTS_VERSION_00 {
- return fmt.Errorf("bad rights version %d", capver(rights))
- }
-
- n := caparsize(rights)
- if n < capArSizeMin || n > capArSizeMax {
- return errors.New("bad rights size")
- }
-
- for _, right := range setrights {
- if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return errors.New("bad right version")
- }
- i, err := rightToIndex(right)
- if err != nil {
- return err
- }
- if i >= n {
- return errors.New("index overflow")
- }
- if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errors.New("index mismatch")
- }
- rights.Rights[i] |= right
- if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errors.New("index mismatch (after assign)")
- }
- }
-
- return nil
-}
-
-// CapRightsClear clears the permissions in clearrights from rights.
-func CapRightsClear(rights *CapRights, clearrights []uint64) error {
- // This is essentially a copy of cap_rights_vclear()
- if capver(rights) != CAP_RIGHTS_VERSION_00 {
- return fmt.Errorf("bad rights version %d", capver(rights))
- }
-
- n := caparsize(rights)
- if n < capArSizeMin || n > capArSizeMax {
- return errors.New("bad rights size")
- }
-
- for _, right := range clearrights {
- if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return errors.New("bad right version")
- }
- i, err := rightToIndex(right)
- if err != nil {
- return err
- }
- if i >= n {
- return errors.New("index overflow")
- }
- if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errors.New("index mismatch")
- }
- rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
- if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errors.New("index mismatch (after assign)")
- }
- }
-
- return nil
-}
-
-// CapRightsIsSet checks whether all the permissions in setrights are present in rights.
-func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
- // This is essentially a copy of cap_rights_is_vset()
- if capver(rights) != CAP_RIGHTS_VERSION_00 {
- return false, fmt.Errorf("bad rights version %d", capver(rights))
- }
-
- n := caparsize(rights)
- if n < capArSizeMin || n > capArSizeMax {
- return false, errors.New("bad rights size")
- }
-
- for _, right := range setrights {
- if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return false, errors.New("bad right version")
- }
- i, err := rightToIndex(right)
- if err != nil {
- return false, err
- }
- if i >= n {
- return false, errors.New("index overflow")
- }
- if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return false, errors.New("index mismatch")
- }
- if (rights.Rights[i] & right) != right {
- return false, nil
- }
- }
-
- return true, nil
-}
-
-func capright(idx uint64, bit uint64) uint64 {
- return ((1 << (57 + idx)) | bit)
-}
-
-// CapRightsInit returns a pointer to an initialised CapRights structure filled with rights.
-// See man cap_rights_init(3) and rights(4).
-func CapRightsInit(rights []uint64) (*CapRights, error) {
- var r CapRights
- r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0)
- r.Rights[1] = capright(1, 0)
-
- err := CapRightsSet(&r, rights)
- if err != nil {
- return nil, err
- }
- return &r, nil
-}
-
-// CapRightsLimit reduces the operations permitted on fd to at most those contained in rights.
-// The capability rights on fd can never be increased by CapRightsLimit.
-// See man cap_rights_limit(2) and rights(4).
-func CapRightsLimit(fd uintptr, rights *CapRights) error {
- return capRightsLimit(int(fd), rights)
-}
-
-// CapRightsGet returns a CapRights structure containing the operations permitted on fd.
-// See man cap_rights_get(3) and rights(4).
-func CapRightsGet(fd uintptr) (*CapRights, error) {
- r, err := CapRightsInit(nil)
- if err != nil {
- return nil, err
- }
- err = capRightsGet(capRightsGoVersion, int(fd), r)
- if err != nil {
- return nil, err
- }
- return r, nil
-}
diff --git a/vendor/golang.org/x/sys/unix/constants.go b/vendor/golang.org/x/sys/unix/constants.go
deleted file mode 100644
index 3a6ac64..0000000
--- a/vendor/golang.org/x/sys/unix/constants.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2015 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-const (
- R_OK = 0x4
- W_OK = 0x2
- X_OK = 0x1
-)
diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go
deleted file mode 100644
index 5e5fb45..0000000
--- a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go
+++ /dev/null
@@ -1,27 +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 aix
-// +build ppc
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used by AIX.
-
-package unix
-
-// Major returns the major component of a Linux device number.
-func Major(dev uint64) uint32 {
- return uint32((dev >> 16) & 0xffff)
-}
-
-// Minor returns the minor component of a Linux device number.
-func Minor(dev uint64) uint32 {
- return uint32(dev & 0xffff)
-}
-
-// Mkdev returns a Linux device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- return uint64(((major) << 16) | (minor))
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
deleted file mode 100644
index 8b40124..0000000
--- a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
+++ /dev/null
@@ -1,29 +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 aix
-// +build ppc64
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used AIX.
-
-package unix
-
-// Major returns the major component of a Linux device number.
-func Major(dev uint64) uint32 {
- return uint32((dev & 0x3fffffff00000000) >> 32)
-}
-
-// Minor returns the minor component of a Linux device number.
-func Minor(dev uint64) uint32 {
- return uint32((dev & 0x00000000ffffffff) >> 0)
-}
-
-// Mkdev returns a Linux device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- var DEVNO64 uint64
- DEVNO64 = 0x8000000000000000
- return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64)
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_darwin.go b/vendor/golang.org/x/sys/unix/dev_darwin.go
deleted file mode 100644
index 8d1dc0f..0000000
--- a/vendor/golang.org/x/sys/unix/dev_darwin.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used in Darwin's sys/types.h header.
-
-package unix
-
-// Major returns the major component of a Darwin device number.
-func Major(dev uint64) uint32 {
- return uint32((dev >> 24) & 0xff)
-}
-
-// Minor returns the minor component of a Darwin device number.
-func Minor(dev uint64) uint32 {
- return uint32(dev & 0xffffff)
-}
-
-// Mkdev returns a Darwin device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- return (uint64(major) << 24) | uint64(minor)
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_dragonfly.go b/vendor/golang.org/x/sys/unix/dev_dragonfly.go
deleted file mode 100644
index 8502f20..0000000
--- a/vendor/golang.org/x/sys/unix/dev_dragonfly.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used in Dragonfly's sys/types.h header.
-//
-// The information below is extracted and adapted from sys/types.h:
-//
-// Minor gives a cookie instead of an index since in order to avoid changing the
-// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
-// devices that don't use them.
-
-package unix
-
-// Major returns the major component of a DragonFlyBSD device number.
-func Major(dev uint64) uint32 {
- return uint32((dev >> 8) & 0xff)
-}
-
-// Minor returns the minor component of a DragonFlyBSD device number.
-func Minor(dev uint64) uint32 {
- return uint32(dev & 0xffff00ff)
-}
-
-// Mkdev returns a DragonFlyBSD device number generated from the given major and
-// minor components.
-func Mkdev(major, minor uint32) uint64 {
- return (uint64(major) << 8) | uint64(minor)
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_freebsd.go b/vendor/golang.org/x/sys/unix/dev_freebsd.go
deleted file mode 100644
index eba3b4b..0000000
--- a/vendor/golang.org/x/sys/unix/dev_freebsd.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used in FreeBSD's sys/types.h header.
-//
-// The information below is extracted and adapted from sys/types.h:
-//
-// Minor gives a cookie instead of an index since in order to avoid changing the
-// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
-// devices that don't use them.
-
-package unix
-
-// Major returns the major component of a FreeBSD device number.
-func Major(dev uint64) uint32 {
- return uint32((dev >> 8) & 0xff)
-}
-
-// Minor returns the minor component of a FreeBSD device number.
-func Minor(dev uint64) uint32 {
- return uint32(dev & 0xffff00ff)
-}
-
-// Mkdev returns a FreeBSD device number generated from the given major and
-// minor components.
-func Mkdev(major, minor uint32) uint64 {
- return (uint64(major) << 8) | uint64(minor)
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_linux.go b/vendor/golang.org/x/sys/unix/dev_linux.go
deleted file mode 100644
index d165d6f..0000000
--- a/vendor/golang.org/x/sys/unix/dev_linux.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used by the Linux kernel and glibc.
-//
-// The information below is extracted and adapted from bits/sysmacros.h in the
-// glibc sources:
-//
-// dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
-// default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
-// number and m is a hex digit of the minor number. This is backward compatible
-// with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
-// backward compatible with the Linux kernel, which for some architectures uses
-// 32-bit dev_t, encoded as mmmM MMmm.
-
-package unix
-
-// Major returns the major component of a Linux device number.
-func Major(dev uint64) uint32 {
- major := uint32((dev & 0x00000000000fff00) >> 8)
- major |= uint32((dev & 0xfffff00000000000) >> 32)
- return major
-}
-
-// Minor returns the minor component of a Linux device number.
-func Minor(dev uint64) uint32 {
- minor := uint32((dev & 0x00000000000000ff) >> 0)
- minor |= uint32((dev & 0x00000ffffff00000) >> 12)
- return minor
-}
-
-// Mkdev returns a Linux device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- dev := (uint64(major) & 0x00000fff) << 8
- dev |= (uint64(major) & 0xfffff000) << 32
- dev |= (uint64(minor) & 0x000000ff) << 0
- dev |= (uint64(minor) & 0xffffff00) << 12
- return dev
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_netbsd.go b/vendor/golang.org/x/sys/unix/dev_netbsd.go
deleted file mode 100644
index b4a203d..0000000
--- a/vendor/golang.org/x/sys/unix/dev_netbsd.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used in NetBSD's sys/types.h header.
-
-package unix
-
-// Major returns the major component of a NetBSD device number.
-func Major(dev uint64) uint32 {
- return uint32((dev & 0x000fff00) >> 8)
-}
-
-// Minor returns the minor component of a NetBSD device number.
-func Minor(dev uint64) uint32 {
- minor := uint32((dev & 0x000000ff) >> 0)
- minor |= uint32((dev & 0xfff00000) >> 12)
- return minor
-}
-
-// Mkdev returns a NetBSD device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- dev := (uint64(major) << 8) & 0x000fff00
- dev |= (uint64(minor) << 12) & 0xfff00000
- dev |= (uint64(minor) << 0) & 0x000000ff
- return dev
-}
diff --git a/vendor/golang.org/x/sys/unix/dev_openbsd.go b/vendor/golang.org/x/sys/unix/dev_openbsd.go
deleted file mode 100644
index f3430c4..0000000
--- a/vendor/golang.org/x/sys/unix/dev_openbsd.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 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.
-
-// Functions to access/create device major and minor numbers matching the
-// encoding used in OpenBSD's sys/types.h header.
-
-package unix
-
-// Major returns the major component of an OpenBSD device number.
-func Major(dev uint64) uint32 {
- return uint32((dev & 0x0000ff00) >> 8)
-}
-
-// Minor returns the minor component of an OpenBSD device number.
-func Minor(dev uint64) uint32 {
- minor := uint32((dev & 0x000000ff) >> 0)
- minor |= uint32((dev & 0xffff0000) >> 8)
- return minor
-}
-
-// Mkdev returns an OpenBSD device number generated from the given major and minor
-// components.
-func Mkdev(major, minor uint32) uint64 {
- dev := (uint64(major) << 8) & 0x0000ff00
- dev |= (uint64(minor) << 8) & 0xffff0000
- dev |= (uint64(minor) << 0) & 0x000000ff
- return dev
-}
diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go
deleted file mode 100644
index 4407c50..0000000
--- a/vendor/golang.org/x/sys/unix/dirent.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2009 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 aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
-
-package unix
-
-import "syscall"
-
-// ParseDirent parses up to max directory entries in buf,
-// appending the names to names. It returns the number of
-// bytes consumed from buf, the number of entries added
-// to names, and the new names slice.
-func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
- return syscall.ParseDirent(buf, max, names)
-}
diff --git a/vendor/golang.org/x/sys/unix/endian_big.go b/vendor/golang.org/x/sys/unix/endian_big.go
deleted file mode 100644
index 5e92690..0000000
--- a/vendor/golang.org/x/sys/unix/endian_big.go
+++ /dev/null
@@ -1,9 +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 ppc64 s390x mips mips64
-
-package unix
-
-const isBigEndian = true
diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go
deleted file mode 100644
index 085df2d..0000000
--- a/vendor/golang.org/x/sys/unix/endian_little.go
+++ /dev/null
@@ -1,9 +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 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le
-
-package unix
-
-const isBigEndian = false
diff --git a/vendor/golang.org/x/sys/unix/env_unix.go b/vendor/golang.org/x/sys/unix/env_unix.go
deleted file mode 100644
index 84178b0..0000000
--- a/vendor/golang.org/x/sys/unix/env_unix.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2010 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-// Unix environment variables.
-
-package unix
-
-import "syscall"
-
-func Getenv(key string) (value string, found bool) {
- return syscall.Getenv(key)
-}
-
-func Setenv(key, value string) error {
- return syscall.Setenv(key, value)
-}
-
-func Clearenv() {
- syscall.Clearenv()
-}
-
-func Environ() []string {
- return syscall.Environ()
-}
-
-func Unsetenv(key string) error {
- return syscall.Unsetenv(key)
-}
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go b/vendor/golang.org/x/sys/unix/errors_freebsd_386.go
deleted file mode 100644
index c56bc8b..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go
+++ /dev/null
@@ -1,227 +0,0 @@
-// Copyright 2017 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.
-
-// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
-// them here for backwards compatibility.
-
-package unix
-
-const (
- IFF_SMART = 0x20
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAITH = 0xf2
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_IPXIP = 0xf9
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IP_FAITH = 0x16
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- SIOCADDRT = 0x8030720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8030720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
deleted file mode 100644
index 3e97711..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
+++ /dev/null
@@ -1,227 +0,0 @@
-// Copyright 2017 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.
-
-// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
-// them here for backwards compatibility.
-
-package unix
-
-const (
- IFF_SMART = 0x20
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAITH = 0xf2
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_IPXIP = 0xf9
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IP_FAITH = 0x16
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- SIOCADDRT = 0x8040720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8040720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
deleted file mode 100644
index 856dca3..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
+++ /dev/null
@@ -1,226 +0,0 @@
-// Copyright 2017 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.
-
-package unix
-
-const (
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
-
- // missing constants on FreeBSD-11.1-RELEASE, copied from old values in ztypes_freebsd_arm.go
- IFF_SMART = 0x20
- IFT_FAITH = 0xf2
- IFT_IPXIP = 0xf9
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IP_FAITH = 0x16
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- SIOCADDRT = 0x8030720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8030720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go
deleted file mode 100644
index 9379ba9..0000000
--- a/vendor/golang.org/x/sys/unix/fcntl.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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 darwin dragonfly freebsd linux netbsd openbsd
-
-package unix
-
-import "unsafe"
-
-// fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
-// systems by flock_linux_32bit.go to be SYS_FCNTL64.
-var fcntl64Syscall uintptr = SYS_FCNTL
-
-// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
-func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
- valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
- var err error
- if errno != 0 {
- err = errno
- }
- return int(valptr), err
-}
-
-// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
-func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
- _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
- if errno == 0 {
- return nil
- }
- return errno
-}
diff --git a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
deleted file mode 100644
index fc0e50e..0000000
--- a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// +build linux,386 linux,arm linux,mips linux,mipsle
-
-// Copyright 2014 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.
-
-package unix
-
-func init() {
- // On 32-bit Linux systems, the fcntl syscall that matches Go's
- // Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
- fcntl64Syscall = SYS_FCNTL64
-}
diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go
deleted file mode 100644
index cd6f5a6..0000000
--- a/vendor/golang.org/x/sys/unix/gccgo.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015 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 gccgo
-// +build !aix
-
-package unix
-
-import "syscall"
-
-// We can't use the gc-syntax .s files for gccgo. On the plus side
-// much of the functionality can be written directly in Go.
-
-//extern gccgoRealSyscallNoError
-func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
-
-//extern gccgoRealSyscall
-func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
-
-func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
- syscall.Entersyscall()
- r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
- syscall.Exitsyscall()
- return r, 0
-}
-
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- syscall.Entersyscall()
- r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
- syscall.Exitsyscall()
- return r, 0, syscall.Errno(errno)
-}
-
-func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- syscall.Entersyscall()
- r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
- syscall.Exitsyscall()
- return r, 0, syscall.Errno(errno)
-}
-
-func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- syscall.Entersyscall()
- r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
- syscall.Exitsyscall()
- return r, 0, syscall.Errno(errno)
-}
-
-func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
- r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
- return r, 0
-}
-
-func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
- return r, 0, syscall.Errno(errno)
-}
-
-func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
- return r, 0, syscall.Errno(errno)
-}
diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c
deleted file mode 100644
index c44730c..0000000
--- a/vendor/golang.org/x/sys/unix/gccgo_c.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 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 gccgo
-// +build !aix
-
-#include
-#include
-#include
-
-#define _STRINGIFY2_(x) #x
-#define _STRINGIFY_(x) _STRINGIFY2_(x)
-#define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
-
-// Call syscall from C code because the gccgo support for calling from
-// Go to C does not support varargs functions.
-
-struct ret {
- uintptr_t r;
- uintptr_t err;
-};
-
-struct ret
-gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
-{
- struct ret r;
-
- errno = 0;
- r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
- r.err = errno;
- return r;
-}
-
-uintptr_t
-gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
-{
- return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
-}
diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
deleted file mode 100644
index 251a977..0000000
--- a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2015 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 gccgo,linux,amd64
-
-package unix
-
-import "syscall"
-
-//extern gettimeofday
-func realGettimeofday(*Timeval, *byte) int32
-
-func gettimeofday(tv *Timeval) (err syscall.Errno) {
- r := realGettimeofday(tv, nil)
- if r < 0 {
- return syscall.GetErrno()
- }
- return 0
-}
diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go
deleted file mode 100644
index f121a8d..0000000
--- a/vendor/golang.org/x/sys/unix/ioctl.go
+++ /dev/null
@@ -1,30 +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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-import "runtime"
-
-// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
-//
-// To change fd's window size, the req argument should be TIOCSWINSZ.
-func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
- // TODO: if we get the chance, remove the req parameter and
- // hardcode TIOCSWINSZ.
- err := ioctlSetWinsize(fd, req, value)
- runtime.KeepAlive(value)
- return err
-}
-
-// IoctlSetTermios performs an ioctl on fd with a *Termios.
-//
-// The req value will usually be TCSETA or TIOCSETA.
-func IoctlSetTermios(fd int, req uint, value *Termios) error {
- // TODO: if we get the chance, remove the req parameter.
- err := ioctlSetTermios(fd, req, value)
- runtime.KeepAlive(value)
- return err
-}
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
deleted file mode 100755
index b9804c0..0000000
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 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.
-
-# This script runs or (given -n) prints suggested commands to generate files for
-# the Architecture/OS specified by the GOARCH and GOOS environment variables.
-# See README.md for more information about how the build system works.
-
-GOOSARCH="${GOOS}_${GOARCH}"
-
-# defaults
-mksyscall="go run mksyscall.go"
-mkerrors="./mkerrors.sh"
-zerrors="zerrors_$GOOSARCH.go"
-mksysctl=""
-zsysctl="zsysctl_$GOOSARCH.go"
-mksysnum=
-mktypes=
-mkasm=
-run="sh"
-cmd=""
-
-case "$1" in
--syscalls)
- for i in zsyscall*go
- do
- # Run the command line that appears in the first line
- # of the generated file to regenerate it.
- sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i
- rm _$i
- done
- exit 0
- ;;
--n)
- run="cat"
- cmd="echo"
- shift
-esac
-
-case "$#" in
-0)
- ;;
-*)
- echo 'usage: mkall.sh [-n]' 1>&2
- exit 2
-esac
-
-if [[ "$GOOS" = "linux" ]]; then
- # Use the Docker-based build system
- # Files generated through docker (use $cmd so you can Ctl-C the build or run)
- $cmd docker build --tag generate:$GOOS $GOOS
- $cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS
- exit
-fi
-
-GOOSARCH_in=syscall_$GOOSARCH.go
-case "$GOOSARCH" in
-_* | *_ | _)
- echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2
- exit 1
- ;;
-aix_ppc)
- mkerrors="$mkerrors -maix32"
- mksyscall="./mksyscall_aix_ppc.pl -aix"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-aix_ppc64)
- mkerrors="$mkerrors -maix64"
- mksyscall="./mksyscall_aix_ppc64.pl -aix"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-darwin_386)
- mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32"
- mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
-darwin_amd64)
- mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
-darwin_arm)
- mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32"
- mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
-darwin_arm64)
- mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
- ;;
-dragonfly_amd64)
- mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -dragonfly"
- mksysnum="go run mksysnum.go 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-freebsd_386)
- mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32"
- mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-freebsd_amd64)
- mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-freebsd_arm)
- mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32 -arm"
- mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'"
- # Let the type of C char be signed for making the bare syscall
- # API consistent across platforms.
- mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
- ;;
-freebsd_arm64)
- mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-netbsd_386)
- mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32 -netbsd"
- mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-netbsd_amd64)
- mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -netbsd"
- mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-netbsd_arm)
- mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32 -netbsd -arm"
- mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'"
- # Let the type of C char be signed for making the bare syscall
- # API consistent across platforms.
- mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
- ;;
-openbsd_386)
- mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32 -openbsd"
- mksysctl="./mksysctl_openbsd.pl"
- mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-openbsd_amd64)
- mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -openbsd"
- mksysctl="./mksysctl_openbsd.pl"
- mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-openbsd_arm)
- mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32 -openbsd -arm"
- mksysctl="./mksysctl_openbsd.pl"
- mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
- # Let the type of C char be signed for making the bare syscall
- # API consistent across platforms.
- mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
- ;;
-solaris_amd64)
- mksyscall="./mksyscall_solaris.pl"
- mkerrors="$mkerrors -m64"
- mksysnum=
- mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- ;;
-*)
- echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
- exit 1
- ;;
-esac
-
-(
- if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi
- case "$GOOS" in
- *)
- syscall_goos="syscall_$GOOS.go"
- case "$GOOS" in
- darwin | dragonfly | freebsd | netbsd | openbsd)
- syscall_goos="syscall_bsd.go $syscall_goos"
- ;;
- esac
- if [ -n "$mksyscall" ]; then
- if [ "$GOOSARCH" == "aix_ppc64" ]; then
- # aix/ppc64 script generates files instead of writing to stdin.
- echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
- elif [ "$GOOS" == "darwin" ]; then
- # pre-1.12, direct syscalls
- echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go";
- # 1.12 and later, syscalls via libSystem
- echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
- else
- echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
- fi
- fi
- esac
- if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
- if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
- if [ -n "$mktypes" ]; then
- echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go";
- if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi
- fi
-) | $run
diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go
deleted file mode 100644
index 4548b99..0000000
--- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go
+++ /dev/null
@@ -1,61 +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 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)
-
- 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 go1.12\n")
- 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(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
- if err != nil {
- log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err)
- }
-}
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
deleted file mode 100755
index 178077f..0000000
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ /dev/null
@@ -1,664 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 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.
-
-# Generate Go code listing errors and other #defined constant
-# values (ENAMETOOLONG etc.), by asking the preprocessor
-# about the definitions.
-
-unset LANG
-export LC_ALL=C
-export LC_CTYPE=C
-
-if test -z "$GOARCH" -o -z "$GOOS"; then
- echo 1>&2 "GOARCH or GOOS not defined in environment"
- exit 1
-fi
-
-# Check that we are using the new build system if we should
-if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then
- echo 1>&2 "In the Docker based build system, mkerrors should not be called directly."
- echo 1>&2 "See README.md"
- exit 1
-fi
-
-if [[ "$GOOS" = "aix" ]]; then
- CC=${CC:-gcc}
-else
- CC=${CC:-cc}
-fi
-
-if [[ "$GOOS" = "solaris" ]]; then
- # Assumes GNU versions of utilities in PATH.
- export PATH=/usr/gnu/bin:$PATH
-fi
-
-uname=$(uname)
-
-includes_AIX='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define AF_LOCAL AF_UNIX
-'
-
-includes_Darwin='
-#define _DARWIN_C_SOURCE
-#define KERNEL
-#define _DARWIN_USE_64_BIT_INODE
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-'
-
-includes_DragonFly='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-'
-
-includes_FreeBSD='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if __FreeBSD__ >= 10
-#define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10
-#undef SIOCAIFADDR
-#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data
-#undef SIOCSIFPHYADDR
-#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data
-#endif
-'
-
-includes_Linux='
-#define _LARGEFILE_SOURCE
-#define _LARGEFILE64_SOURCE
-#ifndef __LP64__
-#define _FILE_OFFSET_BITS 64
-#endif
-#define _GNU_SOURCE
-
-// is broken on powerpc64, as it fails to include definitions of
-// these structures. We just include them copied from .
-#if defined(__powerpc__)
-struct sgttyb {
- char sg_ispeed;
- char sg_ospeed;
- char sg_erase;
- char sg_kill;
- short sg_flags;
-};
-
-struct tchars {
- char t_intrc;
- char t_quitc;
- char t_startc;
- char t_stopc;
- char t_eofc;
- char t_brkc;
-};
-
-struct ltchars {
- char t_suspc;
- char t_dsuspc;
- char t_rprntc;
- char t_flushc;
- char t_werasc;
- char t_lnextc;
-};
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if defined(__sparc__)
-// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the
-// definition in glibc. As only the error constants are needed here, include the
-// generic termibits.h (which is included by termbits.h on sparc).
-#include
-#else
-#include
-#endif
-
-#ifndef MSG_FASTOPEN
-#define MSG_FASTOPEN 0x20000000
-#endif
-
-#ifndef PTRACE_GETREGS
-#define PTRACE_GETREGS 0xc
-#endif
-
-#ifndef PTRACE_SETREGS
-#define PTRACE_SETREGS 0xd
-#endif
-
-#ifndef SOL_NETLINK
-#define SOL_NETLINK 270
-#endif
-
-#ifdef SOL_BLUETOOTH
-// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
-// but it is already in bluetooth_linux.go
-#undef SOL_BLUETOOTH
-#endif
-
-// Certain constants are missing from the fs/crypto UAPI
-#define FS_KEY_DESC_PREFIX "fscrypt:"
-#define FS_KEY_DESC_PREFIX_SIZE 8
-#define FS_MAX_KEY_SIZE 64
-
-// XDP socket constants do not appear to be picked up otherwise.
-// Copied from samples/bpf/xdpsock_user.c.
-#ifndef SOL_XDP
-#define SOL_XDP 283
-#endif
-
-#ifndef AF_XDP
-#define AF_XDP 44
-#endif
-'
-
-includes_NetBSD='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// Needed since refers to it...
-#define schedppq 1
-'
-
-includes_OpenBSD='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// We keep some constants not supported in OpenBSD 5.5 and beyond for
-// the promise of compatibility.
-#define EMUL_ENABLED 0x1
-#define EMUL_NATIVE 0x2
-#define IPV6_FAITH 0x1d
-#define IPV6_OPTIONS 0x1
-#define IPV6_RTHDR_STRICT 0x1
-#define IPV6_SOCKOPT_RESERVED1 0x3
-#define SIOCGIFGENERIC 0xc020693a
-#define SIOCSIFGENERIC 0x80206939
-#define WALTSIG 0x4
-'
-
-includes_SunOS='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-'
-
-
-includes='
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-'
-ccflags="$@"
-
-# Write go tool cgo -godefs input.
-(
- echo package unix
- echo
- echo '/*'
- indirect="includes_$(uname)"
- echo "${!indirect} $includes"
- echo '*/'
- echo 'import "C"'
- echo 'import "syscall"'
- echo
- echo 'const ('
-
- # The gcc command line prints all the #defines
- # it encounters while processing the input
- echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags |
- awk '
- $1 != "#define" || $2 ~ /\(/ || $3 == "" {next}
-
- $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
- $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
- $2 ~ /^(SCM_SRCRT)$/ {next}
- $2 ~ /^(MAP_FAILED)$/ {next}
- $2 ~ /^ELF_.*$/ {next}# contains ELF_ARCH, etc.
-
- $2 ~ /^EXTATTR_NAMESPACE_NAMES/ ||
- $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next}
-
- $2 !~ /^ECCAPBITS/ &&
- $2 !~ /^ETH_/ &&
- $2 !~ /^EPROC_/ &&
- $2 !~ /^EQUIV_/ &&
- $2 !~ /^EXPR_/ &&
- $2 ~ /^E[A-Z0-9_]+$/ ||
- $2 ~ /^B[0-9_]+$/ ||
- $2 ~ /^(OLD|NEW)DEV$/ ||
- $2 == "BOTHER" ||
- $2 ~ /^CI?BAUD(EX)?$/ ||
- $2 == "IBSHIFT" ||
- $2 ~ /^V[A-Z0-9]+$/ ||
- $2 ~ /^CS[A-Z0-9]/ ||
- $2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ ||
- $2 ~ /^IGN/ ||
- $2 ~ /^IX(ON|ANY|OFF)$/ ||
- $2 ~ /^IN(LCR|PCK)$/ ||
- $2 !~ "X86_CR3_PCID_NOFLUSH" &&
- $2 ~ /(^FLU?SH)|(FLU?SH$)/ ||
- $2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ ||
- $2 == "BRKINT" ||
- $2 == "HUPCL" ||
- $2 == "PENDIN" ||
- $2 == "TOSTOP" ||
- $2 == "XCASE" ||
- $2 == "ALTWERASE" ||
- $2 == "NOKERNINFO" ||
- $2 ~ /^PAR/ ||
- $2 ~ /^SIG[^_]/ ||
- $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ ||
- $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ ||
- $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ ||
- $2 ~ /^O?XTABS$/ ||
- $2 ~ /^TC[IO](ON|OFF)$/ ||
- $2 ~ /^IN_/ ||
- $2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
- $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
- $2 ~ /^TP_STATUS_/ ||
- $2 ~ /^FALLOC_/ ||
- $2 == "ICMPV6_FILTER" ||
- $2 == "SOMAXCONN" ||
- $2 == "NAME_MAX" ||
- $2 == "IFNAMSIZ" ||
- $2 ~ /^CTL_(HW|KERN|MAXNAME|NET|QUERY)$/ ||
- $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ ||
- $2 ~ /^HW_MACHINE$/ ||
- $2 ~ /^SYSCTL_VERS/ ||
- $2 !~ "MNT_BITS" &&
- $2 ~ /^(MS|MNT|UMOUNT)_/ ||
- $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
- $2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ ||
- $2 ~ /^KEXEC_/ ||
- $2 ~ /^LINUX_REBOOT_CMD_/ ||
- $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
- $2 ~ /^MODULE_INIT_/ ||
- $2 !~ "NLA_TYPE_MASK" &&
- $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
- $2 ~ /^SIOC/ ||
- $2 ~ /^TIOC/ ||
- $2 ~ /^TCGET/ ||
- $2 ~ /^TCSET/ ||
- $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||
- $2 !~ "RTF_BITS" &&
- $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||
- $2 ~ /^BIOC/ ||
- $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
- $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
- $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
- $2 ~ /^CLONE_[A-Z_]+/ ||
- $2 !~ /^(BPF_TIMEVAL)$/ &&
- $2 ~ /^(BPF|DLT)_/ ||
- $2 ~ /^CLOCK_/ ||
- $2 ~ /^CAN_/ ||
- $2 ~ /^CAP_/ ||
- $2 ~ /^ALG_/ ||
- $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
- $2 ~ /^GRND_/ ||
- $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
- $2 ~ /^KEYCTL_/ ||
- $2 ~ /^PERF_EVENT_IOC_/ ||
- $2 ~ /^SECCOMP_MODE_/ ||
- $2 ~ /^SPLICE_/ ||
- $2 ~ /^SYNC_FILE_RANGE_/ ||
- $2 !~ /^AUDIT_RECORD_MAGIC/ &&
- $2 !~ /IOC_MAGIC/ &&
- $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ ||
- $2 ~ /^(VM|VMADDR)_/ ||
- $2 ~ /^IOCTL_VM_SOCKETS_/ ||
- $2 ~ /^(TASKSTATS|TS)_/ ||
- $2 ~ /^CGROUPSTATS_/ ||
- $2 ~ /^GENL_/ ||
- $2 ~ /^STATX_/ ||
- $2 ~ /^RENAME/ ||
- $2 ~ /^UBI_IOC[A-Z]/ ||
- $2 ~ /^UTIME_/ ||
- $2 ~ /^XATTR_(CREATE|REPLACE|NO(DEFAULT|FOLLOW|SECURITY)|SHOWCOMPRESSION)/ ||
- $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ ||
- $2 ~ /^FSOPT_/ ||
- $2 ~ /^WDIOC_/ ||
- $2 ~ /^NFN/ ||
- $2 ~ /^XDP_/ ||
- $2 ~ /^(HDIO|WIN|SMART)_/ ||
- $2 !~ "WMESGLEN" &&
- $2 ~ /^W[A-Z0-9]+$/ ||
- $2 ~/^PPPIOC/ ||
- $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
- $2 ~ /^__WCOREFLAG$/ {next}
- $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
-
- {next}
- ' | sort
-
- echo ')'
-) >_const.go
-
-# Pull out the error names for later.
-errors=$(
- echo '#include ' | $CC -x c - -E -dM $ccflags |
- awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |
- sort
-)
-
-# Pull out the signal names for later.
-signals=$(
- echo '#include ' | $CC -x c - -E -dM $ccflags |
- awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
- egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
- sort
-)
-
-# Again, writing regexps to a file.
-echo '#include ' | $CC -x c - -E -dM $ccflags |
- awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' |
- sort >_error.grep
-echo '#include ' | $CC -x c - -E -dM $ccflags |
- awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
- egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
- sort >_signal.grep
-
-echo '// mkerrors.sh' "$@"
-echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
-echo
-echo "// +build ${GOARCH},${GOOS}"
-echo
-go tool cgo -godefs -- "$@" _const.go >_error.out
-cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
-echo
-echo '// Errors'
-echo 'const ('
-cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= syscall.Errno(\1)/'
-echo ')'
-
-echo
-echo '// Signals'
-echo 'const ('
-cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= syscall.Signal(\1)/'
-echo ')'
-
-# Run C program to print error and syscall strings.
-(
- echo -E "
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define nelem(x) (sizeof(x)/sizeof((x)[0]))
-
-enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below
-
-struct tuple {
- int num;
- const char *name;
-};
-
-struct tuple errors[] = {
-"
- for i in $errors
- do
- echo -E ' {'$i', "'$i'" },'
- done
-
- echo -E "
-};
-
-struct tuple signals[] = {
-"
- for i in $signals
- do
- echo -E ' {'$i', "'$i'" },'
- done
-
- # Use -E because on some systems bash builtin interprets \n itself.
- echo -E '
-};
-
-static int
-tuplecmp(const void *a, const void *b)
-{
- return ((struct tuple *)a)->num - ((struct tuple *)b)->num;
-}
-
-int
-main(void)
-{
- int i, e;
- char buf[1024], *p;
-
- printf("\n\n// Error table\n");
- printf("var errorList = [...]struct {\n");
- printf("\tnum syscall.Errno\n");
- printf("\tname string\n");
- printf("\tdesc string\n");
- printf("} {\n");
- qsort(errors, nelem(errors), sizeof errors[0], tuplecmp);
- for(i=0; i 0 && errors[i-1].num == e)
- continue;
- strcpy(buf, strerror(e));
- // lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
- buf[0] += a - A;
- printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf);
- }
- printf("}\n\n");
-
- printf("\n\n// Signal table\n");
- printf("var signalList = [...]struct {\n");
- printf("\tnum syscall.Signal\n");
- printf("\tname string\n");
- printf("\tdesc string\n");
- printf("} {\n");
- qsort(signals, nelem(signals), sizeof signals[0], tuplecmp);
- for(i=0; i 0 && signals[i-1].num == e)
- continue;
- strcpy(buf, strsignal(e));
- // lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
- buf[0] += a - A;
- // cut trailing : number.
- p = strrchr(buf, ":"[0]);
- if(p)
- *p = '\0';
- printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf);
- }
- printf("}\n\n");
-
- return 0;
-}
-
-'
-) >_errors.c
-
-$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go
deleted file mode 100644
index 9feddd0..0000000
--- a/vendor/golang.org/x/sys/unix/mkpost.go
+++ /dev/null
@@ -1,106 +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)
- }
-
- // Intentionally export __val fields in Fsid and Sigset_t
- valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
- b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
-
- // 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 [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))
-
- // gofmt
- b, err = format.Source(b)
- if err != nil {
- log.Fatal(err)
- }
-
- os.Stdout.Write(b)
-}
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go
deleted file mode 100644
index 890652c..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall.go
+++ /dev/null
@@ -1,398 +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
-
-/*
-This program reads a file containing function prototypes
-(like syscall_darwin.go) and generates system call bodies.
-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 errno.
-
-A line beginning with //sysnb is like //sys, except that the
-goroutine will not be suspended during the execution of the system
-call. This must only be used for system calls which can never
-block, as otherwise the system call could cause all goroutines to
-hang.
-*/
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- plan9 = flag.Bool("plan9", false, "plan9")
- openbsd = flag.Bool("openbsd", false, "openbsd")
- netbsd = flag.Bool("netbsd", false, "netbsd")
- dragonfly = flag.Bool("dragonfly", false, "dragonfly")
- arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair
- tags = flag.String("tags", "", "build tags")
- filename = flag.String("output", "", "output file name (standard output if omitted)")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-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
- if goos == "linux" {
- if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n")
- fmt.Fprintf(os.Stderr, "See README.md\n")
- os.Exit(1)
- }
- }
-
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- libc := false
- if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") {
- libc = true
- }
- trampolines := map[string]bool{}
-
- text := ""
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- t = strings.TrimSpace(t)
- t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
- nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, errno error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, sysname := f[2], f[3], f[4], f[5]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // Go function header.
- outDecl := ""
- if len(out) > 0 {
- outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", "))
- }
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl)
-
- // Check if err return available
- errvar := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- break
- }
- }
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name)
- text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass dummy pointer in that case.
- // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).
- text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n)
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name)
- text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n)
- args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
- n++
- } else if p.Type == "int64" && (*openbsd || *netbsd) {
- args = append(args, "0")
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if p.Type == "int64" && *dragonfly {
- if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil {
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if p.Type == "int64" && endianness != "" {
- if len(args)%2 == 1 && *arm {
- // arm abi specifies 64-bit argument uses
- // (even, odd) pair
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- }
-
- // Determine which form to use; pad args with zeros.
- asm := "Syscall"
- if nonblock != nil {
- if errvar == "" && goos == "linux" {
- asm = "RawSyscallNoError"
- } else {
- asm = "RawSyscall"
- }
- } else {
- if errvar == "" && goos == "linux" {
- asm = "SyscallNoError"
- }
- }
- if len(args) <= 3 {
- for len(args) < 3 {
- args = append(args, "0")
- }
- } else if len(args) <= 6 {
- asm += "6"
- for len(args) < 6 {
- args = append(args, "0")
- }
- } else if len(args) <= 9 {
- asm += "9"
- for len(args) < 9 {
- args = append(args, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct)
- }
-
- // System call number.
- if sysname == "" {
- sysname = "SYS_" + funct
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToUpper(sysname)
- }
-
- var libcFn string
- if libc {
- asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call
- sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_
- sysname = strings.ToLower(sysname) // lowercase
- if sysname == "getdirentries64" {
- // Special case - libSystem name and
- // raw syscall name don't match.
- sysname = "__getdirentries64"
- }
- libcFn = sysname
- sysname = "funcPC(libc_" + sysname + "_trampoline)"
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist)
-
- // Assign return values.
- body := ""
- ret := []string{"_", "_", "_"}
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" && !*plan9 {
- reg = "e1"
- ret[2] = reg
- doErrno = true
- } else if p.Name == "err" && *plan9 {
- ret[0] = "r0"
- ret[2] = "e1"
- break
- } else {
- reg = fmt.Sprintf("r%d", i)
- ret[i] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%s != 0", reg)
- }
- if p.Type == "int64" && endianness != "" {
- // 64-bit number in r1:r0 or r0:r1.
- if i+2 > len(out) {
- fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct)
- }
- if endianness == "big-endian" {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
- } else {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
- }
- ret[i] = fmt.Sprintf("r%d", i)
- ret[i+1] = fmt.Sprintf("r%d", i+1)
- }
- if reg != "e1" || *plan9 {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
- text += fmt.Sprintf("\t%s\n", call)
- } else {
- if errvar == "" && goos == "linux" {
- // raw syscall without error on Linux, see golang.org/issue/22924
- text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call)
- } else {
- text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
- }
- }
- text += body
-
- if *plan9 && ret[2] == "e1" {
- text += "\tif int32(r0) == -1 {\n"
- text += "\t\terr = e1\n"
- text += "\t}\n"
- } else if doErrno {
- text += "\tif e1 != 0 {\n"
- text += "\t\terr = errnoErr(e1)\n"
- text += "\t}\n"
- }
- text += "\treturn\n"
- text += "}\n\n"
-
- if libc && !trampolines[libcFn] {
- // some system calls share a trampoline, like read and readlen.
- trampolines[libcFn] = true
- // Declare assembly trampoline.
- text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn)
- // Assembly trampoline calls the libc_* function, which this magic
- // redirects to use the function from libSystem.
- text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn)
- text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn)
- text += "\n"
- }
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- fmt.Printf(srcTemplate, cmdLine(), buildTags(), text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl
deleted file mode 100755
index c44de8d..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl
+++ /dev/null
@@ -1,384 +0,0 @@
-#!/usr/bin/env perl
-# 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.
-
-# This program reads a file containing function prototypes
-# (like syscall_aix.go) and generates system call bodies.
-# 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 than its libc name,
-# * or the function is not in libc, name could be specified
-# * at the end, after "=" sign, like
-# //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-
-use strict;
-
-my $cmdline = "mksyscall_aix_ppc.pl " . join(' ', @ARGV);
-my $errors = 0;
-my $_32bit = "";
-my $tags = ""; # build tags
-my $aix = 0;
-my $solaris = 0;
-
-binmode STDOUT;
-
-if($ARGV[0] eq "-b32") {
- $_32bit = "big-endian";
- shift;
-} elsif($ARGV[0] eq "-l32") {
- $_32bit = "little-endian";
- shift;
-}
-if($ARGV[0] eq "-aix") {
- $aix = 1;
- shift;
-}
-if($ARGV[0] eq "-tags") {
- shift;
- $tags = $ARGV[0];
- shift;
-}
-
-if($ARGV[0] =~ /^-/) {
- print STDERR "usage: mksyscall_aix.pl [-b32 | -l32] [-tags x,y] [file ...]\n";
- exit 1;
-}
-
-sub parseparamlist($) {
- my ($list) = @_;
- $list =~ s/^\s*//;
- $list =~ s/\s*$//;
- if($list eq "") {
- return ();
- }
- return split(/\s*,\s*/, $list);
-}
-
-sub parseparam($) {
- my ($p) = @_;
- if($p !~ /^(\S*) (\S*)$/) {
- print STDERR "$ARGV:$.: malformed parameter: $p\n";
- $errors = 1;
- return ("xx", "int");
- }
- return ($1, $2);
-}
-
-my $package = "";
-my $text = "";
-my $c_extern = "/*\n#include \n#include \n";
-my @vars = ();
-while(<>) {
- chomp;
- s/\s+/ /g;
- s/^\s+//;
- s/\s+$//;
- $package = $1 if !$package && /^package (\S+)$/;
- my $nonblock = /^\/\/sysnb /;
- next if !/^\/\/sys / && !$nonblock;
-
- # Line must be of the form
- # func Open(path string, mode int, perm int) (fd int, err error)
- # Split into name, in params, out params.
- if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) {
- print STDERR "$ARGV:$.: malformed //sys declaration\n";
- $errors = 1;
- next;
- }
- my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);
-
- # Split argument lists on comma.
- my @in = parseparamlist($in);
- my @out = parseparamlist($out);
-
- $in = join(', ', @in);
- $out = join(', ', @out);
-
- # Try in vain to keep people from editing this file.
- # The theory is that they jump into the middle of the file
- # without reading the header.
- $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
-
- # Check if value return, err return available
- my $errvar = "";
- my $retvar = "";
- my $rettype = "";
- foreach my $p (@out) {
- my ($name, $type) = parseparam($p);
- if($type eq "error") {
- $errvar = $name;
- } else {
- $retvar = $name;
- $rettype = $type;
- }
- }
-
- # System call name.
- #if($func ne "fcntl") {
-
- if($sysname eq "") {
- $sysname = "$func";
- }
-
- $sysname =~ s/([a-z])([A-Z])/${1}_$2/g;
- $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.
-
- my $C_rettype = "";
- if($rettype eq "unsafe.Pointer") {
- $C_rettype = "uintptr_t";
- } elsif($rettype eq "uintptr") {
- $C_rettype = "uintptr_t";
- } elsif($rettype =~ /^_/) {
- $C_rettype = "uintptr_t";
- } elsif($rettype eq "int") {
- $C_rettype = "int";
- } elsif($rettype eq "int32") {
- $C_rettype = "int";
- } elsif($rettype eq "int64") {
- $C_rettype = "long long";
- } elsif($rettype eq "uint32") {
- $C_rettype = "unsigned int";
- } elsif($rettype eq "uint64") {
- $C_rettype = "unsigned long long";
- } else {
- $C_rettype = "int";
- }
- if($sysname eq "exit") {
- $C_rettype = "void";
- }
-
- # Change types to c
- my @c_in = ();
- foreach my $p (@in) {
- my ($name, $type) = parseparam($p);
- if($type =~ /^\*/) {
- push @c_in, "uintptr_t";
- } elsif($type eq "string") {
- push @c_in, "uintptr_t";
- } elsif($type =~ /^\[\](.*)/) {
- push @c_in, "uintptr_t", "size_t";
- } elsif($type eq "unsafe.Pointer") {
- push @c_in, "uintptr_t";
- } elsif($type eq "uintptr") {
- push @c_in, "uintptr_t";
- } elsif($type =~ /^_/) {
- push @c_in, "uintptr_t";
- } elsif($type eq "int") {
- push @c_in, "int";
- } elsif($type eq "int32") {
- push @c_in, "int";
- } elsif($type eq "int64") {
- push @c_in, "long long";
- } elsif($type eq "uint32") {
- push @c_in, "unsigned int";
- } elsif($type eq "uint64") {
- push @c_in, "unsigned long long";
- } else {
- push @c_in, "int";
- }
- }
-
- if ($func ne "fcntl" && $func ne "FcntlInt" && $func ne "readlen" && $func ne "writelen") {
- # Imports of system calls from libc
- $c_extern .= "$C_rettype $sysname";
- my $c_in = join(', ', @c_in);
- $c_extern .= "($c_in);\n";
- }
-
- # So file name.
- if($aix) {
- if($modname eq "") {
- $modname = "libc.a/shr_64.o";
- } else {
- print STDERR "$func: only syscall using libc are available\n";
- $errors = 1;
- next;
- }
- }
-
- my $strconvfunc = "C.CString";
- my $strconvtype = "*byte";
-
- # Go function header.
- if($out ne "") {
- $out = " ($out)";
- }
- if($text ne "") {
- $text .= "\n"
- }
-
- $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out ;
-
- # Prepare arguments to call.
- my @args = ();
- my $n = 0;
- my $arg_n = 0;
- foreach my $p (@in) {
- my ($name, $type) = parseparam($p);
- if($type =~ /^\*/) {
- push @args, "C.uintptr_t(uintptr(unsafe.Pointer($name)))";
- } elsif($type eq "string" && $errvar ne "") {
- $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n";
- push @args, "C.uintptr_t(_p$n)";
- $n++;
- } elsif($type eq "string") {
- print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n";
- $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n";
- push @args, "C.uintptr_t(_p$n)";
- $n++;
- } elsif($type =~ /^\[\](.*)/) {
- # Convert slice into pointer, length.
- # Have to be careful not to take address of &a[0] if len == 0:
- # pass nil in that case.
- $text .= "\tvar _p$n *$1\n";
- $text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n";
- push @args, "C.uintptr_t(uintptr(unsafe.Pointer(_p$n)))";
- $n++;
- $text .= "\tvar _p$n int\n";
- $text .= "\t_p$n = len($name)\n";
- push @args, "C.size_t(_p$n)";
- $n++;
- } elsif($type eq "int64" && $_32bit ne "") {
- if($_32bit eq "big-endian") {
- push @args, "uintptr($name >> 32)", "uintptr($name)";
- } else {
- push @args, "uintptr($name)", "uintptr($name >> 32)";
- }
- $n++;
- } elsif($type eq "bool") {
- $text .= "\tvar _p$n uint32\n";
- $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n";
- push @args, "_p$n";
- $n++;
- } elsif($type =~ /^_/) {
- push @args, "C.uintptr_t(uintptr($name))";
- } elsif($type eq "unsafe.Pointer") {
- push @args, "C.uintptr_t(uintptr($name))";
- } elsif($type eq "int") {
- if (($arg_n == 2) && (($func eq "readlen") || ($func eq "writelen"))) {
- push @args, "C.size_t($name)";
- } elsif ($arg_n == 0 && $func eq "fcntl") {
- push @args, "C.uintptr_t($name)";
- } elsif (($arg_n == 2) && (($func eq "fcntl") || ($func eq "FcntlInt"))) {
- push @args, "C.uintptr_t($name)";
- } else {
- push @args, "C.int($name)";
- }
- } elsif($type eq "int32") {
- push @args, "C.int($name)";
- } elsif($type eq "int64") {
- push @args, "C.longlong($name)";
- } elsif($type eq "uint32") {
- push @args, "C.uint($name)";
- } elsif($type eq "uint64") {
- push @args, "C.ulonglong($name)";
- } elsif($type eq "uintptr") {
- push @args, "C.uintptr_t($name)";
- } else {
- push @args, "C.int($name)";
- }
- $arg_n++;
- }
- my $nargs = @args;
-
-
- # Determine which form to use; pad args with zeros.
- if ($nonblock) {
- }
-
- my $args = join(', ', @args);
- my $call = "";
- if ($sysname eq "exit") {
- if ($errvar ne "") {
- $call .= "er :=";
- } else {
- $call .= "";
- }
- } elsif ($errvar ne "") {
- $call .= "r0,er :=";
- } elsif ($retvar ne "") {
- $call .= "r0,_ :=";
- } else {
- $call .= ""
- }
- $call .= "C.$sysname($args)";
-
- # Assign return values.
- my $body = "";
- my $failexpr = "";
-
- for(my $i=0; $i<@out; $i++) {
- my $p = $out[$i];
- my ($name, $type) = parseparam($p);
- my $reg = "";
- if($name eq "err") {
- $reg = "e1";
- } else {
- $reg = "r0";
- }
- if($reg ne "e1" ) {
- $body .= "\t$name = $type($reg)\n";
- }
- }
-
- # verify return
- if ($sysname ne "exit" && $errvar ne "") {
- if ($C_rettype =~ /^uintptr/) {
- $body .= "\tif \(uintptr\(r0\) ==\^uintptr\(0\) && er != nil\) {\n";
- $body .= "\t\t$errvar = er\n";
- $body .= "\t}\n";
- } else {
- $body .= "\tif \(r0 ==-1 && er != nil\) {\n";
- $body .= "\t\t$errvar = er\n";
- $body .= "\t}\n";
- }
- } elsif ($errvar ne "") {
- $body .= "\tif \(er != nil\) {\n";
- $body .= "\t\t$errvar = er\n";
- $body .= "\t}\n";
- }
-
- $text .= "\t$call\n";
- $text .= $body;
-
- $text .= "\treturn\n";
- $text .= "}\n";
-}
-
-if($errors) {
- exit 1;
-}
-
-print <\n";
-# GC
-my $textgc = "";
-my $dynimports = "";
-my $linknames = "";
-my @vars = ();
-# COMMUN
-my $textcommon = "";
-
-while(<>) {
- chomp;
- s/\s+/ /g;
- s/^\s+//;
- s/\s+$//;
- $package = $1 if !$package && /^package (\S+)$/;
- my $nonblock = /^\/\/sysnb /;
- next if !/^\/\/sys / && !$nonblock;
-
- # Line must be of the form
- # func Open(path string, mode int, perm int) (fd int, err error)
- # Split into name, in params, out params.
- if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) {
- print STDERR "$ARGV:$.: malformed //sys declaration\n";
- $errors = 1;
- next;
- }
- my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);
-
- # Split argument lists on comma.
- my @in = parseparamlist($in);
- my @out = parseparamlist($out);
-
- $in = join(', ', @in);
- $out = join(', ', @out);
-
- if($sysname eq "") {
- $sysname = "$func";
- }
-
- my $onlyCommon = 0;
- if ($func eq "readlen" || $func eq "writelen" || $func eq "FcntlInt" || $func eq "FcntlFlock") {
- # This function call another syscall which is already implemented.
- # Therefore, the gc and gccgo part must not be generated.
- $onlyCommon = 1
- }
-
- # Try in vain to keep people from editing this file.
- # The theory is that they jump into the middle of the file
- # without reading the header.
-
- $textcommon .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
- if (!$onlyCommon) {
- $textgccgo .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
- $textgc .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
- }
-
-
- # Check if value return, err return available
- my $errvar = "";
- my $retvar = "";
- my $rettype = "";
- foreach my $p (@out) {
- my ($name, $type) = parseparam($p);
- if($type eq "error") {
- $errvar = $name;
- } else {
- $retvar = $name;
- $rettype = $type;
- }
- }
-
-
- $sysname =~ s/([a-z])([A-Z])/${1}_$2/g;
- $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.
-
- # GCCGO Prototype return type
- my $C_rettype = "";
- if($rettype eq "unsafe.Pointer") {
- $C_rettype = "uintptr_t";
- } elsif($rettype eq "uintptr") {
- $C_rettype = "uintptr_t";
- } elsif($rettype =~ /^_/) {
- $C_rettype = "uintptr_t";
- } elsif($rettype eq "int") {
- $C_rettype = "int";
- } elsif($rettype eq "int32") {
- $C_rettype = "int";
- } elsif($rettype eq "int64") {
- $C_rettype = "long long";
- } elsif($rettype eq "uint32") {
- $C_rettype = "unsigned int";
- } elsif($rettype eq "uint64") {
- $C_rettype = "unsigned long long";
- } else {
- $C_rettype = "int";
- }
- if($sysname eq "exit") {
- $C_rettype = "void";
- }
-
- # GCCGO Prototype arguments type
- my @c_in = ();
- foreach my $i (0 .. $#in) {
- my ($name, $type) = parseparam($in[$i]);
- if($type =~ /^\*/) {
- push @c_in, "uintptr_t";
- } elsif($type eq "string") {
- push @c_in, "uintptr_t";
- } elsif($type =~ /^\[\](.*)/) {
- push @c_in, "uintptr_t", "size_t";
- } elsif($type eq "unsafe.Pointer") {
- push @c_in, "uintptr_t";
- } elsif($type eq "uintptr") {
- push @c_in, "uintptr_t";
- } elsif($type =~ /^_/) {
- push @c_in, "uintptr_t";
- } elsif($type eq "int") {
- if (($i == 0 || $i == 2) && $func eq "fcntl"){
- # These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock
- push @c_in, "uintptr_t";
- } else {
- push @c_in, "int";
- }
- } elsif($type eq "int32") {
- push @c_in, "int";
- } elsif($type eq "int64") {
- push @c_in, "long long";
- } elsif($type eq "uint32") {
- push @c_in, "unsigned int";
- } elsif($type eq "uint64") {
- push @c_in, "unsigned long long";
- } else {
- push @c_in, "int";
- }
- }
-
- if (!$onlyCommon){
- # GCCGO Prototype Generation
- # Imports of system calls from libc
- $c_extern .= "$C_rettype $sysname";
- my $c_in = join(', ', @c_in);
- $c_extern .= "($c_in);\n";
- }
-
- # GC Library name
- if($modname eq "") {
- $modname = "libc.a/shr_64.o";
- } else {
- print STDERR "$func: only syscall using libc are available\n";
- $errors = 1;
- next;
- }
- my $sysvarname = "libc_${sysname}";
-
- if (!$onlyCommon){
- # GC Runtime import of function to allow cross-platform builds.
- $dynimports .= "//go:cgo_import_dynamic ${sysvarname} ${sysname} \"$modname\"\n";
- # GC Link symbol to proc address variable.
- $linknames .= "//go:linkname ${sysvarname} ${sysvarname}\n";
- # GC Library proc address variable.
- push @vars, $sysvarname;
- }
-
- my $strconvfunc ="BytePtrFromString";
- my $strconvtype = "*byte";
-
- # Go function header.
- if($out ne "") {
- $out = " ($out)";
- }
- if($textcommon ne "") {
- $textcommon .= "\n"
- }
-
- $textcommon .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out ;
-
- # Prepare arguments to call.
- my @argscommun = (); # Arguments in the commun part
- my @argscall = (); # Arguments for call prototype
- my @argsgc = (); # Arguments for gc call (with syscall6)
- my @argsgccgo = (); # Arguments for gccgo call (with C.name_of_syscall)
- my $n = 0;
- my $arg_n = 0;
- foreach my $p (@in) {
- my ($name, $type) = parseparam($p);
- if($type =~ /^\*/) {
- push @argscommun, "uintptr(unsafe.Pointer($name))";
- push @argscall, "$name uintptr";
- push @argsgc, "$name";
- push @argsgccgo, "C.uintptr_t($name)";
- } elsif($type eq "string" && $errvar ne "") {
- $textcommon .= "\tvar _p$n $strconvtype\n";
- $textcommon .= "\t_p$n, $errvar = $strconvfunc($name)\n";
- $textcommon .= "\tif $errvar != nil {\n\t\treturn\n\t}\n";
-
- push @argscommun, "uintptr(unsafe.Pointer(_p$n))";
- push @argscall, "_p$n uintptr ";
- push @argsgc, "_p$n";
- push @argsgccgo, "C.uintptr_t(_p$n)";
- $n++;
- } elsif($type eq "string") {
- print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n";
- $textcommon .= "\tvar _p$n $strconvtype\n";
- $textcommon .= "\t_p$n, $errvar = $strconvfunc($name)\n";
- $textcommon .= "\tif $errvar != nil {\n\t\treturn\n\t}\n";
-
- push @argscommun, "uintptr(unsafe.Pointer(_p$n))";
- push @argscall, "_p$n uintptr";
- push @argsgc, "_p$n";
- push @argsgccgo, "C.uintptr_t(_p$n)";
- $n++;
- } elsif($type =~ /^\[\](.*)/) {
- # Convert slice into pointer, length.
- # Have to be careful not to take address of &a[0] if len == 0:
- # pass nil in that case.
- $textcommon .= "\tvar _p$n *$1\n";
- $textcommon .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n";
- push @argscommun, "uintptr(unsafe.Pointer(_p$n))", "len($name)";
- push @argscall, "_p$n uintptr", "_lenp$n int";
- push @argsgc, "_p$n", "uintptr(_lenp$n)";
- push @argsgccgo, "C.uintptr_t(_p$n)", "C.size_t(_lenp$n)";
- $n++;
- } elsif($type eq "int64" && $_32bit ne "") {
- print STDERR "$ARGV:$.: $func uses int64 with 32 bits mode. Case not yet implemented\n";
- # if($_32bit eq "big-endian") {
- # push @args, "uintptr($name >> 32)", "uintptr($name)";
- # } else {
- # push @args, "uintptr($name)", "uintptr($name >> 32)";
- # }
- # $n++;
- } elsif($type eq "bool") {
- print STDERR "$ARGV:$.: $func uses bool. Case not yet implemented\n";
- # $text .= "\tvar _p$n uint32\n";
- # $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n";
- # push @args, "_p$n";
- # $n++;
- } elsif($type =~ /^_/ ||$type eq "unsafe.Pointer") {
- push @argscommun, "uintptr($name)";
- push @argscall, "$name uintptr";
- push @argsgc, "$name";
- push @argsgccgo, "C.uintptr_t($name)";
- } elsif($type eq "int") {
- if (($arg_n == 0 || $arg_n == 2) && ($func eq "fcntl" || $func eq "FcntlInt" || $func eq "FcntlFlock")) {
- # These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock
- push @argscommun, "uintptr($name)";
- push @argscall, "$name uintptr";
- push @argsgc, "$name";
- push @argsgccgo, "C.uintptr_t($name)";
- } else {
- push @argscommun, "$name";
- push @argscall, "$name int";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.int($name)";
- }
- } elsif($type eq "int32") {
- push @argscommun, "$name";
- push @argscall, "$name int32";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.int($name)";
- } elsif($type eq "int64") {
- push @argscommun, "$name";
- push @argscall, "$name int64";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.longlong($name)";
- } elsif($type eq "uint32") {
- push @argscommun, "$name";
- push @argscall, "$name uint32";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.uint($name)";
- } elsif($type eq "uint64") {
- push @argscommun, "$name";
- push @argscall, "$name uint64";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.ulonglong($name)";
- } elsif($type eq "uintptr") {
- push @argscommun, "$name";
- push @argscall, "$name uintptr";
- push @argsgc, "$name";
- push @argsgccgo, "C.uintptr_t($name)";
- } else {
- push @argscommun, "int($name)";
- push @argscall, "$name int";
- push @argsgc, "uintptr($name)";
- push @argsgccgo, "C.int($name)";
- }
- $arg_n++;
- }
- my $nargs = @argsgc;
-
- # COMMUN function generation
- my $argscommun = join(', ', @argscommun);
- my $callcommun = "call$sysname($argscommun)";
- my @ret = ("_", "_");
- my $body = "";
- my $do_errno = 0;
- for(my $i=0; $i<@out; $i++) {
- my $p = $out[$i];
- my ($name, $type) = parseparam($p);
- my $reg = "";
- if($name eq "err") {
- $reg = "e1";
- $ret[1] = $reg;
- $do_errno = 1;
- } else {
- $reg = "r0";
- $ret[0] = $reg;
- }
- if($type eq "bool") {
- $reg = "$reg != 0";
- }
- if($reg ne "e1") {
- $body .= "\t$name = $type($reg)\n";
- }
- }
- if ($ret[0] eq "_" && $ret[1] eq "_") {
- $textcommon .= "\t$callcommun\n";
- } else {
- $textcommon .= "\t$ret[0], $ret[1] := $callcommun\n";
- }
- $textcommon .= $body;
-
- if ($do_errno) {
- $textcommon .= "\tif e1 != 0 {\n";
- $textcommon .= "\t\terr = errnoErr(e1)\n";
- $textcommon .= "\t}\n";
- }
- $textcommon .= "\treturn\n";
- $textcommon .= "}\n";
-
- if ($onlyCommon){
- next
- }
- # CALL Prototype
- my $callProto = sprintf "func call%s(%s) (r1 uintptr, e1 Errno) {\n", $sysname, join(', ', @argscall);
-
- # GC function generation
- my $asm = "syscall6";
- if ($nonblock) {
- $asm = "rawSyscall6";
- }
-
- if(@argsgc <= 6) {
- while(@argsgc < 6) {
- push @argsgc, "0";
- }
- } else {
- print STDERR "$ARGV:$.: too many arguments to system call\n";
- }
- my $argsgc = join(', ', @argsgc);
- my $callgc = "$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $argsgc)";
-
- $textgc .= $callProto;
- $textgc .= "\tr1, _, e1 = $callgc\n";
- $textgc .= "\treturn\n}\n";
-
- # GCCGO function generation
- my $argsgccgo = join(', ', @argsgccgo);
- my $callgccgo = "C.$sysname($argsgccgo)";
- $textgccgo .= $callProto;
- $textgccgo .= "\tr1 = uintptr($callgccgo)\n";
- $textgccgo .= "\te1 = syscall.GetErrno()\n";
- $textgccgo .= "\treturn\n}\n";
-}
-
-if($errors) {
- exit 1;
-}
-
-# Print zsyscall_aix_ppc64.go
-open(my $fcommun, '>', 'zsyscall_aix_ppc64.go');
-my $tofcommun = <', 'zsyscall_aix_ppc64_gc.go');
-my $tofgc = <', 'zsyscall_aix_ppc64_gccgo.go');
-my $tofgccgo = <) {
- chomp;
- s/\s+/ /g;
- s/^\s+//;
- s/\s+$//;
- $package = $1 if !$package && /^package (\S+)$/;
- my $nonblock = /^\/\/sysnb /;
- next if !/^\/\/sys / && !$nonblock;
-
- # Line must be of the form
- # func Open(path string, mode int, perm int) (fd int, err error)
- # Split into name, in params, out params.
- if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) {
- print STDERR "$ARGV:$.: malformed //sys declaration\n";
- $errors = 1;
- next;
- }
- my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);
-
- # Split argument lists on comma.
- my @in = parseparamlist($in);
- my @out = parseparamlist($out);
-
- # Try in vain to keep people from editing this file.
- # The theory is that they jump into the middle of the file
- # without reading the header.
- $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
-
- # So file name.
- if($modname eq "") {
- $modname = "libc";
- }
-
- # System call name.
- if($sysname eq "") {
- $sysname = "$func";
- }
-
- # System call pointer variable name.
- my $sysvarname = "proc$sysname";
-
- my $strconvfunc = "BytePtrFromString";
- my $strconvtype = "*byte";
-
- $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.
-
- # Runtime import of function to allow cross-platform builds.
- $dynimports .= "//go:cgo_import_dynamic libc_${sysname} ${sysname} \"$modname.so\"\n";
- # Link symbol to proc address variable.
- $linknames .= "//go:linkname ${sysvarname} libc_${sysname}\n";
- # Library proc address variable.
- push @vars, $sysvarname;
-
- # Go function header.
- $out = join(', ', @out);
- if($out ne "") {
- $out = " ($out)";
- }
- if($text ne "") {
- $text .= "\n"
- }
- $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out;
-
- # Check if err return available
- my $errvar = "";
- foreach my $p (@out) {
- my ($name, $type) = parseparam($p);
- if($type eq "error") {
- $errvar = $name;
- last;
- }
- }
-
- # Prepare arguments to Syscall.
- my @args = ();
- my $n = 0;
- foreach my $p (@in) {
- my ($name, $type) = parseparam($p);
- if($type =~ /^\*/) {
- push @args, "uintptr(unsafe.Pointer($name))";
- } elsif($type eq "string" && $errvar ne "") {
- $text .= "\tvar _p$n $strconvtype\n";
- $text .= "\t_p$n, $errvar = $strconvfunc($name)\n";
- $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n";
- push @args, "uintptr(unsafe.Pointer(_p$n))";
- $n++;
- } elsif($type eq "string") {
- print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n";
- $text .= "\tvar _p$n $strconvtype\n";
- $text .= "\t_p$n, _ = $strconvfunc($name)\n";
- push @args, "uintptr(unsafe.Pointer(_p$n))";
- $n++;
- } elsif($type =~ /^\[\](.*)/) {
- # Convert slice into pointer, length.
- # Have to be careful not to take address of &a[0] if len == 0:
- # pass nil in that case.
- $text .= "\tvar _p$n *$1\n";
- $text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n";
- push @args, "uintptr(unsafe.Pointer(_p$n))", "uintptr(len($name))";
- $n++;
- } elsif($type eq "int64" && $_32bit ne "") {
- if($_32bit eq "big-endian") {
- push @args, "uintptr($name >> 32)", "uintptr($name)";
- } else {
- push @args, "uintptr($name)", "uintptr($name >> 32)";
- }
- } elsif($type eq "bool") {
- $text .= "\tvar _p$n uint32\n";
- $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n";
- push @args, "uintptr(_p$n)";
- $n++;
- } else {
- push @args, "uintptr($name)";
- }
- }
- my $nargs = @args;
-
- # Determine which form to use; pad args with zeros.
- my $asm = "sysvicall6";
- if ($nonblock) {
- $asm = "rawSysvicall6";
- }
- if(@args <= 6) {
- while(@args < 6) {
- push @args, "0";
- }
- } else {
- print STDERR "$ARGV:$.: too many arguments to system call\n";
- }
-
- # Actual call.
- my $args = join(', ', @args);
- my $call = "$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $args)";
-
- # Assign return values.
- my $body = "";
- my $failexpr = "";
- my @ret = ("_", "_", "_");
- my @pout= ();
- my $do_errno = 0;
- for(my $i=0; $i<@out; $i++) {
- my $p = $out[$i];
- my ($name, $type) = parseparam($p);
- my $reg = "";
- if($name eq "err") {
- $reg = "e1";
- $ret[2] = $reg;
- $do_errno = 1;
- } else {
- $reg = sprintf("r%d", $i);
- $ret[$i] = $reg;
- }
- if($type eq "bool") {
- $reg = "$reg != 0";
- }
- if($type eq "int64" && $_32bit ne "") {
- # 64-bit number in r1:r0 or r0:r1.
- if($i+2 > @out) {
- print STDERR "$ARGV:$.: not enough registers for int64 return\n";
- }
- if($_32bit eq "big-endian") {
- $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1);
- } else {
- $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i);
- }
- $ret[$i] = sprintf("r%d", $i);
- $ret[$i+1] = sprintf("r%d", $i+1);
- }
- if($reg ne "e1") {
- $body .= "\t$name = $type($reg)\n";
- }
- }
- if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
- $text .= "\t$call\n";
- } else {
- $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
- }
- $text .= $body;
-
- if ($do_errno) {
- $text .= "\tif e1 != 0 {\n";
- $text .= "\t\terr = e1\n";
- $text .= "\t}\n";
- }
- $text .= "\treturn\n";
- $text .= "}\n";
-}
-
-if($errors) {
- exit 1;
-}
-
-print < "net.inet",
- "net.inet.ipproto" => "net.inet",
- "net.inet6.ipv6proto" => "net.inet6",
- "net.inet6.ipv6" => "net.inet6.ip6",
- "net.inet.icmpv6" => "net.inet6.icmp6",
- "net.inet6.divert6" => "net.inet6.divert",
- "net.inet6.tcp6" => "net.inet.tcp",
- "net.inet6.udp6" => "net.inet.udp",
- "mpls" => "net.mpls",
- "swpenc" => "vm.swapencrypt"
-);
-
-# Node mappings
-my %node_map = (
- "net.inet.ip.ifq" => "net.ifq",
- "net.inet.pfsync" => "net.pfsync",
- "net.mpls.ifq" => "net.ifq"
-);
-
-my $ctlname;
-my %mib = ();
-my %sysctl = ();
-my $node;
-
-sub debug() {
- print STDERR "$_[0]\n" if $debug;
-}
-
-# Walk the MIB and build a sysctl name to OID mapping.
-sub build_sysctl() {
- my ($node, $name, $oid) = @_;
- my %node = %{$node};
- my @oid = @{$oid};
-
- foreach my $key (sort keys %node) {
- my @node = @{$node{$key}};
- my $nodename = $name.($name ne '' ? '.' : '').$key;
- my @nodeoid = (@oid, $node[0]);
- if ($node[1] eq 'CTLTYPE_NODE') {
- if (exists $node_map{$nodename}) {
- $node = \%mib;
- $ctlname = $node_map{$nodename};
- foreach my $part (split /\./, $ctlname) {
- $node = \%{@{$$node{$part}}[2]};
- }
- } else {
- $node = $node[2];
- }
- &build_sysctl($node, $nodename, \@nodeoid);
- } elsif ($node[1] ne '') {
- $sysctl{$nodename} = \@nodeoid;
- }
- }
-}
-
-foreach my $ctl (@ctls) {
- $ctls{$ctl} = $ctl;
-}
-
-# Build MIB
-foreach my $header (@headers) {
- &debug("Processing $header...");
- open HEADER, "/usr/include/$header" ||
- print STDERR "Failed to open $header\n";
- while () {
- if ($_ =~ /^#define\s+(CTL_NAMES)\s+{/ ||
- $_ =~ /^#define\s+(CTL_(.*)_NAMES)\s+{/ ||
- $_ =~ /^#define\s+((.*)CTL_NAMES)\s+{/) {
- if ($1 eq 'CTL_NAMES') {
- # Top level.
- $node = \%mib;
- } else {
- # Node.
- my $nodename = lc($2);
- if ($header =~ /^netinet\//) {
- $ctlname = "net.inet.$nodename";
- } elsif ($header =~ /^netinet6\//) {
- $ctlname = "net.inet6.$nodename";
- } elsif ($header =~ /^net\//) {
- $ctlname = "net.$nodename";
- } else {
- $ctlname = "$nodename";
- $ctlname =~ s/^(fs|net|kern)_/$1\./;
- }
- if (exists $ctl_map{$ctlname}) {
- $ctlname = $ctl_map{$ctlname};
- }
- if (not exists $ctls{$ctlname}) {
- &debug("Ignoring $ctlname...");
- next;
- }
-
- # Walk down from the top of the MIB.
- $node = \%mib;
- foreach my $part (split /\./, $ctlname) {
- if (not exists $$node{$part}) {
- &debug("Missing node $part");
- $$node{$part} = [ 0, '', {} ];
- }
- $node = \%{@{$$node{$part}}[2]};
- }
- }
-
- # Populate current node with entries.
- my $i = -1;
- while (defined($_) && $_ !~ /^}/) {
- $_ = ;
- $i++ if $_ =~ /{.*}/;
- next if $_ !~ /{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}/;
- $$node{$1} = [ $i, $2, {} ];
- }
- }
- }
- close HEADER;
-}
-
-&build_sysctl(\%mib, "", []);
-
-print < 6.2, pass execpromises to the syscall.
- if maj > 6 || (maj == 6 && min > 2) {
- exptr, err := syscall.BytePtrFromString(execpromises)
- if err != nil {
- return err
- }
- expr = unsafe.Pointer(exptr)
- }
-
- _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
- if e != 0 {
- return e
- }
-
- return nil
-}
-
-// PledgePromises implements the pledge syscall.
-//
-// This changes the promises and leaves the execpromises untouched.
-//
-// For more information see pledge(2).
-func PledgePromises(promises string) error {
- maj, min, err := majmin()
- if err != nil {
- return err
- }
-
- err = pledgeAvailable(maj, min, "")
- if err != nil {
- return err
- }
-
- // This variable holds the execpromises and is always nil.
- var expr unsafe.Pointer
-
- pptr, err := syscall.BytePtrFromString(promises)
- if err != nil {
- return err
- }
-
- _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
- if e != 0 {
- return e
- }
-
- return nil
-}
-
-// PledgeExecpromises implements the pledge syscall.
-//
-// This changes the execpromises and leaves the promises untouched.
-//
-// For more information see pledge(2).
-func PledgeExecpromises(execpromises string) error {
- maj, min, err := majmin()
- if err != nil {
- return err
- }
-
- err = pledgeAvailable(maj, min, execpromises)
- if err != nil {
- return err
- }
-
- // This variable holds the promises and is always nil.
- var pptr unsafe.Pointer
-
- exptr, err := syscall.BytePtrFromString(execpromises)
- if err != nil {
- return err
- }
-
- _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0)
- if e != 0 {
- return e
- }
-
- return nil
-}
-
-// majmin returns major and minor version number for an OpenBSD system.
-func majmin() (major int, minor int, err error) {
- var v Utsname
- err = Uname(&v)
- if err != nil {
- return
- }
-
- major, err = strconv.Atoi(string(v.Release[0]))
- if err != nil {
- err = errors.New("cannot parse major version number returned by uname")
- return
- }
-
- minor, err = strconv.Atoi(string(v.Release[2]))
- if err != nil {
- err = errors.New("cannot parse minor version number returned by uname")
- return
- }
-
- return
-}
-
-// pledgeAvailable checks for availability of the pledge(2) syscall
-// based on the running OpenBSD version.
-func pledgeAvailable(maj, min int, execpromises string) error {
- // If OpenBSD <= 5.9, pledge is not available.
- if (maj == 5 && min != 9) || maj < 5 {
- return fmt.Errorf("pledge syscall is not available on OpenBSD %d.%d", maj, min)
- }
-
- // If OpenBSD <= 6.2 and execpromises is not empty,
- // return an error - execpromises is not available before 6.3
- if (maj < 6 || (maj == 6 && min <= 2)) && execpromises != "" {
- return fmt.Errorf("cannot use execpromises on OpenBSD %d.%d", maj, min)
- }
-
- return nil
-}
diff --git a/vendor/golang.org/x/sys/unix/openbsd_unveil.go b/vendor/golang.org/x/sys/unix/openbsd_unveil.go
deleted file mode 100644
index aebc2dc..0000000
--- a/vendor/golang.org/x/sys/unix/openbsd_unveil.go
+++ /dev/null
@@ -1,44 +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 openbsd
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-// Unveil implements the unveil syscall.
-// For more information see unveil(2).
-// Note that the special case of blocking further
-// unveil calls is handled by UnveilBlock.
-func Unveil(path string, flags string) error {
- pathPtr, err := syscall.BytePtrFromString(path)
- if err != nil {
- return err
- }
- flagsPtr, err := syscall.BytePtrFromString(flags)
- if err != nil {
- return err
- }
- _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0)
- if e != 0 {
- return e
- }
- return nil
-}
-
-// UnveilBlock blocks future unveil calls.
-// For more information see unveil(2).
-func UnveilBlock() error {
- // Both pointers must be nil.
- var pathUnsafe, flagsUnsafe unsafe.Pointer
- _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0)
- if e != 0 {
- return e
- }
- return nil
-}
diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go
deleted file mode 100644
index bc2f362..0000000
--- a/vendor/golang.org/x/sys/unix/pagesize_unix.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2017 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-// For Unix, get the pagesize from the runtime.
-
-package unix
-
-import "syscall"
-
-func Getpagesize() int {
- return syscall.Getpagesize()
-}
diff --git a/vendor/golang.org/x/sys/unix/race.go b/vendor/golang.org/x/sys/unix/race.go
deleted file mode 100644
index 61712b5..0000000
--- a/vendor/golang.org/x/sys/unix/race.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012 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 darwin,race linux,race freebsd,race
-
-package unix
-
-import (
- "runtime"
- "unsafe"
-)
-
-const raceenabled = true
-
-func raceAcquire(addr unsafe.Pointer) {
- runtime.RaceAcquire(addr)
-}
-
-func raceReleaseMerge(addr unsafe.Pointer) {
- runtime.RaceReleaseMerge(addr)
-}
-
-func raceReadRange(addr unsafe.Pointer, len int) {
- runtime.RaceReadRange(addr, len)
-}
-
-func raceWriteRange(addr unsafe.Pointer, len int) {
- runtime.RaceWriteRange(addr, len)
-}
diff --git a/vendor/golang.org/x/sys/unix/race0.go b/vendor/golang.org/x/sys/unix/race0.go
deleted file mode 100644
index ad02667..0000000
--- a/vendor/golang.org/x/sys/unix/race0.go
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2012 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 aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly
-
-package unix
-
-import (
- "unsafe"
-)
-
-const raceenabled = false
-
-func raceAcquire(addr unsafe.Pointer) {
-}
-
-func raceReleaseMerge(addr unsafe.Pointer) {
-}
-
-func raceReadRange(addr unsafe.Pointer, len int) {
-}
-
-func raceWriteRange(addr unsafe.Pointer, len int) {
-}
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
deleted file mode 100644
index 6079eb4..0000000
--- a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 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.
-
-// Socket control messages
-
-package unix
-
-import "unsafe"
-
-// UnixCredentials encodes credentials into a socket control message
-// for sending to another process. This can be used for
-// authentication.
-func UnixCredentials(ucred *Ucred) []byte {
- b := make([]byte, CmsgSpace(SizeofUcred))
- h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
- h.Level = SOL_SOCKET
- h.Type = SCM_CREDENTIALS
- h.SetLen(CmsgLen(SizeofUcred))
- *((*Ucred)(cmsgData(h))) = *ucred
- return b
-}
-
-// ParseUnixCredentials decodes a socket control message that contains
-// credentials in a Ucred structure. To receive such a message, the
-// SO_PASSCRED option must be enabled on the socket.
-func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
- if m.Header.Level != SOL_SOCKET {
- return nil, EINVAL
- }
- if m.Header.Type != SCM_CREDENTIALS {
- return nil, EINVAL
- }
- ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
- return &ucred, nil
-}
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
deleted file mode 100644
index 5f9ae23..0000000
--- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2011 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-// Socket control messages
-
-package unix
-
-import (
- "runtime"
- "unsafe"
-)
-
-// Round the length of a raw sockaddr up to align it properly.
-func cmsgAlignOf(salen int) int {
- salign := SizeofPtr
-
- switch runtime.GOOS {
- case "darwin", "dragonfly", "solaris":
- // NOTE: It seems like 64-bit Darwin, DragonFly BSD and
- // Solaris kernels still require 32-bit aligned access to
- // network subsystem.
- if SizeofPtr == 8 {
- salign = 4
- }
- case "openbsd":
- // OpenBSD armv7 requires 64-bit alignment.
- if runtime.GOARCH == "arm" {
- salign = 8
- }
- }
-
- return (salen + salign - 1) & ^(salign - 1)
-}
-
-// CmsgLen returns the value to store in the Len field of the Cmsghdr
-// structure, taking into account any necessary alignment.
-func CmsgLen(datalen int) int {
- return cmsgAlignOf(SizeofCmsghdr) + datalen
-}
-
-// CmsgSpace returns the number of bytes an ancillary element with
-// payload of the passed data length occupies.
-func CmsgSpace(datalen int) int {
- return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen)
-}
-
-func cmsgData(h *Cmsghdr) unsafe.Pointer {
- return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))
-}
-
-// SocketControlMessage represents a socket control message.
-type SocketControlMessage struct {
- Header Cmsghdr
- Data []byte
-}
-
-// ParseSocketControlMessage parses b as an array of socket control
-// messages.
-func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {
- var msgs []SocketControlMessage
- i := 0
- for i+CmsgLen(0) <= len(b) {
- h, dbuf, err := socketControlMessageHeaderAndData(b[i:])
- if err != nil {
- return nil, err
- }
- m := SocketControlMessage{Header: *h, Data: dbuf}
- msgs = append(msgs, m)
- i += cmsgAlignOf(int(h.Len))
- }
- return msgs, nil
-}
-
-func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) {
- h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
- if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) {
- return nil, nil, EINVAL
- }
- return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil
-}
-
-// UnixRights encodes a set of open file descriptors into a socket
-// control message for sending to another process.
-func UnixRights(fds ...int) []byte {
- datalen := len(fds) * 4
- b := make([]byte, CmsgSpace(datalen))
- h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
- h.Level = SOL_SOCKET
- h.Type = SCM_RIGHTS
- h.SetLen(CmsgLen(datalen))
- data := cmsgData(h)
- for _, fd := range fds {
- *(*int32)(data) = int32(fd)
- data = unsafe.Pointer(uintptr(data) + 4)
- }
- return b
-}
-
-// ParseUnixRights decodes a socket control message that contains an
-// integer array of open file descriptors from another process.
-func ParseUnixRights(m *SocketControlMessage) ([]int, error) {
- if m.Header.Level != SOL_SOCKET {
- return nil, EINVAL
- }
- if m.Header.Type != SCM_RIGHTS {
- return nil, EINVAL
- }
- fds := make([]int, len(m.Data)>>2)
- for i, j := 0, 0; i < len(m.Data); i += 4 {
- fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i])))
- j++
- }
- return fds, nil
-}
diff --git a/vendor/golang.org/x/sys/unix/str.go b/vendor/golang.org/x/sys/unix/str.go
deleted file mode 100644
index 17fb698..0000000
--- a/vendor/golang.org/x/sys/unix/str.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2009 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-func itoa(val int) string { // do it here rather than with fmt to avoid dependency
- if val < 0 {
- return "-" + uitoa(uint(-val))
- }
- return uitoa(uint(val))
-}
-
-func uitoa(val uint) string {
- var buf [32]byte // big enough for int64
- i := len(buf) - 1
- for val >= 10 {
- buf[i] = byte(val%10 + '0')
- i--
- val /= 10
- }
- buf[i] = byte(val + '0')
- return string(buf[i:])
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go
deleted file mode 100644
index 0d4b1d7..0000000
--- a/vendor/golang.org/x/sys/unix/syscall.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2009 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-// Package unix contains an interface to the low-level operating system
-// primitives. OS details vary depending on the underlying system, and
-// by default, godoc will display OS-specific documentation for the current
-// system. If you want godoc to display OS documentation for another
-// system, set $GOOS and $GOARCH to the desired system. For example, if
-// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
-// to freebsd and $GOARCH to arm.
-//
-// The primary use of this package is inside other packages that provide a more
-// portable interface to the system, such as "os", "time" and "net". Use
-// those packages rather than this one if you can.
-//
-// For details of the functions and data types in this package consult
-// the manuals for the appropriate operating system.
-//
-// These calls return err == nil to indicate success; otherwise
-// err represents an operating system error describing the failure and
-// holds a value of type syscall.Errno.
-package unix // import "golang.org/x/sys/unix"
-
-import "strings"
-
-// ByteSliceFromString returns a NUL-terminated slice of bytes
-// containing the text of s. If s contains a NUL byte at any
-// location, it returns (nil, EINVAL).
-func ByteSliceFromString(s string) ([]byte, error) {
- if strings.IndexByte(s, 0) != -1 {
- return nil, EINVAL
- }
- a := make([]byte, len(s)+1)
- copy(a, s)
- return a, nil
-}
-
-// BytePtrFromString returns a pointer to a NUL-terminated array of
-// bytes containing the text of s. If s contains a NUL byte at any
-// location, it returns (nil, EINVAL).
-func BytePtrFromString(s string) (*byte, error) {
- a, err := ByteSliceFromString(s)
- if err != nil {
- return nil, err
- }
- return &a[0], nil
-}
-
-// Single-word zero for use when we need a valid pointer to 0 bytes.
-// See mkunix.pl.
-var _zero uintptr
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go
deleted file mode 100644
index 1351a22..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_aix.go
+++ /dev/null
@@ -1,547 +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 aix
-
-// Aix system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and
-// wrap it in our own nicer implementation.
-
-package unix
-
-import "unsafe"
-
-/*
- * Wrapped
- */
-
-//sys utimes(path string, times *[2]Timeval) (err error)
-func Utimes(path string, tv []Timeval) error {
- if len(tv) != 2 {
- return EINVAL
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
-func UtimesNano(path string, ts []Timespec) error {
- if len(ts) != 2 {
- return EINVAL
- }
- return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
- if ts == nil {
- return utimensat(dirfd, path, nil, flags)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
-}
-
-func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil
-}
-
-func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET6
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- sa.raw.Scope_id = sa.ZoneId
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil
-}
-
-func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
- name := sa.Name
- n := len(name)
- if n > len(sa.raw.Path) {
- return nil, 0, EINVAL
- }
- if n == len(sa.raw.Path) && name[0] != '@' {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_UNIX
- for i := 0; i < n; i++ {
- sa.raw.Path[i] = uint8(name[i])
- }
- // length is family (uint16), name, NUL.
- sl := _Socklen(2)
- if n > 0 {
- sl += _Socklen(n) + 1
- }
- if sa.raw.Path[0] == '@' {
- sa.raw.Path[0] = 0
- // Don't count trailing NUL for abstract address.
- sl--
- }
-
- return unsafe.Pointer(&sa.raw), sl, nil
-}
-
-func Getsockname(fd int) (sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if err = getsockname(fd, &rsa, &len); err != nil {
- return
- }
- return anyToSockaddr(fd, &rsa)
-}
-
-//sys getcwd(buf []byte) (err error)
-
-const ImplementsGetwd = true
-
-func Getwd() (ret string, err error) {
- for len := uint64(4096); ; len *= 2 {
- b := make([]byte, len)
- err := getcwd(b)
- if err == nil {
- i := 0
- for b[i] != 0 {
- i++
- }
- return string(b[0:i]), nil
- }
- if err != ERANGE {
- return "", err
- }
- }
-}
-
-func Getcwd(buf []byte) (n int, err error) {
- err = getcwd(buf)
- if err == nil {
- i := 0
- for buf[i] != 0 {
- i++
- }
- n = i + 1
- }
- return
-}
-
-func Getgroups() (gids []int, err error) {
- n, err := getgroups(0, nil)
- if err != nil {
- return nil, err
- }
- if n == 0 {
- return nil, nil
- }
-
- // Sanity check group count. Max is 16 on BSD.
- if n < 0 || n > 1000 {
- return nil, EINVAL
- }
-
- a := make([]_Gid_t, n)
- n, err = getgroups(n, &a[0])
- if err != nil {
- return nil, err
- }
- gids = make([]int, n)
- for i, v := range a[0:n] {
- gids[i] = int(v)
- }
- return
-}
-
-func Setgroups(gids []int) (err error) {
- if len(gids) == 0 {
- return setgroups(0, nil)
- }
-
- a := make([]_Gid_t, len(gids))
- for i, v := range gids {
- a[i] = _Gid_t(v)
- }
- return setgroups(len(a), &a[0])
-}
-
-/*
- * Socket
- */
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-
-func Accept(fd int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept(fd, &rsa, &len)
- if nfd == -1 {
- return
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
- // Recvmsg not implemented on AIX
- sa := new(SockaddrUnix)
- return -1, -1, -1, sa, ENOSYS
-}
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- // SendmsgN not implemented on AIX
- return -1, ENOSYS
-}
-
-func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
- switch rsa.Addr.Family {
-
- case AF_UNIX:
- pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
- sa := new(SockaddrUnix)
-
- // Some versions of AIX have a bug in getsockname (see IV78655).
- // We can't rely on sa.Len being set correctly.
- n := SizeofSockaddrUnix - 3 // substract leading Family, Len, terminating NUL.
- for i := 0; i < n; i++ {
- if pp.Path[i] == 0 {
- n = i
- break
- }
- }
-
- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
- sa.Name = string(bytes)
- return sa, nil
-
- case AF_INET:
- pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet4)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_INET6:
- pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet6)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- sa.ZoneId = pp.Scope_id
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
- }
- return nil, EAFNOSUPPORT
-}
-
-func Gettimeofday(tv *Timeval) (err error) {
- err = gettimeofday(tv, nil)
- return
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-// TODO
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- return -1, ENOSYS
-}
-
-//sys getdirent(fd int, buf []byte) (n int, err error)
-func ReadDirent(fd int, buf []byte) (n int, err error) {
- return getdirent(fd, buf)
-}
-
-//sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error)
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
- var status _C_int
- var r Pid_t
- err = ERESTART
- // AIX wait4 may return with ERESTART errno, while the processus is still
- // active.
- for err == ERESTART {
- r, err = wait4(Pid_t(pid), &status, options, rusage)
- }
- wpid = int(r)
- if wstatus != nil {
- *wstatus = WaitStatus(status)
- }
- return
-}
-
-/*
- * Wait
- */
-
-type WaitStatus uint32
-
-func (w WaitStatus) Stopped() bool { return w&0x40 != 0 }
-func (w WaitStatus) StopSignal() Signal {
- if !w.Stopped() {
- return -1
- }
- return Signal(w>>8) & 0xFF
-}
-
-func (w WaitStatus) Exited() bool { return w&0xFF == 0 }
-func (w WaitStatus) ExitStatus() int {
- if !w.Exited() {
- return -1
- }
- return int((w >> 8) & 0xFF)
-}
-
-func (w WaitStatus) Signaled() bool { return w&0x40 == 0 && w&0xFF != 0 }
-func (w WaitStatus) Signal() Signal {
- if !w.Signaled() {
- return -1
- }
- return Signal(w>>16) & 0xFF
-}
-
-func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 }
-
-func (w WaitStatus) CoreDump() bool { return w&0x200 != 0 }
-
-func (w WaitStatus) TrapCause() int { return -1 }
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
-// There is no way to create a custom fcntl and to keep //sys fcntl easily,
-// Therefore, the programmer must call dup2 instead of fcntl in this case.
-
-// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
-//sys FcntlInt(fd uintptr, cmd int, arg int) (r int,err error) = fcntl
-
-// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
-//sys FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) = fcntl
-
-//sys fcntl(fd int, cmd int, arg int) (val int, err error)
-
-/*
- * Direct access
- */
-
-//sys Acct(path string) (err error)
-//sys Chdir(path string) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(oldfd int) (fd int, err error)
-//sys Exit(code int)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Fdatasync(fd int) (err error)
-//sys Fsync(fd int) (err error)
-// readdir_r
-//sysnb Getpgid(pid int) (pgid int, err error)
-
-//sys Getpgrp() (pid int)
-
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Kill(pid int, sig Signal) (err error)
-//sys Klogctl(typ int, buf []byte) (n int, err error) = syslog
-//sys Mkdir(dirfd int, path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error) = open64
-//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
-//sys Setdomainname(p []byte) (err error)
-//sys Sethostname(p []byte) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tv *Timeval) (err error)
-
-//sys Setuid(uid int) (err error)
-//sys Setgid(uid int) (err error)
-
-//sys Setpriority(which int, who int, prio int) (err error)
-//sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error)
-//sys Sync()
-//sysnb Times(tms *Tms) (ticks uintptr, err error)
-//sysnb Umask(mask int) (oldmask int)
-//sysnb Uname(buf *Utsname) (err error)
-//TODO umount
-// //sys Unmount(target string, flags int) (err error) = umount
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys readlen(fd int, p *byte, np int) (n int, err error) = read
-//sys writelen(fd int, p *byte, np int) (n int, err error) = write
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = fstatat
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getuid() (uid int)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = pread64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64
-//TODO Select
-// //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
-//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys Truncate(path string, length int64) (err error)
-
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-
-//sys munmap(addr uintptr, length uintptr) (err error)
-
-var mapper = &mmapper{
- active: make(map[*byte][]byte),
- mmap: mmap,
- munmap: munmap,
-}
-
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return mapper.Mmap(fd, offset, length, prot, flags)
-}
-
-func Munmap(b []byte) (err error) {
- return mapper.Munmap(b)
-}
-
-//sys Madvise(b []byte, advice int) (err error)
-//sys Mprotect(b []byte, prot int) (err error)
-//sys Mlock(b []byte) (err error)
-//sys Mlockall(flags int) (err error)
-//sys Msync(b []byte, flags int) (err error)
-//sys Munlock(b []byte) (err error)
-//sys Munlockall() (err error)
-
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-//sys gettimeofday(tv *Timeval, tzp *Timezone) (err error)
-//sysnb Time(t *Time_t) (tt Time_t, err error)
-//sys Utime(path string, buf *Utimbuf) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
deleted file mode 100644
index c28af1f..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
+++ /dev/null
@@ -1,34 +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 aix
-// +build ppc
-
-package unix
-
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
-
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
deleted file mode 100644
index 881cacc..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
+++ /dev/null
@@ -1,34 +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 aix
-// +build ppc64
-
-package unix
-
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
-
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int64(sec), Usec: int32(usec)}
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go
deleted file mode 100644
index 33c8b5f..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_bsd.go
+++ /dev/null
@@ -1,624 +0,0 @@
-// Copyright 2009 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 darwin dragonfly freebsd netbsd openbsd
-
-// BSD system call wrappers shared by *BSD based systems
-// including OS X (Darwin) and FreeBSD. Like the other
-// syscall_*.go files it is compiled as Go code but also
-// used as input to mksyscall which parses the //sys
-// lines and generates system call stubs.
-
-package unix
-
-import (
- "runtime"
- "syscall"
- "unsafe"
-)
-
-/*
- * Wrapped
- */
-
-//sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error)
-//sysnb setgroups(ngid int, gid *_Gid_t) (err error)
-
-func Getgroups() (gids []int, err error) {
- n, err := getgroups(0, nil)
- if err != nil {
- return nil, err
- }
- if n == 0 {
- return nil, nil
- }
-
- // Sanity check group count. Max is 16 on BSD.
- if n < 0 || n > 1000 {
- return nil, EINVAL
- }
-
- a := make([]_Gid_t, n)
- n, err = getgroups(n, &a[0])
- if err != nil {
- return nil, err
- }
- gids = make([]int, n)
- for i, v := range a[0:n] {
- gids[i] = int(v)
- }
- return
-}
-
-func Setgroups(gids []int) (err error) {
- if len(gids) == 0 {
- return setgroups(0, nil)
- }
-
- a := make([]_Gid_t, len(gids))
- for i, v := range gids {
- a[i] = _Gid_t(v)
- }
- return setgroups(len(a), &a[0])
-}
-
-func ReadDirent(fd int, buf []byte) (n int, err error) {
- // Final argument is (basep *uintptr) and the syscall doesn't take nil.
- // 64 bits should be enough. (32 bits isn't even on 386). Since the
- // actual system call is getdirentries64, 64 is a good guess.
- // TODO(rsc): Can we use a single global basep for all calls?
- var base = (*uintptr)(unsafe.Pointer(new(uint64)))
- return Getdirentries(fd, buf, base)
-}
-
-// Wait status is 7 bits at bottom, either 0 (exited),
-// 0x7F (stopped), or a signal number that caused an exit.
-// The 0x80 bit is whether there was a core dump.
-// An extra number (exit code, signal causing a stop)
-// is in the high bits.
-
-type WaitStatus uint32
-
-const (
- mask = 0x7F
- core = 0x80
- shift = 8
-
- exited = 0
- stopped = 0x7F
-)
-
-func (w WaitStatus) Exited() bool { return w&mask == exited }
-
-func (w WaitStatus) ExitStatus() int {
- if w&mask != exited {
- return -1
- }
- return int(w >> shift)
-}
-
-func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }
-
-func (w WaitStatus) Signal() syscall.Signal {
- sig := syscall.Signal(w & mask)
- if sig == stopped || sig == 0 {
- return -1
- }
- return sig
-}
-
-func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }
-
-func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }
-
-func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }
-
-func (w WaitStatus) StopSignal() syscall.Signal {
- if !w.Stopped() {
- return -1
- }
- return syscall.Signal(w>>shift) & 0xFF
-}
-
-func (w WaitStatus) TrapCause() int { return -1 }
-
-//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)
-
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
- var status _C_int
- wpid, err = wait4(pid, &status, options, rusage)
- if wstatus != nil {
- *wstatus = WaitStatus(status)
- }
- return
-}
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys Shutdown(s int, how int) (err error)
-
-func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Len = SizeofSockaddrInet4
- sa.raw.Family = AF_INET
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil
-}
-
-func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Len = SizeofSockaddrInet6
- sa.raw.Family = AF_INET6
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- sa.raw.Scope_id = sa.ZoneId
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil
-}
-
-func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
- name := sa.Name
- n := len(name)
- if n >= len(sa.raw.Path) || n == 0 {
- return nil, 0, EINVAL
- }
- sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL
- sa.raw.Family = AF_UNIX
- for i := 0; i < n; i++ {
- sa.raw.Path[i] = int8(name[i])
- }
- return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil
-}
-
-func (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Index == 0 {
- return nil, 0, EINVAL
- }
- sa.raw.Len = sa.Len
- sa.raw.Family = AF_LINK
- sa.raw.Index = sa.Index
- sa.raw.Type = sa.Type
- sa.raw.Nlen = sa.Nlen
- sa.raw.Alen = sa.Alen
- sa.raw.Slen = sa.Slen
- for i := 0; i < len(sa.raw.Data); i++ {
- sa.raw.Data[i] = sa.Data[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil
-}
-
-func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
- switch rsa.Addr.Family {
- case AF_LINK:
- pp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa))
- sa := new(SockaddrDatalink)
- sa.Len = pp.Len
- sa.Family = pp.Family
- sa.Index = pp.Index
- sa.Type = pp.Type
- sa.Nlen = pp.Nlen
- sa.Alen = pp.Alen
- sa.Slen = pp.Slen
- for i := 0; i < len(sa.Data); i++ {
- sa.Data[i] = pp.Data[i]
- }
- return sa, nil
-
- case AF_UNIX:
- pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
- if pp.Len < 2 || pp.Len > SizeofSockaddrUnix {
- return nil, EINVAL
- }
- sa := new(SockaddrUnix)
-
- // Some BSDs include the trailing NUL in the length, whereas
- // others do not. Work around this by subtracting the leading
- // family and len. The path is then scanned to see if a NUL
- // terminator still exists within the length.
- n := int(pp.Len) - 2 // subtract leading Family, Len
- for i := 0; i < n; i++ {
- if pp.Path[i] == 0 {
- // found early NUL; assume Len included the NUL
- // or was overestimating.
- n = i
- break
- }
- }
- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
- sa.Name = string(bytes)
- return sa, nil
-
- case AF_INET:
- pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet4)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_INET6:
- pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet6)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- sa.ZoneId = pp.Scope_id
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
- }
- return nil, EAFNOSUPPORT
-}
-
-func Accept(fd int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept(fd, &rsa, &len)
- if err != nil {
- return
- }
- if runtime.GOOS == "darwin" && len == 0 {
- // Accepted socket has no address.
- // This is likely due to a bug in xnu kernels,
- // where instead of ECONNABORTED error socket
- // is accepted, but has no address.
- Close(nfd)
- return 0, nil, ECONNABORTED
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-func Getsockname(fd int) (sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if err = getsockname(fd, &rsa, &len); err != nil {
- return
- }
- // TODO(jsing): DragonFly has a "bug" (see issue 3349), which should be
- // reported upstream.
- if runtime.GOOS == "dragonfly" && rsa.Addr.Family == AF_UNSPEC && rsa.Addr.Len == 0 {
- rsa.Addr.Family = AF_UNIX
- rsa.Addr.Len = SizeofSockaddrUnix
- }
- return anyToSockaddr(fd, &rsa)
-}
-
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-
-// GetsockoptString returns the string value of the socket option opt for the
-// socket associated with fd at the given socket level.
-func GetsockoptString(fd, level, opt int) (string, error) {
- buf := make([]byte, 256)
- vallen := _Socklen(len(buf))
- err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
- if err != nil {
- return "", err
- }
- return string(buf[:vallen-1]), nil
-}
-
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
- var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
- msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy byte
- if len(oob) > 0 {
- // receive at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
- msg.SetControllen(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = recvmsg(fd, &msg, flags); err != nil {
- return
- }
- oobn = int(msg.Controllen)
- recvflags = int(msg.Flags)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
- return
-}
-
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
- var msg Msghdr
- msg.Name = (*byte)(unsafe.Pointer(ptr))
- msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy byte
- if len(oob) > 0 {
- // send at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
- msg.SetControllen(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = sendmsg(fd, &msg, flags); err != nil {
- return 0, err
- }
- if len(oob) > 0 && len(p) == 0 {
- n = 0
- }
- return n, nil
-}
-
-//sys kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error)
-
-func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error) {
- var change, event unsafe.Pointer
- if len(changes) > 0 {
- change = unsafe.Pointer(&changes[0])
- }
- if len(events) > 0 {
- event = unsafe.Pointer(&events[0])
- }
- return kevent(kq, change, len(changes), event, len(events), timeout)
-}
-
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
-
-// sysctlmib translates name to mib number and appends any additional args.
-func sysctlmib(name string, args ...int) ([]_C_int, error) {
- // Translate name to mib number.
- mib, err := nametomib(name)
- if err != nil {
- return nil, err
- }
-
- for _, a := range args {
- mib = append(mib, _C_int(a))
- }
-
- return mib, nil
-}
-
-func Sysctl(name string) (string, error) {
- return SysctlArgs(name)
-}
-
-func SysctlArgs(name string, args ...int) (string, error) {
- buf, err := SysctlRaw(name, args...)
- if err != nil {
- return "", err
- }
- n := len(buf)
-
- // Throw away terminating NUL.
- if n > 0 && buf[n-1] == '\x00' {
- n--
- }
- return string(buf[0:n]), nil
-}
-
-func SysctlUint32(name string) (uint32, error) {
- return SysctlUint32Args(name)
-}
-
-func SysctlUint32Args(name string, args ...int) (uint32, error) {
- mib, err := sysctlmib(name, args...)
- if err != nil {
- return 0, err
- }
-
- n := uintptr(4)
- buf := make([]byte, 4)
- if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {
- return 0, err
- }
- if n != 4 {
- return 0, EIO
- }
- return *(*uint32)(unsafe.Pointer(&buf[0])), nil
-}
-
-func SysctlUint64(name string, args ...int) (uint64, error) {
- mib, err := sysctlmib(name, args...)
- if err != nil {
- return 0, err
- }
-
- n := uintptr(8)
- buf := make([]byte, 8)
- if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {
- return 0, err
- }
- if n != 8 {
- return 0, EIO
- }
- return *(*uint64)(unsafe.Pointer(&buf[0])), nil
-}
-
-func SysctlRaw(name string, args ...int) ([]byte, error) {
- mib, err := sysctlmib(name, args...)
- if err != nil {
- return nil, err
- }
-
- // Find size.
- n := uintptr(0)
- if err := sysctl(mib, nil, &n, nil, 0); err != nil {
- return nil, err
- }
- if n == 0 {
- return nil, nil
- }
-
- // Read into buffer of that size.
- buf := make([]byte, n)
- if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {
- return nil, err
- }
-
- // The actual call may return less than the original reported required
- // size so ensure we deal with that.
- return buf[:n], nil
-}
-
-//sys utimes(path string, timeval *[2]Timeval) (err error)
-
-func Utimes(path string, tv []Timeval) error {
- if tv == nil {
- return utimes(path, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-func UtimesNano(path string, ts []Timespec) error {
- if ts == nil {
- err := utimensat(AT_FDCWD, path, nil, 0)
- if err != ENOSYS {
- return err
- }
- return utimes(path, nil)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- // Darwin setattrlist can set nanosecond timestamps
- err := setattrlistTimes(path, ts, 0)
- if err != ENOSYS {
- return err
- }
- err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
- if err != ENOSYS {
- return err
- }
- // Not as efficient as it could be because Timespec and
- // Timeval have different types in the different OSes
- tv := [2]Timeval{
- NsecToTimeval(TimespecToNsec(ts[0])),
- NsecToTimeval(TimespecToNsec(ts[1])),
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
- if ts == nil {
- return utimensat(dirfd, path, nil, flags)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- err := setattrlistTimes(path, ts, flags)
- if err != ENOSYS {
- return err
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
-}
-
-//sys futimes(fd int, timeval *[2]Timeval) (err error)
-
-func Futimes(fd int, tv []Timeval) error {
- if tv == nil {
- return futimes(fd, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-//sys fcntl(fd int, cmd int, arg int) (val int, err error)
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-// TODO: wrap
-// Acct(name nil-string) (err error)
-// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
-// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
-
-var mapper = &mmapper{
- active: make(map[*byte][]byte),
- mmap: mmap,
- munmap: munmap,
-}
-
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return mapper.Mmap(fd, offset, length, prot, flags)
-}
-
-func Munmap(b []byte) (err error) {
- return mapper.Munmap(b)
-}
-
-//sys Madvise(b []byte, behav int) (err error)
-//sys Mlock(b []byte) (err error)
-//sys Mlockall(flags int) (err error)
-//sys Mprotect(b []byte, prot int) (err error)
-//sys Msync(b []byte, flags int) (err error)
-//sys Munlock(b []byte) (err error)
-//sys Munlockall() (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
deleted file mode 100644
index 04042e4..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ /dev/null
@@ -1,688 +0,0 @@
-// Copyright 2009,2010 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.
-
-// Darwin system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_bsd.go or syscall_unix.go.
-
-package unix
-
-import (
- "errors"
- "syscall"
- "unsafe"
-)
-
-const ImplementsGetwd = true
-
-func Getwd() (string, error) {
- buf := make([]byte, 2048)
- attrs, err := getAttrList(".", attrList{CommonAttr: attrCmnFullpath}, buf, 0)
- if err == nil && len(attrs) == 1 && len(attrs[0]) >= 2 {
- wd := string(attrs[0])
- // Sanity check that it's an absolute path and ends
- // in a null byte, which we then strip.
- if wd[0] == '/' && wd[len(wd)-1] == 0 {
- return wd[:len(wd)-1], nil
- }
- }
- // If pkg/os/getwd.go gets ENOTSUP, it will fall back to the
- // slow algorithm.
- return "", ENOTSUP
-}
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [12]int8
- raw RawSockaddrDatalink
-}
-
-// Translate "kern.hostname" to []_C_int{0,1,2,3}.
-func nametomib(name string) (mib []_C_int, err error) {
- const siz = unsafe.Sizeof(mib[0])
-
- // NOTE(rsc): It seems strange to set the buffer to have
- // size CTL_MAXNAME+2 but use only CTL_MAXNAME
- // as the size. I don't know why the +2 is here, but the
- // kernel uses +2 for its own implementation of this function.
- // I am scared that if we don't include the +2 here, the kernel
- // will silently write 2 words farther than we specify
- // and we'll get memory corruption.
- var buf [CTL_MAXNAME + 2]_C_int
- n := uintptr(CTL_MAXNAME) * siz
-
- p := (*byte)(unsafe.Pointer(&buf[0]))
- bytes, err := ByteSliceFromString(name)
- if err != nil {
- return nil, err
- }
-
- // Magic sysctl: "setting" 0.3 to a string name
- // lets you read back the array of integers form.
- if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
- return nil, err
- }
- return buf[0 : n/siz], nil
-}
-
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
-func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
-func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
-
-const (
- attrBitMapCount = 5
- attrCmnFullpath = 0x08000000
-)
-
-type attrList struct {
- bitmapCount uint16
- _ uint16
- CommonAttr uint32
- VolAttr uint32
- DirAttr uint32
- FileAttr uint32
- Forkattr uint32
-}
-
-func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
- if len(attrBuf) < 4 {
- return nil, errors.New("attrBuf too small")
- }
- attrList.bitmapCount = attrBitMapCount
-
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return nil, err
- }
-
- if err := getattrlist(_p0, unsafe.Pointer(&attrList), unsafe.Pointer(&attrBuf[0]), uintptr(len(attrBuf)), int(options)); err != nil {
- return nil, err
- }
- size := *(*uint32)(unsafe.Pointer(&attrBuf[0]))
-
- // dat is the section of attrBuf that contains valid data,
- // without the 4 byte length header. All attribute offsets
- // are relative to dat.
- dat := attrBuf
- if int(size) < len(attrBuf) {
- dat = dat[:size]
- }
- dat = dat[4:] // remove length prefix
-
- for i := uint32(0); int(i) < len(dat); {
- header := dat[i:]
- if len(header) < 8 {
- return attrs, errors.New("truncated attribute header")
- }
- datOff := *(*int32)(unsafe.Pointer(&header[0]))
- attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
- if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
- return attrs, errors.New("truncated results; attrBuf too small")
- }
- end := uint32(datOff) + attrLen
- attrs = append(attrs, dat[datOff:end])
- i = end
- if r := i % 4; r != 0 {
- i += (4 - r)
- }
- }
- return
-}
-
-//sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
-
-//sysnb pipe() (r int, w int, err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- p[0], p[1], err = pipe()
- return
-}
-
-func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
- var _p0 unsafe.Pointer
- var bufsize uintptr
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
- }
- return getfsstat(_p0, bufsize, flags)
-}
-
-func xattrPointer(dest []byte) *byte {
- // It's only when dest is set to NULL that the OS X implementations of
- // getxattr() and listxattr() return the current sizes of the named attributes.
- // An empty byte array is not sufficient. To maintain the same behaviour as the
- // linux implementation, we wrap around the system calls and pass in NULL when
- // dest is empty.
- var destp *byte
- if len(dest) > 0 {
- destp = &dest[0]
- }
- return destp
-}
-
-//sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
-
-func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
- return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0)
-}
-
-func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
- return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW)
-}
-
-//sys fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
-
-func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
- return fgetxattr(fd, attr, xattrPointer(dest), len(dest), 0, 0)
-}
-
-//sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error)
-
-func Setxattr(path string, attr string, data []byte, flags int) (err error) {
- // The parameters for the OS X implementation vary slightly compared to the
- // linux system call, specifically the position parameter:
- //
- // linux:
- // int setxattr(
- // const char *path,
- // const char *name,
- // const void *value,
- // size_t size,
- // int flags
- // );
- //
- // darwin:
- // int setxattr(
- // const char *path,
- // const char *name,
- // void *value,
- // size_t size,
- // u_int32_t position,
- // int options
- // );
- //
- // position specifies the offset within the extended attribute. In the
- // current implementation, only the resource fork extended attribute makes
- // use of this argument. For all others, position is reserved. We simply
- // default to setting it to zero.
- return setxattr(path, attr, xattrPointer(data), len(data), 0, flags)
-}
-
-func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
- return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW)
-}
-
-//sys fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error)
-
-func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
- return fsetxattr(fd, attr, xattrPointer(data), len(data), 0, 0)
-}
-
-//sys removexattr(path string, attr string, options int) (err error)
-
-func Removexattr(path string, attr string) (err error) {
- // We wrap around and explicitly zero out the options provided to the OS X
- // implementation of removexattr, we do so for interoperability with the
- // linux variant.
- return removexattr(path, attr, 0)
-}
-
-func Lremovexattr(link string, attr string) (err error) {
- return removexattr(link, attr, XATTR_NOFOLLOW)
-}
-
-//sys fremovexattr(fd int, attr string, options int) (err error)
-
-func Fremovexattr(fd int, attr string) (err error) {
- return fremovexattr(fd, attr, 0)
-}
-
-//sys listxattr(path string, dest *byte, size int, options int) (sz int, err error)
-
-func Listxattr(path string, dest []byte) (sz int, err error) {
- return listxattr(path, xattrPointer(dest), len(dest), 0)
-}
-
-func Llistxattr(link string, dest []byte) (sz int, err error) {
- return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW)
-}
-
-//sys flistxattr(fd int, dest *byte, size int, options int) (sz int, err error)
-
-func Flistxattr(fd int, dest []byte) (sz int, err error) {
- return flistxattr(fd, xattrPointer(dest), len(dest), 0)
-}
-
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- _p0, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
-
- var attrList attrList
- attrList.bitmapCount = ATTR_BIT_MAP_COUNT
- attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
-
- // order is mtime, atime: the opposite of Chtimes
- attributes := [2]Timespec{times[1], times[0]}
- options := 0
- if flags&AT_SYMLINK_NOFOLLOW != 0 {
- options |= FSOPT_NOFOLLOW
- }
- return setattrlist(
- _p0,
- unsafe.Pointer(&attrList),
- unsafe.Pointer(&attributes),
- unsafe.Sizeof(attributes),
- options)
-}
-
-//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
-
-func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
- // Darwin doesn't support SYS_UTIMENSAT
- return ENOSYS
-}
-
-/*
- * Wrapped
- */
-
-//sys kill(pid int, signum int, posix int) (err error)
-
-func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func Uname(uname *Utsname) error {
- mib := []_C_int{CTL_KERN, KERN_OSTYPE}
- n := unsafe.Sizeof(uname.Sysname)
- if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
- n = unsafe.Sizeof(uname.Nodename)
- if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
- n = unsafe.Sizeof(uname.Release)
- if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_VERSION}
- n = unsafe.Sizeof(uname.Version)
- if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
- return err
- }
-
- // The version might have newlines or tabs in it, convert them to
- // spaces.
- for i, b := range uname.Version {
- if b == '\n' || b == '\t' {
- if i == len(uname.Version)-1 {
- uname.Version[i] = 0
- } else {
- uname.Version[i] = ' '
- }
- }
- }
-
- mib = []_C_int{CTL_HW, HW_MACHINE}
- n = unsafe.Sizeof(uname.Machine)
- if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
- return err
- }
-
- return nil
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- var length = int64(count)
- err = sendfile(infd, outfd, *offset, &length, nil, 0)
- written = int(length)
- return
-}
-
-//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys Chdir(path string) (err error)
-//sys Chflags(path string, flags int) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(from int, to int) (err error)
-//sys Exchangedata(path1 string, path2 string, options int) (err error)
-//sys Exit(code int)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchflags(fd int, flags int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sys Getdtablesize() (size int)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (uid int)
-//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgrp int)
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Getuid() (uid int)
-//sysnb Issetugid() (tainted bool)
-//sys Kqueue() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
-//sys Listen(s int, backlog int) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
-//sys Revoke(path string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sys Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sys Setlogin(name string) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sys Setprivexec(flag int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tp *Timeval) (err error)
-//sysnb Setuid(uid int) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-//sys Sync() (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Umask(newmask int) (oldmask int)
-//sys Undelete(path string) (err error)
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Unmount(path string, flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
-//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
-
-/*
- * Unimplemented
- */
-// Profil
-// Sigaction
-// Sigprocmask
-// Getlogin
-// Sigpending
-// Sigaltstack
-// Ioctl
-// Reboot
-// Execve
-// Vfork
-// Sbrk
-// Sstk
-// Ovadvise
-// Mincore
-// Setitimer
-// Swapon
-// Select
-// Sigsuspend
-// Readv
-// Writev
-// Nfssvc
-// Getfh
-// Quotactl
-// Mount
-// Csops
-// Waitid
-// Add_profil
-// Kdebug_trace
-// Sigreturn
-// Atsocket
-// Kqueue_from_portset_np
-// Kqueue_portset
-// Getattrlist
-// Setattrlist
-// Getdirentriesattr
-// Searchfs
-// Delete
-// Copyfile
-// Watchevent
-// Waitevent
-// Modwatch
-// Fsctl
-// Initgroups
-// Posix_spawn
-// Nfsclnt
-// Fhopen
-// Minherit
-// Semsys
-// Msgsys
-// Shmsys
-// Semctl
-// Semget
-// Semop
-// Msgctl
-// Msgget
-// Msgsnd
-// Msgrcv
-// Shmat
-// Shmctl
-// Shmdt
-// Shmget
-// Shm_open
-// Shm_unlink
-// Sem_open
-// Sem_close
-// Sem_unlink
-// Sem_wait
-// Sem_trywait
-// Sem_post
-// Sem_getvalue
-// Sem_init
-// Sem_destroy
-// Open_extended
-// Umask_extended
-// Stat_extended
-// Lstat_extended
-// Fstat_extended
-// Chmod_extended
-// Fchmod_extended
-// Access_extended
-// Settid
-// Gettid
-// Setsgroups
-// Getsgroups
-// Setwgroups
-// Getwgroups
-// Mkfifo_extended
-// Mkdir_extended
-// Identitysvc
-// Shared_region_check_np
-// Shared_region_map_np
-// __pthread_mutex_destroy
-// __pthread_mutex_init
-// __pthread_mutex_lock
-// __pthread_mutex_trylock
-// __pthread_mutex_unlock
-// __pthread_cond_init
-// __pthread_cond_destroy
-// __pthread_cond_broadcast
-// __pthread_cond_signal
-// Setsid_with_pid
-// __pthread_cond_timedwait
-// Aio_fsync
-// Aio_return
-// Aio_suspend
-// Aio_cancel
-// Aio_error
-// Aio_read
-// Aio_write
-// Lio_listio
-// __pthread_cond_wait
-// Iopolicysys
-// __pthread_kill
-// __pthread_sigmask
-// __sigwait
-// __disable_threadsignal
-// __pthread_markcancel
-// __pthread_canceled
-// __semwait_signal
-// Proc_info
-// sendfile
-// Stat64_extended
-// Lstat64_extended
-// Fstat64_extended
-// __pthread_chdir
-// __pthread_fchdir
-// Audit
-// Auditon
-// Getauid
-// Setauid
-// Getaudit
-// Setaudit
-// Getaudit_addr
-// Setaudit_addr
-// Auditctl
-// Bsdthread_create
-// Bsdthread_terminate
-// Stack_snapshot
-// Bsdthread_register
-// Workq_open
-// Workq_ops
-// __mac_execve
-// __mac_syscall
-// __mac_get_file
-// __mac_set_file
-// __mac_get_link
-// __mac_set_link
-// __mac_get_proc
-// __mac_set_proc
-// __mac_get_fd
-// __mac_set_fd
-// __mac_get_pid
-// __mac_get_lcid
-// __mac_get_lctx
-// __mac_set_lctx
-// Setlcid
-// Read_nocancel
-// Write_nocancel
-// Open_nocancel
-// Close_nocancel
-// Wait4_nocancel
-// Recvmsg_nocancel
-// Sendmsg_nocancel
-// Recvfrom_nocancel
-// Accept_nocancel
-// Fcntl_nocancel
-// Select_nocancel
-// Fsync_nocancel
-// Connect_nocancel
-// Sigsuspend_nocancel
-// Readv_nocancel
-// Writev_nocancel
-// Sendto_nocancel
-// Pread_nocancel
-// Pwrite_nocancel
-// Waitid_nocancel
-// Poll_nocancel
-// Msgsnd_nocancel
-// Msgrcv_nocancel
-// Sem_wait_nocancel
-// Aio_suspend_nocancel
-// __sigwait_nocancel
-// __semwait_signal_nocancel
-// __mac_mount
-// __mac_get_mount
-// __mac_getfsstat
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
deleted file mode 100644
index 489726f..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2009 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 386,darwin
-
-package unix
-
-import (
- "syscall"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
-func Gettimeofday(tv *Timeval) (err error) {
- // The tv passed to gettimeofday must be non-nil
- // but is otherwise unused. The answers come back
- // in the two registers.
- sec, usec, err := gettimeofday(tv)
- tv.Sec = int32(sec)
- tv.Usec = int32(usec)
- return err
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of darwin/386 the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
-
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
deleted file mode 100644
index 914b89b..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2009 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 amd64,darwin
-
-package unix
-
-import (
- "syscall"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
-func Gettimeofday(tv *Timeval) (err error) {
- // The tv passed to gettimeofday must be non-nil
- // but is otherwise unused. The answers come back
- // in the two registers.
- sec, usec, err := gettimeofday(tv)
- tv.Sec = sec
- tv.Usec = usec
- return err
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of darwin/amd64 the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
-
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
deleted file mode 100644
index 4a284cf..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2015 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.
-
-package unix
-
-import (
- "syscall"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
-func Gettimeofday(tv *Timeval) (err error) {
- // The tv passed to gettimeofday must be non-nil
- // but is otherwise unused. The answers come back
- // in the two registers.
- sec, usec, err := gettimeofday(tv)
- tv.Sec = int32(sec)
- tv.Usec = int32(usec)
- return err
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of darwin/arm the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
-
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, stat *Statfs_t) (err error)
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, stat *Statfs_t) (err error)
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return 0, ENOSYS
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
deleted file mode 100644
index 52dcd88..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015 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 arm64,darwin
-
-package unix
-
-import (
- "syscall"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
-func Gettimeofday(tv *Timeval) (err error) {
- // The tv passed to gettimeofday must be non-nil
- // but is otherwise unused. The answers come back
- // in the two registers.
- sec, usec, err := gettimeofday(tv)
- tv.Sec = sec
- tv.Usec = usec
- return err
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of darwin/arm64 the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
-
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, stat *Statfs_t) (err error)
-//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, stat *Statfs_t) (err error)
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return 0, ENOSYS
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
deleted file mode 100644
index 4b4ae46..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
+++ /dev/null
@@ -1,31 +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 darwin,go1.12
-
-package unix
-
-import "unsafe"
-
-// Implemented in the runtime package (runtime/sys_darwin.go)
-func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
-func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only
-func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
-func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-
-//go:linkname syscall_syscall syscall.syscall
-//go:linkname syscall_syscall6 syscall.syscall6
-//go:linkname syscall_syscall6X syscall.syscall6X
-//go:linkname syscall_syscall9 syscall.syscall9
-//go:linkname syscall_rawSyscall syscall.rawSyscall
-//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
-
-// Find the entry point for f. See comments in runtime/proc.go for the
-// function of the same name.
-//go:nosplit
-func funcPC(f func()) uintptr {
- return **(**uintptr)(unsafe.Pointer(&f))
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
deleted file mode 100644
index 891c94d..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ /dev/null
@@ -1,538 +0,0 @@
-// Copyright 2009 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.
-
-// DragonFly BSD system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_bsd.go or syscall_unix.go.
-
-package unix
-
-import "unsafe"
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [12]int8
- Rcf uint16
- Route [16]uint16
- raw RawSockaddrDatalink
-}
-
-// Translate "kern.hostname" to []_C_int{0,1,2,3}.
-func nametomib(name string) (mib []_C_int, err error) {
- const siz = unsafe.Sizeof(mib[0])
-
- // NOTE(rsc): It seems strange to set the buffer to have
- // size CTL_MAXNAME+2 but use only CTL_MAXNAME
- // as the size. I don't know why the +2 is here, but the
- // kernel uses +2 for its own implementation of this function.
- // I am scared that if we don't include the +2 here, the kernel
- // will silently write 2 words farther than we specify
- // and we'll get memory corruption.
- var buf [CTL_MAXNAME + 2]_C_int
- n := uintptr(CTL_MAXNAME) * siz
-
- p := (*byte)(unsafe.Pointer(&buf[0]))
- bytes, err := ByteSliceFromString(name)
- if err != nil {
- return nil, err
- }
-
- // Magic sysctl: "setting" 0.3 to a string name
- // lets you read back the array of integers form.
- if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
- return nil, err
- }
- return buf[0 : n/siz], nil
-}
-
-//sysnb pipe() (r int, w int, err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- p[0], p[1], err = pipe()
- return
-}
-
-//sys extpread(fd int, p []byte, flags int, offset int64) (n int, err error)
-func Pread(fd int, p []byte, offset int64) (n int, err error) {
- return extpread(fd, p, 0, offset)
-}
-
-//sys extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error)
-func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
- return extpwrite(fd, p, 0, offset)
-}
-
-func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept4(fd, &rsa, &len, flags)
- if err != nil {
- return
- }
- if len > SizeofSockaddrAny {
- panic("RawSockaddrAny too small")
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
-
-func Getwd() (string, error) {
- var buf [PathMax]byte
- _, err := Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- n := clen(buf[:])
- if n < 1 {
- return "", EINVAL
- }
- return string(buf[:n]), nil
-}
-
-func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
- var _p0 unsafe.Pointer
- var bufsize uintptr
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
- }
- r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
- err := sysctl(mib, old, oldlen, nil, 0)
- if err != nil {
- // Utsname members on Dragonfly are only 32 bytes and
- // the syscall returns ENOMEM in case the actual value
- // is longer.
- if err == ENOMEM {
- err = nil
- }
- }
- return err
-}
-
-func Uname(uname *Utsname) error {
- mib := []_C_int{CTL_KERN, KERN_OSTYPE}
- n := unsafe.Sizeof(uname.Sysname)
- if err := sysctlUname(mib, &uname.Sysname[0], &n); err != nil {
- return err
- }
- uname.Sysname[unsafe.Sizeof(uname.Sysname)-1] = 0
-
- mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
- n = unsafe.Sizeof(uname.Nodename)
- if err := sysctlUname(mib, &uname.Nodename[0], &n); err != nil {
- return err
- }
- uname.Nodename[unsafe.Sizeof(uname.Nodename)-1] = 0
-
- mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
- n = unsafe.Sizeof(uname.Release)
- if err := sysctlUname(mib, &uname.Release[0], &n); err != nil {
- return err
- }
- uname.Release[unsafe.Sizeof(uname.Release)-1] = 0
-
- mib = []_C_int{CTL_KERN, KERN_VERSION}
- n = unsafe.Sizeof(uname.Version)
- if err := sysctlUname(mib, &uname.Version[0], &n); err != nil {
- return err
- }
-
- // The version might have newlines or tabs in it, convert them to
- // spaces.
- for i, b := range uname.Version {
- if b == '\n' || b == '\t' {
- if i == len(uname.Version)-1 {
- uname.Version[i] = 0
- } else {
- uname.Version[i] = ' '
- }
- }
- }
-
- mib = []_C_int{CTL_HW, HW_MACHINE}
- n = unsafe.Sizeof(uname.Machine)
- if err := sysctlUname(mib, &uname.Machine[0], &n); err != nil {
- return err
- }
- uname.Machine[unsafe.Sizeof(uname.Machine)-1] = 0
-
- return nil
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys Chdir(path string) (err error)
-//sys Chflags(path string, flags int) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(from int, to int) (err error)
-//sys Exit(code int)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchflags(fd int, flags int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, stat *Statfs_t) (err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
-//sys Getdtablesize() (size int)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (uid int)
-//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgrp int)
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Getuid() (uid int)
-//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum syscall.Signal) (err error)
-//sys Kqueue() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
-//sys Listen(s int, backlog int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Mknodat(fd int, path string, mode uint32, dev int) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Revoke(path string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sysnb Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sys Setlogin(name string) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tp *Timeval) (err error)
-//sysnb Setuid(uid int) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, stat *Statfs_t) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-//sys Sync() (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Umask(newmask int) (oldmask int)
-//sys Undelete(path string) (err error)
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Unmount(path string, flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
-//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
-//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
-
-/*
- * Unimplemented
- * TODO(jsing): Update this list for DragonFly.
- */
-// Profil
-// Sigaction
-// Sigprocmask
-// Getlogin
-// Sigpending
-// Sigaltstack
-// Reboot
-// Execve
-// Vfork
-// Sbrk
-// Sstk
-// Ovadvise
-// Mincore
-// Setitimer
-// Swapon
-// Select
-// Sigsuspend
-// Readv
-// Writev
-// Nfssvc
-// Getfh
-// Quotactl
-// Mount
-// Csops
-// Waitid
-// Add_profil
-// Kdebug_trace
-// Sigreturn
-// Atsocket
-// Kqueue_from_portset_np
-// Kqueue_portset
-// Getattrlist
-// Setattrlist
-// Getdirentriesattr
-// Searchfs
-// Delete
-// Copyfile
-// Watchevent
-// Waitevent
-// Modwatch
-// Getxattr
-// Fgetxattr
-// Setxattr
-// Fsetxattr
-// Removexattr
-// Fremovexattr
-// Listxattr
-// Flistxattr
-// Fsctl
-// Initgroups
-// Posix_spawn
-// Nfsclnt
-// Fhopen
-// Minherit
-// Semsys
-// Msgsys
-// Shmsys
-// Semctl
-// Semget
-// Semop
-// Msgctl
-// Msgget
-// Msgsnd
-// Msgrcv
-// Shmat
-// Shmctl
-// Shmdt
-// Shmget
-// Shm_open
-// Shm_unlink
-// Sem_open
-// Sem_close
-// Sem_unlink
-// Sem_wait
-// Sem_trywait
-// Sem_post
-// Sem_getvalue
-// Sem_init
-// Sem_destroy
-// Open_extended
-// Umask_extended
-// Stat_extended
-// Lstat_extended
-// Fstat_extended
-// Chmod_extended
-// Fchmod_extended
-// Access_extended
-// Settid
-// Gettid
-// Setsgroups
-// Getsgroups
-// Setwgroups
-// Getwgroups
-// Mkfifo_extended
-// Mkdir_extended
-// Identitysvc
-// Shared_region_check_np
-// Shared_region_map_np
-// __pthread_mutex_destroy
-// __pthread_mutex_init
-// __pthread_mutex_lock
-// __pthread_mutex_trylock
-// __pthread_mutex_unlock
-// __pthread_cond_init
-// __pthread_cond_destroy
-// __pthread_cond_broadcast
-// __pthread_cond_signal
-// Setsid_with_pid
-// __pthread_cond_timedwait
-// Aio_fsync
-// Aio_return
-// Aio_suspend
-// Aio_cancel
-// Aio_error
-// Aio_read
-// Aio_write
-// Lio_listio
-// __pthread_cond_wait
-// Iopolicysys
-// __pthread_kill
-// __pthread_sigmask
-// __sigwait
-// __disable_threadsignal
-// __pthread_markcancel
-// __pthread_canceled
-// __semwait_signal
-// Proc_info
-// Stat64_extended
-// Lstat64_extended
-// Fstat64_extended
-// __pthread_chdir
-// __pthread_fchdir
-// Audit
-// Auditon
-// Getauid
-// Setauid
-// Getaudit
-// Setaudit
-// Getaudit_addr
-// Setaudit_addr
-// Auditctl
-// Bsdthread_create
-// Bsdthread_terminate
-// Stack_snapshot
-// Bsdthread_register
-// Workq_open
-// Workq_ops
-// __mac_execve
-// __mac_syscall
-// __mac_get_file
-// __mac_set_file
-// __mac_get_link
-// __mac_set_link
-// __mac_get_proc
-// __mac_set_proc
-// __mac_get_fd
-// __mac_set_fd
-// __mac_get_pid
-// __mac_get_lcid
-// __mac_get_lctx
-// __mac_set_lctx
-// Setlcid
-// Read_nocancel
-// Write_nocancel
-// Open_nocancel
-// Close_nocancel
-// Wait4_nocancel
-// Recvmsg_nocancel
-// Sendmsg_nocancel
-// Recvfrom_nocancel
-// Accept_nocancel
-// Fcntl_nocancel
-// Select_nocancel
-// Fsync_nocancel
-// Connect_nocancel
-// Sigsuspend_nocancel
-// Readv_nocancel
-// Writev_nocancel
-// Sendto_nocancel
-// Pread_nocancel
-// Pwrite_nocancel
-// Waitid_nocancel
-// Msgsnd_nocancel
-// Msgrcv_nocancel
-// Sem_wait_nocancel
-// Aio_suspend_nocancel
-// __sigwait_nocancel
-// __semwait_signal_nocancel
-// __mac_mount
-// __mac_get_mount
-// __mac_getfsstat
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
deleted file mode 100644
index 9babb31..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2009 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 amd64,dragonfly
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
deleted file mode 100644
index a7ca1eb..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ /dev/null
@@ -1,824 +0,0 @@
-// Copyright 2009,2010 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.
-
-// FreeBSD system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_bsd.go or syscall_unix.go.
-
-package unix
-
-import (
- "sync"
- "unsafe"
-)
-
-const (
- SYS_FSTAT_FREEBSD12 = 551 // { int fstat(int fd, _Out_ struct stat *sb); }
- SYS_FSTATAT_FREEBSD12 = 552 // { int fstatat(int fd, _In_z_ char *path, \
- SYS_GETDIRENTRIES_FREEBSD12 = 554 // { ssize_t getdirentries(int fd, \
- SYS_STATFS_FREEBSD12 = 555 // { int statfs(_In_z_ char *path, \
- SYS_FSTATFS_FREEBSD12 = 556 // { int fstatfs(int fd, \
- SYS_GETFSSTAT_FREEBSD12 = 557 // { int getfsstat( \
- SYS_MKNODAT_FREEBSD12 = 559 // { int mknodat(int fd, _In_z_ char *path, \
-)
-
-// See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html.
-var (
- osreldateOnce sync.Once
- osreldate uint32
-)
-
-// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h
-const _ino64First = 1200031
-
-func supportsABI(ver uint32) bool {
- osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
- return osreldate >= ver
-}
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [46]int8
- raw RawSockaddrDatalink
-}
-
-// Translate "kern.hostname" to []_C_int{0,1,2,3}.
-func nametomib(name string) (mib []_C_int, err error) {
- const siz = unsafe.Sizeof(mib[0])
-
- // NOTE(rsc): It seems strange to set the buffer to have
- // size CTL_MAXNAME+2 but use only CTL_MAXNAME
- // as the size. I don't know why the +2 is here, but the
- // kernel uses +2 for its own implementation of this function.
- // I am scared that if we don't include the +2 here, the kernel
- // will silently write 2 words farther than we specify
- // and we'll get memory corruption.
- var buf [CTL_MAXNAME + 2]_C_int
- n := uintptr(CTL_MAXNAME) * siz
-
- p := (*byte)(unsafe.Pointer(&buf[0]))
- bytes, err := ByteSliceFromString(name)
- if err != nil {
- return nil, err
- }
-
- // Magic sysctl: "setting" 0.3 to a string name
- // lets you read back the array of integers form.
- if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
- return nil, err
- }
- return buf[0 : n/siz], nil
-}
-
-func Pipe(p []int) (err error) {
- return Pipe2(p, 0)
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) error {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err := pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return err
-}
-
-func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
- var value IPMreqn
- vallen := _Socklen(SizeofIPMreqn)
- errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, errno
-}
-
-func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
-}
-
-func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept4(fd, &rsa, &len, flags)
- if err != nil {
- return
- }
- if len > SizeofSockaddrAny {
- panic("RawSockaddrAny too small")
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
-
-func Getwd() (string, error) {
- var buf [PathMax]byte
- _, err := Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- n := clen(buf[:])
- if n < 1 {
- return "", EINVAL
- }
- return string(buf[:n]), nil
-}
-
-func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
- var (
- _p0 unsafe.Pointer
- bufsize uintptr
- oldBuf []statfs_freebsd11_t
- needsConvert bool
- )
-
- if len(buf) > 0 {
- if supportsABI(_ino64First) {
- _p0 = unsafe.Pointer(&buf[0])
- bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
- } else {
- n := len(buf)
- oldBuf = make([]statfs_freebsd11_t, n)
- _p0 = unsafe.Pointer(&oldBuf[0])
- bufsize = unsafe.Sizeof(statfs_freebsd11_t{}) * uintptr(n)
- needsConvert = true
- }
- }
- var sysno uintptr = SYS_GETFSSTAT
- if supportsABI(_ino64First) {
- sysno = SYS_GETFSSTAT_FREEBSD12
- }
- r0, _, e1 := Syscall(sysno, uintptr(_p0), bufsize, uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = e1
- }
- if e1 == 0 && needsConvert {
- for i := range oldBuf {
- buf[i].convertFrom(&oldBuf[i])
- }
- }
- return
-}
-
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func Uname(uname *Utsname) error {
- mib := []_C_int{CTL_KERN, KERN_OSTYPE}
- n := unsafe.Sizeof(uname.Sysname)
- if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
- n = unsafe.Sizeof(uname.Nodename)
- if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
- n = unsafe.Sizeof(uname.Release)
- if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_VERSION}
- n = unsafe.Sizeof(uname.Version)
- if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
- return err
- }
-
- // The version might have newlines or tabs in it, convert them to
- // spaces.
- for i, b := range uname.Version {
- if b == '\n' || b == '\t' {
- if i == len(uname.Version)-1 {
- uname.Version[i] = 0
- } else {
- uname.Version[i] = ' '
- }
- }
- }
-
- mib = []_C_int{CTL_HW, HW_MACHINE}
- n = unsafe.Sizeof(uname.Machine)
- if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
- return err
- }
-
- return nil
-}
-
-func Stat(path string, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(AT_FDCWD, path, st, 0)
- }
- err = stat(path, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Lstat(path string, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW)
- }
- err = lstat(path, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Fstat(fd int, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstat_freebsd12(fd, st)
- }
- err = fstat(fd, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Fstatat(fd int, path string, st *Stat_t, flags int) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(fd, path, st, flags)
- }
- err = fstatat(fd, path, &oldStat, flags)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Statfs(path string, st *Statfs_t) (err error) {
- var oldStatfs statfs_freebsd11_t
- if supportsABI(_ino64First) {
- return statfs_freebsd12(path, st)
- }
- err = statfs(path, &oldStatfs)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStatfs)
- return nil
-}
-
-func Fstatfs(fd int, st *Statfs_t) (err error) {
- var oldStatfs statfs_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatfs_freebsd12(fd, st)
- }
- err = fstatfs(fd, &oldStatfs)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStatfs)
- return nil
-}
-
-func Getdents(fd int, buf []byte) (n int, err error) {
- return Getdirentries(fd, buf, nil)
-}
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- if supportsABI(_ino64First) {
- return getdirentries_freebsd12(fd, buf, basep)
- }
-
- // The old syscall entries are smaller than the new. Use 1/4 of the original
- // buffer size rounded up to DIRBLKSIZ (see /usr/src/lib/libc/sys/getdirentries.c).
- oldBufLen := roundup(len(buf)/4, _dirblksiz)
- oldBuf := make([]byte, oldBufLen)
- n, err = getdirentries(fd, oldBuf, basep)
- if err == nil && n > 0 {
- n = convertFromDirents11(buf, oldBuf[:n])
- }
- return
-}
-
-func Mknod(path string, mode uint32, dev uint64) (err error) {
- var oldDev int
- if supportsABI(_ino64First) {
- return mknodat_freebsd12(AT_FDCWD, path, mode, dev)
- }
- oldDev = int(dev)
- return mknod(path, mode, oldDev)
-}
-
-func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) {
- var oldDev int
- if supportsABI(_ino64First) {
- return mknodat_freebsd12(fd, path, mode, dev)
- }
- oldDev = int(dev)
- return mknodat(fd, path, mode, oldDev)
-}
-
-// round x to the nearest multiple of y, larger or equal to x.
-//
-// from /usr/include/sys/param.h Macros for counting and rounding.
-// #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-func roundup(x, y int) int {
- return ((x + y - 1) / y) * y
-}
-
-func (s *Stat_t) convertFrom(old *stat_freebsd11_t) {
- *s = Stat_t{
- Dev: uint64(old.Dev),
- Ino: uint64(old.Ino),
- Nlink: uint64(old.Nlink),
- Mode: old.Mode,
- Uid: old.Uid,
- Gid: old.Gid,
- Rdev: uint64(old.Rdev),
- Atim: old.Atim,
- Mtim: old.Mtim,
- Ctim: old.Ctim,
- Birthtim: old.Birthtim,
- Size: old.Size,
- Blocks: old.Blocks,
- Blksize: old.Blksize,
- Flags: old.Flags,
- Gen: uint64(old.Gen),
- }
-}
-
-func (s *Statfs_t) convertFrom(old *statfs_freebsd11_t) {
- *s = Statfs_t{
- Version: _statfsVersion,
- Type: old.Type,
- Flags: old.Flags,
- Bsize: old.Bsize,
- Iosize: old.Iosize,
- Blocks: old.Blocks,
- Bfree: old.Bfree,
- Bavail: old.Bavail,
- Files: old.Files,
- Ffree: old.Ffree,
- Syncwrites: old.Syncwrites,
- Asyncwrites: old.Asyncwrites,
- Syncreads: old.Syncreads,
- Asyncreads: old.Asyncreads,
- // Spare
- Namemax: old.Namemax,
- Owner: old.Owner,
- Fsid: old.Fsid,
- // Charspare
- // Fstypename
- // Mntfromname
- // Mntonname
- }
-
- sl := old.Fstypename[:]
- n := clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Fstypename[:], old.Fstypename[:n])
-
- sl = old.Mntfromname[:]
- n = clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Mntfromname[:], old.Mntfromname[:n])
-
- sl = old.Mntonname[:]
- n = clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Mntonname[:], old.Mntonname[:n])
-}
-
-func convertFromDirents11(buf []byte, old []byte) int {
- const (
- fixedSize = int(unsafe.Offsetof(Dirent{}.Name))
- oldFixedSize = int(unsafe.Offsetof(dirent_freebsd11{}.Name))
- )
-
- dstPos := 0
- srcPos := 0
- for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) {
- dstDirent := (*Dirent)(unsafe.Pointer(&buf[dstPos]))
- srcDirent := (*dirent_freebsd11)(unsafe.Pointer(&old[srcPos]))
-
- reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8)
- if dstPos+reclen > len(buf) {
- break
- }
-
- dstDirent.Fileno = uint64(srcDirent.Fileno)
- dstDirent.Off = 0
- dstDirent.Reclen = uint16(reclen)
- dstDirent.Type = srcDirent.Type
- dstDirent.Pad0 = 0
- dstDirent.Namlen = uint16(srcDirent.Namlen)
- dstDirent.Pad1 = 0
-
- copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen])
- padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen]
- for i := range padding {
- padding[i] = 0
- }
-
- dstPos += int(dstDirent.Reclen)
- srcPos += int(srcDirent.Reclen)
- }
-
- return dstPos
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys CapEnter() (err error)
-//sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
-//sys capRightsLimit(fd int, rightsp *CapRights) (err error)
-//sys Chdir(path string) (err error)
-//sys Chflags(path string, flags int) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(from int, to int) (err error)
-//sys Exit(code int)
-//sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
-//sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
-//sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
-//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchflags(fd int, flags int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys fstat(fd int, stat *stat_freebsd11_t) (err error)
-//sys fstat_freebsd12(fd int, stat *Stat_t) (err error)
-//sys fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error)
-//sys fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys fstatfs(fd int, stat *statfs_freebsd11_t) (err error)
-//sys fstatfs_freebsd12(fd int, stat *Statfs_t) (err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sys getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
-//sys getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error)
-//sys Getdtablesize() (size int)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (uid int)
-//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgrp int)
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Getuid() (uid int)
-//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum syscall.Signal) (err error)
-//sys Kqueue() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
-//sys Listen(s int, backlog int) (err error)
-//sys lstat(path string, stat *stat_freebsd11_t) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys mknod(path string, mode uint32, dev int) (err error)
-//sys mknodat(fd int, path string, mode uint32, dev int) (err error)
-//sys mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
-//sys Revoke(path string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sysnb Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sys Setlogin(name string) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tp *Timeval) (err error)
-//sysnb Setuid(uid int) (err error)
-//sys stat(path string, stat *stat_freebsd11_t) (err error)
-//sys statfs(path string, stat *statfs_freebsd11_t) (err error)
-//sys statfs_freebsd12(path string, stat *Statfs_t) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-//sys Sync() (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Umask(newmask int) (oldmask int)
-//sys Undelete(path string) (err error)
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Unmount(path string, flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
-//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
-//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
-
-/*
- * Unimplemented
- */
-// Profil
-// Sigaction
-// Sigprocmask
-// Getlogin
-// Sigpending
-// Sigaltstack
-// Ioctl
-// Reboot
-// Execve
-// Vfork
-// Sbrk
-// Sstk
-// Ovadvise
-// Mincore
-// Setitimer
-// Swapon
-// Select
-// Sigsuspend
-// Readv
-// Writev
-// Nfssvc
-// Getfh
-// Quotactl
-// Mount
-// Csops
-// Waitid
-// Add_profil
-// Kdebug_trace
-// Sigreturn
-// Atsocket
-// Kqueue_from_portset_np
-// Kqueue_portset
-// Getattrlist
-// Setattrlist
-// Getdents
-// Getdirentriesattr
-// Searchfs
-// Delete
-// Copyfile
-// Watchevent
-// Waitevent
-// Modwatch
-// Fsctl
-// Initgroups
-// Posix_spawn
-// Nfsclnt
-// Fhopen
-// Minherit
-// Semsys
-// Msgsys
-// Shmsys
-// Semctl
-// Semget
-// Semop
-// Msgctl
-// Msgget
-// Msgsnd
-// Msgrcv
-// Shmat
-// Shmctl
-// Shmdt
-// Shmget
-// Shm_open
-// Shm_unlink
-// Sem_open
-// Sem_close
-// Sem_unlink
-// Sem_wait
-// Sem_trywait
-// Sem_post
-// Sem_getvalue
-// Sem_init
-// Sem_destroy
-// Open_extended
-// Umask_extended
-// Stat_extended
-// Lstat_extended
-// Fstat_extended
-// Chmod_extended
-// Fchmod_extended
-// Access_extended
-// Settid
-// Gettid
-// Setsgroups
-// Getsgroups
-// Setwgroups
-// Getwgroups
-// Mkfifo_extended
-// Mkdir_extended
-// Identitysvc
-// Shared_region_check_np
-// Shared_region_map_np
-// __pthread_mutex_destroy
-// __pthread_mutex_init
-// __pthread_mutex_lock
-// __pthread_mutex_trylock
-// __pthread_mutex_unlock
-// __pthread_cond_init
-// __pthread_cond_destroy
-// __pthread_cond_broadcast
-// __pthread_cond_signal
-// Setsid_with_pid
-// __pthread_cond_timedwait
-// Aio_fsync
-// Aio_return
-// Aio_suspend
-// Aio_cancel
-// Aio_error
-// Aio_read
-// Aio_write
-// Lio_listio
-// __pthread_cond_wait
-// Iopolicysys
-// __pthread_kill
-// __pthread_sigmask
-// __sigwait
-// __disable_threadsignal
-// __pthread_markcancel
-// __pthread_canceled
-// __semwait_signal
-// Proc_info
-// Stat64_extended
-// Lstat64_extended
-// Fstat64_extended
-// __pthread_chdir
-// __pthread_fchdir
-// Audit
-// Auditon
-// Getauid
-// Setauid
-// Getaudit
-// Setaudit
-// Getaudit_addr
-// Setaudit_addr
-// Auditctl
-// Bsdthread_create
-// Bsdthread_terminate
-// Stack_snapshot
-// Bsdthread_register
-// Workq_open
-// Workq_ops
-// __mac_execve
-// __mac_syscall
-// __mac_get_file
-// __mac_set_file
-// __mac_get_link
-// __mac_set_link
-// __mac_get_proc
-// __mac_set_proc
-// __mac_get_fd
-// __mac_set_fd
-// __mac_get_pid
-// __mac_get_lcid
-// __mac_get_lctx
-// __mac_set_lctx
-// Setlcid
-// Read_nocancel
-// Write_nocancel
-// Open_nocancel
-// Close_nocancel
-// Wait4_nocancel
-// Recvmsg_nocancel
-// Sendmsg_nocancel
-// Recvfrom_nocancel
-// Accept_nocancel
-// Fcntl_nocancel
-// Select_nocancel
-// Fsync_nocancel
-// Connect_nocancel
-// Sigsuspend_nocancel
-// Readv_nocancel
-// Writev_nocancel
-// Sendto_nocancel
-// Pread_nocancel
-// Pwrite_nocancel
-// Waitid_nocancel
-// Poll_nocancel
-// Msgsnd_nocancel
-// Msgrcv_nocancel
-// Sem_wait_nocancel
-// Aio_suspend_nocancel
-// __sigwait_nocancel
-// __semwait_signal_nocancel
-// __mac_mount
-// __mac_get_mount
-// __mac_getfsstat
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
deleted file mode 100644
index 21e0395..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2009 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 386,freebsd
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
deleted file mode 100644
index 9c945a6..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2009 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 amd64,freebsd
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
deleted file mode 100644
index 5cd6243..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2012 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 arm,freebsd
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
deleted file mode 100644
index a318054..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
+++ /dev/null
@@ -1,52 +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 arm64,freebsd
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- var writtenOut uint64 = 0
- _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
-
- written = int(writtenOut)
-
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
deleted file mode 100644
index 7760402..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ /dev/null
@@ -1,1704 +0,0 @@
-// Copyright 2009 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.
-
-// Linux system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and
-// wrap it in our own nicer implementation.
-
-package unix
-
-import (
- "encoding/binary"
- "net"
- "syscall"
- "unsafe"
-)
-
-/*
- * Wrapped
- */
-
-func Access(path string, mode uint32) (err error) {
- return Faccessat(AT_FDCWD, path, mode, 0)
-}
-
-func Chmod(path string, mode uint32) (err error) {
- return Fchmodat(AT_FDCWD, path, mode, 0)
-}
-
-func Chown(path string, uid int, gid int) (err error) {
- return Fchownat(AT_FDCWD, path, uid, gid, 0)
-}
-
-func Creat(path string, mode uint32) (fd int, err error) {
- return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
-}
-
-//sys fchmodat(dirfd int, path string, mode uint32) (err error)
-
-func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
- // Linux fchmodat doesn't support the flags parameter. Mimick glibc's behavior
- // and check the flags. Otherwise the mode would be applied to the symlink
- // destination which is not what the user expects.
- if flags&^AT_SYMLINK_NOFOLLOW != 0 {
- return EINVAL
- } else if flags&AT_SYMLINK_NOFOLLOW != 0 {
- return EOPNOTSUPP
- }
- return fchmodat(dirfd, path, mode)
-}
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetPointerInt performs an ioctl operation which sets an
-// integer value on fd, using the specified request number. The ioctl
-// argument is called with a pointer to the integer value, rather than
-// passing the integer value directly.
-func IoctlSetPointerInt(fd int, req uint, value int) error {
- v := int32(value)
- return ioctl(fd, req, uintptr(unsafe.Pointer(&v)))
-}
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
-
-func Link(oldpath string, newpath string) (err error) {
- return Linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0)
-}
-
-func Mkdir(path string, mode uint32) (err error) {
- return Mkdirat(AT_FDCWD, path, mode)
-}
-
-func Mknod(path string, mode uint32, dev int) (err error) {
- return Mknodat(AT_FDCWD, path, mode, dev)
-}
-
-func Open(path string, mode int, perm uint32) (fd int, err error) {
- return openat(AT_FDCWD, path, mode|O_LARGEFILE, perm)
-}
-
-//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
-
-func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
- return openat(dirfd, path, flags|O_LARGEFILE, mode)
-}
-
-//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
-
-func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
- if len(fds) == 0 {
- return ppoll(nil, 0, timeout, sigmask)
- }
- return ppoll(&fds[0], len(fds), timeout, sigmask)
-}
-
-//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
-
-func Readlink(path string, buf []byte) (n int, err error) {
- return Readlinkat(AT_FDCWD, path, buf)
-}
-
-func Rename(oldpath string, newpath string) (err error) {
- return Renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath)
-}
-
-func Rmdir(path string) error {
- return Unlinkat(AT_FDCWD, path, AT_REMOVEDIR)
-}
-
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-
-func Symlink(oldpath string, newpath string) (err error) {
- return Symlinkat(oldpath, AT_FDCWD, newpath)
-}
-
-func Unlink(path string) error {
- return Unlinkat(AT_FDCWD, path, 0)
-}
-
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-
-func Utimes(path string, tv []Timeval) error {
- if tv == nil {
- err := utimensat(AT_FDCWD, path, nil, 0)
- if err != ENOSYS {
- return err
- }
- return utimes(path, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- var ts [2]Timespec
- ts[0] = NsecToTimespec(TimevalToNsec(tv[0]))
- ts[1] = NsecToTimespec(TimevalToNsec(tv[1]))
- err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
- if err != ENOSYS {
- return err
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
-
-func UtimesNano(path string, ts []Timespec) error {
- if ts == nil {
- err := utimensat(AT_FDCWD, path, nil, 0)
- if err != ENOSYS {
- return err
- }
- return utimes(path, nil)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
- if err != ENOSYS {
- return err
- }
- // If the utimensat syscall isn't available (utimensat was added to Linux
- // in 2.6.22, Released, 8 July 2007) then fall back to utimes
- var tv [2]Timeval
- for i := 0; i < 2; i++ {
- tv[i] = NsecToTimeval(TimespecToNsec(ts[i]))
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
- if ts == nil {
- return utimensat(dirfd, path, nil, flags)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
-}
-
-func Futimesat(dirfd int, path string, tv []Timeval) error {
- if tv == nil {
- return futimesat(dirfd, path, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return futimesat(dirfd, path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-func Futimes(fd int, tv []Timeval) (err error) {
- // Believe it or not, this is the best we can do on Linux
- // (and is what glibc does).
- return Utimes("/proc/self/fd/"+itoa(fd), tv)
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error)
-
-func Getwd() (wd string, err error) {
- var buf [PathMax]byte
- n, err := Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- // Getcwd returns the number of bytes written to buf, including the NUL.
- if n < 1 || n > len(buf) || buf[n-1] != 0 {
- return "", EINVAL
- }
- return string(buf[0 : n-1]), nil
-}
-
-func Getgroups() (gids []int, err error) {
- n, err := getgroups(0, nil)
- if err != nil {
- return nil, err
- }
- if n == 0 {
- return nil, nil
- }
-
- // Sanity check group count. Max is 1<<16 on Linux.
- if n < 0 || n > 1<<20 {
- return nil, EINVAL
- }
-
- a := make([]_Gid_t, n)
- n, err = getgroups(n, &a[0])
- if err != nil {
- return nil, err
- }
- gids = make([]int, n)
- for i, v := range a[0:n] {
- gids[i] = int(v)
- }
- return
-}
-
-func Setgroups(gids []int) (err error) {
- if len(gids) == 0 {
- return setgroups(0, nil)
- }
-
- a := make([]_Gid_t, len(gids))
- for i, v := range gids {
- a[i] = _Gid_t(v)
- }
- return setgroups(len(a), &a[0])
-}
-
-type WaitStatus uint32
-
-// Wait status is 7 bits at bottom, either 0 (exited),
-// 0x7F (stopped), or a signal number that caused an exit.
-// The 0x80 bit is whether there was a core dump.
-// An extra number (exit code, signal causing a stop)
-// is in the high bits. At least that's the idea.
-// There are various irregularities. For example, the
-// "continued" status is 0xFFFF, distinguishing itself
-// from stopped via the core dump bit.
-
-const (
- mask = 0x7F
- core = 0x80
- exited = 0x00
- stopped = 0x7F
- shift = 8
-)
-
-func (w WaitStatus) Exited() bool { return w&mask == exited }
-
-func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited }
-
-func (w WaitStatus) Stopped() bool { return w&0xFF == stopped }
-
-func (w WaitStatus) Continued() bool { return w == 0xFFFF }
-
-func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }
-
-func (w WaitStatus) ExitStatus() int {
- if !w.Exited() {
- return -1
- }
- return int(w>>shift) & 0xFF
-}
-
-func (w WaitStatus) Signal() syscall.Signal {
- if !w.Signaled() {
- return -1
- }
- return syscall.Signal(w & mask)
-}
-
-func (w WaitStatus) StopSignal() syscall.Signal {
- if !w.Stopped() {
- return -1
- }
- return syscall.Signal(w>>shift) & 0xFF
-}
-
-func (w WaitStatus) TrapCause() int {
- if w.StopSignal() != SIGTRAP {
- return -1
- }
- return int(w>>shift) >> 8
-}
-
-//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)
-
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
- var status _C_int
- wpid, err = wait4(pid, &status, options, rusage)
- if wstatus != nil {
- *wstatus = WaitStatus(status)
- }
- return
-}
-
-func Mkfifo(path string, mode uint32) error {
- return Mknod(path, mode|S_IFIFO, 0)
-}
-
-func Mkfifoat(dirfd int, path string, mode uint32) error {
- return Mknodat(dirfd, path, mode|S_IFIFO, 0)
-}
-
-func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil
-}
-
-func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET6
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- sa.raw.Scope_id = sa.ZoneId
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil
-}
-
-func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
- name := sa.Name
- n := len(name)
- if n >= len(sa.raw.Path) {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_UNIX
- for i := 0; i < n; i++ {
- sa.raw.Path[i] = int8(name[i])
- }
- // length is family (uint16), name, NUL.
- sl := _Socklen(2)
- if n > 0 {
- sl += _Socklen(n) + 1
- }
- if sa.raw.Path[0] == '@' {
- sa.raw.Path[0] = 0
- // Don't count trailing NUL for abstract address.
- sl--
- }
-
- return unsafe.Pointer(&sa.raw), sl, nil
-}
-
-// SockaddrLinklayer implements the Sockaddr interface for AF_PACKET type sockets.
-type SockaddrLinklayer struct {
- Protocol uint16
- Ifindex int
- Hatype uint16
- Pkttype uint8
- Halen uint8
- Addr [8]byte
- raw RawSockaddrLinklayer
-}
-
-func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_PACKET
- sa.raw.Protocol = sa.Protocol
- sa.raw.Ifindex = int32(sa.Ifindex)
- sa.raw.Hatype = sa.Hatype
- sa.raw.Pkttype = sa.Pkttype
- sa.raw.Halen = sa.Halen
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil
-}
-
-// SockaddrNetlink implements the Sockaddr interface for AF_NETLINK type sockets.
-type SockaddrNetlink struct {
- Family uint16
- Pad uint16
- Pid uint32
- Groups uint32
- raw RawSockaddrNetlink
-}
-
-func (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_NETLINK
- sa.raw.Pad = sa.Pad
- sa.raw.Pid = sa.Pid
- sa.raw.Groups = sa.Groups
- return unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil
-}
-
-// SockaddrHCI implements the Sockaddr interface for AF_BLUETOOTH type sockets
-// using the HCI protocol.
-type SockaddrHCI struct {
- Dev uint16
- Channel uint16
- raw RawSockaddrHCI
-}
-
-func (sa *SockaddrHCI) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_BLUETOOTH
- sa.raw.Dev = sa.Dev
- sa.raw.Channel = sa.Channel
- return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil
-}
-
-// SockaddrL2 implements the Sockaddr interface for AF_BLUETOOTH type sockets
-// using the L2CAP protocol.
-type SockaddrL2 struct {
- PSM uint16
- CID uint16
- Addr [6]uint8
- AddrType uint8
- raw RawSockaddrL2
-}
-
-func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_BLUETOOTH
- psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm))
- psm[0] = byte(sa.PSM)
- psm[1] = byte(sa.PSM >> 8)
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i]
- }
- cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid))
- cid[0] = byte(sa.CID)
- cid[1] = byte(sa.CID >> 8)
- sa.raw.Bdaddr_type = sa.AddrType
- return unsafe.Pointer(&sa.raw), SizeofSockaddrL2, nil
-}
-
-// SockaddrRFCOMM implements the Sockaddr interface for AF_BLUETOOTH type sockets
-// using the RFCOMM protocol.
-//
-// Server example:
-//
-// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
-// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{
-// Channel: 1,
-// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00
-// })
-// _ = Listen(fd, 1)
-// nfd, sa, _ := Accept(fd)
-// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd)
-// Read(nfd, buf)
-//
-// Client example:
-//
-// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
-// _ = Connect(fd, &SockaddrRFCOMM{
-// Channel: 1,
-// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11
-// })
-// Write(fd, []byte(`hello`))
-type SockaddrRFCOMM struct {
- // Addr represents a bluetooth address, byte ordering is little-endian.
- Addr [6]uint8
-
- // Channel is a designated bluetooth channel, only 1-30 are available for use.
- // Since Linux 2.6.7 and further zero value is the first available channel.
- Channel uint8
-
- raw RawSockaddrRFCOMM
-}
-
-func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_BLUETOOTH
- sa.raw.Channel = sa.Channel
- sa.raw.Bdaddr = sa.Addr
- return unsafe.Pointer(&sa.raw), SizeofSockaddrRFCOMM, nil
-}
-
-// SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets.
-// The RxID and TxID fields are used for transport protocol addressing in
-// (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with
-// zero values for CAN_RAW and CAN_BCM sockets as they have no meaning.
-//
-// The SockaddrCAN struct must be bound to the socket file descriptor
-// using Bind before the CAN socket can be used.
-//
-// // Read one raw CAN frame
-// fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW)
-// addr := &SockaddrCAN{Ifindex: index}
-// Bind(fd, addr)
-// frame := make([]byte, 16)
-// Read(fd, frame)
-//
-// The full SocketCAN documentation can be found in the linux kernel
-// archives at: https://www.kernel.org/doc/Documentation/networking/can.txt
-type SockaddrCAN struct {
- Ifindex int
- RxID uint32
- TxID uint32
- raw RawSockaddrCAN
-}
-
-func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_CAN
- sa.raw.Ifindex = int32(sa.Ifindex)
- rx := (*[4]byte)(unsafe.Pointer(&sa.RxID))
- for i := 0; i < 4; i++ {
- sa.raw.Addr[i] = rx[i]
- }
- tx := (*[4]byte)(unsafe.Pointer(&sa.TxID))
- for i := 0; i < 4; i++ {
- sa.raw.Addr[i+4] = tx[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil
-}
-
-// SockaddrALG implements the Sockaddr interface for AF_ALG type sockets.
-// SockaddrALG enables userspace access to the Linux kernel's cryptography
-// subsystem. The Type and Name fields specify which type of hash or cipher
-// should be used with a given socket.
-//
-// To create a file descriptor that provides access to a hash or cipher, both
-// Bind and Accept must be used. Once the setup process is complete, input
-// data can be written to the socket, processed by the kernel, and then read
-// back as hash output or ciphertext.
-//
-// Here is an example of using an AF_ALG socket with SHA1 hashing.
-// The initial socket setup process is as follows:
-//
-// // Open a socket to perform SHA1 hashing.
-// fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0)
-// addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"}
-// unix.Bind(fd, addr)
-// // Note: unix.Accept does not work at this time; must invoke accept()
-// // manually using unix.Syscall.
-// hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0)
-//
-// Once a file descriptor has been returned from Accept, it may be used to
-// perform SHA1 hashing. The descriptor is not safe for concurrent use, but
-// may be re-used repeatedly with subsequent Write and Read operations.
-//
-// When hashing a small byte slice or string, a single Write and Read may
-// be used:
-//
-// // Assume hashfd is already configured using the setup process.
-// hash := os.NewFile(hashfd, "sha1")
-// // Hash an input string and read the results. Each Write discards
-// // previous hash state. Read always reads the current state.
-// b := make([]byte, 20)
-// for i := 0; i < 2; i++ {
-// io.WriteString(hash, "Hello, world.")
-// hash.Read(b)
-// fmt.Println(hex.EncodeToString(b))
-// }
-// // Output:
-// // 2ae01472317d1935a84797ec1983ae243fc6aa28
-// // 2ae01472317d1935a84797ec1983ae243fc6aa28
-//
-// For hashing larger byte slices, or byte streams such as those read from
-// a file or socket, use Sendto with MSG_MORE to instruct the kernel to update
-// the hash digest instead of creating a new one for a given chunk and finalizing it.
-//
-// // Assume hashfd and addr are already configured using the setup process.
-// hash := os.NewFile(hashfd, "sha1")
-// // Hash the contents of a file.
-// f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz")
-// b := make([]byte, 4096)
-// for {
-// n, err := f.Read(b)
-// if err == io.EOF {
-// break
-// }
-// unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr)
-// }
-// hash.Read(b)
-// fmt.Println(hex.EncodeToString(b))
-// // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5
-//
-// For more information, see: http://www.chronox.de/crypto-API/crypto/userspace-if.html.
-type SockaddrALG struct {
- Type string
- Name string
- Feature uint32
- Mask uint32
- raw RawSockaddrALG
-}
-
-func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) {
- // Leave room for NUL byte terminator.
- if len(sa.Type) > 13 {
- return nil, 0, EINVAL
- }
- if len(sa.Name) > 63 {
- return nil, 0, EINVAL
- }
-
- sa.raw.Family = AF_ALG
- sa.raw.Feat = sa.Feature
- sa.raw.Mask = sa.Mask
-
- typ, err := ByteSliceFromString(sa.Type)
- if err != nil {
- return nil, 0, err
- }
- name, err := ByteSliceFromString(sa.Name)
- if err != nil {
- return nil, 0, err
- }
-
- copy(sa.raw.Type[:], typ)
- copy(sa.raw.Name[:], name)
-
- return unsafe.Pointer(&sa.raw), SizeofSockaddrALG, nil
-}
-
-// SockaddrVM implements the Sockaddr interface for AF_VSOCK type sockets.
-// SockaddrVM provides access to Linux VM sockets: a mechanism that enables
-// bidirectional communication between a hypervisor and its guest virtual
-// machines.
-type SockaddrVM struct {
- // CID and Port specify a context ID and port address for a VM socket.
- // Guests have a unique CID, and hosts may have a well-known CID of:
- // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process.
- // - VMADDR_CID_HOST: refers to other processes on the host.
- CID uint32
- Port uint32
- raw RawSockaddrVM
-}
-
-func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_VSOCK
- sa.raw.Port = sa.Port
- sa.raw.Cid = sa.CID
-
- return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil
-}
-
-type SockaddrXDP struct {
- Flags uint16
- Ifindex uint32
- QueueID uint32
- SharedUmemFD uint32
- raw RawSockaddrXDP
-}
-
-func (sa *SockaddrXDP) sockaddr() (unsafe.Pointer, _Socklen, error) {
- sa.raw.Family = AF_XDP
- sa.raw.Flags = sa.Flags
- sa.raw.Ifindex = sa.Ifindex
- sa.raw.Queue_id = sa.QueueID
- sa.raw.Shared_umem_fd = sa.SharedUmemFD
-
- return unsafe.Pointer(&sa.raw), SizeofSockaddrXDP, nil
-}
-
-// This constant mirrors the #define of PX_PROTO_OE in
-// linux/if_pppox.h. We're defining this by hand here instead of
-// autogenerating through mkerrors.sh because including
-// linux/if_pppox.h causes some declaration conflicts with other
-// includes (linux/if_pppox.h includes linux/in.h, which conflicts
-// with netinet/in.h). Given that we only need a single zero constant
-// out of that file, it's cleaner to just define it by hand here.
-const px_proto_oe = 0
-
-type SockaddrPPPoE struct {
- SID uint16
- Remote net.HardwareAddr
- Dev string
- raw RawSockaddrPPPoX
-}
-
-func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if len(sa.Remote) != 6 {
- return nil, 0, EINVAL
- }
- if len(sa.Dev) > IFNAMSIZ-1 {
- return nil, 0, EINVAL
- }
-
- *(*uint16)(unsafe.Pointer(&sa.raw[0])) = AF_PPPOX
- // This next field is in host-endian byte order. We can't use the
- // same unsafe pointer cast as above, because this value is not
- // 32-bit aligned and some architectures don't allow unaligned
- // access.
- //
- // However, the value of px_proto_oe is 0, so we can use
- // encoding/binary helpers to write the bytes without worrying
- // about the ordering.
- binary.BigEndian.PutUint32(sa.raw[2:6], px_proto_oe)
- // This field is deliberately big-endian, unlike the previous
- // one. The kernel expects SID to be in network byte order.
- binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID)
- copy(sa.raw[8:14], sa.Remote)
- for i := 14; i < 14+IFNAMSIZ; i++ {
- sa.raw[i] = 0
- }
- copy(sa.raw[14:], sa.Dev)
- return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil
-}
-
-func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
- switch rsa.Addr.Family {
- case AF_NETLINK:
- pp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa))
- sa := new(SockaddrNetlink)
- sa.Family = pp.Family
- sa.Pad = pp.Pad
- sa.Pid = pp.Pid
- sa.Groups = pp.Groups
- return sa, nil
-
- case AF_PACKET:
- pp := (*RawSockaddrLinklayer)(unsafe.Pointer(rsa))
- sa := new(SockaddrLinklayer)
- sa.Protocol = pp.Protocol
- sa.Ifindex = int(pp.Ifindex)
- sa.Hatype = pp.Hatype
- sa.Pkttype = pp.Pkttype
- sa.Halen = pp.Halen
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_UNIX:
- pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
- sa := new(SockaddrUnix)
- if pp.Path[0] == 0 {
- // "Abstract" Unix domain socket.
- // Rewrite leading NUL as @ for textual display.
- // (This is the standard convention.)
- // Not friendly to overwrite in place,
- // but the callers below don't care.
- pp.Path[0] = '@'
- }
-
- // Assume path ends at NUL.
- // This is not technically the Linux semantics for
- // abstract Unix domain sockets--they are supposed
- // to be uninterpreted fixed-size binary blobs--but
- // everyone uses this convention.
- n := 0
- for n < len(pp.Path) && pp.Path[n] != 0 {
- n++
- }
- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
- sa.Name = string(bytes)
- return sa, nil
-
- case AF_INET:
- pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet4)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_INET6:
- pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet6)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- sa.ZoneId = pp.Scope_id
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_VSOCK:
- pp := (*RawSockaddrVM)(unsafe.Pointer(rsa))
- sa := &SockaddrVM{
- CID: pp.Cid,
- Port: pp.Port,
- }
- return sa, nil
- case AF_BLUETOOTH:
- proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
- if err != nil {
- return nil, err
- }
- // only BTPROTO_L2CAP and BTPROTO_RFCOMM can accept connections
- switch proto {
- case BTPROTO_L2CAP:
- pp := (*RawSockaddrL2)(unsafe.Pointer(rsa))
- sa := &SockaddrL2{
- PSM: pp.Psm,
- CID: pp.Cid,
- Addr: pp.Bdaddr,
- AddrType: pp.Bdaddr_type,
- }
- return sa, nil
- case BTPROTO_RFCOMM:
- pp := (*RawSockaddrRFCOMM)(unsafe.Pointer(rsa))
- sa := &SockaddrRFCOMM{
- Channel: pp.Channel,
- Addr: pp.Bdaddr,
- }
- return sa, nil
- }
- case AF_XDP:
- pp := (*RawSockaddrXDP)(unsafe.Pointer(rsa))
- sa := &SockaddrXDP{
- Flags: pp.Flags,
- Ifindex: pp.Ifindex,
- QueueID: pp.Queue_id,
- SharedUmemFD: pp.Shared_umem_fd,
- }
- return sa, nil
- case AF_PPPOX:
- pp := (*RawSockaddrPPPoX)(unsafe.Pointer(rsa))
- if binary.BigEndian.Uint32(pp[2:6]) != px_proto_oe {
- return nil, EINVAL
- }
- sa := &SockaddrPPPoE{
- SID: binary.BigEndian.Uint16(pp[6:8]),
- Remote: net.HardwareAddr(pp[8:14]),
- }
- for i := 14; i < 14+IFNAMSIZ; i++ {
- if pp[i] == 0 {
- sa.Dev = string(pp[14:i])
- break
- }
- }
- return sa, nil
- }
- return nil, EAFNOSUPPORT
-}
-
-func Accept(fd int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept(fd, &rsa, &len)
- if err != nil {
- return
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept4(fd, &rsa, &len, flags)
- if err != nil {
- return
- }
- if len > SizeofSockaddrAny {
- panic("RawSockaddrAny too small")
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-func Getsockname(fd int) (sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if err = getsockname(fd, &rsa, &len); err != nil {
- return
- }
- return anyToSockaddr(fd, &rsa)
-}
-
-func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
- var value IPMreqn
- vallen := _Socklen(SizeofIPMreqn)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptUcred(fd, level, opt int) (*Ucred, error) {
- var value Ucred
- vallen := _Socklen(SizeofUcred)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
- var value TCPInfo
- vallen := _Socklen(SizeofTCPInfo)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-// GetsockoptString returns the string value of the socket option opt for the
-// socket associated with fd at the given socket level.
-func GetsockoptString(fd, level, opt int) (string, error) {
- buf := make([]byte, 256)
- vallen := _Socklen(len(buf))
- err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
- if err != nil {
- if err == ERANGE {
- buf = make([]byte, vallen)
- err = getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
- }
- if err != nil {
- return "", err
- }
- }
- return string(buf[:vallen-1]), nil
-}
-
-func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
-}
-
-// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)
-
-// KeyctlInt calls keyctl commands in which each argument is an int.
-// These commands are KEYCTL_REVOKE, KEYCTL_CHOWN, KEYCTL_CLEAR, KEYCTL_LINK,
-// KEYCTL_UNLINK, KEYCTL_NEGATE, KEYCTL_SET_REQKEY_KEYRING, KEYCTL_SET_TIMEOUT,
-// KEYCTL_ASSUME_AUTHORITY, KEYCTL_SESSION_TO_PARENT, KEYCTL_REJECT,
-// KEYCTL_INVALIDATE, and KEYCTL_GET_PERSISTENT.
-//sys KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) = SYS_KEYCTL
-
-// KeyctlBuffer calls keyctl commands in which the third and fourth
-// arguments are a buffer and its length, respectively.
-// These commands are KEYCTL_UPDATE, KEYCTL_READ, and KEYCTL_INSTANTIATE.
-//sys KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) = SYS_KEYCTL
-
-// KeyctlString calls keyctl commands which return a string.
-// These commands are KEYCTL_DESCRIBE and KEYCTL_GET_SECURITY.
-func KeyctlString(cmd int, id int) (string, error) {
- // We must loop as the string data may change in between the syscalls.
- // We could allocate a large buffer here to reduce the chance that the
- // syscall needs to be called twice; however, this is unnecessary as
- // the performance loss is negligible.
- var buffer []byte
- for {
- // Try to fill the buffer with data
- length, err := KeyctlBuffer(cmd, id, buffer, 0)
- if err != nil {
- return "", err
- }
-
- // Check if the data was written
- if length <= len(buffer) {
- // Exclude the null terminator
- return string(buffer[:length-1]), nil
- }
-
- // Make a bigger buffer if needed
- buffer = make([]byte, length)
- }
-}
-
-// Keyctl commands with special signatures.
-
-// KeyctlGetKeyringID implements the KEYCTL_GET_KEYRING_ID command.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_get_keyring_ID.3.html
-func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) {
- createInt := 0
- if create {
- createInt = 1
- }
- return KeyctlInt(KEYCTL_GET_KEYRING_ID, id, createInt, 0, 0)
-}
-
-// KeyctlSetperm implements the KEYCTL_SETPERM command. The perm value is the
-// key handle permission mask as described in the "keyctl setperm" section of
-// http://man7.org/linux/man-pages/man1/keyctl.1.html.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_setperm.3.html
-func KeyctlSetperm(id int, perm uint32) error {
- _, err := KeyctlInt(KEYCTL_SETPERM, id, int(perm), 0, 0)
- return err
-}
-
-//sys keyctlJoin(cmd int, arg2 string) (ret int, err error) = SYS_KEYCTL
-
-// KeyctlJoinSessionKeyring implements the KEYCTL_JOIN_SESSION_KEYRING command.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_join_session_keyring.3.html
-func KeyctlJoinSessionKeyring(name string) (ringid int, err error) {
- return keyctlJoin(KEYCTL_JOIN_SESSION_KEYRING, name)
-}
-
-//sys keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) = SYS_KEYCTL
-
-// KeyctlSearch implements the KEYCTL_SEARCH command.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_search.3.html
-func KeyctlSearch(ringid int, keyType, description string, destRingid int) (id int, err error) {
- return keyctlSearch(KEYCTL_SEARCH, ringid, keyType, description, destRingid)
-}
-
-//sys keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) = SYS_KEYCTL
-
-// KeyctlInstantiateIOV implements the KEYCTL_INSTANTIATE_IOV command. This
-// command is similar to KEYCTL_INSTANTIATE, except that the payload is a slice
-// of Iovec (each of which represents a buffer) instead of a single buffer.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_instantiate_iov.3.html
-func KeyctlInstantiateIOV(id int, payload []Iovec, ringid int) error {
- return keyctlIOV(KEYCTL_INSTANTIATE_IOV, id, payload, ringid)
-}
-
-//sys keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) = SYS_KEYCTL
-
-// KeyctlDHCompute implements the KEYCTL_DH_COMPUTE command. This command
-// computes a Diffie-Hellman shared secret based on the provide params. The
-// secret is written to the provided buffer and the returned size is the number
-// of bytes written (returning an error if there is insufficient space in the
-// buffer). If a nil buffer is passed in, this function returns the minimum
-// buffer length needed to store the appropriate data. Note that this differs
-// from KEYCTL_READ's behavior which always returns the requested payload size.
-// See the full documentation at:
-// http://man7.org/linux/man-pages/man3/keyctl_dh_compute.3.html
-func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error) {
- return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer)
-}
-
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
- var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
- msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = &p[0]
- iov.SetLen(len(p))
- }
- var dummy byte
- if len(oob) > 0 {
- if len(p) == 0 {
- var sockType int
- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
- if err != nil {
- return
- }
- // receive at least one normal byte
- if sockType != SOCK_DGRAM {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- }
- msg.Control = &oob[0]
- msg.SetControllen(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = recvmsg(fd, &msg, flags); err != nil {
- return
- }
- oobn = int(msg.Controllen)
- recvflags = int(msg.Flags)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
- return
-}
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- var err error
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
- var msg Msghdr
- msg.Name = (*byte)(ptr)
- msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = &p[0]
- iov.SetLen(len(p))
- }
- var dummy byte
- if len(oob) > 0 {
- if len(p) == 0 {
- var sockType int
- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
- if err != nil {
- return 0, err
- }
- // send at least one normal byte
- if sockType != SOCK_DGRAM {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- }
- msg.Control = &oob[0]
- msg.SetControllen(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = sendmsg(fd, &msg, flags); err != nil {
- return 0, err
- }
- if len(oob) > 0 && len(p) == 0 {
- n = 0
- }
- return n, nil
-}
-
-// BindToDevice binds the socket associated with fd to device.
-func BindToDevice(fd int, device string) (err error) {
- return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)
-}
-
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
-
-func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) {
- // The peek requests are machine-size oriented, so we wrap it
- // to retrieve arbitrary-length data.
-
- // The ptrace syscall differs from glibc's ptrace.
- // Peeks returns the word in *data, not as the return value.
-
- var buf [SizeofPtr]byte
-
- // Leading edge. PEEKTEXT/PEEKDATA don't require aligned
- // access (PEEKUSER warns that it might), but if we don't
- // align our reads, we might straddle an unmapped page
- // boundary and not get the bytes leading up to the page
- // boundary.
- n := 0
- if addr%SizeofPtr != 0 {
- err = ptrace(req, pid, addr-addr%SizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
- if err != nil {
- return 0, err
- }
- n += copy(out, buf[addr%SizeofPtr:])
- out = out[n:]
- }
-
- // Remainder.
- for len(out) > 0 {
- // We use an internal buffer to guarantee alignment.
- // It's not documented if this is necessary, but we're paranoid.
- err = ptrace(req, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
- if err != nil {
- return n, err
- }
- copied := copy(out, buf[0:])
- n += copied
- out = out[copied:]
- }
-
- return n, nil
-}
-
-func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) {
- return ptracePeek(PTRACE_PEEKTEXT, pid, addr, out)
-}
-
-func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {
- return ptracePeek(PTRACE_PEEKDATA, pid, addr, out)
-}
-
-func PtracePeekUser(pid int, addr uintptr, out []byte) (count int, err error) {
- return ptracePeek(PTRACE_PEEKUSR, pid, addr, out)
-}
-
-func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {
- // As for ptracePeek, we need to align our accesses to deal
- // with the possibility of straddling an invalid page.
-
- // Leading edge.
- n := 0
- if addr%SizeofPtr != 0 {
- var buf [SizeofPtr]byte
- err = ptrace(peekReq, pid, addr-addr%SizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
- if err != nil {
- return 0, err
- }
- n += copy(buf[addr%SizeofPtr:], data)
- word := *((*uintptr)(unsafe.Pointer(&buf[0])))
- err = ptrace(pokeReq, pid, addr-addr%SizeofPtr, word)
- if err != nil {
- return 0, err
- }
- data = data[n:]
- }
-
- // Interior.
- for len(data) > SizeofPtr {
- word := *((*uintptr)(unsafe.Pointer(&data[0])))
- err = ptrace(pokeReq, pid, addr+uintptr(n), word)
- if err != nil {
- return n, err
- }
- n += SizeofPtr
- data = data[SizeofPtr:]
- }
-
- // Trailing edge.
- if len(data) > 0 {
- var buf [SizeofPtr]byte
- err = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
- if err != nil {
- return n, err
- }
- copy(buf[0:], data)
- word := *((*uintptr)(unsafe.Pointer(&buf[0])))
- err = ptrace(pokeReq, pid, addr+uintptr(n), word)
- if err != nil {
- return n, err
- }
- n += len(data)
- }
-
- return n, nil
-}
-
-func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {
- return ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data)
-}
-
-func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
- return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
-}
-
-func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
- return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
-}
-
-func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
- return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
-}
-
-func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
- return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
-}
-
-func PtraceSetOptions(pid int, options int) (err error) {
- return ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options))
-}
-
-func PtraceGetEventMsg(pid int) (msg uint, err error) {
- var data _C_long
- err = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)))
- msg = uint(data)
- return
-}
-
-func PtraceCont(pid int, signal int) (err error) {
- return ptrace(PTRACE_CONT, pid, 0, uintptr(signal))
-}
-
-func PtraceSyscall(pid int, signal int) (err error) {
- return ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal))
-}
-
-func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }
-
-func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }
-
-func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) }
-
-//sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error)
-
-func Reboot(cmd int) (err error) {
- return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "")
-}
-
-func ReadDirent(fd int, buf []byte) (n int, err error) {
- return Getdents(fd, buf)
-}
-
-//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
-
-func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
- // Certain file systems get rather angry and EINVAL if you give
- // them an empty string of data, rather than NULL.
- if data == "" {
- return mount(source, target, fstype, flags, nil)
- }
- datap, err := BytePtrFromString(data)
- if err != nil {
- return err
- }
- return mount(source, target, fstype, flags, datap)
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-// Sendto
-// Recvfrom
-// Socketpair
-
-/*
- * Direct access
- */
-//sys Acct(path string) (err error)
-//sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error)
-//sys Adjtimex(buf *Timex) (state int, err error)
-//sys Chdir(path string) (err error)
-//sys Chroot(path string) (err error)
-//sys ClockGetres(clockid int32, res *Timespec) (err error)
-//sys ClockGettime(clockid int32, time *Timespec) (err error)
-//sys Close(fd int) (err error)
-//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
-//sys DeleteModule(name string, flags int) (err error)
-//sys Dup(oldfd int) (fd int, err error)
-//sys Dup3(oldfd int, newfd int, flags int) (err error)
-//sysnb EpollCreate1(flag int) (fd int, err error)
-//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
-//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2
-//sys Exit(code int) = SYS_EXIT_GROUP
-//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys fcntl(fd int, cmd int, arg int) (val int, err error)
-//sys Fdatasync(fd int) (err error)
-//sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error)
-//sys FinitModule(fd int, params string, flags int) (err error)
-//sys Flistxattr(fd int, dest []byte) (sz int, err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fremovexattr(fd int, attr string) (err error)
-//sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error)
-//sys Fsync(fd int) (err error)
-//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
-//sysnb Getpgid(pid int) (pgid int, err error)
-
-func Getpgrp() (pid int) {
- pid, _ = Getpgid(0)
- return
-}
-
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sys Getrandom(buf []byte, flags int) (n int, err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Gettid() (tid int)
-//sys Getxattr(path string, attr string, dest []byte) (sz int, err error)
-//sys InitModule(moduleImage []byte, params string) (err error)
-//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
-//sysnb InotifyInit1(flags int) (fd int, err error)
-//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
-//sysnb Kill(pid int, sig syscall.Signal) (err error)
-//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
-//sys Lgetxattr(path string, attr string, dest []byte) (sz int, err error)
-//sys Listxattr(path string, dest []byte) (sz int, err error)
-//sys Llistxattr(path string, dest []byte) (sz int, err error)
-//sys Lremovexattr(path string, attr string) (err error)
-//sys Lsetxattr(path string, attr string, data []byte, flags int) (err error)
-//sys MemfdCreate(name string, flags int) (fd int, err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
-//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
-//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
-//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
-//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
-//sys read(fd int, p []byte) (n int, err error)
-//sys Removexattr(path string, attr string) (err error)
-//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
-//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)
-//sys RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error)
-//sys Setdomainname(p []byte) (err error)
-//sys Sethostname(p []byte) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tv *Timeval) (err error)
-//sys Setns(fd int, nstype int) (err error)
-
-// issue 1435.
-// On linux Setuid and Setgid only affects the current thread, not the process.
-// This does not match what most callers expect so we must return an error
-// here rather than letting the caller think that the call succeeded.
-
-func Setuid(uid int) (err error) {
- return EOPNOTSUPP
-}
-
-func Setgid(uid int) (err error) {
- return EOPNOTSUPP
-}
-
-//sys Setpriority(which int, who int, prio int) (err error)
-//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
-//sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error)
-//sys Sync()
-//sys Syncfs(fd int) (err error)
-//sysnb Sysinfo(info *Sysinfo_t) (err error)
-//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
-//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
-//sysnb Times(tms *Tms) (ticks uintptr, err error)
-//sysnb Umask(mask int) (oldmask int)
-//sysnb Uname(buf *Utsname) (err error)
-//sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2
-//sys Unshare(flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys exitThread(code int) (err error) = SYS_EXIT
-//sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ
-//sys writelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE
-
-// mmap varies by architecture; see syscall_linux_*.go.
-//sys munmap(addr uintptr, length uintptr) (err error)
-
-var mapper = &mmapper{
- active: make(map[*byte][]byte),
- mmap: mmap,
- munmap: munmap,
-}
-
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return mapper.Mmap(fd, offset, length, prot, flags)
-}
-
-func Munmap(b []byte) (err error) {
- return mapper.Munmap(b)
-}
-
-//sys Madvise(b []byte, advice int) (err error)
-//sys Mprotect(b []byte, prot int) (err error)
-//sys Mlock(b []byte) (err error)
-//sys Mlockall(flags int) (err error)
-//sys Msync(b []byte, flags int) (err error)
-//sys Munlock(b []byte) (err error)
-//sys Munlockall() (err error)
-
-// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
-// using the specified flags.
-func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
- var p unsafe.Pointer
- if len(iovs) > 0 {
- p = unsafe.Pointer(&iovs[0])
- }
-
- n, _, errno := Syscall6(SYS_VMSPLICE, uintptr(fd), uintptr(p), uintptr(len(iovs)), uintptr(flags), 0, 0)
- if errno != 0 {
- return 0, syscall.Errno(errno)
- }
-
- return int(n), nil
-}
-
-//sys faccessat(dirfd int, path string, mode uint32) (err error)
-
-func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
- if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
- return EINVAL
- }
-
- // The Linux kernel faccessat system call does not take any flags.
- // The glibc faccessat implements the flags itself; see
- // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;hb=HEAD
- // Because people naturally expect syscall.Faccessat to act
- // like C faccessat, we do the same.
-
- if flags == 0 {
- return faccessat(dirfd, path, mode)
- }
-
- var st Stat_t
- if err := Fstatat(dirfd, path, &st, flags&AT_SYMLINK_NOFOLLOW); err != nil {
- return err
- }
-
- mode &= 7
- if mode == 0 {
- return nil
- }
-
- var uid int
- if flags&AT_EACCESS != 0 {
- uid = Geteuid()
- } else {
- uid = Getuid()
- }
-
- if uid == 0 {
- if mode&1 == 0 {
- // Root can read and write any file.
- return nil
- }
- if st.Mode&0111 != 0 {
- // Root can execute any file that anybody can execute.
- return nil
- }
- return EACCES
- }
-
- var fmode uint32
- if uint32(uid) == st.Uid {
- fmode = (st.Mode >> 6) & 7
- } else {
- var gid int
- if flags&AT_EACCESS != 0 {
- gid = Getegid()
- } else {
- gid = Getgid()
- }
-
- if uint32(gid) == st.Gid {
- fmode = (st.Mode >> 3) & 7
- } else {
- fmode = st.Mode & 7
- }
- }
-
- if fmode&mode == mode {
- return nil
- }
-
- return EACCES
-}
-
-/*
- * Unimplemented
- */
-// AfsSyscall
-// Alarm
-// ArchPrctl
-// Brk
-// Capget
-// Capset
-// ClockNanosleep
-// ClockSettime
-// Clone
-// EpollCtlOld
-// EpollPwait
-// EpollWaitOld
-// Execve
-// Fork
-// Futex
-// GetKernelSyms
-// GetMempolicy
-// GetRobustList
-// GetThreadArea
-// Getitimer
-// Getpmsg
-// IoCancel
-// IoDestroy
-// IoGetevents
-// IoSetup
-// IoSubmit
-// IoprioGet
-// IoprioSet
-// KexecLoad
-// LookupDcookie
-// Mbind
-// MigratePages
-// Mincore
-// ModifyLdt
-// Mount
-// MovePages
-// MqGetsetattr
-// MqNotify
-// MqOpen
-// MqTimedreceive
-// MqTimedsend
-// MqUnlink
-// Mremap
-// Msgctl
-// Msgget
-// Msgrcv
-// Msgsnd
-// Nfsservctl
-// Personality
-// Pselect6
-// Ptrace
-// Putpmsg
-// Quotactl
-// Readahead
-// Readv
-// RemapFilePages
-// RestartSyscall
-// RtSigaction
-// RtSigpending
-// RtSigprocmask
-// RtSigqueueinfo
-// RtSigreturn
-// RtSigsuspend
-// RtSigtimedwait
-// SchedGetPriorityMax
-// SchedGetPriorityMin
-// SchedGetparam
-// SchedGetscheduler
-// SchedRrGetInterval
-// SchedSetparam
-// SchedYield
-// Security
-// Semctl
-// Semget
-// Semop
-// Semtimedop
-// SetMempolicy
-// SetRobustList
-// SetThreadArea
-// SetTidAddress
-// Shmat
-// Shmctl
-// Shmdt
-// Shmget
-// Sigaltstack
-// Signalfd
-// Swapoff
-// Swapon
-// Sysfs
-// TimerCreate
-// TimerDelete
-// TimerGetoverrun
-// TimerGettime
-// TimerSettime
-// Timerfd
-// Tkill (obsolete)
-// Tuxcall
-// Umount2
-// Uselib
-// Utimensat
-// Vfork
-// Vhangup
-// Vserver
-// Waitid
-// _Sysctl
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
deleted file mode 100644
index 74bc098..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go
+++ /dev/null
@@ -1,385 +0,0 @@
-// Copyright 2009 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.
-
-// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
-// so that go vet can check that they are correct.
-
-// +build 386,linux
-
-package unix
-
-import (
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-// 64-bit file system and 32-bit uid calls
-// (386 default is 32-bit file system and 16-bit uid).
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
-//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
-//sysnb Getegid() (egid int) = SYS_GETEGID32
-//sysnb Geteuid() (euid int) = SYS_GETEUID32
-//sysnb Getgid() (gid int) = SYS_GETGID32
-//sysnb Getuid() (uid int) = SYS_GETUID32
-//sysnb InotifyInit() (fd int, err error)
-//sys Ioperm(from int, num int, on int) (err error)
-//sys Iopl(level int) (err error)
-//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
-//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
-//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32
-//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
-//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
-//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
-//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
-
-//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
-//sys Pause() (err error)
-
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
- page := uintptr(offset / 4096)
- if offset != int64(page)*4096 {
- return 0, EINVAL
- }
- return mmap2(addr, length, prot, flags, fd, page)
-}
-
-type rlimit32 struct {
- Cur uint32
- Max uint32
-}
-
-//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT
-
-const rlimInf32 = ^uint32(0)
-const rlimInf64 = ^uint64(0)
-
-func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- err = getrlimit(resource, &rl)
- if err != nil {
- return
- }
-
- if rl.Cur == rlimInf32 {
- rlim.Cur = rlimInf64
- } else {
- rlim.Cur = uint64(rl.Cur)
- }
-
- if rl.Max == rlimInf32 {
- rlim.Max = rlimInf64
- } else {
- rlim.Max = uint64(rl.Max)
- }
- return
-}
-
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
-
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- if rlim.Cur == rlimInf64 {
- rl.Cur = rlimInf32
- } else if rlim.Cur < uint64(rlimInf32) {
- rl.Cur = uint32(rlim.Cur)
- } else {
- return EINVAL
- }
- if rlim.Max == rlimInf64 {
- rl.Max = rlimInf32
- } else if rlim.Max < uint64(rlimInf32) {
- rl.Max = uint32(rlim.Max)
- } else {
- return EINVAL
- }
-
- return setrlimit(resource, &rl)
-}
-
-func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- newoffset, errno := seek(fd, offset, whence)
- if errno != 0 {
- return 0, errno
- }
- return newoffset, nil
-}
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Time(t *Time_t) (tt Time_t, err error)
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-// On x86 Linux, all the socket calls go through an extra indirection,
-// I think because the 5-register system call interface can't handle
-// the 6-argument calls like sendto and recvfrom. Instead the
-// arguments to the underlying system call are the number below
-// and a pointer to an array of uintptr. We hide the pointer in the
-// socketcall assembly to avoid allocation on every system call.
-
-const (
- // see linux/net.h
- _SOCKET = 1
- _BIND = 2
- _CONNECT = 3
- _LISTEN = 4
- _ACCEPT = 5
- _GETSOCKNAME = 6
- _GETPEERNAME = 7
- _SOCKETPAIR = 8
- _SEND = 9
- _RECV = 10
- _SENDTO = 11
- _RECVFROM = 12
- _SHUTDOWN = 13
- _SETSOCKOPT = 14
- _GETSOCKOPT = 15
- _SENDMSG = 16
- _RECVMSG = 17
- _ACCEPT4 = 18
- _RECVMMSG = 19
- _SENDMMSG = 20
-)
-
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- fd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
- fd, e := socketcall(_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, e := rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
- _, e := rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {
- _, e := rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, e := socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
- _, e := socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func socket(domain int, typ int, proto int) (fd int, err error) {
- fd, e := rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
- _, e := socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
- _, e := socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
- var base uintptr
- if len(p) > 0 {
- base = uintptr(unsafe.Pointer(&p[0]))
- }
- n, e := socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
- if e != 0 {
- err = e
- }
- return
-}
-
-func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
- var base uintptr
- if len(p) > 0 {
- base = uintptr(unsafe.Pointer(&p[0]))
- }
- _, e := socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen))
- if e != 0 {
- err = e
- }
- return
-}
-
-func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- n, e := socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
- n, e := socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func Listen(s int, n int) (err error) {
- _, e := socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func Shutdown(s, how int) (err error) {
- _, e := socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
-func Fstatfs(fd int, buf *Statfs_t) (err error) {
- _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = e
- }
- return
-}
-
-func Statfs(path string, buf *Statfs_t) (err error) {
- pathp, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
- _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = e
- }
- return
-}
-
-func (r *PtraceRegs) PC() uint64 { return uint64(uint32(r.Eip)) }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Eip = int32(pc) }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
deleted file mode 100644
index 615f291..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright 2009 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 amd64,linux
-
-package unix
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sysnb inotifyInit() (fd int, err error)
-
-func InotifyInit() (fd int, err error) {
- // First try inotify_init1, because Android's seccomp policy blocks the latter.
- fd, err = InotifyInit1(0)
- if err == ENOSYS {
- fd, err = inotifyInit()
- }
- return
-}
-
-//sys Ioperm(from int, num int, on int) (err error)
-//sys Iopl(level int) (err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-
-func Lstat(path string, stat *Stat_t) (err error) {
- return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
-}
-
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- var ts *Timespec
- if timeout != nil {
- ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
- }
- return Pselect(nfd, r, w, e, ts, nil)
-}
-
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-
-func Stat(path string, stat *Stat_t) (err error) {
- // Use fstatat, because Android's seccomp policy blocks stat.
- return Fstatat(AT_FDCWD, path, stat, 0)
-}
-
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-
-func Gettimeofday(tv *Timeval) (err error) {
- errno := gettimeofday(tv)
- if errno != 0 {
- return errno
- }
- return nil
-}
-
-func Time(t *Time_t) (tt Time_t, err error) {
- var tv Timeval
- errno := gettimeofday(&tv)
- if errno != 0 {
- return 0, errno
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Rip }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error)
-
-func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error {
- cmdlineLen := len(cmdline)
- if cmdlineLen > 0 {
- // Account for the additional NULL byte added by
- // BytePtrFromString in kexecFileLoad. The kexec_file_load
- // syscall expects a NULL-terminated string.
- cmdlineLen++
- }
- return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
deleted file mode 100644
index 21a4946..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
+++ /dev/null
@@ -1,13 +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 amd64,linux
-// +build !gccgo
-
-package unix
-
-import "syscall"
-
-//go:noescape
-func gettimeofday(tv *Timeval) (err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
deleted file mode 100644
index ad2bd25..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright 2009 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 arm,linux
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-// Underlying system call writes to newoffset via pointer.
-// Implemented in assembly to avoid allocation.
-func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
-
-func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
- newoffset, errno := seek(fd, offset, whence)
- if errno != 0 {
- return 0, errno
- }
- return newoffset, nil
-}
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
-//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb socketpair(domain int, typ int, flags int, fd *[2]int32) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-
-// 64-bit file system and 32-bit uid calls
-// (16-bit uid calls are not always supported in newer kernels)
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sysnb Getegid() (egid int) = SYS_GETEGID32
-//sysnb Geteuid() (euid int) = SYS_GETEUID32
-//sysnb Getgid() (gid int) = SYS_GETGID32
-//sysnb Getuid() (uid int) = SYS_GETUID32
-//sysnb InotifyInit() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
-//sys Listen(s int, n int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys Pause() (err error)
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
-//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
-//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32
-//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
-//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
-//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func Time(t *Time_t) (Time_t, error) {
- var tv Timeval
- err := Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-func Utime(path string, buf *Utimbuf) error {
- tv := []Timeval{
- {Sec: buf.Actime},
- {Sec: buf.Modtime},
- }
- return Utimes(path, tv)
-}
-
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
-//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
-
-func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
- _, _, e1 := Syscall6(SYS_ARM_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32))
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
-
-func Fstatfs(fd int, buf *Statfs_t) (err error) {
- _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = e
- }
- return
-}
-
-func Statfs(path string, buf *Statfs_t) (err error) {
- pathp, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
- _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = e
- }
- return
-}
-
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
- page := uintptr(offset / 4096)
- if offset != int64(page)*4096 {
- return 0, EINVAL
- }
- return mmap2(addr, length, prot, flags, fd, page)
-}
-
-type rlimit32 struct {
- Cur uint32
- Max uint32
-}
-
-//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT
-
-const rlimInf32 = ^uint32(0)
-const rlimInf64 = ^uint64(0)
-
-func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- err = getrlimit(resource, &rl)
- if err != nil {
- return
- }
-
- if rl.Cur == rlimInf32 {
- rlim.Cur = rlimInf64
- } else {
- rlim.Cur = uint64(rl.Cur)
- }
-
- if rl.Max == rlimInf32 {
- rlim.Max = rlimInf64
- } else {
- rlim.Max = uint64(rl.Max)
- }
- return
-}
-
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
-
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- if rlim.Cur == rlimInf64 {
- rl.Cur = rlimInf32
- } else if rlim.Cur < uint64(rlimInf32) {
- rl.Cur = uint32(rlim.Cur)
- } else {
- return EINVAL
- }
- if rlim.Max == rlimInf64 {
- rl.Max = rlimInf32
- } else if rlim.Max < uint64(rlimInf32) {
- rl.Max = uint32(rlim.Max)
- } else {
- return EINVAL
- }
-
- return setrlimit(resource, &rl)
-}
-
-func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-//sys armSyncFileRange(fd int, flags int, off int64, n int64) (err error) = SYS_ARM_SYNC_FILE_RANGE
-
-func SyncFileRange(fd int, off int64, n int64, flags int) error {
- // The sync_file_range and arm_sync_file_range syscalls differ only in the
- // order of their arguments.
- return armSyncFileRange(fd, flags, off, n)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
deleted file mode 100644
index fa5a9a6..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright 2015 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 arm64,linux
-
-package unix
-
-import "unsafe"
-
-func EpollCreate(size int) (fd int, err error) {
- if size <= 0 {
- return -1, EINVAL
- }
- return EpollCreate1(0)
-}
-
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sys Listen(s int, n int) (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- var ts *Timespec
- if timeout != nil {
- ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
- }
- return Pselect(nfd, r, w, e, ts, nil)
-}
-
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-
-func Stat(path string, stat *Stat_t) (err error) {
- return Fstatat(AT_FDCWD, path, stat, 0)
-}
-
-func Lchown(path string, uid int, gid int) (err error) {
- return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW)
-}
-
-func Lstat(path string, stat *Stat_t) (err error) {
- return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
-}
-
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-
-func Ustat(dev int, ubuf *Ustat_t) (err error) {
- return ENOSYS
-}
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
- if tv == nil {
- return utimensat(dirfd, path, nil, 0)
- }
-
- ts := []Timespec{
- NsecToTimespec(TimevalToNsec(tv[0])),
- NsecToTimespec(TimevalToNsec(tv[1])),
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func Time(t *Time_t) (Time_t, error) {
- var tv Timeval
- err := Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-func Utime(path string, buf *Utimbuf) error {
- tv := []Timeval{
- {Sec: buf.Actime},
- {Sec: buf.Modtime},
- }
- return Utimes(path, tv)
-}
-
-func utimes(path string, tv *[2]Timeval) (err error) {
- if tv == nil {
- return utimensat(AT_FDCWD, path, nil, 0)
- }
-
- ts := []Timespec{
- NsecToTimespec(TimevalToNsec(tv[0])),
- NsecToTimespec(TimevalToNsec(tv[1])),
- }
- return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Pc }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-func InotifyInit() (fd int, err error) {
- return InotifyInit1(0)
-}
-
-func Dup2(oldfd int, newfd int) (err error) {
- return Dup3(oldfd, newfd, 0)
-}
-
-func Pause() error {
- _, err := ppoll(nil, 0, nil, nil)
- return err
-}
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- var ts *Timespec
- if timeout >= 0 {
- ts = new(Timespec)
- *ts = NsecToTimespec(int64(timeout) * 1e6)
- }
- if len(fds) == 0 {
- return ppoll(nil, 0, ts, nil)
- }
- return ppoll(&fds[0], len(fds), ts, nil)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go
deleted file mode 100644
index c26e6ec..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go
+++ /dev/null
@@ -1,14 +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 linux,!gccgo
-
-package unix
-
-// SyscallNoError may be used instead of Syscall for syscalls that don't fail.
-func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
-
-// RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
-// fail.
-func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
deleted file mode 100644
index 070bd38..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
+++ /dev/null
@@ -1,16 +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 linux,!gccgo,386
-
-package unix
-
-import "syscall"
-
-// Underlying system call writes to newoffset via pointer.
-// Implemented in assembly to avoid allocation.
-func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
-
-func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
-func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
deleted file mode 100644
index 308eb7a..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
+++ /dev/null
@@ -1,30 +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 linux,gccgo,386
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
- var newoffset int64
- offsetLow := uint32(offset & 0xffffffff)
- offsetHigh := uint32((offset >> 32) & 0xffffffff)
- _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
- return newoffset, err
-}
-
-func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
- fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
- return int(fd), err
-}
-
-func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
- fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
- return int(fd), err
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
deleted file mode 100644
index aa7fc9e..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
+++ /dev/null
@@ -1,20 +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 linux,gccgo,arm
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
- var newoffset int64
- offsetLow := uint32(offset & 0xffffffff)
- offsetHigh := uint32((offset >> 32) & 0xffffffff)
- _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
- return newoffset, err
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
deleted file mode 100644
index 18541dc..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright 2015 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 linux
-// +build mips64 mips64le
-
-package unix
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- var ts *Timespec
- if timeout != nil {
- ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
- }
- return Pselect(nfd, r, w, e, ts, nil)
-}
-
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func Time(t *Time_t) (tt Time_t, err error) {
- var tv Timeval
- err = Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func Ioperm(from int, num int, on int) (err error) {
- return ENOSYS
-}
-
-func Iopl(level int) (err error) {
- return ENOSYS
-}
-
-type stat_t struct {
- Dev uint32
- Pad0 [3]int32
- Ino uint64
- Mode uint32
- Nlink uint32
- Uid uint32
- Gid uint32
- Rdev uint32
- Pad1 [3]uint32
- Size int64
- Atime uint32
- Atime_nsec uint32
- Mtime uint32
- Mtime_nsec uint32
- Ctime uint32
- Ctime_nsec uint32
- Blksize uint32
- Pad2 uint32
- Blocks int64
-}
-
-//sys fstat(fd int, st *stat_t) (err error)
-//sys fstatat(dirfd int, path string, st *stat_t, flags int) (err error) = SYS_NEWFSTATAT
-//sys lstat(path string, st *stat_t) (err error)
-//sys stat(path string, st *stat_t) (err error)
-
-func Fstat(fd int, s *Stat_t) (err error) {
- st := &stat_t{}
- err = fstat(fd, st)
- fillStat_t(s, st)
- return
-}
-
-func Fstatat(dirfd int, path string, s *Stat_t, flags int) (err error) {
- st := &stat_t{}
- err = fstatat(dirfd, path, st, flags)
- fillStat_t(s, st)
- return
-}
-
-func Lstat(path string, s *Stat_t) (err error) {
- st := &stat_t{}
- err = lstat(path, st)
- fillStat_t(s, st)
- return
-}
-
-func Stat(path string, s *Stat_t) (err error) {
- st := &stat_t{}
- err = stat(path, st)
- fillStat_t(s, st)
- return
-}
-
-func fillStat_t(s *Stat_t, st *stat_t) {
- s.Dev = st.Dev
- s.Ino = st.Ino
- s.Mode = st.Mode
- s.Nlink = st.Nlink
- s.Uid = st.Uid
- s.Gid = st.Gid
- s.Rdev = st.Rdev
- s.Size = st.Size
- s.Atim = Timespec{int64(st.Atime), int64(st.Atime_nsec)}
- s.Mtim = Timespec{int64(st.Mtime), int64(st.Mtime_nsec)}
- s.Ctim = Timespec{int64(st.Ctime), int64(st.Ctime_nsec)}
- s.Blksize = st.Blksize
- s.Blocks = st.Blocks
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Epc }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
deleted file mode 100644
index 99e0e99..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
+++ /dev/null
@@ -1,233 +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 linux
-// +build mips mipsle
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getuid() (uid int)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-
-//sysnb InotifyInit() (fd int, err error)
-//sys Ioperm(from int, num int, on int) (err error)
-//sys Iopl(level int) (err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Time(t *Time_t) (tt Time_t, err error)
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-
-//sys Pause() (err error)
-
-func Fstatfs(fd int, buf *Statfs_t) (err error) {
- _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = errnoErr(e)
- }
- return
-}
-
-func Statfs(path string, buf *Statfs_t) (err error) {
- p, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
- _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(p)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- if e != 0 {
- err = errnoErr(e)
- }
- return
-}
-
-func Seek(fd int, offset int64, whence int) (off int64, err error) {
- _, _, e := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offset>>32), uintptr(offset), uintptr(unsafe.Pointer(&off)), uintptr(whence), 0)
- if e != 0 {
- err = errnoErr(e)
- }
- return
-}
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: int32(sec), Usec: int32(usec)}
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe() (p1 int, p2 int, err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- p[0], p[1], err = pipe()
- return
-}
-
-//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
-
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
- page := uintptr(offset / 4096)
- if offset != int64(page)*4096 {
- return 0, EINVAL
- }
- return mmap2(addr, length, prot, flags, fd, page)
-}
-
-const rlimInf32 = ^uint32(0)
-const rlimInf64 = ^uint64(0)
-
-type rlimit32 struct {
- Cur uint32
- Max uint32
-}
-
-//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT
-
-func Getrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, nil, rlim)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- err = getrlimit(resource, &rl)
- if err != nil {
- return
- }
-
- if rl.Cur == rlimInf32 {
- rlim.Cur = rlimInf64
- } else {
- rlim.Cur = uint64(rl.Cur)
- }
-
- if rl.Max == rlimInf32 {
- rlim.Max = rlimInf64
- } else {
- rlim.Max = uint64(rl.Max)
- }
- return
-}
-
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
-
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
- err = prlimit(0, resource, rlim, nil)
- if err != ENOSYS {
- return err
- }
-
- rl := rlimit32{}
- if rlim.Cur == rlimInf64 {
- rl.Cur = rlimInf32
- } else if rlim.Cur < uint64(rlimInf32) {
- rl.Cur = uint32(rlim.Cur)
- } else {
- return EINVAL
- }
- if rlim.Max == rlimInf64 {
- rl.Max = rlimInf32
- } else if rlim.Max < uint64(rlimInf32) {
- rl.Max = uint32(rlim.Max)
- } else {
- return EINVAL
- }
-
- return setrlimit(resource, &rl)
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Epc }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
deleted file mode 100644
index 4145185..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2009 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 linux
-// +build ppc64 ppc64le
-
-package unix
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT
-//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
-//sys Ioperm(from int, num int, on int) (err error)
-//sys Iopl(level int) (err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Time(t *Time_t) (tt Time_t, err error)
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Nip }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-//sys syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2
-
-func SyncFileRange(fd int, off int64, n int64, flags int) error {
- // The sync_file_range and sync_file_range2 syscalls differ only in the
- // order of their arguments.
- return syncFileRange2(fd, flags, off, n)
-}
-
-//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error)
-
-func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error {
- cmdlineLen := len(cmdline)
- if cmdlineLen > 0 {
- // Account for the additional NULL byte added by
- // BytePtrFromString in kexecFileLoad. The kexec_file_load
- // syscall expects a NULL-terminated string.
- cmdlineLen++
- }
- return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
deleted file mode 100644
index 44aa122..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
+++ /dev/null
@@ -1,209 +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 riscv64,linux
-
-package unix
-
-import "unsafe"
-
-func EpollCreate(size int) (fd int, err error) {
- if size <= 0 {
- return -1, EINVAL
- }
- return EpollCreate1(0)
-}
-
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sys Listen(s int, n int) (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- var ts *Timespec
- if timeout != nil {
- ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
- }
- return Pselect(nfd, r, w, e, ts, nil)
-}
-
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-
-func Stat(path string, stat *Stat_t) (err error) {
- return Fstatat(AT_FDCWD, path, stat, 0)
-}
-
-func Lchown(path string, uid int, gid int) (err error) {
- return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW)
-}
-
-func Lstat(path string, stat *Stat_t) (err error) {
- return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
-}
-
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-
-func Ustat(dev int, ubuf *Ustat_t) (err error) {
- return ENOSYS
-}
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
- if tv == nil {
- return utimensat(dirfd, path, nil, 0)
- }
-
- ts := []Timespec{
- NsecToTimespec(TimevalToNsec(tv[0])),
- NsecToTimespec(TimevalToNsec(tv[1])),
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func Time(t *Time_t) (Time_t, error) {
- var tv Timeval
- err := Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-func Utime(path string, buf *Utimbuf) error {
- tv := []Timeval{
- {Sec: buf.Actime},
- {Sec: buf.Modtime},
- }
- return Utimes(path, tv)
-}
-
-func utimes(path string, tv *[2]Timeval) (err error) {
- if tv == nil {
- return utimensat(AT_FDCWD, path, nil, 0)
- }
-
- ts := []Timespec{
- NsecToTimespec(TimevalToNsec(tv[0])),
- NsecToTimespec(TimevalToNsec(tv[1])),
- }
- return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Pc }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-func InotifyInit() (fd int, err error) {
- return InotifyInit1(0)
-}
-
-func Dup2(oldfd int, newfd int) (err error) {
- return Dup3(oldfd, newfd, 0)
-}
-
-func Pause() error {
- _, err := ppoll(nil, 0, nil, nil)
- return err
-}
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- var ts *Timespec
- if timeout >= 0 {
- ts = new(Timespec)
- *ts = NsecToTimespec(int64(timeout) * 1e6)
- }
- if len(fds) == 0 {
- return ppoll(nil, 0, ts, nil)
- }
- return ppoll(&fds[0], len(fds), ts, nil)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
deleted file mode 100644
index f52f148..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
+++ /dev/null
@@ -1,337 +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 s390x,linux
-
-package unix
-
-import (
- "unsafe"
-)
-
-//sys Dup2(oldfd int, newfd int) (err error)
-//sysnb EpollCreate(size int) (fd int, err error)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func Time(t *Time_t) (tt Time_t, err error) {
- var tv Timeval
- err = Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, 0) // pipe2 is the same as pipe when flags are set to 0.
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-func Ioperm(from int, num int, on int) (err error) {
- return ENOSYS
-}
-
-func Iopl(level int) (err error) {
- return ENOSYS
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct.
-// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in .
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
- mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
- r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
- xaddr = uintptr(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// On s390x Linux, all the socket calls go through an extra indirection.
-// The arguments to the underlying system call (SYS_SOCKETCALL) are the
-// number below and a pointer to an array of uintptr.
-const (
- // see linux/net.h
- netSocket = 1
- netBind = 2
- netConnect = 3
- netListen = 4
- netAccept = 5
- netGetSockName = 6
- netGetPeerName = 7
- netSocketPair = 8
- netSend = 9
- netRecv = 10
- netSendTo = 11
- netRecvFrom = 12
- netShutdown = 13
- netSetSockOpt = 14
- netGetSockOpt = 15
- netSendMsg = 16
- netRecvMsg = 17
- netAccept4 = 18
- netRecvMMsg = 19
- netSendMMsg = 20
-)
-
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (int, error) {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
- fd, _, err := Syscall(SYS_SOCKETCALL, netAccept, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(fd), nil
-}
-
-func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (int, error) {
- args := [4]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)}
- fd, _, err := Syscall(SYS_SOCKETCALL, netAccept4, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(fd), nil
-}
-
-func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
- _, _, err := RawSyscall(SYS_SOCKETCALL, netGetSockName, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
- _, _, err := RawSyscall(SYS_SOCKETCALL, netGetPeerName, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func socketpair(domain int, typ int, flags int, fd *[2]int32) error {
- args := [4]uintptr{uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd))}
- _, _, err := RawSyscall(SYS_SOCKETCALL, netSocketPair, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func bind(s int, addr unsafe.Pointer, addrlen _Socklen) error {
- args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)}
- _, _, err := Syscall(SYS_SOCKETCALL, netBind, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func connect(s int, addr unsafe.Pointer, addrlen _Socklen) error {
- args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)}
- _, _, err := Syscall(SYS_SOCKETCALL, netConnect, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func socket(domain int, typ int, proto int) (int, error) {
- args := [3]uintptr{uintptr(domain), uintptr(typ), uintptr(proto)}
- fd, _, err := RawSyscall(SYS_SOCKETCALL, netSocket, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(fd), nil
-}
-
-func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) error {
- args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))}
- _, _, err := Syscall(SYS_SOCKETCALL, netGetSockOpt, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error {
- args := [4]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val)}
- _, _, err := Syscall(SYS_SOCKETCALL, netSetSockOpt, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (int, error) {
- var base uintptr
- if len(p) > 0 {
- base = uintptr(unsafe.Pointer(&p[0]))
- }
- args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))}
- n, _, err := Syscall(SYS_SOCKETCALL, netRecvFrom, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(n), nil
-}
-
-func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) error {
- var base uintptr
- if len(p) > 0 {
- base = uintptr(unsafe.Pointer(&p[0]))
- }
- args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen)}
- _, _, err := Syscall(SYS_SOCKETCALL, netSendTo, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func recvmsg(s int, msg *Msghdr, flags int) (int, error) {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)}
- n, _, err := Syscall(SYS_SOCKETCALL, netRecvMsg, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(n), nil
-}
-
-func sendmsg(s int, msg *Msghdr, flags int) (int, error) {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)}
- n, _, err := Syscall(SYS_SOCKETCALL, netSendMsg, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(n), nil
-}
-
-func Listen(s int, n int) error {
- args := [2]uintptr{uintptr(s), uintptr(n)}
- _, _, err := Syscall(SYS_SOCKETCALL, netListen, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-func Shutdown(s, how int) error {
- args := [2]uintptr{uintptr(s), uintptr(how)}
- _, _, err := Syscall(SYS_SOCKETCALL, netShutdown, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return err
- }
- return nil
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error)
-
-func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error {
- cmdlineLen := len(cmdline)
- if cmdlineLen > 0 {
- // Account for the additional NULL byte added by
- // BytePtrFromString in kexecFileLoad. The kexec_file_load
- // syscall expects a NULL-terminated string.
- cmdlineLen++
- }
- return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
deleted file mode 100644
index 72e6418..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2009 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 sparc64,linux
-
-package unix
-
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
-//sys Dup2(oldfd int, newfd int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (euid int)
-//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Getuid() (uid int)
-//sysnb InotifyInit() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Listen(s int, n int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
-//sys Setfsgid(gid int) (err error)
-//sys Setfsuid(uid int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, buf *Statfs_t) (err error)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
-//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
-//sysnb setgroups(n int, list *_Gid_t) (err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
-//sysnb socket(domain int, typ int, proto int) (fd int, err error)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-
-func Ioperm(from int, num int, on int) (err error) {
- return ENOSYS
-}
-
-func Iopl(level int) (err error) {
- return ENOSYS
-}
-
-//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-
-func Time(t *Time_t) (tt Time_t, err error) {
- var tv Timeval
- err = Gettimeofday(&tv)
- if err != nil {
- return 0, err
- }
- if t != nil {
- *t = Time_t(tv.Sec)
- }
- return Time_t(tv.Sec), nil
-}
-
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func (r *PtraceRegs) PC() uint64 { return r.Tpc }
-
-func (r *PtraceRegs) SetPC(pc uint64) { r.Tpc = pc }
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint64(length)
-}
-
-//sysnb pipe(p *[2]_C_int) (err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sysnb pipe2(p *[2]_C_int, flags int) (err error)
-
-func Pipe2(p []int, flags int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe2(&pp, flags)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
deleted file mode 100644
index 5240e16..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go
+++ /dev/null
@@ -1,622 +0,0 @@
-// Copyright 2009,2010 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.
-
-// NetBSD system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_bsd.go or syscall_unix.go.
-
-package unix
-
-import (
- "runtime"
- "syscall"
- "unsafe"
-)
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [12]int8
- raw RawSockaddrDatalink
-}
-
-func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {
- var olen uintptr
-
- // Get a list of all sysctl nodes below the given MIB by performing
- // a sysctl for the given MIB with CTL_QUERY appended.
- mib = append(mib, CTL_QUERY)
- qnode := Sysctlnode{Flags: SYSCTL_VERS_1}
- qp := (*byte)(unsafe.Pointer(&qnode))
- sz := unsafe.Sizeof(qnode)
- if err = sysctl(mib, nil, &olen, qp, sz); err != nil {
- return nil, err
- }
-
- // Now that we know the size, get the actual nodes.
- nodes = make([]Sysctlnode, olen/sz)
- np := (*byte)(unsafe.Pointer(&nodes[0]))
- if err = sysctl(mib, np, &olen, qp, sz); err != nil {
- return nil, err
- }
-
- return nodes, nil
-}
-
-func nametomib(name string) (mib []_C_int, err error) {
- // Split name into components.
- var parts []string
- last := 0
- for i := 0; i < len(name); i++ {
- if name[i] == '.' {
- parts = append(parts, name[last:i])
- last = i + 1
- }
- }
- parts = append(parts, name[last:])
-
- // Discover the nodes and construct the MIB OID.
- for partno, part := range parts {
- nodes, err := sysctlNodes(mib)
- if err != nil {
- return nil, err
- }
- for _, node := range nodes {
- n := make([]byte, 0)
- for i := range node.Name {
- if node.Name[i] != 0 {
- n = append(n, byte(node.Name[i]))
- }
- }
- if string(n) == part {
- mib = append(mib, _C_int(node.Num))
- break
- }
- }
- if len(mib) != partno+1 {
- return nil, EINVAL
- }
- }
-
- return mib, nil
-}
-
-func SysctlClockinfo(name string) (*Clockinfo, error) {
- mib, err := sysctlmib(name)
- if err != nil {
- return nil, err
- }
-
- n := uintptr(SizeofClockinfo)
- var ci Clockinfo
- if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
- return nil, err
- }
- if n != SizeofClockinfo {
- return nil, EIO
- }
- return &ci, nil
-}
-
-//sysnb pipe() (fd1 int, fd2 int, err error)
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- p[0], p[1], err = pipe()
- return
-}
-
-//sys getdents(fd int, buf []byte) (n int, err error)
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return getdents(fd, buf)
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
-
-func Getwd() (string, error) {
- var buf [PathMax]byte
- _, err := Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- n := clen(buf[:])
- if n < 1 {
- return "", EINVAL
- }
- return string(buf[:n]), nil
-}
-
-// TODO
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- return -1, ENOSYS
-}
-
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {
- var value Ptmget
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- runtime.KeepAlive(value)
- return &value, err
-}
-
-func Uname(uname *Utsname) error {
- mib := []_C_int{CTL_KERN, KERN_OSTYPE}
- n := unsafe.Sizeof(uname.Sysname)
- if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
- n = unsafe.Sizeof(uname.Nodename)
- if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
- n = unsafe.Sizeof(uname.Release)
- if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_VERSION}
- n = unsafe.Sizeof(uname.Version)
- if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
- return err
- }
-
- // The version might have newlines or tabs in it, convert them to
- // spaces.
- for i, b := range uname.Version {
- if b == '\n' || b == '\t' {
- if i == len(uname.Version)-1 {
- uname.Version[i] = 0
- } else {
- uname.Version[i] = ' '
- }
- }
- }
-
- mib = []_C_int{CTL_HW, HW_MACHINE}
- n = unsafe.Sizeof(uname.Machine)
- if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
- return err
- }
-
- return nil
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys Chdir(path string) (err error)
-//sys Chflags(path string, flags int) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(from int, to int) (err error)
-//sys Exit(code int)
-//sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
-//sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
-//sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
-//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
-//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
-//sys Fchdir(fd int) (err error)
-//sys Fchflags(fd int, flags int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (uid int)
-//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgrp int)
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Getuid() (uid int)
-//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum syscall.Signal) (err error)
-//sys Kqueue() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
-//sys Listen(s int, backlog int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mkfifoat(dirfd int, path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
-//sys Revoke(path string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sysnb Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tp *Timeval) (err error)
-//sysnb Setuid(uid int) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-//sys Sync() (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Umask(newmask int) (oldmask int)
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Unmount(path string, flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
-//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
-
-/*
- * Unimplemented
- */
-// ____semctl13
-// __clone
-// __fhopen40
-// __fhstat40
-// __fhstatvfs140
-// __fstat30
-// __getcwd
-// __getfh30
-// __getlogin
-// __lstat30
-// __mount50
-// __msgctl13
-// __msync13
-// __ntp_gettime30
-// __posix_chown
-// __posix_fchown
-// __posix_lchown
-// __posix_rename
-// __setlogin
-// __shmctl13
-// __sigaction_sigtramp
-// __sigaltstack14
-// __sigpending14
-// __sigprocmask14
-// __sigsuspend14
-// __sigtimedwait
-// __stat30
-// __syscall
-// __vfork14
-// _ksem_close
-// _ksem_destroy
-// _ksem_getvalue
-// _ksem_init
-// _ksem_open
-// _ksem_post
-// _ksem_trywait
-// _ksem_unlink
-// _ksem_wait
-// _lwp_continue
-// _lwp_create
-// _lwp_ctl
-// _lwp_detach
-// _lwp_exit
-// _lwp_getname
-// _lwp_getprivate
-// _lwp_kill
-// _lwp_park
-// _lwp_self
-// _lwp_setname
-// _lwp_setprivate
-// _lwp_suspend
-// _lwp_unpark
-// _lwp_unpark_all
-// _lwp_wait
-// _lwp_wakeup
-// _pset_bind
-// _sched_getaffinity
-// _sched_getparam
-// _sched_setaffinity
-// _sched_setparam
-// acct
-// aio_cancel
-// aio_error
-// aio_fsync
-// aio_read
-// aio_return
-// aio_suspend
-// aio_write
-// break
-// clock_getres
-// clock_gettime
-// clock_settime
-// compat_09_ogetdomainname
-// compat_09_osetdomainname
-// compat_09_ouname
-// compat_10_omsgsys
-// compat_10_osemsys
-// compat_10_oshmsys
-// compat_12_fstat12
-// compat_12_getdirentries
-// compat_12_lstat12
-// compat_12_msync
-// compat_12_oreboot
-// compat_12_oswapon
-// compat_12_stat12
-// compat_13_sigaction13
-// compat_13_sigaltstack13
-// compat_13_sigpending13
-// compat_13_sigprocmask13
-// compat_13_sigreturn13
-// compat_13_sigsuspend13
-// compat_14___semctl
-// compat_14_msgctl
-// compat_14_shmctl
-// compat_16___sigaction14
-// compat_16___sigreturn14
-// compat_20_fhstatfs
-// compat_20_fstatfs
-// compat_20_getfsstat
-// compat_20_statfs
-// compat_30___fhstat30
-// compat_30___fstat13
-// compat_30___lstat13
-// compat_30___stat13
-// compat_30_fhopen
-// compat_30_fhstat
-// compat_30_fhstatvfs1
-// compat_30_getdents
-// compat_30_getfh
-// compat_30_ntp_gettime
-// compat_30_socket
-// compat_40_mount
-// compat_43_fstat43
-// compat_43_lstat43
-// compat_43_oaccept
-// compat_43_ocreat
-// compat_43_oftruncate
-// compat_43_ogetdirentries
-// compat_43_ogetdtablesize
-// compat_43_ogethostid
-// compat_43_ogethostname
-// compat_43_ogetkerninfo
-// compat_43_ogetpagesize
-// compat_43_ogetpeername
-// compat_43_ogetrlimit
-// compat_43_ogetsockname
-// compat_43_okillpg
-// compat_43_olseek
-// compat_43_ommap
-// compat_43_oquota
-// compat_43_orecv
-// compat_43_orecvfrom
-// compat_43_orecvmsg
-// compat_43_osend
-// compat_43_osendmsg
-// compat_43_osethostid
-// compat_43_osethostname
-// compat_43_osetrlimit
-// compat_43_osigblock
-// compat_43_osigsetmask
-// compat_43_osigstack
-// compat_43_osigvec
-// compat_43_otruncate
-// compat_43_owait
-// compat_43_stat43
-// execve
-// extattr_delete_fd
-// extattr_delete_file
-// extattr_delete_link
-// extattr_get_fd
-// extattr_get_file
-// extattr_get_link
-// extattr_list_fd
-// extattr_list_file
-// extattr_list_link
-// extattr_set_fd
-// extattr_set_file
-// extattr_set_link
-// extattrctl
-// fchroot
-// fdatasync
-// fgetxattr
-// fktrace
-// flistxattr
-// fork
-// fremovexattr
-// fsetxattr
-// fstatvfs1
-// fsync_range
-// getcontext
-// getitimer
-// getvfsstat
-// getxattr
-// ktrace
-// lchflags
-// lchmod
-// lfs_bmapv
-// lfs_markv
-// lfs_segclean
-// lfs_segwait
-// lgetxattr
-// lio_listio
-// listxattr
-// llistxattr
-// lremovexattr
-// lseek
-// lsetxattr
-// lutimes
-// madvise
-// mincore
-// minherit
-// modctl
-// mq_close
-// mq_getattr
-// mq_notify
-// mq_open
-// mq_receive
-// mq_send
-// mq_setattr
-// mq_timedreceive
-// mq_timedsend
-// mq_unlink
-// mremap
-// msgget
-// msgrcv
-// msgsnd
-// nfssvc
-// ntp_adjtime
-// pmc_control
-// pmc_get_info
-// pollts
-// preadv
-// profil
-// pselect
-// pset_assign
-// pset_create
-// pset_destroy
-// ptrace
-// pwritev
-// quotactl
-// rasctl
-// readv
-// reboot
-// removexattr
-// sa_enable
-// sa_preempt
-// sa_register
-// sa_setconcurrency
-// sa_stacks
-// sa_yield
-// sbrk
-// sched_yield
-// semconfig
-// semget
-// semop
-// setcontext
-// setitimer
-// setxattr
-// shmat
-// shmdt
-// shmget
-// sstk
-// statvfs1
-// swapctl
-// sysarch
-// syscall
-// timer_create
-// timer_delete
-// timer_getoverrun
-// timer_gettime
-// timer_settime
-// undelete
-// utrace
-// uuidgen
-// vadvise
-// vfork
-// writev
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
deleted file mode 100644
index 24f74e5..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2009 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 386,netbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = uint32(mode)
- k.Flags = uint32(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
deleted file mode 100644
index 6878bf7..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2009 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 amd64,netbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = uint32(mode)
- k.Flags = uint32(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
deleted file mode 100644
index dbbfcf7..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
+++ /dev/null
@@ -1,33 +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 arm,netbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = uint32(mode)
- k.Flags = uint32(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
deleted file mode 100644
index 6879995..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ /dev/null
@@ -1,399 +0,0 @@
-// Copyright 2009,2010 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.
-
-// OpenBSD system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_bsd.go or syscall_unix.go.
-
-package unix
-
-import (
- "sort"
- "syscall"
- "unsafe"
-)
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Len uint8
- Family uint8
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [24]int8
- raw RawSockaddrDatalink
-}
-
-func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-func nametomib(name string) (mib []_C_int, err error) {
- i := sort.Search(len(sysctlMib), func(i int) bool {
- return sysctlMib[i].ctlname >= name
- })
- if i < len(sysctlMib) && sysctlMib[i].ctlname == name {
- return sysctlMib[i].ctloid, nil
- }
- return nil, EINVAL
-}
-
-func SysctlUvmexp(name string) (*Uvmexp, error) {
- mib, err := sysctlmib(name)
- if err != nil {
- return nil, err
- }
-
- n := uintptr(SizeofUvmexp)
- var u Uvmexp
- if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil {
- return nil, err
- }
- if n != SizeofUvmexp {
- return nil, EIO
- }
- return &u, nil
-}
-
-//sysnb pipe(p *[2]_C_int) (err error)
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- err = pipe(&pp)
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return
-}
-
-//sys getdents(fd int, buf []byte) (n int, err error)
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return getdents(fd, buf)
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
-
-func Getwd() (string, error) {
- var buf [PathMax]byte
- _, err := Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- n := clen(buf[:])
- if n < 1 {
- return "", EINVAL
- }
- return string(buf[:n]), nil
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-// TODO
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- return -1, ENOSYS
-}
-
-func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
- var _p0 unsafe.Pointer
- var bufsize uintptr
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
- }
- r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
-
-func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
- if len(fds) == 0 {
- return ppoll(nil, 0, timeout, sigmask)
- }
- return ppoll(&fds[0], len(fds), timeout, sigmask)
-}
-
-func Uname(uname *Utsname) error {
- mib := []_C_int{CTL_KERN, KERN_OSTYPE}
- n := unsafe.Sizeof(uname.Sysname)
- if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
- n = unsafe.Sizeof(uname.Nodename)
- if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
- n = unsafe.Sizeof(uname.Release)
- if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
- return err
- }
-
- mib = []_C_int{CTL_KERN, KERN_VERSION}
- n = unsafe.Sizeof(uname.Version)
- if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
- return err
- }
-
- // The version might have newlines or tabs in it, convert them to
- // spaces.
- for i, b := range uname.Version {
- if b == '\n' || b == '\t' {
- if i == len(uname.Version)-1 {
- uname.Version[i] = 0
- } else {
- uname.Version[i] = ' '
- }
- }
- }
-
- mib = []_C_int{CTL_HW, HW_MACHINE}
- n = unsafe.Sizeof(uname.Machine)
- if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
- return err
- }
-
- return nil
-}
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys Chdir(path string) (err error)
-//sys Chflags(path string, flags int) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(from int, to int) (err error)
-//sys Exit(code int)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchflags(fd int, flags int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatfs(fd int, stat *Statfs_t) (err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sysnb Getegid() (egid int)
-//sysnb Geteuid() (uid int)
-//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgrp int)
-//sysnb Getpid() (pid int)
-//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrtable() (rtable int, err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Getsid(pid int) (sid int, err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Getuid() (uid int)
-//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum syscall.Signal) (err error)
-//sys Kqueue() (fd int, err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
-//sys Listen(s int, backlog int) (err error)
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mkfifoat(dirfd int, path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
-//sys Revoke(path string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sysnb Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sys Setlogin(name string) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setrtable(rtable int) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Settimeofday(tp *Timeval) (err error)
-//sysnb Setuid(uid int) (err error)
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statfs(path string, stat *Statfs_t) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
-//sys Sync() (err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Umask(newmask int) (oldmask int)
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Unmount(path string, flags int) (err error)
-//sys write(fd int, p []byte) (n int, err error)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
-//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
-//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
-
-/*
- * Unimplemented
- */
-// __getcwd
-// __semctl
-// __syscall
-// __sysctl
-// adjfreq
-// break
-// clock_getres
-// clock_gettime
-// clock_settime
-// closefrom
-// execve
-// fcntl
-// fhopen
-// fhstat
-// fhstatfs
-// fork
-// futimens
-// getfh
-// getgid
-// getitimer
-// getlogin
-// getresgid
-// getresuid
-// getthrid
-// ktrace
-// lfs_bmapv
-// lfs_markv
-// lfs_segclean
-// lfs_segwait
-// mincore
-// minherit
-// mount
-// mquery
-// msgctl
-// msgget
-// msgrcv
-// msgsnd
-// nfssvc
-// nnpfspioctl
-// preadv
-// profil
-// pwritev
-// quotactl
-// readv
-// reboot
-// renameat
-// rfork
-// sched_yield
-// semget
-// semop
-// setgroups
-// setitimer
-// setsockopt
-// shmat
-// shmctl
-// shmdt
-// shmget
-// sigaction
-// sigaltstack
-// sigpending
-// sigprocmask
-// sigreturn
-// sigsuspend
-// sysarch
-// syscall
-// threxit
-// thrsigdivert
-// thrsleep
-// thrwakeup
-// vfork
-// writev
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
deleted file mode 100644
index d62da60..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2009 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 386,openbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of openbsd/386 the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
deleted file mode 100644
index 9a35334..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2009 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 amd64,openbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint64(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
deleted file mode 100644
index 5d812aa..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2017 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 arm,openbsd
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: int32(nsec)}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: int32(usec)}
-}
-
-func SetKevent(k *Kevent_t, fd, mode, flags int) {
- k.Ident = uint32(fd)
- k.Filter = int16(mode)
- k.Flags = uint16(flags)
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint32(length)
-}
-
-func (msghdr *Msghdr) SetControllen(length int) {
- msghdr.Controllen = uint32(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
-
-// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
-// of openbsd/arm the syscall is called sysctl instead of __sysctl.
-const SYS___SYSCTL = SYS_SYSCTL
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
deleted file mode 100644
index e478012..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ /dev/null
@@ -1,737 +0,0 @@
-// Copyright 2009 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.
-
-// Solaris system calls.
-// This file is compiled as ordinary Go code,
-// but it is also input to mksyscall,
-// which parses the //sys lines and generates system call stubs.
-// Note that sometimes we use a lowercase //sys name and wrap
-// it in our own nicer implementation, either here or in
-// syscall_solaris.go or syscall_unix.go.
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-// Implemented in runtime/syscall_solaris.go.
-type syscallFunc uintptr
-
-func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
-func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
-
-// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
-type SockaddrDatalink struct {
- Family uint16
- Index uint16
- Type uint8
- Nlen uint8
- Alen uint8
- Slen uint8
- Data [244]int8
- raw RawSockaddrDatalink
-}
-
-//sysnb pipe(p *[2]_C_int) (n int, err error)
-
-func Pipe(p []int) (err error) {
- if len(p) != 2 {
- return EINVAL
- }
- var pp [2]_C_int
- n, err := pipe(&pp)
- if n != 0 {
- return err
- }
- p[0] = int(pp[0])
- p[1] = int(pp[1])
- return nil
-}
-
-func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil
-}
-
-func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
- if sa.Port < 0 || sa.Port > 0xFFFF {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_INET6
- p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
- p[0] = byte(sa.Port >> 8)
- p[1] = byte(sa.Port)
- sa.raw.Scope_id = sa.ZoneId
- for i := 0; i < len(sa.Addr); i++ {
- sa.raw.Addr[i] = sa.Addr[i]
- }
- return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil
-}
-
-func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
- name := sa.Name
- n := len(name)
- if n >= len(sa.raw.Path) {
- return nil, 0, EINVAL
- }
- sa.raw.Family = AF_UNIX
- for i := 0; i < n; i++ {
- sa.raw.Path[i] = int8(name[i])
- }
- // length is family (uint16), name, NUL.
- sl := _Socklen(2)
- if n > 0 {
- sl += _Socklen(n) + 1
- }
- if sa.raw.Path[0] == '@' {
- sa.raw.Path[0] = 0
- // Don't count trailing NUL for abstract address.
- sl--
- }
-
- return unsafe.Pointer(&sa.raw), sl, nil
-}
-
-//sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getsockname
-
-func Getsockname(fd int) (sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if err = getsockname(fd, &rsa, &len); err != nil {
- return
- }
- return anyToSockaddr(fd, &rsa)
-}
-
-// GetsockoptString returns the string value of the socket option opt for the
-// socket associated with fd at the given socket level.
-func GetsockoptString(fd, level, opt int) (string, error) {
- buf := make([]byte, 256)
- vallen := _Socklen(len(buf))
- err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
- if err != nil {
- return "", err
- }
- return string(buf[:vallen-1]), nil
-}
-
-const ImplementsGetwd = true
-
-//sys Getcwd(buf []byte) (n int, err error)
-
-func Getwd() (wd string, err error) {
- var buf [PathMax]byte
- // Getcwd will return an error if it failed for any reason.
- _, err = Getcwd(buf[0:])
- if err != nil {
- return "", err
- }
- n := clen(buf[:])
- if n < 1 {
- return "", EINVAL
- }
- return string(buf[:n]), nil
-}
-
-/*
- * Wrapped
- */
-
-//sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error)
-//sysnb setgroups(ngid int, gid *_Gid_t) (err error)
-
-func Getgroups() (gids []int, err error) {
- n, err := getgroups(0, nil)
- // Check for error and sanity check group count. Newer versions of
- // Solaris allow up to 1024 (NGROUPS_MAX).
- if n < 0 || n > 1024 {
- if err != nil {
- return nil, err
- }
- return nil, EINVAL
- } else if n == 0 {
- return nil, nil
- }
-
- a := make([]_Gid_t, n)
- n, err = getgroups(n, &a[0])
- if n == -1 {
- return nil, err
- }
- gids = make([]int, n)
- for i, v := range a[0:n] {
- gids[i] = int(v)
- }
- return
-}
-
-func Setgroups(gids []int) (err error) {
- if len(gids) == 0 {
- return setgroups(0, nil)
- }
-
- a := make([]_Gid_t, len(gids))
- for i, v := range gids {
- a[i] = _Gid_t(v)
- }
- return setgroups(len(a), &a[0])
-}
-
-func ReadDirent(fd int, buf []byte) (n int, err error) {
- // Final argument is (basep *uintptr) and the syscall doesn't take nil.
- // TODO(rsc): Can we use a single global basep for all calls?
- return Getdents(fd, buf, new(uintptr))
-}
-
-// Wait status is 7 bits at bottom, either 0 (exited),
-// 0x7F (stopped), or a signal number that caused an exit.
-// The 0x80 bit is whether there was a core dump.
-// An extra number (exit code, signal causing a stop)
-// is in the high bits.
-
-type WaitStatus uint32
-
-const (
- mask = 0x7F
- core = 0x80
- shift = 8
-
- exited = 0
- stopped = 0x7F
-)
-
-func (w WaitStatus) Exited() bool { return w&mask == exited }
-
-func (w WaitStatus) ExitStatus() int {
- if w&mask != exited {
- return -1
- }
- return int(w >> shift)
-}
-
-func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }
-
-func (w WaitStatus) Signal() syscall.Signal {
- sig := syscall.Signal(w & mask)
- if sig == stopped || sig == 0 {
- return -1
- }
- return sig
-}
-
-func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }
-
-func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }
-
-func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }
-
-func (w WaitStatus) StopSignal() syscall.Signal {
- if !w.Stopped() {
- return -1
- }
- return syscall.Signal(w>>shift) & 0xFF
-}
-
-func (w WaitStatus) TrapCause() int { return -1 }
-
-//sys wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error)
-
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (int, error) {
- var status _C_int
- rpid, err := wait4(int32(pid), &status, options, rusage)
- wpid := int(rpid)
- if wpid == -1 {
- return wpid, err
- }
- if wstatus != nil {
- *wstatus = WaitStatus(status)
- }
- return wpid, nil
-}
-
-//sys gethostname(buf []byte) (n int, err error)
-
-func Gethostname() (name string, err error) {
- var buf [MaxHostNameLen]byte
- n, err := gethostname(buf[:])
- if n != 0 {
- return "", err
- }
- n = clen(buf[:])
- if n < 1 {
- return "", EFAULT
- }
- return string(buf[:n]), nil
-}
-
-//sys utimes(path string, times *[2]Timeval) (err error)
-
-func Utimes(path string, tv []Timeval) (err error) {
- if tv == nil {
- return utimes(path, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-//sys utimensat(fd int, path string, times *[2]Timespec, flag int) (err error)
-
-func UtimesNano(path string, ts []Timespec) error {
- if ts == nil {
- return utimensat(AT_FDCWD, path, nil, 0)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
-}
-
-func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
- if ts == nil {
- return utimensat(dirfd, path, nil, flags)
- }
- if len(ts) != 2 {
- return EINVAL
- }
- return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
-}
-
-//sys fcntl(fd int, cmd int, arg int) (val int, err error)
-
-// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
-func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
- valptr, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
- var err error
- if errno != 0 {
- err = errno
- }
- return int(valptr), err
-}
-
-// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
-func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
- _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)
- if e1 != 0 {
- return e1
- }
- return nil
-}
-
-//sys futimesat(fildes int, path *byte, times *[2]Timeval) (err error)
-
-func Futimesat(dirfd int, path string, tv []Timeval) error {
- pathp, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
- if tv == nil {
- return futimesat(dirfd, pathp, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-// Solaris doesn't have an futimes function because it allows NULL to be
-// specified as the path for futimesat. However, Go doesn't like
-// NULL-style string interfaces, so this simple wrapper is provided.
-func Futimes(fd int, tv []Timeval) error {
- if tv == nil {
- return futimesat(fd, nil, nil)
- }
- if len(tv) != 2 {
- return EINVAL
- }
- return futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-}
-
-func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
- switch rsa.Addr.Family {
- case AF_UNIX:
- pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
- sa := new(SockaddrUnix)
- // Assume path ends at NUL.
- // This is not technically the Solaris semantics for
- // abstract Unix domain sockets -- they are supposed
- // to be uninterpreted fixed-size binary blobs -- but
- // everyone uses this convention.
- n := 0
- for n < len(pp.Path) && pp.Path[n] != 0 {
- n++
- }
- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
- sa.Name = string(bytes)
- return sa, nil
-
- case AF_INET:
- pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet4)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
-
- case AF_INET6:
- pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
- sa := new(SockaddrInet6)
- p := (*[2]byte)(unsafe.Pointer(&pp.Port))
- sa.Port = int(p[0])<<8 + int(p[1])
- sa.ZoneId = pp.Scope_id
- for i := 0; i < len(sa.Addr); i++ {
- sa.Addr[i] = pp.Addr[i]
- }
- return sa, nil
- }
- return nil, EAFNOSUPPORT
-}
-
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = libsocket.accept
-
-func Accept(fd int) (nfd int, sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- nfd, err = accept(fd, &rsa, &len)
- if nfd == -1 {
- return
- }
- sa, err = anyToSockaddr(fd, &rsa)
- if err != nil {
- Close(nfd)
- nfd = 0
- }
- return
-}
-
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg
-
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
- var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
- msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*int8)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy int8
- if len(oob) > 0 {
- // receive at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- msg.Accrightslen = int32(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = recvmsg(fd, &msg, flags); n == -1 {
- return
- }
- oobn = int(msg.Accrightslen)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
- return
-}
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
- var msg Msghdr
- msg.Name = (*byte)(unsafe.Pointer(ptr))
- msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*int8)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy int8
- if len(oob) > 0 {
- // send at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
- }
- msg.Accrightslen = int32(len(oob))
- }
- msg.Iov = &iov
- msg.Iovlen = 1
- if n, err = sendmsg(fd, &msg, flags); err != nil {
- return 0, err
- }
- if len(oob) > 0 && len(p) == 0 {
- n = 0
- }
- return n, nil
-}
-
-//sys acct(path *byte) (err error)
-
-func Acct(path string) (err error) {
- if len(path) == 0 {
- // Assume caller wants to disable accounting.
- return acct(nil)
- }
-
- pathp, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
- return acct(pathp)
-}
-
-//sys __makedev(version int, major uint, minor uint) (val uint64)
-
-func Mkdev(major, minor uint32) uint64 {
- return __makedev(NEWDEV, uint(major), uint(minor))
-}
-
-//sys __major(version int, dev uint64) (val uint)
-
-func Major(dev uint64) uint32 {
- return uint32(__major(NEWDEV, dev))
-}
-
-//sys __minor(version int, dev uint64) (val uint)
-
-func Minor(dev uint64) uint32 {
- return uint32(__minor(NEWDEV, dev))
-}
-
-/*
- * Expose the ioctl function
- */
-
-//sys ioctl(fd int, req uint, arg uintptr) (err error)
-
-func IoctlSetInt(fd int, req uint, value int) (err error) {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) (err error) {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) (err error) {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func IoctlSetTermio(fd int, req uint, value *Termio) (err error) {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermio(fd int, req uint) (*Termio, error) {
- var value Termio
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
-
-func Poll(fds []PollFd, timeout int) (n int, err error) {
- if len(fds) == 0 {
- return poll(nil, 0, timeout)
- }
- return poll(&fds[0], len(fds), timeout)
-}
-
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- return sendfile(outfd, infd, offset, count)
-}
-
-/*
- * Exposed directly
- */
-//sys Access(path string, mode uint32) (err error)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
-//sys Chdir(path string) (err error)
-//sys Chmod(path string, mode uint32) (err error)
-//sys Chown(path string, uid int, gid int) (err error)
-//sys Chroot(path string) (err error)
-//sys Close(fd int) (err error)
-//sys Creat(path string, mode uint32) (fd int, err error)
-//sys Dup(fd int) (nfd int, err error)
-//sys Dup2(oldfd int, newfd int) (err error)
-//sys Exit(code int)
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchdir(fd int) (err error)
-//sys Fchmod(fd int, mode uint32) (err error)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
-//sys Fchown(fd int, uid int, gid int) (err error)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
-//sys Fdatasync(fd int) (err error)
-//sys Flock(fd int, how int) (err error)
-//sys Fpathconf(fd int, name int) (val int, err error)
-//sys Fstat(fd int, stat *Stat_t) (err error)
-//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
-//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
-//sysnb Getgid() (gid int)
-//sysnb Getpid() (pid int)
-//sysnb Getpgid(pid int) (pgid int, err error)
-//sysnb Getpgrp() (pgid int, err error)
-//sys Geteuid() (euid int)
-//sys Getegid() (egid int)
-//sys Getppid() (ppid int)
-//sys Getpriority(which int, who int) (n int, err error)
-//sysnb Getrlimit(which int, lim *Rlimit) (err error)
-//sysnb Getrusage(who int, rusage *Rusage) (err error)
-//sysnb Gettimeofday(tv *Timeval) (err error)
-//sysnb Getuid() (uid int)
-//sys Kill(pid int, signum syscall.Signal) (err error)
-//sys Lchown(path string, uid int, gid int) (err error)
-//sys Link(path string, link string) (err error)
-//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten
-//sys Lstat(path string, stat *Stat_t) (err error)
-//sys Madvise(b []byte, advice int) (err error)
-//sys Mkdir(path string, mode uint32) (err error)
-//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
-//sys Mkfifo(path string, mode uint32) (err error)
-//sys Mkfifoat(dirfd int, path string, mode uint32) (err error)
-//sys Mknod(path string, mode uint32, dev int) (err error)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
-//sys Mlock(b []byte) (err error)
-//sys Mlockall(flags int) (err error)
-//sys Mprotect(b []byte, prot int) (err error)
-//sys Msync(b []byte, flags int) (err error)
-//sys Munlock(b []byte) (err error)
-//sys Munlockall() (err error)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
-//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
-//sys Pathconf(path string, name int) (val int, err error)
-//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//sys read(fd int, p []byte) (n int, err error)
-//sys Readlink(path string, buf []byte) (n int, err error)
-//sys Rename(from string, to string) (err error)
-//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
-//sys Rmdir(path string) (err error)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
-//sysnb Setegid(egid int) (err error)
-//sysnb Seteuid(euid int) (err error)
-//sysnb Setgid(gid int) (err error)
-//sys Sethostname(p []byte) (err error)
-//sysnb Setpgid(pid int, pgid int) (err error)
-//sys Setpriority(which int, who int, prio int) (err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setreuid(ruid int, euid int) (err error)
-//sysnb Setrlimit(which int, lim *Rlimit) (err error)
-//sysnb Setsid() (pid int, err error)
-//sysnb Setuid(uid int) (err error)
-//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
-//sys Stat(path string, stat *Stat_t) (err error)
-//sys Statvfs(path string, vfsstat *Statvfs_t) (err error)
-//sys Symlink(path string, link string) (err error)
-//sys Sync() (err error)
-//sysnb Times(tms *Tms) (ticks uintptr, err error)
-//sys Truncate(path string, length int64) (err error)
-//sys Fsync(fd int) (err error)
-//sys Ftruncate(fd int, length int64) (err error)
-//sys Umask(mask int) (oldmask int)
-//sysnb Uname(buf *Utsname) (err error)
-//sys Unmount(target string, flags int) (err error) = libc.umount
-//sys Unlink(path string) (err error)
-//sys Unlinkat(dirfd int, path string, flags int) (err error)
-//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys Utime(path string, buf *Utimbuf) (err error)
-//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_bind
-//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
-//sys munmap(addr uintptr, length uintptr) (err error)
-//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = libsendfile.sendfile
-//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto
-//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair
-//sys write(fd int, p []byte) (n int, err error)
-//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.__xnet_getsockopt
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername
-//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
-
-func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)
- n = int(r0)
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
- r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)
- n = int(r0)
- if e1 != 0 {
- err = e1
- }
- return
-}
-
-var mapper = &mmapper{
- active: make(map[*byte][]byte),
- mmap: mmap,
- munmap: munmap,
-}
-
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return mapper.Mmap(fd, offset, length, prot, flags)
-}
-
-func Munmap(b []byte) (err error) {
- return mapper.Munmap(b)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
deleted file mode 100644
index 91c32dd..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2009 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 amd64,solaris
-
-package unix
-
-func setTimespec(sec, nsec int64) Timespec {
- return Timespec{Sec: sec, Nsec: nsec}
-}
-
-func setTimeval(sec, usec int64) Timeval {
- return Timeval{Sec: sec, Usec: usec}
-}
-
-func (iov *Iovec) SetLen(length int) {
- iov.Len = uint64(length)
-}
-
-func (cmsg *Cmsghdr) SetLen(length int) {
- cmsg.Len = uint32(length)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go
deleted file mode 100644
index 33583a2..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_unix.go
+++ /dev/null
@@ -1,379 +0,0 @@
-// Copyright 2009 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-import (
- "bytes"
- "sort"
- "sync"
- "syscall"
- "unsafe"
-)
-
-var (
- Stdin = 0
- Stdout = 1
- Stderr = 2
-)
-
-// Do the interface allocations only once for common
-// Errno values.
-var (
- errEAGAIN error = syscall.EAGAIN
- errEINVAL error = syscall.EINVAL
- errENOENT error = syscall.ENOENT
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case EAGAIN:
- return errEAGAIN
- case EINVAL:
- return errEINVAL
- case ENOENT:
- return errENOENT
- }
- return e
-}
-
-// ErrnoName returns the error name for error number e.
-func ErrnoName(e syscall.Errno) string {
- i := sort.Search(len(errorList), func(i int) bool {
- return errorList[i].num >= e
- })
- if i < len(errorList) && errorList[i].num == e {
- return errorList[i].name
- }
- return ""
-}
-
-// SignalName returns the signal name for signal number s.
-func SignalName(s syscall.Signal) string {
- i := sort.Search(len(signalList), func(i int) bool {
- return signalList[i].num >= s
- })
- if i < len(signalList) && signalList[i].num == s {
- return signalList[i].name
- }
- return ""
-}
-
-// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte.
-func clen(n []byte) int {
- i := bytes.IndexByte(n, 0)
- if i == -1 {
- i = len(n)
- }
- return i
-}
-
-// Mmap manager, for use by operating system-specific implementations.
-
-type mmapper struct {
- sync.Mutex
- active map[*byte][]byte // active mappings; key is last byte in mapping
- mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error)
- munmap func(addr uintptr, length uintptr) error
-}
-
-func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- if length <= 0 {
- return nil, EINVAL
- }
-
- // Map the requested memory.
- addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset)
- if errno != nil {
- return nil, errno
- }
-
- // Slice memory layout
- var sl = struct {
- addr uintptr
- len int
- cap int
- }{addr, length, length}
-
- // Use unsafe to turn sl into a []byte.
- b := *(*[]byte)(unsafe.Pointer(&sl))
-
- // Register mapping in m and return it.
- p := &b[cap(b)-1]
- m.Lock()
- defer m.Unlock()
- m.active[p] = b
- return b, nil
-}
-
-func (m *mmapper) Munmap(data []byte) (err error) {
- if len(data) == 0 || len(data) != cap(data) {
- return EINVAL
- }
-
- // Find the base of the mapping.
- p := &data[cap(data)-1]
- m.Lock()
- defer m.Unlock()
- b := m.active[p]
- if b == nil || &b[0] != &data[0] {
- return EINVAL
- }
-
- // Unmap the memory and update m.
- if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil {
- return errno
- }
- delete(m.active, p)
- return nil
-}
-
-func Read(fd int, p []byte) (n int, err error) {
- n, err = read(fd, p)
- if raceenabled {
- if n > 0 {
- raceWriteRange(unsafe.Pointer(&p[0]), n)
- }
- if err == nil {
- raceAcquire(unsafe.Pointer(&ioSync))
- }
- }
- return
-}
-
-func Write(fd int, p []byte) (n int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
- }
- n, err = write(fd, p)
- if raceenabled && n > 0 {
- raceReadRange(unsafe.Pointer(&p[0]), n)
- }
- return
-}
-
-// For testing: clients can set this flag to force
-// creation of IPv6 sockets to return EAFNOSUPPORT.
-var SocketDisableIPv6 bool
-
-// Sockaddr represents a socket address.
-type Sockaddr interface {
- sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs
-}
-
-// SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets.
-type SockaddrInet4 struct {
- Port int
- Addr [4]byte
- raw RawSockaddrInet4
-}
-
-// SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets.
-type SockaddrInet6 struct {
- Port int
- ZoneId uint32
- Addr [16]byte
- raw RawSockaddrInet6
-}
-
-// SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets.
-type SockaddrUnix struct {
- Name string
- raw RawSockaddrUnix
-}
-
-func Bind(fd int, sa Sockaddr) (err error) {
- ptr, n, err := sa.sockaddr()
- if err != nil {
- return err
- }
- return bind(fd, ptr, n)
-}
-
-func Connect(fd int, sa Sockaddr) (err error) {
- ptr, n, err := sa.sockaddr()
- if err != nil {
- return err
- }
- return connect(fd, ptr, n)
-}
-
-func Getpeername(fd int) (sa Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if err = getpeername(fd, &rsa, &len); err != nil {
- return
- }
- return anyToSockaddr(fd, &rsa)
-}
-
-func GetsockoptByte(fd, level, opt int) (value byte, err error) {
- var n byte
- vallen := _Socklen(1)
- err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)
- return n, err
-}
-
-func GetsockoptInt(fd, level, opt int) (value int, err error) {
- var n int32
- vallen := _Socklen(4)
- err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)
- return int(n), err
-}
-
-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
- vallen := _Socklen(4)
- err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
- return value, err
-}
-
-func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
- var value IPMreq
- vallen := _Socklen(SizeofIPMreq)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
- var value IPv6Mreq
- vallen := _Socklen(SizeofIPv6Mreq)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {
- var value IPv6MTUInfo
- vallen := _Socklen(SizeofIPv6MTUInfo)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {
- var value ICMPv6Filter
- vallen := _Socklen(SizeofICMPv6Filter)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
- return &value, err
-}
-
-func GetsockoptLinger(fd, level, opt int) (*Linger, error) {
- var linger Linger
- vallen := _Socklen(SizeofLinger)
- err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen)
- return &linger, err
-}
-
-func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) {
- var tv Timeval
- vallen := _Socklen(unsafe.Sizeof(tv))
- err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen)
- return &tv, err
-}
-
-func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
- var rsa RawSockaddrAny
- var len _Socklen = SizeofSockaddrAny
- if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil {
- return
- }
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
- return
-}
-
-func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
- ptr, n, err := to.sockaddr()
- if err != nil {
- return err
- }
- return sendto(fd, p, flags, ptr, n)
-}
-
-func SetsockoptByte(fd, level, opt int, value byte) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(&value), 1)
-}
-
-func SetsockoptInt(fd, level, opt int, value int) (err error) {
- var n = int32(value)
- return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4)
-}
-
-func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4)
-}
-
-func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq)
-}
-
-func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq)
-}
-
-func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error {
- return setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter)
-}
-
-func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger)
-}
-
-func SetsockoptString(fd, level, opt int, s string) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(&[]byte(s)[0]), uintptr(len(s)))
-}
-
-func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) {
- return setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv))
-}
-
-func Socket(domain, typ, proto int) (fd int, err error) {
- if domain == AF_INET6 && SocketDisableIPv6 {
- return -1, EAFNOSUPPORT
- }
- fd, err = socket(domain, typ, proto)
- return
-}
-
-func Socketpair(domain, typ, proto int) (fd [2]int, err error) {
- var fdx [2]int32
- err = socketpair(domain, typ, proto, &fdx)
- if err == nil {
- fd[0] = int(fdx[0])
- fd[1] = int(fdx[1])
- }
- return
-}
-
-var ioSync int64
-
-func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) }
-
-func SetNonblock(fd int, nonblocking bool) (err error) {
- flag, err := fcntl(fd, F_GETFL, 0)
- if err != nil {
- return err
- }
- if nonblocking {
- flag |= O_NONBLOCK
- } else {
- flag &= ^O_NONBLOCK
- }
- _, err = fcntl(fd, F_SETFL, flag)
- return err
-}
-
-// Exec calls execve(2), which replaces the calling executable in the process
-// tree. argv0 should be the full path to an executable ("/bin/ls") and the
-// executable name should also be the first argument in argv (["ls", "-l"]).
-// envv are the environment variables that should be passed to the new
-// process (["USER=go", "PWD=/tmp"]).
-func Exec(argv0 string, argv []string, envv []string) error {
- return syscall.Exec(argv0, argv, envv)
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
deleted file mode 100644
index 1c70d1b..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
+++ /dev/null
@@ -1,15 +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 darwin dragonfly freebsd linux netbsd openbsd solaris
-// +build !gccgo,!ppc64le,!ppc64
-
-package unix
-
-import "syscall"
-
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
-func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
-func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
-func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go
deleted file mode 100644
index 86dc765..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go
+++ /dev/null
@@ -1,24 +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 linux
-// +build ppc64le ppc64
-// +build !gccgo
-
-package unix
-
-import "syscall"
-
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return syscall.Syscall(trap, a1, a2, a3)
-}
-func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6)
-}
-func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return syscall.RawSyscall(trap, a1, a2, a3)
-}
-func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
-}
diff --git a/vendor/golang.org/x/sys/unix/timestruct.go b/vendor/golang.org/x/sys/unix/timestruct.go
deleted file mode 100644
index 4a672f5..0000000
--- a/vendor/golang.org/x/sys/unix/timestruct.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2017 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-import "time"
-
-// TimespecToNsec converts a Timespec value into a number of
-// nanoseconds since the Unix epoch.
-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
-
-// NsecToTimespec takes a number of nanoseconds since the Unix epoch
-// and returns the corresponding Timespec value.
-func NsecToTimespec(nsec int64) Timespec {
- sec := nsec / 1e9
- nsec = nsec % 1e9
- if nsec < 0 {
- nsec += 1e9
- sec--
- }
- return setTimespec(sec, nsec)
-}
-
-// TimeToTimespec converts t into a Timespec.
-// On some 32-bit systems the range of valid Timespec values are smaller
-// than that of time.Time values. So if t is out of the valid range of
-// Timespec, it returns a zero Timespec and ERANGE.
-func TimeToTimespec(t time.Time) (Timespec, error) {
- sec := t.Unix()
- nsec := int64(t.Nanosecond())
- ts := setTimespec(sec, nsec)
-
- // Currently all targets have either int32 or int64 for Timespec.Sec.
- // If there were a new target with floating point type for it, we have
- // to consider the rounding error.
- if int64(ts.Sec) != sec {
- return Timespec{}, ERANGE
- }
- return ts, nil
-}
-
-// TimevalToNsec converts a Timeval value into a number of nanoseconds
-// since the Unix epoch.
-func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
-
-// NsecToTimeval takes a number of nanoseconds since the Unix epoch
-// and returns the corresponding Timeval value.
-func NsecToTimeval(nsec int64) Timeval {
- nsec += 999 // round up to microsecond
- usec := nsec % 1e9 / 1e3
- sec := nsec / 1e9
- if usec < 0 {
- usec += 1e6
- sec--
- }
- return setTimeval(sec, usec)
-}
-
-// Unix returns ts as the number of seconds and nanoseconds elapsed since the
-// Unix epoch.
-func (ts *Timespec) Unix() (sec int64, nsec int64) {
- return int64(ts.Sec), int64(ts.Nsec)
-}
-
-// Unix returns tv as the number of seconds and nanoseconds elapsed since the
-// Unix epoch.
-func (tv *Timeval) Unix() (sec int64, nsec int64) {
- return int64(tv.Sec), int64(tv.Usec) * 1000
-}
-
-// Nano returns ts as the number of nanoseconds elapsed since the Unix epoch.
-func (ts *Timespec) Nano() int64 {
- return int64(ts.Sec)*1e9 + int64(ts.Nsec)
-}
-
-// Nano returns tv as the number of nanoseconds elapsed since the Unix epoch.
-func (tv *Timeval) Nano() int64 {
- return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
-}
diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go
deleted file mode 100644
index 25e8349..0000000
--- a/vendor/golang.org/x/sys/unix/types_aix.go
+++ /dev/null
@@ -1,236 +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
-// +build aix
-
-/*
-Input to cgo -godefs. See also mkerrors.sh and mkall.sh
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include