diff --git a/src/Docker.DotNet/Endpoints/ISwarmOperations.cs b/src/Docker.DotNet/Endpoints/ISwarmOperations.cs
index 877e2f18d..92eeb227a 100644
--- a/src/Docker.DotNet/Endpoints/ISwarmOperations.cs
+++ b/src/Docker.DotNet/Endpoints/ISwarmOperations.cs
@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Docker.DotNet.Models;
using System.Threading;
+using System.IO;
namespace Docker.DotNet
{
@@ -154,6 +155,37 @@ public interface ISwarmOperations
/// ID or name of service.
Task RemoveServiceAsync(string id, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get service logs.
+ ///
+ /// Get {stdout} and {stderr} logs from all service tasks.
+ /// Note: This endpoint works only for services with the {json-file} or {journald} logging driver.
+ ///
+ ///
+ /// docker service logs
+ ///
+ /// HTTP GET /services/(id)/logs
+ ///
+ /// 101 - Logs returned as a stream.
+ /// 200 - Logs returned as a string in response body.
+ /// 404 - No such service.
+ /// 500 - Server error.
+ /// 503 - Node is not part of a swarm.
+ ///
+ /// ID or name of the service.
+ Task GetServiceLogsAsync(string id, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Gets the stdout and stderr logs from all service tasks.
+ /// This endpoint works only for services with the json-file or journald logging driver.
+ ///
+ /// ID or name of the service.
+ /// If the service was created with a TTY or not. If , the returned stream is multiplexed.
+ /// The parameters used to retrieve the logs.
+ /// A token used to cancel this operation.
+ /// A stream with the retrieved logs. If the service wasn't created with a TTY, this stream is multiplexed.
+ Task GetServiceLogsAsync(string id, bool tty, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
+
#endregion Services
#region Nodes
@@ -207,4 +239,4 @@ public interface ISwarmOperations
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Docker.DotNet/Endpoints/SwarmOperations.cs b/src/Docker.DotNet/Endpoints/SwarmOperations.cs
index 13d1c819e..a9d95a75f 100644
--- a/src/Docker.DotNet/Endpoints/SwarmOperations.cs
+++ b/src/Docker.DotNet/Endpoints/SwarmOperations.cs
@@ -8,6 +8,7 @@ namespace Docker.DotNet
using System.Threading.Tasks;
using System.Threading;
using Models;
+ using System.IO;
internal class SwarmOperations : ISwarmOperations
{
@@ -156,6 +157,41 @@ async Task ISwarmOperations.UpdateServiceAsync(string id,
return this._client.JsonSerializer.DeserializeObject(response.Body);
}
+ public Task GetServiceLogsAsync(string id, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ throw new ArgumentNullException(nameof(id));
+ }
+
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ IQueryString queryParameters = new QueryString(parameters);
+ return this._client.MakeRequestForStreamAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"services/{id}/logs", queryParameters, cancellationToken);
+ }
+
+ public async Task GetServiceLogsAsync(string id, bool tty, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ throw new ArgumentNullException(nameof(id));
+ }
+
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ IQueryString queryParameters = new QueryString(parameters);
+
+ Stream result = await this._client.MakeRequestForStreamAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"services/{id}/logs", queryParameters, cancellationToken).ConfigureAwait(false);
+
+ return new MultiplexedStream(result, !tty);
+ }
+
async Task ISwarmOperations.UpdateSwarmAsync(SwarmUpdateParameters parameters, CancellationToken cancellationToken)
{
var query = new QueryString(parameters ?? throw new ArgumentNullException(nameof(parameters)));
diff --git a/src/Docker.DotNet/JsonSerializer.cs b/src/Docker.DotNet/JsonSerializer.cs
index 11f150934..f234b2d82 100644
--- a/src/Docker.DotNet/JsonSerializer.cs
+++ b/src/Docker.DotNet/JsonSerializer.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Docker.DotNet
@@ -35,4 +35,4 @@ public string SerializeObject(T value)
return JsonConvert.SerializeObject(value, this._settings);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs
index 5c8eb300c..8ac3c8e35 100644
--- a/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs
+++ b/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs
@@ -5,7 +5,7 @@ namespace Docker.DotNet.Models
[DataContract]
public class ContainerExecInspectResponse // (types.ContainerExecInspect)
{
- [DataMember(Name = "ExecID", EmitDefaultValue = false)]
+ [DataMember(Name = "ID", EmitDefaultValue = false)]
public string ExecID { get; set; }
[DataMember(Name = "ContainerID", EmitDefaultValue = false)]
diff --git a/src/Docker.DotNet/Models/ContainerSpec.Generated.cs b/src/Docker.DotNet/Models/ContainerSpec.Generated.cs
index 4a2f85f2c..96c9005e2 100644
--- a/src/Docker.DotNet/Models/ContainerSpec.Generated.cs
+++ b/src/Docker.DotNet/Models/ContainerSpec.Generated.cs
@@ -77,8 +77,5 @@ public class ContainerSpec // (swarm.ContainerSpec)
[DataMember(Name = "Sysctls", EmitDefaultValue = false)]
public IDictionary Sysctls { get; set; }
-
- [DataMember(Name = "Capabilities", EmitDefaultValue = false)]
- public IList Capabilities { get; set; }
}
}
diff --git a/src/Docker.DotNet/Models/HostConfig.Generated.cs b/src/Docker.DotNet/Models/HostConfig.Generated.cs
index 621c147de..13ccec74a 100644
--- a/src/Docker.DotNet/Models/HostConfig.Generated.cs
+++ b/src/Docker.DotNet/Models/HostConfig.Generated.cs
@@ -84,9 +84,6 @@ public HostConfig(Resources Resources)
[DataMember(Name = "Capabilities", EmitDefaultValue = false)]
public IList Capabilities { get; set; }
- [DataMember(Name = "CgroupnsMode", EmitDefaultValue = false)]
- public string CgroupnsMode { get; set; }
-
[DataMember(Name = "Dns", EmitDefaultValue = false)]
public IList DNS { get; set; }
diff --git a/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs b/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs
index a029838ca..444703c52 100644
--- a/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs
+++ b/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs
@@ -43,9 +43,6 @@ public class ImageInspectResponse // (types.ImageInspect)
[DataMember(Name = "Architecture", EmitDefaultValue = false)]
public string Architecture { get; set; }
- [DataMember(Name = "Variant", EmitDefaultValue = false)]
- public string Variant { get; set; }
-
[DataMember(Name = "Os", EmitDefaultValue = false)]
public string Os { get; set; }
diff --git a/src/Docker.DotNet/Models/PluginSpec.Generated.cs b/src/Docker.DotNet/Models/PluginSpec.Generated.cs
index 9f00d4ee7..a060529fa 100644
--- a/src/Docker.DotNet/Models/PluginSpec.Generated.cs
+++ b/src/Docker.DotNet/Models/PluginSpec.Generated.cs
@@ -17,8 +17,5 @@ public class PluginSpec // (runtime.PluginSpec)
[DataMember(Name = "disabled", EmitDefaultValue = false)]
public bool Disabled { get; set; }
-
- [DataMember(Name = "env", EmitDefaultValue = false)]
- public IList Env { get; set; }
}
}
diff --git a/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs b/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs
new file mode 100644
index 000000000..4dbe47cf4
--- /dev/null
+++ b/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs
@@ -0,0 +1,29 @@
+using System.Runtime.Serialization;
+
+namespace Docker.DotNet.Models
+{
+ [DataContract]
+ public class ServiceLogsParameters // (main.ServiceLogsParameters)
+ {
+ [QueryStringParameter("stdout", false, typeof(BoolQueryStringConverter))]
+ public bool? ShowStdout { get; set; }
+
+ [QueryStringParameter("stderr", false, typeof(BoolQueryStringConverter))]
+ public bool? ShowStderr { get; set; }
+
+ [QueryStringParameter("since", false)]
+ public string Since { get; set; }
+
+ [QueryStringParameter("timestamps", false, typeof(BoolQueryStringConverter))]
+ public bool? Timestamps { get; set; }
+
+ [QueryStringParameter("follow", false, typeof(BoolQueryStringConverter))]
+ public bool? Follow { get; set; }
+
+ [QueryStringParameter("tail", false)]
+ public string Tail { get; set; }
+
+ [QueryStringParameter("details", false, typeof(BoolQueryStringConverter))]
+ public bool? Details { get; set; }
+ }
+}
diff --git a/src/Docker.DotNet/Models/ServiceStatus.Generated.cs b/src/Docker.DotNet/Models/ServiceStatus.Generated.cs
deleted file mode 100644
index 76c3396e8..000000000
--- a/src/Docker.DotNet/Models/ServiceStatus.Generated.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace Docker.DotNet.Models
-{
- [DataContract]
- public class ServiceStatus // (swarm.ServiceStatus)
- {
- [DataMember(Name = "RunningTasks", EmitDefaultValue = false)]
- public ulong RunningTasks { get; set; }
-
- [DataMember(Name = "DesiredTasks", EmitDefaultValue = false)]
- public ulong DesiredTasks { get; set; }
- }
-}
diff --git a/src/Docker.DotNet/Models/SwarmService.Generated.cs b/src/Docker.DotNet/Models/SwarmService.Generated.cs
index 1d1178328..293b6bbe1 100644
--- a/src/Docker.DotNet/Models/SwarmService.Generated.cs
+++ b/src/Docker.DotNet/Models/SwarmService.Generated.cs
@@ -43,8 +43,5 @@ public SwarmService(Meta Meta)
[DataMember(Name = "UpdateStatus", EmitDefaultValue = false)]
public UpdateStatus UpdateStatus { get; set; }
-
- [DataMember(Name = "ServiceStatus", EmitDefaultValue = false)]
- public ServiceStatus ServiceStatus { get; set; }
}
}
diff --git a/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs b/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs
index 4d83370c1..893b13bb1 100644
--- a/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs
+++ b/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs
@@ -102,9 +102,6 @@ public class SystemInfoResponse // (types.Info)
[DataMember(Name = "OperatingSystem", EmitDefaultValue = false)]
public string OperatingSystem { get; set; }
- [DataMember(Name = "OSVersion", EmitDefaultValue = false)]
- public string OSVersion { get; set; }
-
[DataMember(Name = "OSType", EmitDefaultValue = false)]
public string OSType { get; set; }
diff --git a/tools/specgen/.gitignore b/tools/specgen/.gitignore
new file mode 100644
index 000000000..290f18fe1
--- /dev/null
+++ b/tools/specgen/.gitignore
@@ -0,0 +1,2 @@
+specgen.exe
+specgen
\ No newline at end of file
diff --git a/tools/specgen/Godeps/Godeps.json b/tools/specgen/Godeps/Godeps.json
deleted file mode 100644
index 0aaaeed14..000000000
--- a/tools/specgen/Godeps/Godeps.json
+++ /dev/null
@@ -1,139 +0,0 @@
-{
- "ImportPath": "github.com/Microsoft/Docker.DotNet/tools/specgen",
- "GoVersion": "go1.13",
- "GodepVersion": "v80",
- "Deps": [
- {
- "ImportPath": "github.com/Azure/go-ansiterm",
- "Rev": "388960b655244e76e24c75f48631564eaefade62"
- },
- {
- "ImportPath": "github.com/Azure/go-ansiterm/winterm",
- "Rev": "388960b655244e76e24c75f48631564eaefade62"
- },
- {
- "ImportPath": "github.com/Sirupsen/logrus",
- "Comment": "v0.11.0",
- "Rev": "d26492970760ca5d33129d2d799e34be5c4782eb"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/blkiodev",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/events",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/container",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/filters",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/mount",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/network",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/registry",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/strslice",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/swarm",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/api/types/versions",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/pkg/jsonlog",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/pkg/jsonmessage",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/pkg/term",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/pkg/term/windows",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/go-connections/nat",
- "Comment": "v0.2.1-12-g4ccf312",
- "Rev": "4ccf312bf1d35e5dbda654e57a9be4c3f3cd0366"
- },
- {
- "ImportPath": "github.com/docker/go-units",
- "Comment": "v0.3.1-8-g8a7beac",
- "Rev": "8a7beacffa3009a9ac66bad506b18ffdd110cf97"
- },
- {
- "ImportPath": "golang.org/x/sys/unix",
- "Rev": "62bee037599929a6e9146f29d10dd5208c43507d"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/github.com/docker/go-connections/nat",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/github.com/docker/go-units",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/github.com/Azure/go-ansiterm/winterm",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/github.com/Azure/go-ansiterm",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/github.com/Sirupsen/logrus",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- },
- {
- "ImportPath": "github.com/docker/docker/vendor/golang.org/x/sys/unix",
- "Comment": "v1.13.0",
- "Rev": "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
- }
- ]
-}
diff --git a/tools/specgen/Godeps/Readme b/tools/specgen/Godeps/Readme
deleted file mode 100644
index 4cdaa53d5..000000000
--- a/tools/specgen/Godeps/Readme
+++ /dev/null
@@ -1,5 +0,0 @@
-This directory tree is generated automatically by godep.
-
-Please do not edit.
-
-See https://github.com/tools/godep for more information.
diff --git a/tools/specgen/README.md b/tools/specgen/README.md
index e2b79a8b3..f975384df 100644
--- a/tools/specgen/README.md
+++ b/tools/specgen/README.md
@@ -6,15 +6,14 @@ A tool that reflects the Docker client [engine-api](https://github.com/docker/en
##How to use:
-This tool relies on [GoDep](https://github.com/tools/godep), a tool used to manage which git hash's were used at which time to generate the corresponding models.
-
To update the source repositories please use the following from your `$GOPATH`:
```
-> go get -u foo/bar
-> godep update foo/bar
+> go get -u github.com/docker/docker@
```
+Note: Since the docker library is not a go module the version go generates will look something like this v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible even though this is for v19.03.13. The commit hash bd33bbf0497b matches the commit hash of docker v 19.03.13
+
Once you have the latest engine-api. Calling:
```
diff --git a/tools/specgen/go.mod b/tools/specgen/go.mod
new file mode 100644
index 000000000..9c2cf4f8e
--- /dev/null
+++ b/tools/specgen/go.mod
@@ -0,0 +1,19 @@
+module github.com/dotnet/Docker.DotNet/tools/specgen
+
+go 1.15
+
+require (
+ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
+ github.com/containerd/containerd v1.4.1 // indirect
+ github.com/docker/distribution v2.7.1+incompatible // indirect
+ github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible
+ github.com/docker/go-connections v0.4.0 // indirect
+ github.com/docker/go-units v0.4.0
+ github.com/gogo/protobuf v1.3.1 // indirect
+ github.com/morikuni/aec v1.0.0 // indirect
+ github.com/opencontainers/go-digest v1.0.0 // indirect
+ github.com/opencontainers/image-spec v1.0.1 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/sirupsen/logrus v1.7.0 // indirect
+ google.golang.org/grpc v1.33.0 // indirect
+)
diff --git a/tools/specgen/go.sum b/tools/specgen/go.sum
new file mode 100644
index 000000000..5874fcf3a
--- /dev/null
+++ b/tools/specgen/go.sum
@@ -0,0 +1,83 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
+github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY=
+github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
+github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
+github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible h1:SiUATuP//KecDjpOK2tvZJgeScYAklvyjfK8JZlU6fo=
+github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
+github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
+github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
+github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
+github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
+github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
+github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
+github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
+github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
+github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg=
+google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/tools/specgen/modeldefs.go b/tools/specgen/modeldefs.go
index c11e4cd29..3199ff173 100644
--- a/tools/specgen/modeldefs.go
+++ b/tools/specgen/modeldefs.go
@@ -228,8 +228,8 @@ type ImagesSearchParameters struct {
// ImageDeleteParameters for DELETE /images/(id)
type ImageDeleteParameters struct {
- Force bool `rest:"query"`
- NoPrune bool `rest:"query,noprune"`
+ Force bool `rest:"query"`
+ NoPrune bool `rest:"query,noprune"`
}
// ImageInspectParameters for GET /images/(id)/json
@@ -373,6 +373,17 @@ type ServiceUpdateParameters struct {
RegistryAuth types.AuthConfig `rest:"headers,X-Registry-Auth"`
}
+// ServiceLogsParameters for POST /services/(id)/logs
+type ServiceLogsParameters struct {
+ ShowStdout bool `rest:"query,stdout"`
+ ShowStderr bool `rest:"query,stderr"`
+ Since string `rest:"query"`
+ Timestamps bool `rest:"query"`
+ Follow bool `rest:"query"`
+ Tail string `rest:"query"`
+ Details bool `rest:"query"`
+}
+
// SecretCreateResponse for POST /secrets/create
type SecretCreateResponse struct {
ID string
@@ -380,5 +391,5 @@ type SecretCreateResponse struct {
// TasksListParameters for GET /tasks
type TasksListParameters struct {
- Filters Args `rest:"query"`
-}
\ No newline at end of file
+ Filters Args `rest:"query"`
+}
diff --git a/tools/specgen/specgen.go b/tools/specgen/specgen.go
index 1004adaa6..3f7a25275 100644
--- a/tools/specgen/specgen.go
+++ b/tools/specgen/specgen.go
@@ -70,10 +70,10 @@ var typesToDisambiguate = map[string]*CSModelType{
},
},
},
- typeToKey(reflect.TypeOf(network.Task{})): {Name: "NetworkTask"},
+ typeToKey(reflect.TypeOf(network.Task{})): {Name: "NetworkTask"},
typeToKey(reflect.TypeOf(registry.AuthenticateOKBody{})): {Name: "AuthResponse"},
typeToKey(reflect.TypeOf(registry.SearchResult{})): {Name: "ImageSearchResponse"},
- typeToKey(reflect.TypeOf(runtime.PluginPrivilege{})): {Name: "RuntimePluginPrivilege"},
+ typeToKey(reflect.TypeOf(runtime.PluginPrivilege{})): {Name: "RuntimePluginPrivilege"},
typeToKey(reflect.TypeOf(swarm.Driver{})): {Name: "SwarmDriver"},
typeToKey(reflect.TypeOf(swarm.InitRequest{})): {Name: "SwarmInitParameters"},
typeToKey(reflect.TypeOf(swarm.JoinRequest{})): {Name: "SwarmJoinParameters"},
@@ -95,15 +95,15 @@ var typesToDisambiguate = map[string]*CSModelType{
CSProperty{Name: "State", Type: CSType{"", "TaskState", false}},
},
},
- typeToKey(reflect.TypeOf(swarm.UpdateConfig{})): {Name: "SwarmUpdateConfig"},
- typeToKey(reflect.TypeOf(swarm.ConfigReference{})): {Name: "SwarmConfigReference"},
+ typeToKey(reflect.TypeOf(swarm.UpdateConfig{})): {Name: "SwarmUpdateConfig"},
+ typeToKey(reflect.TypeOf(swarm.ConfigReference{})): {Name: "SwarmConfigReference"},
typeToKey(reflect.TypeOf(types.Container{})): {
Name: "ContainerListResponse",
Properties: []CSProperty{
CSProperty{Name: "Created", Type: CSType{"System", "DateTime", false}},
},
},
- typeToKey(reflect.TypeOf(container.ContainerChangeResponseItem {})): {
+ typeToKey(reflect.TypeOf(container.ContainerChangeResponseItem{})): {
Name: "ContainerFileSystemChangeResponse",
Properties: []CSProperty{
CSProperty{Name: "Kind", Type: CSType{"", "FileSystemChangeKind", false}},
@@ -116,10 +116,10 @@ var typesToDisambiguate = map[string]*CSModelType{
CSProperty{Name: "Created", Type: CSType{"System", "DateTime", false}},
},
},
- typeToKey(reflect.TypeOf(types.ContainerPathStat{})): {Name: "ContainerPathStatResponse"},
+ typeToKey(reflect.TypeOf(types.ContainerPathStat{})): {Name: "ContainerPathStatResponse"},
typeToKey(reflect.TypeOf(container.ContainerTopOKBody{})): {Name: "ContainerProcessesResponse"},
- typeToKey(reflect.TypeOf(types.ContainersPruneReport{})): {Name: "ContainersPruneResponse"},
- typeToKey(reflect.TypeOf(types.ImageDeleteResponseItem{})): {Name: "ImageDeleteResponse"},
+ typeToKey(reflect.TypeOf(types.ContainersPruneReport{})): {Name: "ContainersPruneResponse"},
+ typeToKey(reflect.TypeOf(types.ImageDeleteResponseItem{})): {Name: "ImageDeleteResponse"},
typeToKey(reflect.TypeOf(image.HistoryResponseItem{})): {
Name: "ImageHistoryResponse",
Properties: []CSProperty{
@@ -198,7 +198,7 @@ var dockerTypesToReflect = []reflect.Type{
// POST /containers/(id)/attach/ws
// GET /containers/(id)/changes
- reflect.TypeOf(container.ContainerChangeResponseItem {}),
+ reflect.TypeOf(container.ContainerChangeResponseItem{}),
// OBSOLETE - POST /containers/(id)/copy
@@ -243,7 +243,7 @@ var dockerTypesToReflect = []reflect.Type{
// GET /containers/(id)/top
reflect.TypeOf(ContainerListProcessesParameters{}),
- reflect.TypeOf(container.ContainerTopOKBody {}),
+ reflect.TypeOf(container.ContainerTopOKBody{}),
// POST /containers/(id)/unpause
@@ -438,6 +438,9 @@ var dockerTypesToReflect = []reflect.Type{
// DELETE /services/(id)
+ // GET /services/(id)/logs
+ reflect.TypeOf(ServiceLogsParameters{}),
+
// GET /tasks
reflect.TypeOf(TasksListParameters{}),
reflect.TypeOf(swarm.Task{}),
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/LICENSE b/tools/specgen/vendor/github.com/Azure/go-ansiterm/LICENSE
deleted file mode 100644
index c30d9afe5..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) .NET Foundation and Contributors
-
-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/tools/specgen/vendor/github.com/Azure/go-ansiterm/README.md b/tools/specgen/vendor/github.com/Azure/go-ansiterm/README.md
deleted file mode 100644
index e25e38210..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# go-ansiterm
-
-This is a cross platform Ansi Terminal Emulation library. It reads a stream of Ansi characters and produces the appropriate function calls. The results of the function calls are platform dependent.
-
-For example the parser might receive "ESC, [, A" as a stream of three characters. This is the code for Cursor Up (http://www.vt100.net/docs/vt510-rm/CUU). The parser then calls the cursor up function (CUU()) on an event handler. The event handler determines what platform specific work must be done to cause the cursor to move up one position.
-
-The parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png). There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go).
-
-See parser_test.go for examples exercising the state machine and generating appropriate function calls.
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/constants.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/constants.go
deleted file mode 100644
index 96504a33b..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/constants.go
+++ /dev/null
@@ -1,188 +0,0 @@
-package ansiterm
-
-const LogEnv = "DEBUG_TERMINAL"
-
-// ANSI constants
-// References:
-// -- http://www.ecma-international.org/publications/standards/Ecma-048.htm
-// -- http://man7.org/linux/man-pages/man4/console_codes.4.html
-// -- http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html
-// -- http://en.wikipedia.org/wiki/ANSI_escape_code
-// -- http://vt100.net/emu/dec_ansi_parser
-// -- http://vt100.net/emu/vt500_parser.svg
-// -- http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
-// -- http://www.inwap.com/pdp10/ansicode.txt
-const (
- // ECMA-48 Set Graphics Rendition
- // Note:
- // -- Constants leading with an underscore (e.g., _ANSI_xxx) are unsupported or reserved
- // -- Fonts could possibly be supported via SetCurrentConsoleFontEx
- // -- Windows does not expose the per-window cursor (i.e., caret) blink times
- ANSI_SGR_RESET = 0
- ANSI_SGR_BOLD = 1
- ANSI_SGR_DIM = 2
- _ANSI_SGR_ITALIC = 3
- ANSI_SGR_UNDERLINE = 4
- _ANSI_SGR_BLINKSLOW = 5
- _ANSI_SGR_BLINKFAST = 6
- ANSI_SGR_REVERSE = 7
- _ANSI_SGR_INVISIBLE = 8
- _ANSI_SGR_LINETHROUGH = 9
- _ANSI_SGR_FONT_00 = 10
- _ANSI_SGR_FONT_01 = 11
- _ANSI_SGR_FONT_02 = 12
- _ANSI_SGR_FONT_03 = 13
- _ANSI_SGR_FONT_04 = 14
- _ANSI_SGR_FONT_05 = 15
- _ANSI_SGR_FONT_06 = 16
- _ANSI_SGR_FONT_07 = 17
- _ANSI_SGR_FONT_08 = 18
- _ANSI_SGR_FONT_09 = 19
- _ANSI_SGR_FONT_10 = 20
- _ANSI_SGR_DOUBLEUNDERLINE = 21
- ANSI_SGR_BOLD_DIM_OFF = 22
- _ANSI_SGR_ITALIC_OFF = 23
- ANSI_SGR_UNDERLINE_OFF = 24
- _ANSI_SGR_BLINK_OFF = 25
- _ANSI_SGR_RESERVED_00 = 26
- ANSI_SGR_REVERSE_OFF = 27
- _ANSI_SGR_INVISIBLE_OFF = 28
- _ANSI_SGR_LINETHROUGH_OFF = 29
- ANSI_SGR_FOREGROUND_BLACK = 30
- ANSI_SGR_FOREGROUND_RED = 31
- ANSI_SGR_FOREGROUND_GREEN = 32
- ANSI_SGR_FOREGROUND_YELLOW = 33
- ANSI_SGR_FOREGROUND_BLUE = 34
- ANSI_SGR_FOREGROUND_MAGENTA = 35
- ANSI_SGR_FOREGROUND_CYAN = 36
- ANSI_SGR_FOREGROUND_WHITE = 37
- _ANSI_SGR_RESERVED_01 = 38
- ANSI_SGR_FOREGROUND_DEFAULT = 39
- ANSI_SGR_BACKGROUND_BLACK = 40
- ANSI_SGR_BACKGROUND_RED = 41
- ANSI_SGR_BACKGROUND_GREEN = 42
- ANSI_SGR_BACKGROUND_YELLOW = 43
- ANSI_SGR_BACKGROUND_BLUE = 44
- ANSI_SGR_BACKGROUND_MAGENTA = 45
- ANSI_SGR_BACKGROUND_CYAN = 46
- ANSI_SGR_BACKGROUND_WHITE = 47
- _ANSI_SGR_RESERVED_02 = 48
- ANSI_SGR_BACKGROUND_DEFAULT = 49
- // 50 - 65: Unsupported
-
- ANSI_MAX_CMD_LENGTH = 4096
-
- MAX_INPUT_EVENTS = 128
- DEFAULT_WIDTH = 80
- DEFAULT_HEIGHT = 24
-
- ANSI_BEL = 0x07
- ANSI_BACKSPACE = 0x08
- ANSI_TAB = 0x09
- ANSI_LINE_FEED = 0x0A
- ANSI_VERTICAL_TAB = 0x0B
- ANSI_FORM_FEED = 0x0C
- ANSI_CARRIAGE_RETURN = 0x0D
- ANSI_ESCAPE_PRIMARY = 0x1B
- ANSI_ESCAPE_SECONDARY = 0x5B
- ANSI_OSC_STRING_ENTRY = 0x5D
- ANSI_COMMAND_FIRST = 0x40
- ANSI_COMMAND_LAST = 0x7E
- DCS_ENTRY = 0x90
- CSI_ENTRY = 0x9B
- OSC_STRING = 0x9D
- ANSI_PARAMETER_SEP = ";"
- ANSI_CMD_G0 = '('
- ANSI_CMD_G1 = ')'
- ANSI_CMD_G2 = '*'
- ANSI_CMD_G3 = '+'
- ANSI_CMD_DECPNM = '>'
- ANSI_CMD_DECPAM = '='
- ANSI_CMD_OSC = ']'
- ANSI_CMD_STR_TERM = '\\'
-
- KEY_CONTROL_PARAM_2 = ";2"
- KEY_CONTROL_PARAM_3 = ";3"
- KEY_CONTROL_PARAM_4 = ";4"
- KEY_CONTROL_PARAM_5 = ";5"
- KEY_CONTROL_PARAM_6 = ";6"
- KEY_CONTROL_PARAM_7 = ";7"
- KEY_CONTROL_PARAM_8 = ";8"
- KEY_ESC_CSI = "\x1B["
- KEY_ESC_N = "\x1BN"
- KEY_ESC_O = "\x1BO"
-
- FILL_CHARACTER = ' '
-)
-
-func getByteRange(start byte, end byte) []byte {
- bytes := make([]byte, 0, 32)
- for i := start; i <= end; i++ {
- bytes = append(bytes, byte(i))
- }
-
- return bytes
-}
-
-var toGroundBytes = getToGroundBytes()
-var executors = getExecuteBytes()
-
-// SPACE 20+A0 hex Always and everywhere a blank space
-// Intermediate 20-2F hex !"#$%&'()*+,-./
-var intermeds = getByteRange(0x20, 0x2F)
-
-// Parameters 30-3F hex 0123456789:;<=>?
-// CSI Parameters 30-39, 3B hex 0123456789;
-var csiParams = getByteRange(0x30, 0x3F)
-
-var csiCollectables = append(getByteRange(0x30, 0x39), getByteRange(0x3B, 0x3F)...)
-
-// Uppercase 40-5F hex @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
-var upperCase = getByteRange(0x40, 0x5F)
-
-// Lowercase 60-7E hex `abcdefghijlkmnopqrstuvwxyz{|}~
-var lowerCase = getByteRange(0x60, 0x7E)
-
-// Alphabetics 40-7E hex (all of upper and lower case)
-var alphabetics = append(upperCase, lowerCase...)
-
-var printables = getByteRange(0x20, 0x7F)
-
-var escapeIntermediateToGroundBytes = getByteRange(0x30, 0x7E)
-var escapeToGroundBytes = getEscapeToGroundBytes()
-
-// See http://www.vt100.net/emu/vt500_parser.png for description of the complex
-// byte ranges below
-
-func getEscapeToGroundBytes() []byte {
- escapeToGroundBytes := getByteRange(0x30, 0x4F)
- escapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x51, 0x57)...)
- escapeToGroundBytes = append(escapeToGroundBytes, 0x59)
- escapeToGroundBytes = append(escapeToGroundBytes, 0x5A)
- escapeToGroundBytes = append(escapeToGroundBytes, 0x5C)
- escapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x60, 0x7E)...)
- return escapeToGroundBytes
-}
-
-func getExecuteBytes() []byte {
- executeBytes := getByteRange(0x00, 0x17)
- executeBytes = append(executeBytes, 0x19)
- executeBytes = append(executeBytes, getByteRange(0x1C, 0x1F)...)
- return executeBytes
-}
-
-func getToGroundBytes() []byte {
- groundBytes := []byte{0x18}
- groundBytes = append(groundBytes, 0x1A)
- groundBytes = append(groundBytes, getByteRange(0x80, 0x8F)...)
- groundBytes = append(groundBytes, getByteRange(0x91, 0x97)...)
- groundBytes = append(groundBytes, 0x99)
- groundBytes = append(groundBytes, 0x9A)
- groundBytes = append(groundBytes, 0x9C)
- return groundBytes
-}
-
-// Delete 7F hex Always and everywhere ignored
-// C1 Control 80-9F hex 32 additional control characters
-// G1 Displayable A1-FE hex 94 additional displayable characters
-// Special A0+FF hex Same as SPACE and DELETE
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/context.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/context.go
deleted file mode 100644
index 8d66e777c..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/context.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package ansiterm
-
-type ansiContext struct {
- currentChar byte
- paramBuffer []byte
- interBuffer []byte
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go
deleted file mode 100644
index 1bd6057da..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package ansiterm
-
-type csiEntryState struct {
- baseState
-}
-
-func (csiState csiEntryState) Handle(b byte) (s state, e error) {
- logger.Infof("CsiEntry::Handle %#x", b)
-
- nextState, err := csiState.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case sliceContains(alphabetics, b):
- return csiState.parser.ground, nil
- case sliceContains(csiCollectables, b):
- return csiState.parser.csiParam, nil
- case sliceContains(executors, b):
- return csiState, csiState.parser.execute()
- }
-
- return csiState, nil
-}
-
-func (csiState csiEntryState) Transition(s state) error {
- logger.Infof("CsiEntry::Transition %s --> %s", csiState.Name(), s.Name())
- csiState.baseState.Transition(s)
-
- switch s {
- case csiState.parser.ground:
- return csiState.parser.csiDispatch()
- case csiState.parser.csiParam:
- switch {
- case sliceContains(csiParams, csiState.parser.context.currentChar):
- csiState.parser.collectParam()
- case sliceContains(intermeds, csiState.parser.context.currentChar):
- csiState.parser.collectInter()
- }
- }
-
- return nil
-}
-
-func (csiState csiEntryState) Enter() error {
- csiState.parser.clear()
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_param_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_param_state.go
deleted file mode 100644
index 4be35c5fd..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/csi_param_state.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package ansiterm
-
-type csiParamState struct {
- baseState
-}
-
-func (csiState csiParamState) Handle(b byte) (s state, e error) {
- logger.Infof("CsiParam::Handle %#x", b)
-
- nextState, err := csiState.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case sliceContains(alphabetics, b):
- return csiState.parser.ground, nil
- case sliceContains(csiCollectables, b):
- csiState.parser.collectParam()
- return csiState, nil
- case sliceContains(executors, b):
- return csiState, csiState.parser.execute()
- }
-
- return csiState, nil
-}
-
-func (csiState csiParamState) Transition(s state) error {
- logger.Infof("CsiParam::Transition %s --> %s", csiState.Name(), s.Name())
- csiState.baseState.Transition(s)
-
- switch s {
- case csiState.parser.ground:
- return csiState.parser.csiDispatch()
- }
-
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go
deleted file mode 100644
index 2189eb6b6..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package ansiterm
-
-type escapeIntermediateState struct {
- baseState
-}
-
-func (escState escapeIntermediateState) Handle(b byte) (s state, e error) {
- logger.Infof("escapeIntermediateState::Handle %#x", b)
- nextState, err := escState.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case sliceContains(intermeds, b):
- return escState, escState.parser.collectInter()
- case sliceContains(executors, b):
- return escState, escState.parser.execute()
- case sliceContains(escapeIntermediateToGroundBytes, b):
- return escState.parser.ground, nil
- }
-
- return escState, nil
-}
-
-func (escState escapeIntermediateState) Transition(s state) error {
- logger.Infof("escapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name())
- escState.baseState.Transition(s)
-
- switch s {
- case escState.parser.ground:
- return escState.parser.escDispatch()
- }
-
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_state.go
deleted file mode 100644
index 7b1b9ad3f..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/escape_state.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package ansiterm
-
-type escapeState struct {
- baseState
-}
-
-func (escState escapeState) Handle(b byte) (s state, e error) {
- logger.Infof("escapeState::Handle %#x", b)
- nextState, err := escState.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case b == ANSI_ESCAPE_SECONDARY:
- return escState.parser.csiEntry, nil
- case b == ANSI_OSC_STRING_ENTRY:
- return escState.parser.oscString, nil
- case sliceContains(executors, b):
- return escState, escState.parser.execute()
- case sliceContains(escapeToGroundBytes, b):
- return escState.parser.ground, nil
- case sliceContains(intermeds, b):
- return escState.parser.escapeIntermediate, nil
- }
-
- return escState, nil
-}
-
-func (escState escapeState) Transition(s state) error {
- logger.Infof("Escape::Transition %s --> %s", escState.Name(), s.Name())
- escState.baseState.Transition(s)
-
- switch s {
- case escState.parser.ground:
- return escState.parser.escDispatch()
- case escState.parser.escapeIntermediate:
- return escState.parser.collectInter()
- }
-
- return nil
-}
-
-func (escState escapeState) Enter() error {
- escState.parser.clear()
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/event_handler.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/event_handler.go
deleted file mode 100644
index 98087b38c..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/event_handler.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package ansiterm
-
-type AnsiEventHandler interface {
- // Print
- Print(b byte) error
-
- // Execute C0 commands
- Execute(b byte) error
-
- // CUrsor Up
- CUU(int) error
-
- // CUrsor Down
- CUD(int) error
-
- // CUrsor Forward
- CUF(int) error
-
- // CUrsor Backward
- CUB(int) error
-
- // Cursor to Next Line
- CNL(int) error
-
- // Cursor to Previous Line
- CPL(int) error
-
- // Cursor Horizontal position Absolute
- CHA(int) error
-
- // Vertical line Position Absolute
- VPA(int) error
-
- // CUrsor Position
- CUP(int, int) error
-
- // Horizontal and Vertical Position (depends on PUM)
- HVP(int, int) error
-
- // Text Cursor Enable Mode
- DECTCEM(bool) error
-
- // Origin Mode
- DECOM(bool) error
-
- // 132 Column Mode
- DECCOLM(bool) error
-
- // Erase in Display
- ED(int) error
-
- // Erase in Line
- EL(int) error
-
- // Insert Line
- IL(int) error
-
- // Delete Line
- DL(int) error
-
- // Insert Character
- ICH(int) error
-
- // Delete Character
- DCH(int) error
-
- // Set Graphics Rendition
- SGR([]int) error
-
- // Pan Down
- SU(int) error
-
- // Pan Up
- SD(int) error
-
- // Device Attributes
- DA([]string) error
-
- // Set Top and Bottom Margins
- DECSTBM(int, int) error
-
- // Index
- IND() error
-
- // Reverse Index
- RI() error
-
- // Flush updates from previous commands
- Flush() error
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/ground_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/ground_state.go
deleted file mode 100644
index 52451e946..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/ground_state.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package ansiterm
-
-type groundState struct {
- baseState
-}
-
-func (gs groundState) Handle(b byte) (s state, e error) {
- gs.parser.context.currentChar = b
-
- nextState, err := gs.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case sliceContains(printables, b):
- return gs, gs.parser.print()
-
- case sliceContains(executors, b):
- return gs, gs.parser.execute()
- }
-
- return gs, nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/osc_string_state.go
deleted file mode 100644
index 24062d420..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/osc_string_state.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package ansiterm
-
-type oscStringState struct {
- baseState
-}
-
-func (oscState oscStringState) Handle(b byte) (s state, e error) {
- logger.Infof("OscString::Handle %#x", b)
- nextState, err := oscState.baseState.Handle(b)
- if nextState != nil || err != nil {
- return nextState, err
- }
-
- switch {
- case isOscStringTerminator(b):
- return oscState.parser.ground, nil
- }
-
- return oscState, nil
-}
-
-// See below for OSC string terminators for linux
-// http://man7.org/linux/man-pages/man4/console_codes.4.html
-func isOscStringTerminator(b byte) bool {
-
- if b == ANSI_BEL || b == 0x5C {
- return true
- }
-
- return false
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser.go
deleted file mode 100644
index 169f68dbe..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser.go
+++ /dev/null
@@ -1,136 +0,0 @@
-package ansiterm
-
-import (
- "errors"
- "io/ioutil"
- "os"
-
- "github.com/Sirupsen/logrus"
-)
-
-var logger *logrus.Logger
-
-type AnsiParser struct {
- currState state
- eventHandler AnsiEventHandler
- context *ansiContext
- csiEntry state
- csiParam state
- dcsEntry state
- escape state
- escapeIntermediate state
- error state
- ground state
- oscString state
- stateMap []state
-}
-
-func CreateParser(initialState string, evtHandler AnsiEventHandler) *AnsiParser {
- logFile := ioutil.Discard
-
- if isDebugEnv := os.Getenv(LogEnv); isDebugEnv == "1" {
- logFile, _ = os.Create("ansiParser.log")
- }
-
- logger = &logrus.Logger{
- Out: logFile,
- Formatter: new(logrus.TextFormatter),
- Level: logrus.InfoLevel,
- }
-
- parser := &AnsiParser{
- eventHandler: evtHandler,
- context: &ansiContext{},
- }
-
- parser.csiEntry = csiEntryState{baseState{name: "CsiEntry", parser: parser}}
- parser.csiParam = csiParamState{baseState{name: "CsiParam", parser: parser}}
- parser.dcsEntry = dcsEntryState{baseState{name: "DcsEntry", parser: parser}}
- parser.escape = escapeState{baseState{name: "Escape", parser: parser}}
- parser.escapeIntermediate = escapeIntermediateState{baseState{name: "EscapeIntermediate", parser: parser}}
- parser.error = errorState{baseState{name: "Error", parser: parser}}
- parser.ground = groundState{baseState{name: "Ground", parser: parser}}
- parser.oscString = oscStringState{baseState{name: "OscString", parser: parser}}
-
- parser.stateMap = []state{
- parser.csiEntry,
- parser.csiParam,
- parser.dcsEntry,
- parser.escape,
- parser.escapeIntermediate,
- parser.error,
- parser.ground,
- parser.oscString,
- }
-
- parser.currState = getState(initialState, parser.stateMap)
-
- logger.Infof("CreateParser: parser %p", parser)
- return parser
-}
-
-func getState(name string, states []state) state {
- for _, el := range states {
- if el.Name() == name {
- return el
- }
- }
-
- return nil
-}
-
-func (ap *AnsiParser) Parse(bytes []byte) (int, error) {
- for i, b := range bytes {
- if err := ap.handle(b); err != nil {
- return i, err
- }
- }
-
- return len(bytes), ap.eventHandler.Flush()
-}
-
-func (ap *AnsiParser) handle(b byte) error {
- ap.context.currentChar = b
- newState, err := ap.currState.Handle(b)
- if err != nil {
- return err
- }
-
- if newState == nil {
- logger.Warning("newState is nil")
- return errors.New("New state of 'nil' is invalid.")
- }
-
- if newState != ap.currState {
- if err := ap.changeState(newState); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func (ap *AnsiParser) changeState(newState state) error {
- logger.Infof("ChangeState %s --> %s", ap.currState.Name(), newState.Name())
-
- // Exit old state
- if err := ap.currState.Exit(); err != nil {
- logger.Infof("Exit state '%s' failed with : '%v'", ap.currState.Name(), err)
- return err
- }
-
- // Perform transition action
- if err := ap.currState.Transition(newState); err != nil {
- logger.Infof("Transition from '%s' to '%s' failed with: '%v'", ap.currState.Name(), newState.Name, err)
- return err
- }
-
- // Enter new state
- if err := newState.Enter(); err != nil {
- logger.Infof("Enter state '%s' failed with: '%v'", newState.Name(), err)
- return err
- }
-
- ap.currState = newState
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go
deleted file mode 100644
index 8b69a67a5..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package ansiterm
-
-import (
- "strconv"
-)
-
-func parseParams(bytes []byte) ([]string, error) {
- paramBuff := make([]byte, 0, 0)
- params := []string{}
-
- for _, v := range bytes {
- if v == ';' {
- if len(paramBuff) > 0 {
- // Completed parameter, append it to the list
- s := string(paramBuff)
- params = append(params, s)
- paramBuff = make([]byte, 0, 0)
- }
- } else {
- paramBuff = append(paramBuff, v)
- }
- }
-
- // Last parameter may not be terminated with ';'
- if len(paramBuff) > 0 {
- s := string(paramBuff)
- params = append(params, s)
- }
-
- logger.Infof("Parsed params: %v with length: %d", params, len(params))
- return params, nil
-}
-
-func parseCmd(context ansiContext) (string, error) {
- return string(context.currentChar), nil
-}
-
-func getInt(params []string, dflt int) int {
- i := getInts(params, 1, dflt)[0]
- logger.Infof("getInt: %v", i)
- return i
-}
-
-func getInts(params []string, minCount int, dflt int) []int {
- ints := []int{}
-
- for _, v := range params {
- i, _ := strconv.Atoi(v)
- // Zero is mapped to the default value in VT100.
- if i == 0 {
- i = dflt
- }
- ints = append(ints, i)
- }
-
- if len(ints) < minCount {
- remaining := minCount - len(ints)
- for i := 0; i < remaining; i++ {
- ints = append(ints, dflt)
- }
- }
-
- logger.Infof("getInts: %v", ints)
-
- return ints
-}
-
-func (ap *AnsiParser) modeDispatch(param string, set bool) error {
- switch param {
- case "?3":
- return ap.eventHandler.DECCOLM(set)
- case "?6":
- return ap.eventHandler.DECOM(set)
- case "?25":
- return ap.eventHandler.DECTCEM(set)
- }
- return nil
-}
-
-func (ap *AnsiParser) hDispatch(params []string) error {
- if len(params) == 1 {
- return ap.modeDispatch(params[0], true)
- }
-
- return nil
-}
-
-func (ap *AnsiParser) lDispatch(params []string) error {
- if len(params) == 1 {
- return ap.modeDispatch(params[0], false)
- }
-
- return nil
-}
-
-func getEraseParam(params []string) int {
- param := getInt(params, 0)
- if param < 0 || 3 < param {
- param = 0
- }
-
- return param
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_actions.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_actions.go
deleted file mode 100644
index 58750a2d2..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/parser_actions.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package ansiterm
-
-import (
- "fmt"
-)
-
-func (ap *AnsiParser) collectParam() error {
- currChar := ap.context.currentChar
- logger.Infof("collectParam %#x", currChar)
- ap.context.paramBuffer = append(ap.context.paramBuffer, currChar)
- return nil
-}
-
-func (ap *AnsiParser) collectInter() error {
- currChar := ap.context.currentChar
- logger.Infof("collectInter %#x", currChar)
- ap.context.paramBuffer = append(ap.context.interBuffer, currChar)
- return nil
-}
-
-func (ap *AnsiParser) escDispatch() error {
- cmd, _ := parseCmd(*ap.context)
- intermeds := ap.context.interBuffer
- logger.Infof("escDispatch currentChar: %#x", ap.context.currentChar)
- logger.Infof("escDispatch: %v(%v)", cmd, intermeds)
-
- switch cmd {
- case "D": // IND
- return ap.eventHandler.IND()
- case "E": // NEL, equivalent to CRLF
- err := ap.eventHandler.Execute(ANSI_CARRIAGE_RETURN)
- if err == nil {
- err = ap.eventHandler.Execute(ANSI_LINE_FEED)
- }
- return err
- case "M": // RI
- return ap.eventHandler.RI()
- }
-
- return nil
-}
-
-func (ap *AnsiParser) csiDispatch() error {
- cmd, _ := parseCmd(*ap.context)
- params, _ := parseParams(ap.context.paramBuffer)
-
- logger.Infof("csiDispatch: %v(%v)", cmd, params)
-
- switch cmd {
- case "@":
- return ap.eventHandler.ICH(getInt(params, 1))
- case "A":
- return ap.eventHandler.CUU(getInt(params, 1))
- case "B":
- return ap.eventHandler.CUD(getInt(params, 1))
- case "C":
- return ap.eventHandler.CUF(getInt(params, 1))
- case "D":
- return ap.eventHandler.CUB(getInt(params, 1))
- case "E":
- return ap.eventHandler.CNL(getInt(params, 1))
- case "F":
- return ap.eventHandler.CPL(getInt(params, 1))
- case "G":
- return ap.eventHandler.CHA(getInt(params, 1))
- case "H":
- ints := getInts(params, 2, 1)
- x, y := ints[0], ints[1]
- return ap.eventHandler.CUP(x, y)
- case "J":
- param := getEraseParam(params)
- return ap.eventHandler.ED(param)
- case "K":
- param := getEraseParam(params)
- return ap.eventHandler.EL(param)
- case "L":
- return ap.eventHandler.IL(getInt(params, 1))
- case "M":
- return ap.eventHandler.DL(getInt(params, 1))
- case "P":
- return ap.eventHandler.DCH(getInt(params, 1))
- case "S":
- return ap.eventHandler.SU(getInt(params, 1))
- case "T":
- return ap.eventHandler.SD(getInt(params, 1))
- case "c":
- return ap.eventHandler.DA(params)
- case "d":
- return ap.eventHandler.VPA(getInt(params, 1))
- case "f":
- ints := getInts(params, 2, 1)
- x, y := ints[0], ints[1]
- return ap.eventHandler.HVP(x, y)
- case "h":
- return ap.hDispatch(params)
- case "l":
- return ap.lDispatch(params)
- case "m":
- return ap.eventHandler.SGR(getInts(params, 1, 0))
- case "r":
- ints := getInts(params, 2, 1)
- top, bottom := ints[0], ints[1]
- return ap.eventHandler.DECSTBM(top, bottom)
- default:
- logger.Errorf(fmt.Sprintf("Unsupported CSI command: '%s', with full context: %v", cmd, ap.context))
- return nil
- }
-
-}
-
-func (ap *AnsiParser) print() error {
- return ap.eventHandler.Print(ap.context.currentChar)
-}
-
-func (ap *AnsiParser) clear() error {
- ap.context = &ansiContext{}
- return nil
-}
-
-func (ap *AnsiParser) execute() error {
- return ap.eventHandler.Execute(ap.context.currentChar)
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/states.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/states.go
deleted file mode 100644
index f2ea1fcd1..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/states.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package ansiterm
-
-type stateID int
-
-type state interface {
- Enter() error
- Exit() error
- Handle(byte) (state, error)
- Name() string
- Transition(state) error
-}
-
-type baseState struct {
- name string
- parser *AnsiParser
-}
-
-func (base baseState) Enter() error {
- return nil
-}
-
-func (base baseState) Exit() error {
- return nil
-}
-
-func (base baseState) Handle(b byte) (s state, e error) {
-
- switch {
- case b == CSI_ENTRY:
- return base.parser.csiEntry, nil
- case b == DCS_ENTRY:
- return base.parser.dcsEntry, nil
- case b == ANSI_ESCAPE_PRIMARY:
- return base.parser.escape, nil
- case b == OSC_STRING:
- return base.parser.oscString, nil
- case sliceContains(toGroundBytes, b):
- return base.parser.ground, nil
- }
-
- return nil, nil
-}
-
-func (base baseState) Name() string {
- return base.name
-}
-
-func (base baseState) Transition(s state) error {
- if s == base.parser.ground {
- execBytes := []byte{0x18}
- execBytes = append(execBytes, 0x1A)
- execBytes = append(execBytes, getByteRange(0x80, 0x8F)...)
- execBytes = append(execBytes, getByteRange(0x91, 0x97)...)
- execBytes = append(execBytes, 0x99)
- execBytes = append(execBytes, 0x9A)
-
- if sliceContains(execBytes, base.parser.context.currentChar) {
- return base.parser.execute()
- }
- }
-
- return nil
-}
-
-type dcsEntryState struct {
- baseState
-}
-
-type errorState struct {
- baseState
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/utilities.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/utilities.go
deleted file mode 100644
index 392114493..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/utilities.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package ansiterm
-
-import (
- "strconv"
-)
-
-func sliceContains(bytes []byte, b byte) bool {
- for _, v := range bytes {
- if v == b {
- return true
- }
- }
-
- return false
-}
-
-func convertBytesToInteger(bytes []byte) int {
- s := string(bytes)
- i, _ := strconv.Atoi(s)
- return i
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go
deleted file mode 100644
index daf2f0696..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go
+++ /dev/null
@@ -1,182 +0,0 @@
-// +build windows
-
-package winterm
-
-import (
- "fmt"
- "os"
- "strconv"
- "strings"
- "syscall"
-
- "github.com/Azure/go-ansiterm"
-)
-
-// Windows keyboard constants
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx.
-const (
- VK_PRIOR = 0x21 // PAGE UP key
- VK_NEXT = 0x22 // PAGE DOWN key
- VK_END = 0x23 // END key
- VK_HOME = 0x24 // HOME key
- VK_LEFT = 0x25 // LEFT ARROW key
- VK_UP = 0x26 // UP ARROW key
- VK_RIGHT = 0x27 // RIGHT ARROW key
- VK_DOWN = 0x28 // DOWN ARROW key
- VK_SELECT = 0x29 // SELECT key
- VK_PRINT = 0x2A // PRINT key
- VK_EXECUTE = 0x2B // EXECUTE key
- VK_SNAPSHOT = 0x2C // PRINT SCREEN key
- VK_INSERT = 0x2D // INS key
- VK_DELETE = 0x2E // DEL key
- VK_HELP = 0x2F // HELP key
- VK_F1 = 0x70 // F1 key
- VK_F2 = 0x71 // F2 key
- VK_F3 = 0x72 // F3 key
- VK_F4 = 0x73 // F4 key
- VK_F5 = 0x74 // F5 key
- VK_F6 = 0x75 // F6 key
- VK_F7 = 0x76 // F7 key
- VK_F8 = 0x77 // F8 key
- VK_F9 = 0x78 // F9 key
- VK_F10 = 0x79 // F10 key
- VK_F11 = 0x7A // F11 key
- VK_F12 = 0x7B // F12 key
-
- RIGHT_ALT_PRESSED = 0x0001
- LEFT_ALT_PRESSED = 0x0002
- RIGHT_CTRL_PRESSED = 0x0004
- LEFT_CTRL_PRESSED = 0x0008
- SHIFT_PRESSED = 0x0010
- NUMLOCK_ON = 0x0020
- SCROLLLOCK_ON = 0x0040
- CAPSLOCK_ON = 0x0080
- ENHANCED_KEY = 0x0100
-)
-
-type ansiCommand struct {
- CommandBytes []byte
- Command string
- Parameters []string
- IsSpecial bool
-}
-
-func newAnsiCommand(command []byte) *ansiCommand {
-
- if isCharacterSelectionCmdChar(command[1]) {
- // Is Character Set Selection commands
- return &ansiCommand{
- CommandBytes: command,
- Command: string(command),
- IsSpecial: true,
- }
- }
-
- // last char is command character
- lastCharIndex := len(command) - 1
-
- ac := &ansiCommand{
- CommandBytes: command,
- Command: string(command[lastCharIndex]),
- IsSpecial: false,
- }
-
- // more than a single escape
- if lastCharIndex != 0 {
- start := 1
- // skip if double char escape sequence
- if command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_ESCAPE_SECONDARY {
- start++
- }
- // convert this to GetNextParam method
- ac.Parameters = strings.Split(string(command[start:lastCharIndex]), ansiterm.ANSI_PARAMETER_SEP)
- }
-
- return ac
-}
-
-func (ac *ansiCommand) paramAsSHORT(index int, defaultValue int16) int16 {
- if index < 0 || index >= len(ac.Parameters) {
- return defaultValue
- }
-
- param, err := strconv.ParseInt(ac.Parameters[index], 10, 16)
- if err != nil {
- return defaultValue
- }
-
- return int16(param)
-}
-
-func (ac *ansiCommand) String() string {
- return fmt.Sprintf("0x%v \"%v\" (\"%v\")",
- bytesToHex(ac.CommandBytes),
- ac.Command,
- strings.Join(ac.Parameters, "\",\""))
-}
-
-// isAnsiCommandChar returns true if the passed byte falls within the range of ANSI commands.
-// See http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html.
-func isAnsiCommandChar(b byte) bool {
- switch {
- case ansiterm.ANSI_COMMAND_FIRST <= b && b <= ansiterm.ANSI_COMMAND_LAST && b != ansiterm.ANSI_ESCAPE_SECONDARY:
- return true
- case b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_OSC || b == ansiterm.ANSI_CMD_DECPAM || b == ansiterm.ANSI_CMD_DECPNM:
- // non-CSI escape sequence terminator
- return true
- case b == ansiterm.ANSI_CMD_STR_TERM || b == ansiterm.ANSI_BEL:
- // String escape sequence terminator
- return true
- }
- return false
-}
-
-func isXtermOscSequence(command []byte, current byte) bool {
- return (len(command) >= 2 && command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_CMD_OSC && current != ansiterm.ANSI_BEL)
-}
-
-func isCharacterSelectionCmdChar(b byte) bool {
- return (b == ansiterm.ANSI_CMD_G0 || b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_G2 || b == ansiterm.ANSI_CMD_G3)
-}
-
-// bytesToHex converts a slice of bytes to a human-readable string.
-func bytesToHex(b []byte) string {
- hex := make([]string, len(b))
- for i, ch := range b {
- hex[i] = fmt.Sprintf("%X", ch)
- }
- return strings.Join(hex, "")
-}
-
-// ensureInRange adjusts the passed value, if necessary, to ensure it is within
-// the passed min / max range.
-func ensureInRange(n int16, min int16, max int16) int16 {
- if n < min {
- return min
- } else if n > max {
- return max
- } else {
- return n
- }
-}
-
-func GetStdFile(nFile int) (*os.File, uintptr) {
- var file *os.File
- switch nFile {
- case syscall.STD_INPUT_HANDLE:
- file = os.Stdin
- case syscall.STD_OUTPUT_HANDLE:
- file = os.Stdout
- case syscall.STD_ERROR_HANDLE:
- file = os.Stderr
- default:
- panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile))
- }
-
- fd, err := syscall.GetStdHandle(nFile)
- if err != nil {
- panic(fmt.Errorf("Invalid standard handle indentifier: %v -- %v", nFile, err))
- }
-
- return file, uintptr(fd)
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/api.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/api.go
deleted file mode 100644
index 462d92f8e..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/api.go
+++ /dev/null
@@ -1,322 +0,0 @@
-// +build windows
-
-package winterm
-
-import (
- "fmt"
- "syscall"
- "unsafe"
-)
-
-//===========================================================================================================
-// IMPORTANT NOTE:
-//
-// The methods below make extensive use of the "unsafe" package to obtain the required pointers.
-// Beginning in Go 1.3, the garbage collector may release local variables (e.g., incoming arguments, stack
-// variables) the pointers reference *before* the API completes.
-//
-// As a result, in those cases, the code must hint that the variables remain in active by invoking the
-// dummy method "use" (see below). Newer versions of Go are planned to change the mechanism to no longer
-// require unsafe pointers.
-//
-// If you add or modify methods, ENSURE protection of local variables through the "use" builtin to inform
-// the garbage collector the variables remain in use if:
-//
-// -- The value is not a pointer (e.g., int32, struct)
-// -- The value is not referenced by the method after passing the pointer to Windows
-//
-// See http://golang.org/doc/go1.3.
-//===========================================================================================================
-
-var (
- kernel32DLL = syscall.NewLazyDLL("kernel32.dll")
-
- getConsoleCursorInfoProc = kernel32DLL.NewProc("GetConsoleCursorInfo")
- setConsoleCursorInfoProc = kernel32DLL.NewProc("SetConsoleCursorInfo")
- setConsoleCursorPositionProc = kernel32DLL.NewProc("SetConsoleCursorPosition")
- setConsoleModeProc = kernel32DLL.NewProc("SetConsoleMode")
- getConsoleScreenBufferInfoProc = kernel32DLL.NewProc("GetConsoleScreenBufferInfo")
- setConsoleScreenBufferSizeProc = kernel32DLL.NewProc("SetConsoleScreenBufferSize")
- scrollConsoleScreenBufferProc = kernel32DLL.NewProc("ScrollConsoleScreenBufferA")
- setConsoleTextAttributeProc = kernel32DLL.NewProc("SetConsoleTextAttribute")
- setConsoleWindowInfoProc = kernel32DLL.NewProc("SetConsoleWindowInfo")
- writeConsoleOutputProc = kernel32DLL.NewProc("WriteConsoleOutputW")
- readConsoleInputProc = kernel32DLL.NewProc("ReadConsoleInputW")
- waitForSingleObjectProc = kernel32DLL.NewProc("WaitForSingleObject")
-)
-
-// Windows Console constants
-const (
- // Console modes
- // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx.
- ENABLE_PROCESSED_INPUT = 0x0001
- ENABLE_LINE_INPUT = 0x0002
- ENABLE_ECHO_INPUT = 0x0004
- ENABLE_WINDOW_INPUT = 0x0008
- ENABLE_MOUSE_INPUT = 0x0010
- ENABLE_INSERT_MODE = 0x0020
- ENABLE_QUICK_EDIT_MODE = 0x0040
- ENABLE_EXTENDED_FLAGS = 0x0080
-
- ENABLE_PROCESSED_OUTPUT = 0x0001
- ENABLE_WRAP_AT_EOL_OUTPUT = 0x0002
-
- // Character attributes
- // Note:
- // -- The attributes are combined to produce various colors (e.g., Blue + Green will create Cyan).
- // Clearing all foreground or background colors results in black; setting all creates white.
- // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes.
- FOREGROUND_BLUE uint16 = 0x0001
- FOREGROUND_GREEN uint16 = 0x0002
- FOREGROUND_RED uint16 = 0x0004
- FOREGROUND_INTENSITY uint16 = 0x0008
- FOREGROUND_MASK uint16 = 0x000F
-
- BACKGROUND_BLUE uint16 = 0x0010
- BACKGROUND_GREEN uint16 = 0x0020
- BACKGROUND_RED uint16 = 0x0040
- BACKGROUND_INTENSITY uint16 = 0x0080
- BACKGROUND_MASK uint16 = 0x00F0
-
- COMMON_LVB_MASK uint16 = 0xFF00
- COMMON_LVB_REVERSE_VIDEO uint16 = 0x4000
- COMMON_LVB_UNDERSCORE uint16 = 0x8000
-
- // Input event types
- // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx.
- KEY_EVENT = 0x0001
- MOUSE_EVENT = 0x0002
- WINDOW_BUFFER_SIZE_EVENT = 0x0004
- MENU_EVENT = 0x0008
- FOCUS_EVENT = 0x0010
-
- // WaitForSingleObject return codes
- WAIT_ABANDONED = 0x00000080
- WAIT_FAILED = 0xFFFFFFFF
- WAIT_SIGNALED = 0x0000000
- WAIT_TIMEOUT = 0x00000102
-
- // WaitForSingleObject wait duration
- WAIT_INFINITE = 0xFFFFFFFF
- WAIT_ONE_SECOND = 1000
- WAIT_HALF_SECOND = 500
- WAIT_QUARTER_SECOND = 250
-)
-
-// Windows API Console types
-// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682101(v=vs.85).aspx for Console specific types (e.g., COORD)
-// -- See https://msdn.microsoft.com/en-us/library/aa296569(v=vs.60).aspx for comments on alignment
-type (
- CHAR_INFO struct {
- UnicodeChar uint16
- Attributes uint16
- }
-
- CONSOLE_CURSOR_INFO struct {
- Size uint32
- Visible int32
- }
-
- CONSOLE_SCREEN_BUFFER_INFO struct {
- Size COORD
- CursorPosition COORD
- Attributes uint16
- Window SMALL_RECT
- MaximumWindowSize COORD
- }
-
- COORD struct {
- X int16
- Y int16
- }
-
- SMALL_RECT struct {
- Left int16
- Top int16
- Right int16
- Bottom int16
- }
-
- // INPUT_RECORD is a C/C++ union of which KEY_EVENT_RECORD is one case, it is also the largest
- // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx.
- INPUT_RECORD struct {
- EventType uint16
- KeyEvent KEY_EVENT_RECORD
- }
-
- KEY_EVENT_RECORD struct {
- KeyDown int32
- RepeatCount uint16
- VirtualKeyCode uint16
- VirtualScanCode uint16
- UnicodeChar uint16
- ControlKeyState uint32
- }
-
- WINDOW_BUFFER_SIZE struct {
- Size COORD
- }
-)
-
-// boolToBOOL converts a Go bool into a Windows int32.
-func boolToBOOL(f bool) int32 {
- if f {
- return int32(1)
- } else {
- return int32(0)
- }
-}
-
-// GetConsoleCursorInfo retrieves information about the size and visiblity of the console cursor.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683163(v=vs.85).aspx.
-func GetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error {
- r1, r2, err := getConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)
- return checkError(r1, r2, err)
-}
-
-// SetConsoleCursorInfo sets the size and visiblity of the console cursor.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx.
-func SetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error {
- r1, r2, err := setConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)
- return checkError(r1, r2, err)
-}
-
-// SetConsoleCursorPosition location of the console cursor.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686025(v=vs.85).aspx.
-func SetConsoleCursorPosition(handle uintptr, coord COORD) error {
- r1, r2, err := setConsoleCursorPositionProc.Call(handle, coordToPointer(coord))
- use(coord)
- return checkError(r1, r2, err)
-}
-
-// GetConsoleMode gets the console mode for given file descriptor
-// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx.
-func GetConsoleMode(handle uintptr) (mode uint32, err error) {
- err = syscall.GetConsoleMode(syscall.Handle(handle), &mode)
- return mode, err
-}
-
-// SetConsoleMode sets the console mode for given file descriptor
-// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx.
-func SetConsoleMode(handle uintptr, mode uint32) error {
- r1, r2, err := setConsoleModeProc.Call(handle, uintptr(mode), 0)
- use(mode)
- return checkError(r1, r2, err)
-}
-
-// GetConsoleScreenBufferInfo retrieves information about the specified console screen buffer.
-// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx.
-func GetConsoleScreenBufferInfo(handle uintptr) (*CONSOLE_SCREEN_BUFFER_INFO, error) {
- info := CONSOLE_SCREEN_BUFFER_INFO{}
- err := checkError(getConsoleScreenBufferInfoProc.Call(handle, uintptr(unsafe.Pointer(&info)), 0))
- if err != nil {
- return nil, err
- }
- return &info, nil
-}
-
-func ScrollConsoleScreenBuffer(handle uintptr, scrollRect SMALL_RECT, clipRect SMALL_RECT, destOrigin COORD, char CHAR_INFO) error {
- r1, r2, err := scrollConsoleScreenBufferProc.Call(handle, uintptr(unsafe.Pointer(&scrollRect)), uintptr(unsafe.Pointer(&clipRect)), coordToPointer(destOrigin), uintptr(unsafe.Pointer(&char)))
- use(scrollRect)
- use(clipRect)
- use(destOrigin)
- use(char)
- return checkError(r1, r2, err)
-}
-
-// SetConsoleScreenBufferSize sets the size of the console screen buffer.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686044(v=vs.85).aspx.
-func SetConsoleScreenBufferSize(handle uintptr, coord COORD) error {
- r1, r2, err := setConsoleScreenBufferSizeProc.Call(handle, coordToPointer(coord))
- use(coord)
- return checkError(r1, r2, err)
-}
-
-// SetConsoleTextAttribute sets the attributes of characters written to the
-// console screen buffer by the WriteFile or WriteConsole function.
-// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx.
-func SetConsoleTextAttribute(handle uintptr, attribute uint16) error {
- r1, r2, err := setConsoleTextAttributeProc.Call(handle, uintptr(attribute), 0)
- use(attribute)
- return checkError(r1, r2, err)
-}
-
-// SetConsoleWindowInfo sets the size and position of the console screen buffer's window.
-// Note that the size and location must be within and no larger than the backing console screen buffer.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686125(v=vs.85).aspx.
-func SetConsoleWindowInfo(handle uintptr, isAbsolute bool, rect SMALL_RECT) error {
- r1, r2, err := setConsoleWindowInfoProc.Call(handle, uintptr(boolToBOOL(isAbsolute)), uintptr(unsafe.Pointer(&rect)))
- use(isAbsolute)
- use(rect)
- return checkError(r1, r2, err)
-}
-
-// WriteConsoleOutput writes the CHAR_INFOs from the provided buffer to the active console buffer.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687404(v=vs.85).aspx.
-func WriteConsoleOutput(handle uintptr, buffer []CHAR_INFO, bufferSize COORD, bufferCoord COORD, writeRegion *SMALL_RECT) error {
- r1, r2, err := writeConsoleOutputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), coordToPointer(bufferSize), coordToPointer(bufferCoord), uintptr(unsafe.Pointer(writeRegion)))
- use(buffer)
- use(bufferSize)
- use(bufferCoord)
- return checkError(r1, r2, err)
-}
-
-// ReadConsoleInput reads (and removes) data from the console input buffer.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms684961(v=vs.85).aspx.
-func ReadConsoleInput(handle uintptr, buffer []INPUT_RECORD, count *uint32) error {
- r1, r2, err := readConsoleInputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), uintptr(len(buffer)), uintptr(unsafe.Pointer(count)))
- use(buffer)
- return checkError(r1, r2, err)
-}
-
-// WaitForSingleObject waits for the passed handle to be signaled.
-// It returns true if the handle was signaled; false otherwise.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx.
-func WaitForSingleObject(handle uintptr, msWait uint32) (bool, error) {
- r1, _, err := waitForSingleObjectProc.Call(handle, uintptr(uint32(msWait)))
- switch r1 {
- case WAIT_ABANDONED, WAIT_TIMEOUT:
- return false, nil
- case WAIT_SIGNALED:
- return true, nil
- }
- use(msWait)
- return false, err
-}
-
-// String helpers
-func (info CONSOLE_SCREEN_BUFFER_INFO) String() string {
- return fmt.Sprintf("Size(%v) Cursor(%v) Window(%v) Max(%v)", info.Size, info.CursorPosition, info.Window, info.MaximumWindowSize)
-}
-
-func (coord COORD) String() string {
- return fmt.Sprintf("%v,%v", coord.X, coord.Y)
-}
-
-func (rect SMALL_RECT) String() string {
- return fmt.Sprintf("(%v,%v),(%v,%v)", rect.Left, rect.Top, rect.Right, rect.Bottom)
-}
-
-// checkError evaluates the results of a Windows API call and returns the error if it failed.
-func checkError(r1, r2 uintptr, err error) error {
- // Windows APIs return non-zero to indicate success
- if r1 != 0 {
- return nil
- }
-
- // Return the error if provided, otherwise default to EINVAL
- if err != nil {
- return err
- }
- return syscall.EINVAL
-}
-
-// coordToPointer converts a COORD into a uintptr (by fooling the type system).
-func coordToPointer(c COORD) uintptr {
- // Note: This code assumes the two SHORTs are correctly laid out; the "cast" to uint32 is just to get a pointer to pass.
- return uintptr(*((*uint32)(unsafe.Pointer(&c))))
-}
-
-// use is a no-op, but the compiler cannot see that it is.
-// Calling use(p) ensures that p is kept live until that point.
-func use(p interface{}) {}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go
deleted file mode 100644
index cbec8f728..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// +build windows
-
-package winterm
-
-import "github.com/Azure/go-ansiterm"
-
-const (
- FOREGROUND_COLOR_MASK = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
- BACKGROUND_COLOR_MASK = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE
-)
-
-// collectAnsiIntoWindowsAttributes modifies the passed Windows text mode flags to reflect the
-// request represented by the passed ANSI mode.
-func collectAnsiIntoWindowsAttributes(windowsMode uint16, inverted bool, baseMode uint16, ansiMode int16) (uint16, bool) {
- switch ansiMode {
-
- // Mode styles
- case ansiterm.ANSI_SGR_BOLD:
- windowsMode = windowsMode | FOREGROUND_INTENSITY
-
- case ansiterm.ANSI_SGR_DIM, ansiterm.ANSI_SGR_BOLD_DIM_OFF:
- windowsMode &^= FOREGROUND_INTENSITY
-
- case ansiterm.ANSI_SGR_UNDERLINE:
- windowsMode = windowsMode | COMMON_LVB_UNDERSCORE
-
- case ansiterm.ANSI_SGR_REVERSE:
- inverted = true
-
- case ansiterm.ANSI_SGR_REVERSE_OFF:
- inverted = false
-
- case ansiterm.ANSI_SGR_UNDERLINE_OFF:
- windowsMode &^= COMMON_LVB_UNDERSCORE
-
- // Foreground colors
- case ansiterm.ANSI_SGR_FOREGROUND_DEFAULT:
- windowsMode = (windowsMode &^ FOREGROUND_MASK) | (baseMode & FOREGROUND_MASK)
-
- case ansiterm.ANSI_SGR_FOREGROUND_BLACK:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK)
-
- case ansiterm.ANSI_SGR_FOREGROUND_RED:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED
-
- case ansiterm.ANSI_SGR_FOREGROUND_GREEN:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN
-
- case ansiterm.ANSI_SGR_FOREGROUND_YELLOW:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN
-
- case ansiterm.ANSI_SGR_FOREGROUND_BLUE:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_BLUE
-
- case ansiterm.ANSI_SGR_FOREGROUND_MAGENTA:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_BLUE
-
- case ansiterm.ANSI_SGR_FOREGROUND_CYAN:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN | FOREGROUND_BLUE
-
- case ansiterm.ANSI_SGR_FOREGROUND_WHITE:
- windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
-
- // Background colors
- case ansiterm.ANSI_SGR_BACKGROUND_DEFAULT:
- // Black with no intensity
- windowsMode = (windowsMode &^ BACKGROUND_MASK) | (baseMode & BACKGROUND_MASK)
-
- case ansiterm.ANSI_SGR_BACKGROUND_BLACK:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK)
-
- case ansiterm.ANSI_SGR_BACKGROUND_RED:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED
-
- case ansiterm.ANSI_SGR_BACKGROUND_GREEN:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN
-
- case ansiterm.ANSI_SGR_BACKGROUND_YELLOW:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN
-
- case ansiterm.ANSI_SGR_BACKGROUND_BLUE:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_BLUE
-
- case ansiterm.ANSI_SGR_BACKGROUND_MAGENTA:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_BLUE
-
- case ansiterm.ANSI_SGR_BACKGROUND_CYAN:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN | BACKGROUND_BLUE
-
- case ansiterm.ANSI_SGR_BACKGROUND_WHITE:
- windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE
- }
-
- return windowsMode, inverted
-}
-
-// invertAttributes inverts the foreground and background colors of a Windows attributes value
-func invertAttributes(windowsMode uint16) uint16 {
- return (COMMON_LVB_MASK & windowsMode) | ((FOREGROUND_MASK & windowsMode) << 4) | ((BACKGROUND_MASK & windowsMode) >> 4)
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go
deleted file mode 100644
index f015723ad..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// +build windows
-
-package winterm
-
-const (
- horizontal = iota
- vertical
-)
-
-func (h *windowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_INFO) SMALL_RECT {
- if h.originMode {
- sr := h.effectiveSr(info.Window)
- return SMALL_RECT{
- Top: sr.top,
- Bottom: sr.bottom,
- Left: 0,
- Right: info.Size.X - 1,
- }
- } else {
- return SMALL_RECT{
- Top: info.Window.Top,
- Bottom: info.Window.Bottom,
- Left: 0,
- Right: info.Size.X - 1,
- }
- }
-}
-
-// setCursorPosition sets the cursor to the specified position, bounded to the screen size
-func (h *windowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL_RECT) error {
- position.X = ensureInRange(position.X, window.Left, window.Right)
- position.Y = ensureInRange(position.Y, window.Top, window.Bottom)
- err := SetConsoleCursorPosition(h.fd, position)
- if err != nil {
- return err
- }
- logger.Infof("Cursor position set: (%d, %d)", position.X, position.Y)
- return err
-}
-
-func (h *windowsAnsiEventHandler) moveCursorVertical(param int) error {
- return h.moveCursor(vertical, param)
-}
-
-func (h *windowsAnsiEventHandler) moveCursorHorizontal(param int) error {
- return h.moveCursor(horizontal, param)
-}
-
-func (h *windowsAnsiEventHandler) moveCursor(moveMode int, param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- position := info.CursorPosition
- switch moveMode {
- case horizontal:
- position.X += int16(param)
- case vertical:
- position.Y += int16(param)
- }
-
- if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {
- return err
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) moveCursorLine(param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- position := info.CursorPosition
- position.X = 0
- position.Y += int16(param)
-
- if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {
- return err
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) moveCursorColumn(param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- position := info.CursorPosition
- position.X = int16(param) - 1
-
- if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil {
- return err
- }
-
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go
deleted file mode 100644
index 244b5fa25..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// +build windows
-
-package winterm
-
-import "github.com/Azure/go-ansiterm"
-
-func (h *windowsAnsiEventHandler) clearRange(attributes uint16, fromCoord COORD, toCoord COORD) error {
- // Ignore an invalid (negative area) request
- if toCoord.Y < fromCoord.Y {
- return nil
- }
-
- var err error
-
- var coordStart = COORD{}
- var coordEnd = COORD{}
-
- xCurrent, yCurrent := fromCoord.X, fromCoord.Y
- xEnd, yEnd := toCoord.X, toCoord.Y
-
- // Clear any partial initial line
- if xCurrent > 0 {
- coordStart.X, coordStart.Y = xCurrent, yCurrent
- coordEnd.X, coordEnd.Y = xEnd, yCurrent
-
- err = h.clearRect(attributes, coordStart, coordEnd)
- if err != nil {
- return err
- }
-
- xCurrent = 0
- yCurrent += 1
- }
-
- // Clear intervening rectangular section
- if yCurrent < yEnd {
- coordStart.X, coordStart.Y = xCurrent, yCurrent
- coordEnd.X, coordEnd.Y = xEnd, yEnd-1
-
- err = h.clearRect(attributes, coordStart, coordEnd)
- if err != nil {
- return err
- }
-
- xCurrent = 0
- yCurrent = yEnd
- }
-
- // Clear remaining partial ending line
- coordStart.X, coordStart.Y = xCurrent, yCurrent
- coordEnd.X, coordEnd.Y = xEnd, yEnd
-
- err = h.clearRect(attributes, coordStart, coordEnd)
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) clearRect(attributes uint16, fromCoord COORD, toCoord COORD) error {
- region := SMALL_RECT{Top: fromCoord.Y, Left: fromCoord.X, Bottom: toCoord.Y, Right: toCoord.X}
- width := toCoord.X - fromCoord.X + 1
- height := toCoord.Y - fromCoord.Y + 1
- size := uint32(width) * uint32(height)
-
- if size <= 0 {
- return nil
- }
-
- buffer := make([]CHAR_INFO, size)
-
- char := CHAR_INFO{ansiterm.FILL_CHARACTER, attributes}
- for i := 0; i < int(size); i++ {
- buffer[i] = char
- }
-
- err := WriteConsoleOutput(h.fd, buffer, COORD{X: width, Y: height}, COORD{X: 0, Y: 0}, ®ion)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go
deleted file mode 100644
index 706d27057..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// +build windows
-
-package winterm
-
-// effectiveSr gets the current effective scroll region in buffer coordinates
-func (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion {
- top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom)
- bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom)
- if top >= bottom {
- top = window.Top
- bottom = window.Bottom
- }
- return scrollRegion{top: top, bottom: bottom}
-}
-
-func (h *windowsAnsiEventHandler) scrollUp(param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- sr := h.effectiveSr(info.Window)
- return h.scroll(param, sr, info)
-}
-
-func (h *windowsAnsiEventHandler) scrollDown(param int) error {
- return h.scrollUp(-param)
-}
-
-func (h *windowsAnsiEventHandler) deleteLines(param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- start := info.CursorPosition.Y
- sr := h.effectiveSr(info.Window)
- // Lines cannot be inserted or deleted outside the scrolling region.
- if start >= sr.top && start <= sr.bottom {
- sr.top = start
- return h.scroll(param, sr, info)
- } else {
- return nil
- }
-}
-
-func (h *windowsAnsiEventHandler) insertLines(param int) error {
- return h.deleteLines(-param)
-}
-
-// scroll scrolls the provided scroll region by param lines. The scroll region is in buffer coordinates.
-func (h *windowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSOLE_SCREEN_BUFFER_INFO) error {
- logger.Infof("scroll: scrollTop: %d, scrollBottom: %d", sr.top, sr.bottom)
- logger.Infof("scroll: windowTop: %d, windowBottom: %d", info.Window.Top, info.Window.Bottom)
-
- // Copy from and clip to the scroll region (full buffer width)
- scrollRect := SMALL_RECT{
- Top: sr.top,
- Bottom: sr.bottom,
- Left: 0,
- Right: info.Size.X - 1,
- }
-
- // Origin to which area should be copied
- destOrigin := COORD{
- X: 0,
- Y: sr.top - int16(param),
- }
-
- char := CHAR_INFO{
- UnicodeChar: ' ',
- Attributes: h.attributes,
- }
-
- if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {
- return err
- }
- return nil
-}
-
-func (h *windowsAnsiEventHandler) deleteCharacters(param int) error {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
- return h.scrollLine(param, info.CursorPosition, info)
-}
-
-func (h *windowsAnsiEventHandler) insertCharacters(param int) error {
- return h.deleteCharacters(-param)
-}
-
-// scrollLine scrolls a line horizontally starting at the provided position by a number of columns.
-func (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error {
- // Copy from and clip to the scroll region (full buffer width)
- scrollRect := SMALL_RECT{
- Top: position.Y,
- Bottom: position.Y,
- Left: position.X,
- Right: info.Size.X - 1,
- }
-
- // Origin to which area should be copied
- destOrigin := COORD{
- X: position.X - int16(columns),
- Y: position.Y,
- }
-
- char := CHAR_INFO{
- UnicodeChar: ' ',
- Attributes: h.attributes,
- }
-
- if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {
- return err
- }
- return nil
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go
deleted file mode 100644
index afa7635d7..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build windows
-
-package winterm
-
-// AddInRange increments a value by the passed quantity while ensuring the values
-// always remain within the supplied min / max range.
-func addInRange(n int16, increment int16, min int16, max int16) int16 {
- return ensureInRange(n+increment, min, max)
-}
diff --git a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go b/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go
deleted file mode 100644
index 4d858ed61..000000000
--- a/tools/specgen/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go
+++ /dev/null
@@ -1,726 +0,0 @@
-// +build windows
-
-package winterm
-
-import (
- "bytes"
- "io/ioutil"
- "os"
- "strconv"
-
- "github.com/Azure/go-ansiterm"
- "github.com/Sirupsen/logrus"
-)
-
-var logger *logrus.Logger
-
-type windowsAnsiEventHandler struct {
- fd uintptr
- file *os.File
- infoReset *CONSOLE_SCREEN_BUFFER_INFO
- sr scrollRegion
- buffer bytes.Buffer
- attributes uint16
- inverted bool
- wrapNext bool
- drewMarginByte bool
- originMode bool
- marginByte byte
- curInfo *CONSOLE_SCREEN_BUFFER_INFO
- curPos COORD
-}
-
-func CreateWinEventHandler(fd uintptr, file *os.File) ansiterm.AnsiEventHandler {
- logFile := ioutil.Discard
-
- if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" {
- logFile, _ = os.Create("winEventHandler.log")
- }
-
- logger = &logrus.Logger{
- Out: logFile,
- Formatter: new(logrus.TextFormatter),
- Level: logrus.DebugLevel,
- }
-
- infoReset, err := GetConsoleScreenBufferInfo(fd)
- if err != nil {
- return nil
- }
-
- return &windowsAnsiEventHandler{
- fd: fd,
- file: file,
- infoReset: infoReset,
- attributes: infoReset.Attributes,
- }
-}
-
-type scrollRegion struct {
- top int16
- bottom int16
-}
-
-// simulateLF simulates a LF or CR+LF by scrolling if necessary to handle the
-// current cursor position and scroll region settings, in which case it returns
-// true. If no special handling is necessary, then it does nothing and returns
-// false.
-//
-// In the false case, the caller should ensure that a carriage return
-// and line feed are inserted or that the text is otherwise wrapped.
-func (h *windowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) {
- if h.wrapNext {
- if err := h.Flush(); err != nil {
- return false, err
- }
- h.clearWrap()
- }
- pos, info, err := h.getCurrentInfo()
- if err != nil {
- return false, err
- }
- sr := h.effectiveSr(info.Window)
- if pos.Y == sr.bottom {
- // Scrolling is necessary. Let Windows automatically scroll if the scrolling region
- // is the full window.
- if sr.top == info.Window.Top && sr.bottom == info.Window.Bottom {
- if includeCR {
- pos.X = 0
- h.updatePos(pos)
- }
- return false, nil
- }
-
- // A custom scroll region is active. Scroll the window manually to simulate
- // the LF.
- if err := h.Flush(); err != nil {
- return false, err
- }
- logger.Info("Simulating LF inside scroll region")
- if err := h.scrollUp(1); err != nil {
- return false, err
- }
- if includeCR {
- pos.X = 0
- if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
- return false, err
- }
- }
- return true, nil
-
- } else if pos.Y < info.Window.Bottom {
- // Let Windows handle the LF.
- pos.Y++
- if includeCR {
- pos.X = 0
- }
- h.updatePos(pos)
- return false, nil
- } else {
- // The cursor is at the bottom of the screen but outside the scroll
- // region. Skip the LF.
- logger.Info("Simulating LF outside scroll region")
- if includeCR {
- if err := h.Flush(); err != nil {
- return false, err
- }
- pos.X = 0
- if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
- return false, err
- }
- }
- return true, nil
- }
-}
-
-// executeLF executes a LF without a CR.
-func (h *windowsAnsiEventHandler) executeLF() error {
- handled, err := h.simulateLF(false)
- if err != nil {
- return err
- }
- if !handled {
- // Windows LF will reset the cursor column position. Write the LF
- // and restore the cursor position.
- pos, _, err := h.getCurrentInfo()
- if err != nil {
- return err
- }
- h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)
- if pos.X != 0 {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Info("Resetting cursor position for LF without CR")
- if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-func (h *windowsAnsiEventHandler) Print(b byte) error {
- if h.wrapNext {
- h.buffer.WriteByte(h.marginByte)
- h.clearWrap()
- if _, err := h.simulateLF(true); err != nil {
- return err
- }
- }
- pos, info, err := h.getCurrentInfo()
- if err != nil {
- return err
- }
- if pos.X == info.Size.X-1 {
- h.wrapNext = true
- h.marginByte = b
- } else {
- pos.X++
- h.updatePos(pos)
- h.buffer.WriteByte(b)
- }
- return nil
-}
-
-func (h *windowsAnsiEventHandler) Execute(b byte) error {
- switch b {
- case ansiterm.ANSI_TAB:
- logger.Info("Execute(TAB)")
- // Move to the next tab stop, but preserve auto-wrap if already set.
- if !h.wrapNext {
- pos, info, err := h.getCurrentInfo()
- if err != nil {
- return err
- }
- pos.X = (pos.X + 8) - pos.X%8
- if pos.X >= info.Size.X {
- pos.X = info.Size.X - 1
- }
- if err := h.Flush(); err != nil {
- return err
- }
- if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
- return err
- }
- }
- return nil
-
- case ansiterm.ANSI_BEL:
- h.buffer.WriteByte(ansiterm.ANSI_BEL)
- return nil
-
- case ansiterm.ANSI_BACKSPACE:
- if h.wrapNext {
- if err := h.Flush(); err != nil {
- return err
- }
- h.clearWrap()
- }
- pos, _, err := h.getCurrentInfo()
- if err != nil {
- return err
- }
- if pos.X > 0 {
- pos.X--
- h.updatePos(pos)
- h.buffer.WriteByte(ansiterm.ANSI_BACKSPACE)
- }
- return nil
-
- case ansiterm.ANSI_VERTICAL_TAB, ansiterm.ANSI_FORM_FEED:
- // Treat as true LF.
- return h.executeLF()
-
- case ansiterm.ANSI_LINE_FEED:
- // Simulate a CR and LF for now since there is no way in go-ansiterm
- // to tell if the LF should include CR (and more things break when it's
- // missing than when it's incorrectly added).
- handled, err := h.simulateLF(true)
- if handled || err != nil {
- return err
- }
- return h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)
-
- case ansiterm.ANSI_CARRIAGE_RETURN:
- if h.wrapNext {
- if err := h.Flush(); err != nil {
- return err
- }
- h.clearWrap()
- }
- pos, _, err := h.getCurrentInfo()
- if err != nil {
- return err
- }
- if pos.X != 0 {
- pos.X = 0
- h.updatePos(pos)
- h.buffer.WriteByte(ansiterm.ANSI_CARRIAGE_RETURN)
- }
- return nil
-
- default:
- return nil
- }
-}
-
-func (h *windowsAnsiEventHandler) CUU(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CUU: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorVertical(-param)
-}
-
-func (h *windowsAnsiEventHandler) CUD(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CUD: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorVertical(param)
-}
-
-func (h *windowsAnsiEventHandler) CUF(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CUF: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorHorizontal(param)
-}
-
-func (h *windowsAnsiEventHandler) CUB(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CUB: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorHorizontal(-param)
-}
-
-func (h *windowsAnsiEventHandler) CNL(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CNL: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorLine(param)
-}
-
-func (h *windowsAnsiEventHandler) CPL(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CPL: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorLine(-param)
-}
-
-func (h *windowsAnsiEventHandler) CHA(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CHA: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.moveCursorColumn(param)
-}
-
-func (h *windowsAnsiEventHandler) VPA(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("VPA: [[%d]]", param)
- h.clearWrap()
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
- window := h.getCursorWindow(info)
- position := info.CursorPosition
- position.Y = window.Top + int16(param) - 1
- return h.setCursorPosition(position, window)
-}
-
-func (h *windowsAnsiEventHandler) CUP(row int, col int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("CUP: [[%d %d]]", row, col)
- h.clearWrap()
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- window := h.getCursorWindow(info)
- position := COORD{window.Left + int16(col) - 1, window.Top + int16(row) - 1}
- return h.setCursorPosition(position, window)
-}
-
-func (h *windowsAnsiEventHandler) HVP(row int, col int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("HVP: [[%d %d]]", row, col)
- h.clearWrap()
- return h.CUP(row, col)
-}
-
-func (h *windowsAnsiEventHandler) DECTCEM(visible bool) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DECTCEM: [%v]", []string{strconv.FormatBool(visible)})
- h.clearWrap()
- return nil
-}
-
-func (h *windowsAnsiEventHandler) DECOM(enable bool) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DECOM: [%v]", []string{strconv.FormatBool(enable)})
- h.clearWrap()
- h.originMode = enable
- return h.CUP(1, 1)
-}
-
-func (h *windowsAnsiEventHandler) DECCOLM(use132 bool) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DECCOLM: [%v]", []string{strconv.FormatBool(use132)})
- h.clearWrap()
- if err := h.ED(2); err != nil {
- return err
- }
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
- targetWidth := int16(80)
- if use132 {
- targetWidth = 132
- }
- if info.Size.X < targetWidth {
- if err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil {
- logger.Info("set buffer failed:", err)
- return err
- }
- }
- window := info.Window
- window.Left = 0
- window.Right = targetWidth - 1
- if err := SetConsoleWindowInfo(h.fd, true, window); err != nil {
- logger.Info("set window failed:", err)
- return err
- }
- if info.Size.X > targetWidth {
- if err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil {
- logger.Info("set buffer failed:", err)
- return err
- }
- }
- return SetConsoleCursorPosition(h.fd, COORD{0, 0})
-}
-
-func (h *windowsAnsiEventHandler) ED(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("ED: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
-
- // [J -- Erases from the cursor to the end of the screen, including the cursor position.
- // [1J -- Erases from the beginning of the screen to the cursor, including the cursor position.
- // [2J -- Erases the complete display. The cursor does not move.
- // Notes:
- // -- Clearing the entire buffer, versus just the Window, works best for Windows Consoles
-
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- var start COORD
- var end COORD
-
- switch param {
- case 0:
- start = info.CursorPosition
- end = COORD{info.Size.X - 1, info.Size.Y - 1}
-
- case 1:
- start = COORD{0, 0}
- end = info.CursorPosition
-
- case 2:
- start = COORD{0, 0}
- end = COORD{info.Size.X - 1, info.Size.Y - 1}
- }
-
- err = h.clearRange(h.attributes, start, end)
- if err != nil {
- return err
- }
-
- // If the whole buffer was cleared, move the window to the top while preserving
- // the window-relative cursor position.
- if param == 2 {
- pos := info.CursorPosition
- window := info.Window
- pos.Y -= window.Top
- window.Bottom -= window.Top
- window.Top = 0
- if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
- return err
- }
- if err := SetConsoleWindowInfo(h.fd, true, window); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) EL(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("EL: [%v]", strconv.Itoa(param))
- h.clearWrap()
-
- // [K -- Erases from the cursor to the end of the line, including the cursor position.
- // [1K -- Erases from the beginning of the line to the cursor, including the cursor position.
- // [2K -- Erases the complete line.
-
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- var start COORD
- var end COORD
-
- switch param {
- case 0:
- start = info.CursorPosition
- end = COORD{info.Size.X, info.CursorPosition.Y}
-
- case 1:
- start = COORD{0, info.CursorPosition.Y}
- end = info.CursorPosition
-
- case 2:
- start = COORD{0, info.CursorPosition.Y}
- end = COORD{info.Size.X, info.CursorPosition.Y}
- }
-
- err = h.clearRange(h.attributes, start, end)
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) IL(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("IL: [%v]", strconv.Itoa(param))
- h.clearWrap()
- return h.insertLines(param)
-}
-
-func (h *windowsAnsiEventHandler) DL(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DL: [%v]", strconv.Itoa(param))
- h.clearWrap()
- return h.deleteLines(param)
-}
-
-func (h *windowsAnsiEventHandler) ICH(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("ICH: [%v]", strconv.Itoa(param))
- h.clearWrap()
- return h.insertCharacters(param)
-}
-
-func (h *windowsAnsiEventHandler) DCH(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DCH: [%v]", strconv.Itoa(param))
- h.clearWrap()
- return h.deleteCharacters(param)
-}
-
-func (h *windowsAnsiEventHandler) SGR(params []int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- strings := []string{}
- for _, v := range params {
- strings = append(strings, strconv.Itoa(v))
- }
-
- logger.Infof("SGR: [%v]", strings)
-
- if len(params) <= 0 {
- h.attributes = h.infoReset.Attributes
- h.inverted = false
- } else {
- for _, attr := range params {
-
- if attr == ansiterm.ANSI_SGR_RESET {
- h.attributes = h.infoReset.Attributes
- h.inverted = false
- continue
- }
-
- h.attributes, h.inverted = collectAnsiIntoWindowsAttributes(h.attributes, h.inverted, h.infoReset.Attributes, int16(attr))
- }
- }
-
- attributes := h.attributes
- if h.inverted {
- attributes = invertAttributes(attributes)
- }
- err := SetConsoleTextAttribute(h.fd, attributes)
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func (h *windowsAnsiEventHandler) SU(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("SU: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.scrollUp(param)
-}
-
-func (h *windowsAnsiEventHandler) SD(param int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("SD: [%v]", []string{strconv.Itoa(param)})
- h.clearWrap()
- return h.scrollDown(param)
-}
-
-func (h *windowsAnsiEventHandler) DA(params []string) error {
- logger.Infof("DA: [%v]", params)
- // DA cannot be implemented because it must send data on the VT100 input stream,
- // which is not available to go-ansiterm.
- return nil
-}
-
-func (h *windowsAnsiEventHandler) DECSTBM(top int, bottom int) error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Infof("DECSTBM: [%d, %d]", top, bottom)
-
- // Windows is 0 indexed, Linux is 1 indexed
- h.sr.top = int16(top - 1)
- h.sr.bottom = int16(bottom - 1)
-
- // This command also moves the cursor to the origin.
- h.clearWrap()
- return h.CUP(1, 1)
-}
-
-func (h *windowsAnsiEventHandler) RI() error {
- if err := h.Flush(); err != nil {
- return err
- }
- logger.Info("RI: []")
- h.clearWrap()
-
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- sr := h.effectiveSr(info.Window)
- if info.CursorPosition.Y == sr.top {
- return h.scrollDown(1)
- }
-
- return h.moveCursorVertical(-1)
-}
-
-func (h *windowsAnsiEventHandler) IND() error {
- logger.Info("IND: []")
- return h.executeLF()
-}
-
-func (h *windowsAnsiEventHandler) Flush() error {
- h.curInfo = nil
- if h.buffer.Len() > 0 {
- logger.Infof("Flush: [%s]", h.buffer.Bytes())
- if _, err := h.buffer.WriteTo(h.file); err != nil {
- return err
- }
- }
-
- if h.wrapNext && !h.drewMarginByte {
- logger.Infof("Flush: drawing margin byte '%c'", h.marginByte)
-
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return err
- }
-
- charInfo := []CHAR_INFO{{UnicodeChar: uint16(h.marginByte), Attributes: info.Attributes}}
- size := COORD{1, 1}
- position := COORD{0, 0}
- region := SMALL_RECT{Left: info.CursorPosition.X, Top: info.CursorPosition.Y, Right: info.CursorPosition.X, Bottom: info.CursorPosition.Y}
- if err := WriteConsoleOutput(h.fd, charInfo, size, position, ®ion); err != nil {
- return err
- }
- h.drewMarginByte = true
- }
- return nil
-}
-
-// cacheConsoleInfo ensures that the current console screen information has been queried
-// since the last call to Flush(). It must be called before accessing h.curInfo or h.curPos.
-func (h *windowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFER_INFO, error) {
- if h.curInfo == nil {
- info, err := GetConsoleScreenBufferInfo(h.fd)
- if err != nil {
- return COORD{}, nil, err
- }
- h.curInfo = info
- h.curPos = info.CursorPosition
- }
- return h.curPos, h.curInfo, nil
-}
-
-func (h *windowsAnsiEventHandler) updatePos(pos COORD) {
- if h.curInfo == nil {
- panic("failed to call getCurrentInfo before calling updatePos")
- }
- h.curPos = pos
-}
-
-// clearWrap clears the state where the cursor is in the margin
-// waiting for the next character before wrapping the line. This must
-// be done before most operations that act on the cursor.
-func (h *windowsAnsiEventHandler) clearWrap() {
- h.wrapNext = false
- h.drewMarginByte = false
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/.gitignore b/tools/specgen/vendor/github.com/Sirupsen/logrus/.gitignore
deleted file mode 100644
index 66be63a00..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-logrus
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/.travis.yml b/tools/specgen/vendor/github.com/Sirupsen/logrus/.travis.yml
deleted file mode 100644
index dee4eb2cc..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: go
-go:
- - 1.3
- - 1.4
- - 1.5
- - 1.6
- - tip
-install:
- - go get -t ./...
-script: GOMAXPROCS=4 GORACE="halt_on_error=1" go test -race -v ./...
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/CHANGELOG.md b/tools/specgen/vendor/github.com/Sirupsen/logrus/CHANGELOG.md
deleted file mode 100644
index f2c2bc211..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/CHANGELOG.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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/tools/specgen/vendor/github.com/Sirupsen/logrus/LICENSE b/tools/specgen/vendor/github.com/Sirupsen/logrus/LICENSE
deleted file mode 100644
index f090cb42f..000000000
--- a/tools/specgen/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/tools/specgen/vendor/github.com/Sirupsen/logrus/README.md b/tools/specgen/vendor/github.com/Sirupsen/logrus/README.md
deleted file mode 100644
index 126cd1fc2..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/README.md
+++ /dev/null
@@ -1,425 +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. [Godoc][godoc]. **Please note the Logrus API is not
-yet stable (pre 1.0). Logrus itself is completely stable and has been used in
-many large deployments. The core API is unlikely to change much but please
-version control your Logrus to make sure you aren't fetching latest `master` on
-every build.**
-
-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
-exit status 1
-```
-
-#### 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 stderr instead of stdout, could also be a file.
- log.SetOutput(os.Stderr)
-
- // 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 (
- "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.Stderr
-
- log.WithFields(logrus.Fields{
- "animal": "walrus",
- "size": 10,
- }).Info("A group of walrus emerges from the ocean")
-}
-```
-
-#### Fields
-
-Logrus encourages careful, structured logging though 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.
-
-#### 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 "aibrake"
- 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).
-
-| Hook | Description |
-| ----- | ----------- |
-| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. |
-| [Airbrake "legacy"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. |
-| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. |
-| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. |
-| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. |
-| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. |
-| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. |
-| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) |
-| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. |
-| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` |
-| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) |
-| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) |
-| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem |
-| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger |
-| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail |
-| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar |
-| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd |
-| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb |
-| [Influxus] (http://github.com/vlad-doru/influxus) | Hook for concurrently logging to [InfluxDB] (http://influxdata.com/) |
-| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb |
-| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit |
-| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic |
-| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) |
-| [Amqp-Hook](https://github.com/vladoatanasov/logrus_amqp) | Hook for logging to Amqp broker (Like RabbitMQ) |
-| [KafkaLogrus](https://github.com/goibibo/KafkaLogrus) | Hook for logging to kafka |
-| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) |
-| [ElasticSearch](https://github.com/sohlich/elogrus) | Hook for logging to ElasticSearch|
-| [Sumorus](https://github.com/doublefree/sumorus) | Hook for logging to [SumoLogic](https://www.sumologic.com/)|
-| [Scribe](https://github.com/sagar8192/logrus-scribe-hook) | Hook for logging to [Scribe](https://github.com/facebookarchive/scribe)|
-| [Logstash](https://github.com/bshuster-repo/logrus-logstash-hook) | Hook for logging to [Logstash](https://www.elastic.co/products/logstash) |
-| [logz.io](https://github.com/ripcurld00d/logrus-logzio-hook) | Hook for logging to [logz.io](https://logz.io), a Log as a Service using Logstash |
-| [Logmatic.io](https://github.com/logmatic/logmatic-go) | Hook for logging to [Logmatic.io](http://logmatic.io/) |
-| [Pushover](https://github.com/toorop/logrus_pushover) | Send error via [Pushover](https://pushover.net) |
-
-
-#### Level logging
-
-Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic.
-
-```go
-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`
-* `logrus.JSONFormatter`. Logs fields as JSON.
-
-Third party logging formatters:
-
-* [`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`.
-
-#### 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 arround 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
-logger, hook := NewNullLogger()
-logger.Error("Hello error")
-
-assert.Equal(1, len(hook.Entries))
-assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level)
-assert.Equal("Hello error", hook.LastEntry().Message)
-
-hook.Reset()
-assert.Nil(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 safty
-
-By default Logger is protected by mutex for concurrent writes, this mutex is invoked 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/tools/specgen/vendor/github.com/Sirupsen/logrus/alt_exit.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/alt_exit.go
deleted file mode 100644
index b4c9e8475..000000000
--- a/tools/specgen/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://bitbucket.org/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/tools/specgen/vendor/github.com/Sirupsen/logrus/doc.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/doc.go
deleted file mode 100644
index dddd5f877..000000000
--- a/tools/specgen/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/tools/specgen/vendor/github.com/Sirupsen/logrus/entry.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/entry.go
deleted file mode 100644
index 4edbe7a2d..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/entry.go
+++ /dev/null
@@ -1,275 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "fmt"
- "os"
- "sync"
- "time"
-)
-
-var bufferPool *sync.Pool
-
-func init() {
- bufferPool = &sync.Pool{
- New: func() interface{} {
- return new(bytes.Buffer)
- },
- }
-}
-
-// 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 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: Debug, Info, Warn, Error, Fatal or Panic
- Level Level
-
- // Message passed to Debug, Info, Warn, Error, Fatal or Panic
- Message string
-
- // When formatter is called in entry.log(), an Buffer may be set to entry
- Buffer *bytes.Buffer
-}
-
-func NewEntry(logger *Logger) *Entry {
- return &Entry{
- Logger: logger,
- // Default is three fields, give a little extra room
- Data: make(Fields, 5),
- }
-}
-
-// 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
- }
- for k, v := range fields {
- data[k] = v
- }
- return &Entry{Logger: entry.Logger, Data: data}
-}
-
-// 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
- entry.Time = time.Now()
- entry.Level = level
- entry.Message = msg
-
- if err := entry.Logger.Hooks.Fire(level, &entry); err != nil {
- entry.Logger.mu.Lock()
- fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)
- entry.Logger.mu.Unlock()
- }
- buffer = bufferPool.Get().(*bytes.Buffer)
- buffer.Reset()
- defer bufferPool.Put(buffer)
- entry.Buffer = buffer
- serialized, err := entry.Logger.Formatter.Format(&entry)
- entry.Buffer = nil
- if err != nil {
- entry.Logger.mu.Lock()
- fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
- entry.Logger.mu.Unlock()
- } else {
- entry.Logger.mu.Lock()
- _, err = entry.Logger.Out.Write(serialized)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
- }
- entry.Logger.mu.Unlock()
- }
-
- // 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) Debug(args ...interface{}) {
- if entry.Logger.Level >= 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.Level >= InfoLevel {
- entry.log(InfoLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Warn(args ...interface{}) {
- if entry.Logger.Level >= 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.Level >= ErrorLevel {
- entry.log(ErrorLevel, fmt.Sprint(args...))
- }
-}
-
-func (entry *Entry) Fatal(args ...interface{}) {
- if entry.Logger.Level >= FatalLevel {
- entry.log(FatalLevel, fmt.Sprint(args...))
- }
- Exit(1)
-}
-
-func (entry *Entry) Panic(args ...interface{}) {
- if entry.Logger.Level >= PanicLevel {
- entry.log(PanicLevel, fmt.Sprint(args...))
- }
- panic(fmt.Sprint(args...))
-}
-
-// Entry Printf family functions
-
-func (entry *Entry) Debugf(format string, args ...interface{}) {
- if entry.Logger.Level >= DebugLevel {
- entry.Debug(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Infof(format string, args ...interface{}) {
- if entry.Logger.Level >= 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.Level >= 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.Level >= ErrorLevel {
- entry.Error(fmt.Sprintf(format, args...))
- }
-}
-
-func (entry *Entry) Fatalf(format string, args ...interface{}) {
- if entry.Logger.Level >= FatalLevel {
- entry.Fatal(fmt.Sprintf(format, args...))
- }
- Exit(1)
-}
-
-func (entry *Entry) Panicf(format string, args ...interface{}) {
- if entry.Logger.Level >= PanicLevel {
- entry.Panic(fmt.Sprintf(format, args...))
- }
-}
-
-// Entry Println family functions
-
-func (entry *Entry) Debugln(args ...interface{}) {
- if entry.Logger.Level >= DebugLevel {
- entry.Debug(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Infoln(args ...interface{}) {
- if entry.Logger.Level >= InfoLevel {
- entry.Info(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Println(args ...interface{}) {
- entry.Infoln(args...)
-}
-
-func (entry *Entry) Warnln(args ...interface{}) {
- if entry.Logger.Level >= WarnLevel {
- entry.Warn(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Warningln(args ...interface{}) {
- entry.Warnln(args...)
-}
-
-func (entry *Entry) Errorln(args ...interface{}) {
- if entry.Logger.Level >= ErrorLevel {
- entry.Error(entry.sprintlnn(args...))
- }
-}
-
-func (entry *Entry) Fatalln(args ...interface{}) {
- if entry.Logger.Level >= FatalLevel {
- entry.Fatal(entry.sprintlnn(args...))
- }
- Exit(1)
-}
-
-func (entry *Entry) Panicln(args ...interface{}) {
- if entry.Logger.Level >= 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/tools/specgen/vendor/github.com/Sirupsen/logrus/exported.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/exported.go
deleted file mode 100644
index 9a0120ac1..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/exported.go
+++ /dev/null
@@ -1,193 +0,0 @@
-package logrus
-
-import (
- "io"
-)
-
-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.mu.Lock()
- defer std.mu.Unlock()
- std.Out = out
-}
-
-// SetFormatter sets the standard logger formatter.
-func SetFormatter(formatter Formatter) {
- std.mu.Lock()
- defer std.mu.Unlock()
- std.Formatter = formatter
-}
-
-// SetLevel sets the standard logger level.
-func SetLevel(level Level) {
- std.mu.Lock()
- defer std.mu.Unlock()
- std.Level = level
-}
-
-// GetLevel returns the standard logger level.
-func GetLevel() Level {
- std.mu.Lock()
- defer std.mu.Unlock()
- return std.Level
-}
-
-// AddHook adds a hook to the standard logger hooks.
-func AddHook(hook Hook) {
- std.mu.Lock()
- defer std.mu.Unlock()
- std.Hooks.Add(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)
-}
-
-// 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.
-func Fatal(args ...interface{}) {
- std.Fatal(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.
-func Fatalf(format string, args ...interface{}) {
- std.Fatalf(format, 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.
-func Fatalln(args ...interface{}) {
- std.Fatalln(args...)
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/formatter.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/formatter.go
deleted file mode 100644
index b5fbe934d..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/formatter.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package logrus
-
-import "time"
-
-const DefaultTimestampFormat = time.RFC3339
-
-// 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` 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) {
- if t, ok := data["time"]; ok {
- data["fields.time"] = t
- }
-
- if m, ok := data["msg"]; ok {
- data["fields.msg"] = m
- }
-
- if l, ok := data["level"]; ok {
- data["fields.level"] = l
- }
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/hooks.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/hooks.go
deleted file mode 100644
index 3f151cdc3..000000000
--- a/tools/specgen/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/tools/specgen/vendor/github.com/Sirupsen/logrus/json_formatter.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/json_formatter.go
deleted file mode 100644
index 2ad6dc5cf..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/json_formatter.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package logrus
-
-import (
- "encoding/json"
- "fmt"
-)
-
-type JSONFormatter struct {
- // TimestampFormat sets the format used for marshaling timestamps.
- TimestampFormat string
-}
-
-func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
- data := make(Fields, len(entry.Data)+3)
- 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
- }
- }
- prefixFieldClashes(data)
-
- timestampFormat := f.TimestampFormat
- if timestampFormat == "" {
- timestampFormat = DefaultTimestampFormat
- }
-
- data["time"] = entry.Time.Format(timestampFormat)
- data["msg"] = entry.Message
- data["level"] = entry.Level.String()
-
- serialized, err := json.Marshal(data)
- if err != nil {
- return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
- }
- return append(serialized, '\n'), nil
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/logger.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/logger.go
deleted file mode 100644
index b769f3d35..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/logger.go
+++ /dev/null
@@ -1,308 +0,0 @@
-package logrus
-
-import (
- "io"
- "os"
- "sync"
-)
-
-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 adventorous, 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
- // 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. `logrus.Debug` is useful in
- Level Level
- // Used to sync writing to the log. Locking is enabled by Default
- mu MutexWrap
- // Reusable empty entry
- entryPool sync.Pool
-}
-
-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,
- }
-}
-
-func (logger *Logger) newEntry() *Entry {
- entry, ok := logger.entryPool.Get().(*Entry)
- if ok {
- return entry
- }
- return NewEntry(logger)
-}
-
-func (logger *Logger) releaseEntry(entry *Entry) {
- logger.entryPool.Put(entry)
-}
-
-// Adds a field to the log entry, note that it doesn't log until you call
-// Debug, Print, Info, Warn, 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)
-}
-
-func (logger *Logger) Debugf(format string, args ...interface{}) {
- if logger.Level >= DebugLevel {
- entry := logger.newEntry()
- entry.Debugf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Infof(format string, args ...interface{}) {
- if logger.Level >= 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.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warnf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warningf(format string, args ...interface{}) {
- if logger.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warnf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Errorf(format string, args ...interface{}) {
- if logger.Level >= ErrorLevel {
- entry := logger.newEntry()
- entry.Errorf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatalf(format string, args ...interface{}) {
- if logger.Level >= FatalLevel {
- entry := logger.newEntry()
- entry.Fatalf(format, args...)
- logger.releaseEntry(entry)
- }
- Exit(1)
-}
-
-func (logger *Logger) Panicf(format string, args ...interface{}) {
- if logger.Level >= PanicLevel {
- entry := logger.newEntry()
- entry.Panicf(format, args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Debug(args ...interface{}) {
- if logger.Level >= DebugLevel {
- entry := logger.newEntry()
- entry.Debug(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Info(args ...interface{}) {
- if logger.Level >= 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.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warn(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warning(args ...interface{}) {
- if logger.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warn(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Error(args ...interface{}) {
- if logger.Level >= ErrorLevel {
- entry := logger.newEntry()
- entry.Error(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatal(args ...interface{}) {
- if logger.Level >= FatalLevel {
- entry := logger.newEntry()
- entry.Fatal(args...)
- logger.releaseEntry(entry)
- }
- Exit(1)
-}
-
-func (logger *Logger) Panic(args ...interface{}) {
- if logger.Level >= PanicLevel {
- entry := logger.newEntry()
- entry.Panic(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Debugln(args ...interface{}) {
- if logger.Level >= DebugLevel {
- entry := logger.newEntry()
- entry.Debugln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Infoln(args ...interface{}) {
- if logger.Level >= 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.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warnln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Warningln(args ...interface{}) {
- if logger.Level >= WarnLevel {
- entry := logger.newEntry()
- entry.Warnln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Errorln(args ...interface{}) {
- if logger.Level >= ErrorLevel {
- entry := logger.newEntry()
- entry.Errorln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-func (logger *Logger) Fatalln(args ...interface{}) {
- if logger.Level >= FatalLevel {
- entry := logger.newEntry()
- entry.Fatalln(args...)
- logger.releaseEntry(entry)
- }
- Exit(1)
-}
-
-func (logger *Logger) Panicln(args ...interface{}) {
- if logger.Level >= PanicLevel {
- entry := logger.newEntry()
- entry.Panicln(args...)
- logger.releaseEntry(entry)
- }
-}
-
-//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()
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/logrus.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/logrus.go
deleted file mode 100644
index e59669111..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/logrus.go
+++ /dev/null
@@ -1,143 +0,0 @@
-package logrus
-
-import (
- "fmt"
- "log"
- "strings"
-)
-
-// Fields type, used to pass to `WithFields`.
-type Fields map[string]interface{}
-
-// Level type
-type Level uint8
-
-// Convert the Level to a string. E.g. PanicLevel becomes "panic".
-func (level Level) String() string {
- switch level {
- 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
- }
-
- var l Level
- return l, fmt.Errorf("not a valid logrus Level: %q", lvl)
-}
-
-// A constant exposing all logging levels
-var AllLevels = []Level{
- PanicLevel,
- FatalLevel,
- ErrorLevel,
- WarnLevel,
- InfoLevel,
- DebugLevel,
-}
-
-// 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 `os.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
-)
-
-// 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{})
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_appengine.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_appengine.go
deleted file mode 100644
index 1960169ef..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_appengine.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// +build appengine
-
-package logrus
-
-// IsTerminal returns true if stderr's file descriptor is a terminal.
-func IsTerminal() bool {
- return true
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_bsd.go
deleted file mode 100644
index 5f6be4d3c..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_bsd.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// +build darwin freebsd openbsd netbsd dragonfly
-// +build !appengine
-
-package logrus
-
-import "syscall"
-
-const ioctlReadTermios = syscall.TIOCGETA
-
-type Termios syscall.Termios
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_linux.go
deleted file mode 100644
index 308160ca8..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_linux.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Based on ssh/terminal:
-// 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 !appengine
-
-package logrus
-
-import "syscall"
-
-const ioctlReadTermios = syscall.TCGETS
-
-type Termios syscall.Termios
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go
deleted file mode 100644
index 329038f6c..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Based on ssh/terminal:
-// 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 linux darwin freebsd openbsd netbsd dragonfly
-// +build !appengine
-
-package logrus
-
-import (
- "syscall"
- "unsafe"
-)
-
-// IsTerminal returns true if stderr's file descriptor is a terminal.
-func IsTerminal() bool {
- fd := syscall.Stderr
- var termios Termios
- _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
- return err == 0
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_solaris.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
deleted file mode 100644
index a3c6f6e7d..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build solaris,!appengine
-
-package logrus
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-// IsTerminal returns true if the given file descriptor is a terminal.
-func IsTerminal() bool {
- _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
- return err == nil
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_windows.go
deleted file mode 100644
index 3727e8adf..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/terminal_windows.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Based on ssh/terminal:
-// 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,!appengine
-
-package logrus
-
-import (
- "syscall"
- "unsafe"
-)
-
-var kernel32 = syscall.NewLazyDLL("kernel32.dll")
-
-var (
- procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
-)
-
-// IsTerminal returns true if stderr's file descriptor is a terminal.
-func IsTerminal() bool {
- fd := syscall.Stderr
- var st uint32
- r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
- return r != 0 && e == 0
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/text_formatter.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/text_formatter.go
deleted file mode 100644
index 9114b3ca4..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/text_formatter.go
+++ /dev/null
@@ -1,168 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "fmt"
- "runtime"
- "sort"
- "strings"
- "time"
-)
-
-const (
- nocolor = 0
- red = 31
- green = 32
- yellow = 33
- blue = 34
- gray = 37
-)
-
-var (
- baseTimestamp time.Time
- isTerminal bool
-)
-
-func init() {
- baseTimestamp = time.Now()
- isTerminal = IsTerminal()
-}
-
-func miniTS() int {
- return int(time.Since(baseTimestamp) / time.Second)
-}
-
-type TextFormatter struct {
- // Set to true to bypass checking for a TTY before outputting colors.
- ForceColors bool
-
- // Force disabling colors.
- DisableColors 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
-}
-
-func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
- var b *bytes.Buffer
- var keys []string = make([]string, 0, len(entry.Data))
- for k := range entry.Data {
- keys = append(keys, k)
- }
-
- if !f.DisableSorting {
- sort.Strings(keys)
- }
- if entry.Buffer != nil {
- b = entry.Buffer
- } else {
- b = &bytes.Buffer{}
- }
-
- prefixFieldClashes(entry.Data)
-
- isColorTerminal := isTerminal && (runtime.GOOS != "windows")
- isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors
-
- timestampFormat := f.TimestampFormat
- if timestampFormat == "" {
- timestampFormat = DefaultTimestampFormat
- }
- if isColored {
- f.printColored(b, entry, keys, timestampFormat)
- } else {
- if !f.DisableTimestamp {
- f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat))
- }
- f.appendKeyValue(b, "level", entry.Level.String())
- if entry.Message != "" {
- f.appendKeyValue(b, "msg", entry.Message)
- }
- for _, key := range keys {
- f.appendKeyValue(b, key, entry.Data[key])
- }
- }
-
- 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:
- levelColor = gray
- case WarnLevel:
- levelColor = yellow
- case ErrorLevel, FatalLevel, PanicLevel:
- levelColor = red
- default:
- levelColor = blue
- }
-
- levelText := strings.ToUpper(entry.Level.String())[0:4]
-
- if !f.FullTimestamp {
- fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message)
- } else {
- fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), 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 needsQuoting(text string) bool {
- for _, ch := range text {
- if !((ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') ||
- ch == '-' || ch == '.') {
- return true
- }
- }
- return false
-}
-
-func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {
-
- b.WriteString(key)
- b.WriteByte('=')
- f.appendValue(b, value)
- b.WriteByte(' ')
-}
-
-func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) {
- switch value := value.(type) {
- case string:
- if !needsQuoting(value) {
- b.WriteString(value)
- } else {
- fmt.Fprintf(b, "%q", value)
- }
- case error:
- errmsg := value.Error()
- if !needsQuoting(errmsg) {
- b.WriteString(errmsg)
- } else {
- fmt.Fprintf(b, "%q", errmsg)
- }
- default:
- fmt.Fprint(b, value)
- }
-}
diff --git a/tools/specgen/vendor/github.com/Sirupsen/logrus/writer.go b/tools/specgen/vendor/github.com/Sirupsen/logrus/writer.go
deleted file mode 100644
index f74d2aa5f..000000000
--- a/tools/specgen/vendor/github.com/Sirupsen/logrus/writer.go
+++ /dev/null
@@ -1,53 +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 {
- reader, writer := io.Pipe()
-
- var printFunc func(args ...interface{})
- switch level {
- case DebugLevel:
- printFunc = logger.Debug
- case InfoLevel:
- printFunc = logger.Info
- case WarnLevel:
- printFunc = logger.Warn
- case ErrorLevel:
- printFunc = logger.Error
- case FatalLevel:
- printFunc = logger.Fatal
- case PanicLevel:
- printFunc = logger.Panic
- default:
- printFunc = logger.Print
- }
-
- go logger.writerScanner(reader, printFunc)
- runtime.SetFinalizer(writer, writerFinalizer)
-
- return writer
-}
-
-func (logger *Logger) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
- scanner := bufio.NewScanner(reader)
- for scanner.Scan() {
- printFunc(scanner.Text())
- }
- if err := scanner.Err(); err != nil {
- logger.Errorf("Error while reading from Writer: %s", err)
- }
- reader.Close()
-}
-
-func writerFinalizer(writer *io.PipeWriter) {
- writer.Close()
-}
diff --git a/tools/specgen/vendor/github.com/docker/docker/AUTHORS b/tools/specgen/vendor/github.com/docker/docker/AUTHORS
deleted file mode 100644
index 246e2a33f..000000000
--- a/tools/specgen/vendor/github.com/docker/docker/AUTHORS
+++ /dev/null
@@ -1,1652 +0,0 @@
-# This file lists all individuals having contributed content to the repository.
-# For how it is generated, see `hack/generate-authors.sh`.
-
-Aanand Prasad
-Aaron Davidson
-Aaron Feng
-Aaron Huslage
-Aaron Lehmann
-Aaron Welch
-Abel Muiño
-Abhijeet Kasurde
-Abhinav Ajgaonkar
-Abhishek Chanda
-Abin Shahab
-Adam Avilla
-Adam Kunk
-Adam Miller
-Adam Mills
-Adam Singer
-Adam Walz
-Aditi Rajagopal
-Aditya
-Adolfo Ochagavía
-Adria Casas
-Adrian Moisey
-Adrian Mouat
-Adrian Oprea
-Adrien Folie
-Adrien Gallouët
-Ahmed Kamal
-Ahmet Alp Balkan
-Aidan Feldman
-Aidan Hobson Sayers
-AJ Bowen
-Ajey Charantimath
-ajneu
-Akihiro Suda
-Al Tobey
-alambike
-Alan Scherger
-Alan Thompson
-Albert Callarisa
-Albert Zhang
-Aleksa Sarai
-Aleksandrs Fadins
-Alena Prokharchyk
-Alessandro Boch
-Alessio Biancalana
-Alex Chan
-Alex Coventry
-Alex Crawford
-Alex Ellis
-Alex Gaynor
-Alex Olshansky
-Alex Samorukov
-Alex Warhawk
-Alexander Artemenko
-Alexander Boyd
-Alexander Larsson
-Alexander Morozov
-Alexander Shopov
-Alexandre Beslic
-Alexandre González
-Alexandru Sfirlogea
-Alexey Guskov
-Alexey Kotlyarov
-Alexey Shamrin
-Alexis THOMAS
-Ali Dehghani
-Allen Madsen
-Allen Sun
-almoehi
-Alvaro Saurin
-Alvin Richards
-amangoel
-Amen Belayneh
-Amit Bakshi
-Amit Krishnan
-Amit Shukla
-Amy Lindburg
-Anand Patil
-AnandkumarPatel
-Anatoly Borodin
-Anchal Agrawal
-Anders Janmyr
-Andre Dublin <81dublin@gmail.com>
-Andre Granovsky
-Andrea Luzzardi
-Andrea Turli
-Andreas Köhler
-Andreas Savvides
-Andreas Tiefenthaler
-Andrei Gherzan
-Andrew C. Bodine
-Andrew Clay Shafer
-Andrew Duckworth
-Andrew France
-Andrew Gerrand
-Andrew Guenther
-Andrew Kuklewicz
-Andrew Macgregor
-Andrew Macpherson
-Andrew Martin
-Andrew Munsell
-Andrew Po
-Andrew Weiss
-Andrew Williams
-Andrews Medina
-Andrey Petrov
-Andrey Stolbovsky
-André Martins
-andy
-Andy Chambers
-andy diller
-Andy Goldstein
-Andy Kipp
-Andy Rothfusz
-Andy Smith
-Andy Wilson
-Anes Hasicic
-Anil Belur
-Anil Madhavapeddy
-Ankush Agarwal
-Anonmily
-Anthon van der Neut
-Anthony Baire
-Anthony Bishopric
-Anthony Dahanne
-Anton Löfgren
-Anton Nikitin
-Anton Polonskiy
-Anton Tiurin
-Antonio Murdaca
-Antonis Kalipetis
-Antony Messerli
-Anuj Bahuguna
-Anusha Ragunathan
-apocas
-ArikaChen
-Arnaud Lefebvre
-Arnaud Porterie
-Arthur Barr
-Arthur Gautier
-Artur Meyster
-Arun Gupta
-Asbjørn Enge
-averagehuman
-Avi Das
-Avi Miller
-Avi Vaid
-ayoshitake
-Azat Khuyiyakhmetov
-Bardia Keyoumarsi
-Barnaby Gray
-Barry Allard
-Bartłomiej Piotrowski
-Bastiaan Bakker
-bdevloed
-Ben Firshman
-Ben Golub
-Ben Hall
-Ben Sargent
-Ben Severson
-Ben Toews
-Ben Wiklund
-Benjamin Atkin
-Benoit Chesneau
-Bernerd Schaefer
-Bert Goethals
-Bharath Thiruveedula
-Bhiraj Butala
-Bilal Amarni
-Bill W
-bin liu
-Blake Geno
-Boaz Shuster
-bobby abbott
-boucher
-Bouke Haarsma
-Boyd Hemphill
-boynux
-Bradley Cicenas
-Bradley Wright
-Brandon Liu
-Brandon Philips
-Brandon Rhodes
-Brendan Dixon
-Brent Salisbury
-Brett Higgins
-Brett Kochendorfer
-Brian (bex) Exelbierd
-Brian Bland
-Brian DeHamer
-Brian Dorsey
-Brian Flad
-Brian Goff
-Brian McCallister
-Brian Olsen
-Brian Shumate
-Brian Torres-Gil
-Brian Trump
-Brice Jaglin
-Briehan Lombaard
-Bruno Bigras
-Bruno Binet
-Bruno Gazzera
-Bruno Renié
-Bryan Bess
-Bryan Boreham
-Bryan Matsuo
-Bryan Murphy
-buddhamagnet
-Burke Libbey
-Byung Kang
-Caleb Spare
-Calen Pennington
-Cameron Boehmer
-Cameron Spear
-Campbell Allen
-Candid Dauth
-Cao Weiwei
-Carl Henrik Lunde
-Carl Loa Odin
-Carl X. Su
-Carlos Alexandro Becker
-Carlos Sanchez
-Carol Fager-Higgins
-Cary
-Casey Bisson
-Cedric Davies
-Cezar Sa Espinola
-Chad Swenson
-Chance Zibolski
-Chander G
-Charles Chan
-Charles Hooper
-Charles Law
-Charles Lindsay
-Charles Merriam
-Charles Sarrazin
-Charles Smith
-Charlie Lewis