aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2017-02-12 22:24:33 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-02-12 22:24:33 +0000
commitba4840c52becf73c2749c9ef0f2f09ed0b9d5c7f (patch)
tree61b839884d66c9dd8269e26117aa4e4c995ad119 /vendor/github.com
parent6e00d0000e54f21a4a393e67fd914bda4d394f4a (diff)
Update dependencies
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/client/client.go7
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go68
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go34
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go4
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/session/session.go34
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/types.go2
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/version.go2
-rw-r--r--vendor/github.com/aws/aws-sdk-go/service/s3/api.go247
-rw-r--r--vendor/github.com/aws/aws-sdk-go/service/s3/errors.go48
-rw-r--r--vendor/github.com/aws/aws-sdk-go/service/sts/api.go63
-rw-r--r--vendor/github.com/aws/aws-sdk-go/service/sts/errors.go73
-rw-r--r--vendor/github.com/davecgh/go-spew/spew/bypasssafe.go38
-rw-r--r--vendor/github.com/fatih/structs/structs.go17
-rw-r--r--vendor/github.com/fsnotify/fsnotify/README.md31
-rw-r--r--vendor/github.com/go-ini/ini/README.md8
-rw-r--r--vendor/github.com/go-ini/ini/README_ZH.md6
-rw-r--r--vendor/github.com/go-ini/ini/ini.go5
-rw-r--r--vendor/github.com/go-ini/ini/parser.go7
-rw-r--r--vendor/github.com/go-ini/ini/section.go11
-rw-r--r--vendor/github.com/go-ini/ini/struct.go2
-rw-r--r--vendor/github.com/go-sql-driver/mysql/appengine.go19
-rw-r--r--vendor/github.com/golang/protobuf/proto/pointer_reflect.go484
-rw-r--r--vendor/github.com/google/go-github/github/activity_events.go50
-rw-r--r--vendor/github.com/google/go-github/github/activity_star.go12
-rw-r--r--vendor/github.com/google/go-github/github/activity_watching.go12
-rw-r--r--vendor/github.com/google/go-github/github/authorizations.go6
-rw-r--r--vendor/github.com/google/go-github/github/event_types.go229
-rw-r--r--vendor/github.com/google/go-github/github/gists.go31
-rw-r--r--vendor/github.com/google/go-github/github/gists_comments.go6
-rw-r--r--vendor/github.com/google/go-github/github/github.go20
-rw-r--r--vendor/github.com/google/go-github/github/gitignore.go6
-rw-r--r--vendor/github.com/google/go-github/github/integration.go4
-rw-r--r--vendor/github.com/google/go-github/github/issues.go18
-rw-r--r--vendor/github.com/google/go-github/github/issues_assignees.go6
-rw-r--r--vendor/github.com/google/go-github/github/issues_comments.go12
-rw-r--r--vendor/github.com/google/go-github/github/issues_labels.go40
-rw-r--r--vendor/github.com/google/go-github/github/issues_milestones.go12
-rw-r--r--vendor/github.com/google/go-github/github/licenses.go6
-rw-r--r--vendor/github.com/google/go-github/github/messages.go1
-rw-r--r--vendor/github.com/google/go-github/github/migrations_source_import.go12
-rw-r--r--vendor/github.com/google/go-github/github/misc.go6
-rw-r--r--vendor/github.com/google/go-github/github/orgs.go6
-rw-r--r--vendor/github.com/google/go-github/github/orgs_hooks.go6
-rw-r--r--vendor/github.com/google/go-github/github/orgs_members.go32
-rw-r--r--vendor/github.com/google/go-github/github/orgs_teams.go73
-rw-r--r--vendor/github.com/google/go-github/github/pulls.go51
-rw-r--r--vendor/github.com/google/go-github/github/pulls_comments.go12
-rw-r--r--vendor/github.com/google/go-github/github/pulls_reviews.go242
-rw-r--r--vendor/github.com/google/go-github/github/repos.go100
-rw-r--r--vendor/github.com/google/go-github/github/repos_collaborators.go35
-rw-r--r--vendor/github.com/google/go-github/github/repos_comments.go12
-rw-r--r--vendor/github.com/google/go-github/github/repos_commits.go6
-rw-r--r--vendor/github.com/google/go-github/github/repos_deployments.go38
-rw-r--r--vendor/github.com/google/go-github/github/repos_forks.go6
-rw-r--r--vendor/github.com/google/go-github/github/repos_hooks.go6
-rw-r--r--vendor/github.com/google/go-github/github/repos_keys.go6
-rw-r--r--vendor/github.com/google/go-github/github/repos_releases.go18
-rw-r--r--vendor/github.com/google/go-github/github/repos_statuses.go6
-rw-r--r--vendor/github.com/google/go-github/github/repos_traffic.go20
-rw-r--r--vendor/github.com/google/go-github/github/search.go41
-rw-r--r--vendor/github.com/google/go-github/github/users.go6
-rw-r--r--vendor/github.com/google/go-github/github/users_emails.go12
-rw-r--r--vendor/github.com/google/go-github/github/users_followers.go12
-rw-r--r--vendor/github.com/google/go-github/github/users_keys.go6
-rw-r--r--vendor/github.com/google/go-querystring/query/encode.go10
-rw-r--r--vendor/github.com/gorilla/handlers/handlers.go2
-rw-r--r--vendor/github.com/gorilla/handlers/handlers_go18.go21
-rw-r--r--vendor/github.com/gorilla/handlers/handlers_pre18.go7
-rw-r--r--vendor/github.com/gorilla/mux/README.md44
-rw-r--r--vendor/github.com/gorilla/mux/doc.go5
-rw-r--r--vendor/github.com/gorilla/mux/regexp.go7
-rw-r--r--vendor/github.com/gorilla/mux/route.go2
-rw-r--r--vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go25
-rw-r--r--vendor/github.com/hashicorp/hcl/hcl/parser/parser.go12
-rw-r--r--vendor/github.com/hashicorp/vault/api/client.go2
-rw-r--r--vendor/github.com/hashicorp/vault/api/sys_seal.go1
-rw-r--r--vendor/github.com/jmoiron/sqlx/sqlx.go7
-rw-r--r--vendor/github.com/magiconair/properties/CHANGELOG.md5
-rw-r--r--vendor/github.com/magiconair/properties/README.md2
-rw-r--r--vendor/github.com/magiconair/properties/decode.go19
-rw-r--r--vendor/github.com/magiconair/properties/doc.go2
-rw-r--r--vendor/github.com/magiconair/properties/integrate.go2
-rw-r--r--vendor/github.com/magiconair/properties/lex.go21
-rw-r--r--vendor/github.com/magiconair/properties/load.go8
-rw-r--r--vendor/github.com/magiconair/properties/parser.go2
-rw-r--r--vendor/github.com/magiconair/properties/properties.go17
-rw-r--r--vendor/github.com/magiconair/properties/rangecheck.go2
-rw-r--r--vendor/github.com/mattn/go-sqlite3/README.md17
-rw-r--r--vendor/github.com/mattn/go-sqlite3/doc.go2
-rw-r--r--vendor/github.com/mattn/go-sqlite3/sqlite3.go19
-rw-r--r--vendor/github.com/mattn/go-sqlite3/tracecallback.go1
-rw-r--r--vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go10
-rw-r--r--vendor/github.com/mitchellh/mapstructure/mapstructure.go24
-rw-r--r--vendor/github.com/nsheridan/autocert-wkfs-cache/License.txt21
-rw-r--r--vendor/github.com/nsheridan/wkfs/License.txt21
-rw-r--r--vendor/github.com/pelletier/go-toml/LICENSE3
-rw-r--r--vendor/github.com/pelletier/go-toml/README.md4
-rw-r--r--vendor/github.com/pelletier/go-toml/doc.go8
-rw-r--r--vendor/github.com/pelletier/go-toml/lexer.go20
-rw-r--r--vendor/github.com/pelletier/go-toml/tomltree_conversions.go32
-rw-r--r--vendor/github.com/pkg/browser/browser_openbsd.go16
-rw-r--r--vendor/github.com/pkg/browser/browser_unsupported.go2
-rw-r--r--vendor/github.com/sethgrid/pester/main.go2
-rw-r--r--vendor/github.com/spf13/afero/basepath.go26
-rw-r--r--vendor/github.com/spf13/afero/mem/file.go4
-rw-r--r--vendor/github.com/spf13/afero/memmap.go20
-rw-r--r--vendor/github.com/spf13/cast/caste.go9
-rw-r--r--vendor/github.com/spf13/jwalterweatherman/README.md33
-rw-r--r--vendor/github.com/spf13/jwalterweatherman/default_notepad.go113
-rw-r--r--vendor/github.com/spf13/jwalterweatherman/log_counter.go56
-rw-r--r--vendor/github.com/spf13/jwalterweatherman/notepad.go195
-rw-r--r--vendor/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go256
-rw-r--r--vendor/github.com/spf13/pflag/README.md2
-rw-r--r--vendor/github.com/spf13/pflag/bool_slice.go147
-rw-r--r--vendor/github.com/spf13/pflag/flag.go146
-rw-r--r--vendor/github.com/spf13/pflag/golangflag.go3
-rw-r--r--vendor/github.com/spf13/pflag/ip.go2
-rw-r--r--vendor/github.com/spf13/pflag/ip_slice.go148
-rw-r--r--vendor/github.com/spf13/pflag/ipnet.go2
-rw-r--r--vendor/github.com/spf13/pflag/string_array.go6
-rw-r--r--vendor/github.com/spf13/pflag/string_slice.go5
-rw-r--r--vendor/github.com/spf13/pflag/uint_slice.go126
-rw-r--r--vendor/github.com/xanzy/go-gitlab/gitlab.go2
-rw-r--r--vendor/github.com/xanzy/go-gitlab/merge_requests.go1
-rw-r--r--vendor/github.com/xanzy/go-gitlab/projects.go2
-rw-r--r--vendor/github.com/xanzy/go-gitlab/time_stats.go183
126 files changed, 2765 insertions, 1600 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
index aeeada0..17fc76a 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
@@ -24,6 +24,13 @@ type ConfigProvider interface {
ClientConfig(serviceName string, cfgs ...*aws.Config) Config
}
+// ConfigNoResolveEndpointProvider same as ConfigProvider except it will not
+// resolve the endpoint automatically. The service client's endpoint must be
+// provided via the aws.Config.Endpoint field.
+type ConfigNoResolveEndpointProvider interface {
+ ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config
+}
+
// A Client implements the base client request and response handling
// used by all service clients.
type Client struct {
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
index 987d928..5361656 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
@@ -46,10 +46,11 @@ const (
AcmServiceID = "acm" // Acm.
ApigatewayServiceID = "apigateway" // Apigateway.
ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling.
- AppstreamServiceID = "appstream" // Appstream.
Appstream2ServiceID = "appstream2" // Appstream2.
AutoscalingServiceID = "autoscaling" // Autoscaling.
+ BatchServiceID = "batch" // Batch.
BudgetsServiceID = "budgets" // Budgets.
+ ClouddirectoryServiceID = "clouddirectory" // Clouddirectory.
CloudformationServiceID = "cloudformation" // Cloudformation.
CloudfrontServiceID = "cloudfront" // Cloudfront.
CloudhsmServiceID = "cloudhsm" // Cloudhsm.
@@ -63,6 +64,7 @@ const (
CognitoIdpServiceID = "cognito-idp" // CognitoIdp.
CognitoSyncServiceID = "cognito-sync" // CognitoSync.
ConfigServiceID = "config" // Config.
+ CurServiceID = "cur" // Cur.
DatapipelineServiceID = "datapipeline" // Datapipeline.
DevicefarmServiceID = "devicefarm" // Devicefarm.
DirectconnectServiceID = "directconnect" // Directconnect.
@@ -111,6 +113,7 @@ const (
RekognitionServiceID = "rekognition" // Rekognition.
Route53ServiceID = "route53" // Route53.
Route53domainsServiceID = "route53domains" // Route53domains.
+ RuntimeLexServiceID = "runtime.lex" // RuntimeLex.
S3ServiceID = "s3" // S3.
SdbServiceID = "sdb" // Sdb.
ServicecatalogServiceID = "servicecatalog" // Servicecatalog.
@@ -247,6 +250,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -278,13 +282,6 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
- "appstream": service{
-
- Endpoints: endpoints{
- "ap-northeast-1": endpoint{},
- "us-east-1": endpoint{},
- },
- },
"appstream2": service{
Defaults: endpoint{
Protocols: []string{"https"},
@@ -320,6 +317,12 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "batch": service{
+
+ Endpoints: endpoints{
+ "us-east-1": endpoint{},
+ },
+ },
"budgets": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
@@ -333,6 +336,17 @@ var awsPartition = partition{
},
},
},
+ "clouddirectory": service{
+
+ Endpoints: endpoints{
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"cloudformation": service{
Endpoints: endpoints{
@@ -420,6 +434,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
+ "us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
@@ -523,6 +538,12 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "cur": service{
+
+ Endpoints: endpoints{
+ "us-east-1": endpoint{},
+ },
+ },
"datapipeline": service{
Endpoints: endpoints{
@@ -829,6 +850,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -996,6 +1018,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1041,10 +1064,23 @@ var awsPartition = partition{
},
},
"metering.marketplace": service{
-
+ Defaults: endpoint{
+ CredentialScope: credentialScope{
+ Service: "aws-marketplace",
+ },
+ },
Endpoints: endpoints{
- "us-east-1": endpoint{},
- "us-west-2": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"mobileanalytics": service{
@@ -1186,6 +1222,16 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
+ "runtime.lex": service{
+ Defaults: endpoint{
+ CredentialScope: credentialScope{
+ Service: "lex",
+ },
+ },
+ Endpoints: endpoints{
+ "us-east-1": endpoint{},
+ },
+ },
"s3": service{
PartitionEndpoint: "us-east-1",
IsRegionalized: boxedTrue,
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
index 3adec13..37e19ab 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
@@ -27,6 +27,25 @@ type Options struct {
// error will be returned. This option will prevent returning endpoints
// that look valid, but may not resolve to any real endpoint.
StrictMatching bool
+
+ // Enables resolving a service endpoint based on the region provided if the
+ // service does not exist. The service endpoint ID will be used as the service
+ // domain name prefix. By default the endpoint resolver requires the service
+ // to be known when resolving endpoints.
+ //
+ // If resolving an endpoint on the partition list the provided region will
+ // be used to determine which partition's domain name pattern to the service
+ // endpoint ID with. If both the service and region are unkonwn and resolving
+ // the endpoint on partition list an UnknownEndpointError error will be returned.
+ //
+ // If resolving and endpoint on a partition specific resolver that partition's
+ // domain name pattern will be used with the service endpoint ID. If both
+ // region and service do not exist when resolving an endpoint on a specific
+ // partition the partition's domain pattern will be used to combine the
+ // endpoint and region together.
+ //
+ // This option is ignored if StrictMatching is enabled.
+ ResolveUnknownService bool
}
// Set combines all of the option functions together.
@@ -54,6 +73,12 @@ func StrictMatchingOption(o *Options) {
o.StrictMatching = true
}
+// ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used
+// as a functional option when resolving endpoints.
+func ResolveUnknownServiceOption(o *Options) {
+ o.ResolveUnknownService = true
+}
+
// A Resolver provides the interface for functionality to resolve endpoints.
// The build in Partition and DefaultResolver return value satisfy this interface.
type Resolver interface {
@@ -114,15 +139,18 @@ func (p *Partition) ID() string { return p.id }
//
// If the service cannot be found in the metadata the UnknownServiceError
// error will be returned. This validation will occur regardless if
-// StrictMatching is enabled.
+// StrictMatching is enabled. To enable resolving unknown services set the
+// "ResolveUnknownService" option to true. When StrictMatching is disabled
+// this option allows the partition resolver to resolve a endpoint based on
+// the service endpoint ID provided.
//
// When resolving endpoints you can choose to enable StrictMatching. This will
// require the provided service and region to be known by the partition.
// If the endpoint cannot be strictly resolved an error will be returned. This
// mode is useful to ensure the endpoint resolved is valid. Without
-// StrictMatching enabled the enpoint returned my look valid but may not work.
+// StrictMatching enabled the endpoint returned my look valid but may not work.
// StrictMatching requires the SDK to be updated if you want to take advantage
-// of new regions and services expantions.
+// of new regions and services expansions.
//
// Errors that can be returned.
// * UnknownServiceError
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
index 6522ce9..13d968a 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
@@ -79,7 +79,9 @@ func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (
opt.Set(opts...)
s, hasService := p.Services[service]
- if !hasService {
+ if !(hasService || opt.ResolveUnknownService) {
+ // Only return error if the resolver will not fallback to creating
+ // endpoint based on service endpoint ID passed in.
return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services))
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
index c9427e9..3d52fc2 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
@@ -40,7 +40,7 @@ type Session struct {
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded, in addition to
-// the shared credentials file (~/.aws/config). Values set in both the
+// the shared credentials file (~/.aws/credentials). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file.
//
@@ -83,7 +83,7 @@ func New(cfgs ...*aws.Config) *Session {
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded in addition to
-// the shared credentials file (~/.aws/config). Values set in both the
+// the shared credentials file (~/.aws/credentials). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file. Enabling the Shared Config will also allow the Session
// to be built with retrieving credentials with AssumeRole set in the config.
@@ -155,7 +155,7 @@ type Options struct {
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded in addition to
-// the shared credentials file (~/.aws/config). Values set in both the
+// the shared credentials file (~/.aws/credentials). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file. Enabling the Shared Config will also allow the Session
// to be built with retrieving credentials with AssumeRole set in the config.
@@ -404,6 +404,10 @@ func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (
func(opt *endpoints.Options) {
opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL)
opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack)
+
+ // Support the condition where the service is modeled but its
+ // endpoint metadata is not available.
+ opt.ResolveUnknownService = true
},
)
}
@@ -416,3 +420,27 @@ func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (
SigningName: resolved.SigningName,
}, err
}
+
+// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception
+// that the EndpointResolver will not be used to resolve the endpoint. The only
+// endpoint set must come from the aws.Config.Endpoint field.
+func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config {
+ s = s.Copy(cfgs...)
+
+ var resolved endpoints.ResolvedEndpoint
+
+ region := aws.StringValue(s.Config.Region)
+
+ if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 {
+ resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL))
+ resolved.SigningRegion = region
+ }
+
+ return client.Config{
+ Config: s.Config,
+ Handlers: s.Handlers,
+ Endpoint: resolved.URL,
+ SigningRegion: resolved.SigningRegion,
+ SigningName: resolved.SigningName,
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go
index 9ca685e..0e2d864 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/types.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go
@@ -114,5 +114,5 @@ func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) {
func (b *WriteAtBuffer) Bytes() []byte {
b.m.Lock()
defer b.m.Unlock()
- return b.buf[:len(b.buf):len(b.buf)]
+ return b.buf
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index 33622b3..466b820 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.6.8"
+const SDKVersion = "1.6.21"
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go
index 8ce3de0..9b205f3 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go
@@ -52,9 +52,8 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req
input = &AbortMultipartUploadInput{}
}
- req = c.newRequest(op, input, output)
output = &AbortMultipartUploadOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -74,7 +73,7 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req
// API operation AbortMultipartUpload for usage and error information.
//
// Returned Error Codes:
-// * NoSuchUpload
+// * ErrCodeNoSuchUpload "NoSuchUpload"
// The specified multipart upload does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload
@@ -122,9 +121,8 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput)
input = &CompleteMultipartUploadInput{}
}
- req = c.newRequest(op, input, output)
output = &CompleteMultipartUploadOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -183,9 +181,8 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou
input = &CopyObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &CopyObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -201,7 +198,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou
// API operation CopyObject for usage and error information.
//
// Returned Error Codes:
-// * ObjectNotInActiveTierError
+// * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError"
// The source object of the COPY operation is not in the active tier and is
// only stored in Amazon Glacier.
//
@@ -250,9 +247,8 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request
input = &CreateBucketInput{}
}
- req = c.newRequest(op, input, output)
output = &CreateBucketOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -268,12 +264,11 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request
// API operation CreateBucket for usage and error information.
//
// Returned Error Codes:
-// * BucketAlreadyExists
+// * ErrCodeBucketAlreadyExists "BucketAlreadyExists"
// The requested bucket name is not available. The bucket namespace is shared
// by all users of the system. Please select a different name and try again.
//
-// * BucketAlreadyOwnedByYou
-
+// * ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou"
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket
func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) {
@@ -320,9 +315,8 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re
input = &CreateMultipartUploadInput{}
}
- req = c.newRequest(op, input, output)
output = &CreateMultipartUploadOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -387,11 +381,10 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request
input = &DeleteBucketInput{}
}
+ output = &DeleteBucketOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketOutput{}
- req.Data = output
return
}
@@ -451,11 +444,10 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt
input = &DeleteBucketAnalyticsConfigurationInput{}
}
+ output = &DeleteBucketAnalyticsConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketAnalyticsConfigurationOutput{}
- req.Data = output
return
}
@@ -515,11 +507,10 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request
input = &DeleteBucketCorsInput{}
}
+ output = &DeleteBucketCorsOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketCorsOutput{}
- req.Data = output
return
}
@@ -578,11 +569,10 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent
input = &DeleteBucketInventoryConfigurationInput{}
}
+ output = &DeleteBucketInventoryConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketInventoryConfigurationOutput{}
- req.Data = output
return
}
@@ -642,11 +632,10 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re
input = &DeleteBucketLifecycleInput{}
}
+ output = &DeleteBucketLifecycleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketLifecycleOutput{}
- req.Data = output
return
}
@@ -705,11 +694,10 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC
input = &DeleteBucketMetricsConfigurationInput{}
}
+ output = &DeleteBucketMetricsConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketMetricsConfigurationOutput{}
- req.Data = output
return
}
@@ -769,11 +757,10 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req
input = &DeleteBucketPolicyInput{}
}
+ output = &DeleteBucketPolicyOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketPolicyOutput{}
- req.Data = output
return
}
@@ -832,11 +819,10 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput)
input = &DeleteBucketReplicationInput{}
}
+ output = &DeleteBucketReplicationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketReplicationOutput{}
- req.Data = output
return
}
@@ -895,11 +881,10 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r
input = &DeleteBucketTaggingInput{}
}
+ output = &DeleteBucketTaggingOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketTaggingOutput{}
- req.Data = output
return
}
@@ -958,11 +943,10 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r
input = &DeleteBucketWebsiteInput{}
}
+ output = &DeleteBucketWebsiteOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &DeleteBucketWebsiteOutput{}
- req.Data = output
return
}
@@ -1021,9 +1005,8 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request
input = &DeleteObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &DeleteObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1084,9 +1067,8 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r
input = &DeleteObjectTaggingInput{}
}
- req = c.newRequest(op, input, output)
output = &DeleteObjectTaggingOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1145,9 +1127,8 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque
input = &DeleteObjectsInput{}
}
- req = c.newRequest(op, input, output)
output = &DeleteObjectsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1207,9 +1188,8 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC
input = &GetBucketAccelerateConfigurationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketAccelerateConfigurationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1268,9 +1248,8 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request
input = &GetBucketAclInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketAclOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1329,9 +1308,8 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon
input = &GetBucketAnalyticsConfigurationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketAnalyticsConfigurationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1391,9 +1369,8 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Reque
input = &GetBucketCorsInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketCorsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1452,9 +1429,8 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon
input = &GetBucketInventoryConfigurationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketInventoryConfigurationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1517,9 +1493,8 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req
input = &GetBucketLifecycleInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketLifecycleOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1578,9 +1553,8 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon
input = &GetBucketLifecycleConfigurationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketLifecycleConfigurationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1639,9 +1613,8 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *reque
input = &GetBucketLocationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketLocationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1700,9 +1673,8 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request
input = &GetBucketLoggingInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketLoggingOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1762,9 +1734,8 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu
input = &GetBucketMetricsConfigurationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketMetricsConfigurationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1827,9 +1798,8 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat
input = &GetBucketNotificationConfigurationRequest{}
}
- req = c.newRequest(op, input, output)
output = &NotificationConfigurationDeprecated{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1888,9 +1858,8 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat
input = &GetBucketNotificationConfigurationRequest{}
}
- req = c.newRequest(op, input, output)
output = &NotificationConfiguration{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -1949,9 +1918,8 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R
input = &GetBucketPolicyInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketPolicyOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2010,9 +1978,8 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req
input = &GetBucketReplicationInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketReplicationOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2071,9 +2038,8 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput)
input = &GetBucketRequestPaymentInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketRequestPaymentOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2132,9 +2098,8 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request
input = &GetBucketTaggingInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketTaggingOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2193,9 +2158,8 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *r
input = &GetBucketVersioningInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketVersioningOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2254,9 +2218,8 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request
input = &GetBucketWebsiteInput{}
}
- req = c.newRequest(op, input, output)
output = &GetBucketWebsiteOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2315,9 +2278,8 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp
input = &GetObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &GetObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2333,7 +2295,7 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp
// API operation GetObject for usage and error information.
//
// Returned Error Codes:
-// * NoSuchKey
+// * ErrCodeNoSuchKey "NoSuchKey"
// The specified key does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject
@@ -2381,9 +2343,8 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request
input = &GetObjectAclInput{}
}
- req = c.newRequest(op, input, output)
output = &GetObjectAclOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2399,7 +2360,7 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request
// API operation GetObjectAcl for usage and error information.
//
// Returned Error Codes:
-// * NoSuchKey
+// * ErrCodeNoSuchKey "NoSuchKey"
// The specified key does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl
@@ -2447,9 +2408,8 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request
input = &GetObjectTaggingInput{}
}
- req = c.newRequest(op, input, output)
output = &GetObjectTaggingOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2508,9 +2468,8 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request
input = &GetObjectTorrentInput{}
}
- req = c.newRequest(op, input, output)
output = &GetObjectTorrentOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2569,11 +2528,10 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou
input = &HeadBucketInput{}
}
+ output = &HeadBucketOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &HeadBucketOutput{}
- req.Data = output
return
}
@@ -2590,7 +2548,7 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou
// API operation HeadBucket for usage and error information.
//
// Returned Error Codes:
-// * NoSuchBucket
+// * ErrCodeNoSuchBucket "NoSuchBucket"
// The specified bucket does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket
@@ -2638,9 +2596,8 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou
input = &HeadObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &HeadObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2658,7 +2615,7 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou
// API operation HeadObject for usage and error information.
//
// Returned Error Codes:
-// * NoSuchKey
+// * ErrCodeNoSuchKey "NoSuchKey"
// The specified key does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject
@@ -2706,9 +2663,8 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics
input = &ListBucketAnalyticsConfigurationsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListBucketAnalyticsConfigurationsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2767,9 +2723,8 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory
input = &ListBucketInventoryConfigurationsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListBucketInventoryConfigurationsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2828,9 +2783,8 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf
input = &ListBucketMetricsConfigurationsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListBucketMetricsConfigurationsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2889,9 +2843,8 @@ func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request,
input = &ListBucketsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListBucketsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -2956,9 +2909,8 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req
input = &ListMultipartUploadsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListMultipartUploadsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -3048,9 +3000,8 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req
input = &ListObjectVersionsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListObjectVersionsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -3140,9 +3091,8 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request,
input = &ListObjectsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListObjectsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -3160,7 +3110,7 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request,
// API operation ListObjects for usage and error information.
//
// Returned Error Codes:
-// * NoSuchBucket
+// * ErrCodeNoSuchBucket "NoSuchBucket"
// The specified bucket does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects
@@ -3239,9 +3189,8 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque
input = &ListObjectsV2Input{}
}
- req = c.newRequest(op, input, output)
output = &ListObjectsV2Output{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -3260,7 +3209,7 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque
// API operation ListObjectsV2 for usage and error information.
//
// Returned Error Codes:
-// * NoSuchBucket
+// * ErrCodeNoSuchBucket "NoSuchBucket"
// The specified bucket does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2
@@ -3339,9 +3288,8 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp
input = &ListPartsInput{}
}
- req = c.newRequest(op, input, output)
output = &ListPartsOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -3425,11 +3373,10 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC
input = &PutBucketAccelerateConfigurationInput{}
}
+ output = &PutBucketAccelerateConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketAccelerateConfigurationOutput{}
- req.Data = output
return
}
@@ -3488,11 +3435,10 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request
input = &PutBucketAclInput{}
}
+ output = &PutBucketAclOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketAclOutput{}
- req.Data = output
return
}
@@ -3551,11 +3497,10 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon
input = &PutBucketAnalyticsConfigurationInput{}
}
+ output = &PutBucketAnalyticsConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketAnalyticsConfigurationOutput{}
- req.Data = output
return
}
@@ -3615,11 +3560,10 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque
input = &PutBucketCorsInput{}
}
+ output = &PutBucketCorsOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketCorsOutput{}
- req.Data = output
return
}
@@ -3678,11 +3622,10 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon
input = &PutBucketInventoryConfigurationInput{}
}
+ output = &PutBucketInventoryConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketInventoryConfigurationOutput{}
- req.Data = output
return
}
@@ -3745,11 +3688,10 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req
input = &PutBucketLifecycleInput{}
}
+ output = &PutBucketLifecycleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketLifecycleOutput{}
- req.Data = output
return
}
@@ -3808,11 +3750,10 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon
input = &PutBucketLifecycleConfigurationInput{}
}
+ output = &PutBucketLifecycleConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketLifecycleConfigurationOutput{}
- req.Data = output
return
}
@@ -3872,11 +3813,10 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request
input = &PutBucketLoggingInput{}
}
+ output = &PutBucketLoggingOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketLoggingOutput{}
- req.Data = output
return
}
@@ -3937,11 +3877,10 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu
input = &PutBucketMetricsConfigurationInput{}
}
+ output = &PutBucketMetricsConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketMetricsConfigurationOutput{}
- req.Data = output
return
}
@@ -4004,11 +3943,10 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (re
input = &PutBucketNotificationInput{}
}
+ output = &PutBucketNotificationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketNotificationOutput{}
- req.Data = output
return
}
@@ -4067,11 +4005,10 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat
input = &PutBucketNotificationConfigurationInput{}
}
+ output = &PutBucketNotificationConfigurationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketNotificationConfigurationOutput{}
- req.Data = output
return
}
@@ -4130,11 +4067,10 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R
input = &PutBucketPolicyInput{}
}
+ output = &PutBucketPolicyOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketPolicyOutput{}
- req.Data = output
return
}
@@ -4194,11 +4130,10 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req
input = &PutBucketReplicationInput{}
}
+ output = &PutBucketReplicationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketReplicationOutput{}
- req.Data = output
return
}
@@ -4258,11 +4193,10 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput)
input = &PutBucketRequestPaymentInput{}
}
+ output = &PutBucketRequestPaymentOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketRequestPaymentOutput{}
- req.Data = output
return
}
@@ -4325,11 +4259,10 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request
input = &PutBucketTaggingInput{}
}
+ output = &PutBucketTaggingOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketTaggingOutput{}
- req.Data = output
return
}
@@ -4388,11 +4321,10 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r
input = &PutBucketVersioningInput{}
}
+ output = &PutBucketVersioningOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketVersioningOutput{}
- req.Data = output
return
}
@@ -4452,11 +4384,10 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request
input = &PutBucketWebsiteInput{}
}
+ output = &PutBucketWebsiteOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
- output = &PutBucketWebsiteOutput{}
- req.Data = output
return
}
@@ -4515,9 +4446,8 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp
input = &PutObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &PutObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -4576,9 +4506,8 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request
input = &PutObjectAclInput{}
}
- req = c.newRequest(op, input, output)
output = &PutObjectAclOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -4595,7 +4524,7 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request
// API operation PutObjectAcl for usage and error information.
//
// Returned Error Codes:
-// * NoSuchKey
+// * ErrCodeNoSuchKey "NoSuchKey"
// The specified key does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl
@@ -4643,9 +4572,8 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request
input = &PutObjectTaggingInput{}
}
- req = c.newRequest(op, input, output)
output = &PutObjectTaggingOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -4704,9 +4632,8 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque
input = &RestoreObjectInput{}
}
- req = c.newRequest(op, input, output)
output = &RestoreObjectOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -4722,7 +4649,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque
// API operation RestoreObject for usage and error information.
//
// Returned Error Codes:
-// * ObjectAlreadyInActiveTierError
+// * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError"
// This operation is not allowed against this storage tier
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject
@@ -4770,9 +4697,8 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou
input = &UploadPartInput{}
}
- req = c.newRequest(op, input, output)
output = &UploadPartOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -4837,9 +4763,8 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req
input = &UploadPartCopyInput{}
}
- req = c.newRequest(op, input, output)
output = &UploadPartCopyOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go
new file mode 100644
index 0000000..13ebbda
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go
@@ -0,0 +1,48 @@
+// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
+
+package s3
+
+const (
+
+ // ErrCodeBucketAlreadyExists for service response error code
+ // "BucketAlreadyExists".
+ //
+ // The requested bucket name is not available. The bucket namespace is shared
+ // by all users of the system. Please select a different name and try again.
+ ErrCodeBucketAlreadyExists = "BucketAlreadyExists"
+
+ // ErrCodeBucketAlreadyOwnedByYou for service response error code
+ // "BucketAlreadyOwnedByYou".
+ ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou"
+
+ // ErrCodeNoSuchBucket for service response error code
+ // "NoSuchBucket".
+ //
+ // The specified bucket does not exist.
+ ErrCodeNoSuchBucket = "NoSuchBucket"
+
+ // ErrCodeNoSuchKey for service response error code
+ // "NoSuchKey".
+ //
+ // The specified key does not exist.
+ ErrCodeNoSuchKey = "NoSuchKey"
+
+ // ErrCodeNoSuchUpload for service response error code
+ // "NoSuchUpload".
+ //
+ // The specified multipart upload does not exist.
+ ErrCodeNoSuchUpload = "NoSuchUpload"
+
+ // ErrCodeObjectAlreadyInActiveTierError for service response error code
+ // "ObjectAlreadyInActiveTierError".
+ //
+ // This operation is not allowed against this storage tier
+ ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError"
+
+ // ErrCodeObjectNotInActiveTierError for service response error code
+ // "ObjectNotInActiveTierError".
+ //
+ // The source object of the COPY operation is not in the active tier and is
+ // only stored in Amazon Glacier.
+ ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError"
+)
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
index 4459465..ad42b4c 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
@@ -48,9 +48,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
input = &AssumeRoleInput{}
}
- req = c.newRequest(op, input, output)
output = &AssumeRoleOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -154,16 +153,16 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
// API operation AssumeRole for usage and error information.
//
// Returned Error Codes:
-// * MalformedPolicyDocument
+// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
// The request was rejected because the policy document was malformed. The error
// message describes the specific error.
//
-// * PackedPolicyTooLarge
+// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
// The request was rejected because the policy document was too large. The error
// message describes how big the policy document is, in packed form, as a percentage
// of what the API allows.
//
-// * RegionDisabledException
+// * ErrCodeRegionDisabledException "RegionDisabledException"
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
@@ -215,9 +214,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
input = &AssumeRoleWithSAMLInput{}
}
- req = c.newRequest(op, input, output)
output = &AssumeRoleWithSAMLOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -299,31 +297,31 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
// API operation AssumeRoleWithSAML for usage and error information.
//
// Returned Error Codes:
-// * MalformedPolicyDocument
+// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
// The request was rejected because the policy document was malformed. The error
// message describes the specific error.
//
-// * PackedPolicyTooLarge
+// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
// The request was rejected because the policy document was too large. The error
// message describes how big the policy document is, in packed form, as a percentage
// of what the API allows.
//
-// * IDPRejectedClaim
+// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim"
// The identity provider (IdP) reported that authentication failed. This might
// be because the claim is invalid.
//
// If this error is returned for the AssumeRoleWithWebIdentity operation, it
// can also mean that the claim has expired or has been explicitly revoked.
//
-// * InvalidIdentityToken
+// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken"
// The web identity token that was passed could not be validated by AWS. Get
// a new identity token from the identity provider and then retry the request.
//
-// * ExpiredTokenException
+// * ErrCodeExpiredTokenException "ExpiredTokenException"
// The web identity token that was passed is expired or is not valid. Get a
// new identity token from the identity provider and then retry the request.
//
-// * RegionDisabledException
+// * ErrCodeRegionDisabledException "RegionDisabledException"
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
@@ -375,9 +373,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
input = &AssumeRoleWithWebIdentityInput{}
}
- req = c.newRequest(op, input, output)
output = &AssumeRoleWithWebIdentityOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -481,38 +478,38 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
// API operation AssumeRoleWithWebIdentity for usage and error information.
//
// Returned Error Codes:
-// * MalformedPolicyDocument
+// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
// The request was rejected because the policy document was malformed. The error
// message describes the specific error.
//
-// * PackedPolicyTooLarge
+// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
// The request was rejected because the policy document was too large. The error
// message describes how big the policy document is, in packed form, as a percentage
// of what the API allows.
//
-// * IDPRejectedClaim
+// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim"
// The identity provider (IdP) reported that authentication failed. This might
// be because the claim is invalid.
//
// If this error is returned for the AssumeRoleWithWebIdentity operation, it
// can also mean that the claim has expired or has been explicitly revoked.
//
-// * IDPCommunicationError
+// * ErrCodeIDPCommunicationErrorException "IDPCommunicationError"
// The request could not be fulfilled because the non-AWS identity provider
// (IDP) that was asked to verify the incoming identity token could not be reached.
// This is often a transient error caused by network conditions. Retry the request
// a limited number of times so that you don't exceed the request rate. If the
// error persists, the non-AWS identity provider might be down or not responding.
//
-// * InvalidIdentityToken
+// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken"
// The web identity token that was passed could not be validated by AWS. Get
// a new identity token from the identity provider and then retry the request.
//
-// * ExpiredTokenException
+// * ErrCodeExpiredTokenException "ExpiredTokenException"
// The web identity token that was passed is expired or is not valid. Get a
// new identity token from the identity provider and then retry the request.
//
-// * RegionDisabledException
+// * ErrCodeRegionDisabledException "RegionDisabledException"
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
@@ -564,9 +561,8 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
input = &DecodeAuthorizationMessageInput{}
}
- req = c.newRequest(op, input, output)
output = &DecodeAuthorizationMessageOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -613,7 +609,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
// API operation DecodeAuthorizationMessage for usage and error information.
//
// Returned Error Codes:
-// * InvalidAuthorizationMessageException
+// * ErrCodeInvalidAuthorizationMessageException "InvalidAuthorizationMessageException"
// The error returned if the message passed to DecodeAuthorizationMessage was
// invalid. This can happen if the token contains invalid characters, such as
// linebreaks.
@@ -663,9 +659,8 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ
input = &GetCallerIdentityInput{}
}
- req = c.newRequest(op, input, output)
output = &GetCallerIdentityOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -725,9 +720,8 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
input = &GetFederationTokenInput{}
}
- req = c.newRequest(op, input, output)
output = &GetFederationTokenOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -820,16 +814,16 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
// API operation GetFederationToken for usage and error information.
//
// Returned Error Codes:
-// * MalformedPolicyDocument
+// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
// The request was rejected because the policy document was malformed. The error
// message describes the specific error.
//
-// * PackedPolicyTooLarge
+// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
// The request was rejected because the policy document was too large. The error
// message describes how big the policy document is, in packed form, as a percentage
// of what the API allows.
//
-// * RegionDisabledException
+// * ErrCodeRegionDisabledException "RegionDisabledException"
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
@@ -881,9 +875,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
input = &GetSessionTokenInput{}
}
- req = c.newRequest(op, input, output)
output = &GetSessionTokenOutput{}
- req.Data = output
+ req = c.newRequest(op, input, output)
return
}
@@ -944,7 +937,7 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
// API operation GetSessionToken for usage and error information.
//
// Returned Error Codes:
-// * RegionDisabledException
+// * ErrCodeRegionDisabledException "RegionDisabledException"
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
new file mode 100644
index 0000000..dbcd667
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
@@ -0,0 +1,73 @@
+// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
+
+package sts
+
+const (
+
+ // ErrCodeExpiredTokenException for service response error code
+ // "ExpiredTokenException".
+ //
+ // The web identity token that was passed is expired or is not valid. Get a
+ // new identity token from the identity provider and then retry the request.
+ ErrCodeExpiredTokenException = "ExpiredTokenException"
+
+ // ErrCodeIDPCommunicationErrorException for service response error code
+ // "IDPCommunicationError".
+ //
+ // The request could not be fulfilled because the non-AWS identity provider
+ // (IDP) that was asked to verify the incoming identity token could not be reached.
+ // This is often a transient error caused by network conditions. Retry the request
+ // a limited number of times so that you don't exceed the request rate. If the
+ // error persists, the non-AWS identity provider might be down or not responding.
+ ErrCodeIDPCommunicationErrorException = "IDPCommunicationError"
+
+ // ErrCodeIDPRejectedClaimException for service response error code
+ // "IDPRejectedClaim".
+ //
+ // The identity provider (IdP) reported that authentication failed. This might
+ // be because the claim is invalid.
+ //
+ // If this error is returned for the AssumeRoleWithWebIdentity operation, it
+ // can also mean that the claim has expired or has been explicitly revoked.
+ ErrCodeIDPRejectedClaimException = "IDPRejectedClaim"
+
+ // ErrCodeInvalidAuthorizationMessageException for service response error code
+ // "InvalidAuthorizationMessageException".
+ //
+ // The error returned if the message passed to DecodeAuthorizationMessage was
+ // invalid. This can happen if the token contains invalid characters, such as
+ // linebreaks.
+ ErrCodeInvalidAuthorizationMessageException = "InvalidAuthorizationMessageException"
+
+ // ErrCodeInvalidIdentityTokenException for service response error code
+ // "InvalidIdentityToken".
+ //
+ // The web identity token that was passed could not be validated by AWS. Get
+ // a new identity token from the identity provider and then retry the request.
+ ErrCodeInvalidIdentityTokenException = "InvalidIdentityToken"
+
+ // ErrCodeMalformedPolicyDocumentException for service response error code
+ // "MalformedPolicyDocument".
+ //
+ // The request was rejected because the policy document was malformed. The error
+ // message describes the specific error.
+ ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument"
+
+ // ErrCodePackedPolicyTooLargeException for service response error code
+ // "PackedPolicyTooLarge".
+ //
+ // The request was rejected because the policy document was too large. The error
+ // message describes how big the policy document is, in packed form, as a percentage
+ // of what the API allows.
+ ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge"
+
+ // ErrCodeRegionDisabledException for service response error code
+ // "RegionDisabledException".
+ //
+ // STS is not activated in the requested region for the account that is being
+ // asked to generate credentials. The account administrator must use the IAM
+ // console to activate STS in that region. For more information, see Activating
+ // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+ // in the IAM User Guide.
+ ErrCodeRegionDisabledException = "RegionDisabledException"
+)
diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
deleted file mode 100644
index 1fe3cf3..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when the code is running on Google App Engine, compiled by GopherJS, or
-// "-tags safe" is added to the go build command line. The "disableunsafe"
-// tag is deprecated and thus should not be used.
-// +build js appengine safe disableunsafe
-
-package spew
-
-import "reflect"
-
-const (
- // UnsafeDisabled is a build-time constant which specifies whether or
- // not access to the unsafe package is available.
- UnsafeDisabled = true
-)
-
-// unsafeReflectValue typically converts the passed reflect.Value into a one
-// that bypasses the typical safety restrictions preventing access to
-// unaddressable and unexported data. However, doing this relies on access to
-// the unsafe package. This is a stub version which simply returns the passed
-// reflect.Value when the unsafe package is not available.
-func unsafeReflectValue(v reflect.Value) reflect.Value {
- return v
-}
diff --git a/vendor/github.com/fatih/structs/structs.go b/vendor/github.com/fatih/structs/structs.go
index 06da620..be3816a 100644
--- a/vendor/github.com/fatih/structs/structs.go
+++ b/vendor/github.com/fatih/structs/structs.go
@@ -530,15 +530,22 @@ func (s *Struct) nested(val reflect.Value) interface{} {
finalVal = m
}
case reflect.Map:
- v := val.Type().Elem()
- if v.Kind() == reflect.Ptr {
- v = v.Elem()
+ // get the element type of the map
+ mapElem := val.Type()
+ switch val.Type().Kind() {
+ case reflect.Ptr, reflect.Array, reflect.Map,
+ reflect.Slice, reflect.Chan:
+ mapElem = val.Type().Elem()
+ if mapElem.Kind() == reflect.Ptr {
+ mapElem = mapElem.Elem()
+ }
}
// only iterate over struct types, ie: map[string]StructType,
// map[string][]StructType,
- if v.Kind() == reflect.Struct ||
- (v.Kind() == reflect.Slice && v.Elem().Kind() == reflect.Struct) {
+ if mapElem.Kind() == reflect.Struct ||
+ (mapElem.Kind() == reflect.Slice &&
+ mapElem.Elem().Kind() == reflect.Struct) {
m := make(map[string]interface{}, val.Len())
for _, k := range val.MapKeys() {
m[k.String()] = s.nested(val.MapIndex(k))
diff --git a/vendor/github.com/fsnotify/fsnotify/README.md b/vendor/github.com/fsnotify/fsnotify/README.md
index 25180c6..3993207 100644
--- a/vendor/github.com/fsnotify/fsnotify/README.md
+++ b/vendor/github.com/fsnotify/fsnotify/README.md
@@ -23,7 +23,7 @@ Cross platform: Windows, Linux, BSD and macOS.
\* Android and iOS are untested.
-Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) for usage. Consult the [Wiki](https://github.com/fsnotify/fsnotify/wiki) for the FAQ and further information.
+Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information.
## API stability
@@ -41,6 +41,35 @@ Please refer to [CONTRIBUTING][] before opening an issue or pull request.
See [example_test.go](https://github.com/fsnotify/fsnotify/blob/master/example_test.go).
+## FAQ
+
+**When a file is moved to another directory is it still being watched?**
+
+No (it shouldn't be, unless you are watching where it was moved to).
+
+**When I watch a directory, are all subdirectories watched as well?**
+
+No, you must add watches for any directory you want to watch (a recursive watcher is on the roadmap [#18][]).
+
+**Do I have to watch the Error and Event channels in a separate goroutine?**
+
+As of now, yes. Looking into making this single-thread friendly (see [howeyc #7][#7])
+
+**Why am I receiving multiple events for the same file on OS X?**
+
+Spotlight indexing on OS X can result in multiple events (see [howeyc #62][#62]). A temporary workaround is to add your folder(s) to the *Spotlight Privacy settings* until we have a native FSEvents implementation (see [#11][]).
+
+**How many files can be watched at once?**
+
+There are OS-specific limits as to how many watches can be created:
+* Linux: /proc/sys/fs/inotify/max_user_watches contains the limit, reaching this limit results in a "no space left on device" error.
+* BSD / OSX: sysctl variables "kern.maxfiles" and "kern.maxfilesperproc", reaching these limits results in a "too many open files" error.
+
+[#62]: https://github.com/howeyc/fsnotify/issues/62
+[#18]: https://github.com/fsnotify/fsnotify/issues/18
+[#11]: https://github.com/fsnotify/fsnotify/issues/11
+[#7]: https://github.com/howeyc/fsnotify/issues/7
+
[contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md
## Related Projects
diff --git a/vendor/github.com/go-ini/ini/README.md b/vendor/github.com/go-ini/ini/README.md
index 22a4234..8594742 100644
--- a/vendor/github.com/go-ini/ini/README.md
+++ b/vendor/github.com/go-ini/ini/README.md
@@ -1,4 +1,4 @@
-INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini)
+INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini) [![Sourcegraph](https://sourcegraph.com/github.com/go-ini/ini/-/badge.svg)](https://sourcegraph.com/github.com/go-ini/ini?badge)
===
![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200)
@@ -106,6 +106,12 @@ cfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, "my.cnf"))
The value of those keys are always `true`, and when you save to a file, it will keep in the same foramt as you read.
+To generate such keys in your program, you could use `NewBooleanKey`:
+
+```go
+key, err := sec.NewBooleanKey("skip-host-cache")
+```
+
#### Comment
Take care that following format will be treated as comment:
diff --git a/vendor/github.com/go-ini/ini/README_ZH.md b/vendor/github.com/go-ini/ini/README_ZH.md
index 3b4fb66..163432d 100644
--- a/vendor/github.com/go-ini/ini/README_ZH.md
+++ b/vendor/github.com/go-ini/ini/README_ZH.md
@@ -99,6 +99,12 @@ cfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, "my.cnf"))
这些键的值永远为 `true`,且在保存到文件时也只会输出键名。
+如果您想要通过程序来生成此类键,则可以使用 `NewBooleanKey`:
+
+```go
+key, err := sec.NewBooleanKey("skip-host-cache")
+```
+
#### 关于注释
下述几种情况的内容将被视为注释:
diff --git a/vendor/github.com/go-ini/ini/ini.go b/vendor/github.com/go-ini/ini/ini.go
index 50abd81..c343ded 100644
--- a/vendor/github.com/go-ini/ini/ini.go
+++ b/vendor/github.com/go-ini/ini/ini.go
@@ -37,7 +37,7 @@ const (
// Maximum allowed depth when recursively substituing variable names.
_DEPTH_VALUES = 99
- _VERSION = "1.23.0"
+ _VERSION = "1.24.0"
)
// Version returns current package version literal.
@@ -472,6 +472,9 @@ func (f *File) WriteToIndent(w io.Writer, indent string) (n int64, err error) {
}
if key.isBooleanType {
+ if kname != sec.keyList[len(sec.keyList)-1] {
+ buf.WriteString(LineBreak)
+ }
continue
}
diff --git a/vendor/github.com/go-ini/ini/parser.go b/vendor/github.com/go-ini/ini/parser.go
index b0aabe3..01ff20a 100644
--- a/vendor/github.com/go-ini/ini/parser.go
+++ b/vendor/github.com/go-ini/ini/parser.go
@@ -318,11 +318,14 @@ func (f *File) parse(reader io.Reader) (err error) {
if err != nil {
// Treat as boolean key when desired, and whole line is key name.
if IsErrDelimiterNotFound(err) && f.options.AllowBooleanKeys {
- key, err := section.NewKey(string(line), "true")
+ kname, err := p.readValue(line, f.options.IgnoreContinuation)
+ if err != nil {
+ return err
+ }
+ key, err := section.NewBooleanKey(kname)
if err != nil {
return err
}
- key.isBooleanType = true
key.Comment = strings.TrimSpace(p.comment.String())
p.comment.Reset()
continue
diff --git a/vendor/github.com/go-ini/ini/section.go b/vendor/github.com/go-ini/ini/section.go
index 45d2f3b..806f149 100644
--- a/vendor/github.com/go-ini/ini/section.go
+++ b/vendor/github.com/go-ini/ini/section.go
@@ -82,6 +82,17 @@ func (s *Section) NewKey(name, val string) (*Key, error) {
return s.keys[name], nil
}
+// NewBooleanKey creates a new boolean type key to given section.
+func (s *Section) NewBooleanKey(name string) (*Key, error) {
+ key, err := s.NewKey(name, "true")
+ if err != nil {
+ return nil, err
+ }
+
+ key.isBooleanType = true
+ return key, nil
+}
+
// GetKey returns key in section by given name.
func (s *Section) GetKey(name string) (*Key, error) {
// FIXME: change to section level lock?
diff --git a/vendor/github.com/go-ini/ini/struct.go b/vendor/github.com/go-ini/ini/struct.go
index d00fb4b..5ef38d8 100644
--- a/vendor/github.com/go-ini/ini/struct.go
+++ b/vendor/github.com/go-ini/ini/struct.go
@@ -174,7 +174,7 @@ func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim stri
}
field.SetUint(uintVal)
- case reflect.Float64:
+ case reflect.Float32, reflect.Float64:
floatVal, err := key.Float64()
if err != nil {
return nil
diff --git a/vendor/github.com/go-sql-driver/mysql/appengine.go b/vendor/github.com/go-sql-driver/mysql/appengine.go
deleted file mode 100644
index 565614e..0000000
--- a/vendor/github.com/go-sql-driver/mysql/appengine.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// +build appengine
-
-package mysql
-
-import (
- "appengine/cloudsql"
-)
-
-func init() {
- RegisterDial("cloudsql", cloudsql.Dial)
-}
diff --git a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
deleted file mode 100644
index fb512e2..0000000
--- a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
+++ /dev/null
@@ -1,484 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2012 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// +build appengine js
-
-// This file contains an implementation of proto field accesses using package reflect.
-// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
-// be used on App Engine.
-
-package proto
-
-import (
- "math"
- "reflect"
-)
-
-// A structPointer is a pointer to a struct.
-type structPointer struct {
- v reflect.Value
-}
-
-// toStructPointer returns a structPointer equivalent to the given reflect value.
-// The reflect value must itself be a pointer to a struct.
-func toStructPointer(v reflect.Value) structPointer {
- return structPointer{v}
-}
-
-// IsNil reports whether p is nil.
-func structPointer_IsNil(p structPointer) bool {
- return p.v.IsNil()
-}
-
-// Interface returns the struct pointer as an interface value.
-func structPointer_Interface(p structPointer, _ reflect.Type) interface{} {
- return p.v.Interface()
-}
-
-// A field identifies a field in a struct, accessible from a structPointer.
-// In this implementation, a field is identified by the sequence of field indices
-// passed to reflect's FieldByIndex.
-type field []int
-
-// toField returns a field equivalent to the given reflect field.
-func toField(f *reflect.StructField) field {
- return f.Index
-}
-
-// invalidField is an invalid field identifier.
-var invalidField = field(nil)
-
-// IsValid reports whether the field identifier is valid.
-func (f field) IsValid() bool { return f != nil }
-
-// field returns the given field in the struct as a reflect value.
-func structPointer_field(p structPointer, f field) reflect.Value {
- // Special case: an extension map entry with a value of type T
- // passes a *T to the struct-handling code with a zero field,
- // expecting that it will be treated as equivalent to *struct{ X T },
- // which has the same memory layout. We have to handle that case
- // specially, because reflect will panic if we call FieldByIndex on a
- // non-struct.
- if f == nil {
- return p.v.Elem()
- }
-
- return p.v.Elem().FieldByIndex(f)
-}
-
-// ifield returns the given field in the struct as an interface value.
-func structPointer_ifield(p structPointer, f field) interface{} {
- return structPointer_field(p, f).Addr().Interface()
-}
-
-// Bytes returns the address of a []byte field in the struct.
-func structPointer_Bytes(p structPointer, f field) *[]byte {
- return structPointer_ifield(p, f).(*[]byte)
-}
-
-// BytesSlice returns the address of a [][]byte field in the struct.
-func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
- return structPointer_ifield(p, f).(*[][]byte)
-}
-
-// Bool returns the address of a *bool field in the struct.
-func structPointer_Bool(p structPointer, f field) **bool {
- return structPointer_ifield(p, f).(**bool)
-}
-
-// BoolVal returns the address of a bool field in the struct.
-func structPointer_BoolVal(p structPointer, f field) *bool {
- return structPointer_ifield(p, f).(*bool)
-}
-
-// BoolSlice returns the address of a []bool field in the struct.
-func structPointer_BoolSlice(p structPointer, f field) *[]bool {
- return structPointer_ifield(p, f).(*[]bool)
-}
-
-// String returns the address of a *string field in the struct.
-func structPointer_String(p structPointer, f field) **string {
- return structPointer_ifield(p, f).(**string)
-}
-
-// StringVal returns the address of a string field in the struct.
-func structPointer_StringVal(p structPointer, f field) *string {
- return structPointer_ifield(p, f).(*string)
-}
-
-// StringSlice returns the address of a []string field in the struct.
-func structPointer_StringSlice(p structPointer, f field) *[]string {
- return structPointer_ifield(p, f).(*[]string)
-}
-
-// Extensions returns the address of an extension map field in the struct.
-func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
- return structPointer_ifield(p, f).(*XXX_InternalExtensions)
-}
-
-// ExtMap returns the address of an extension map field in the struct.
-func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
- return structPointer_ifield(p, f).(*map[int32]Extension)
-}
-
-// NewAt returns the reflect.Value for a pointer to a field in the struct.
-func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
- return structPointer_field(p, f).Addr()
-}
-
-// SetStructPointer writes a *struct field in the struct.
-func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
- structPointer_field(p, f).Set(q.v)
-}
-
-// GetStructPointer reads a *struct field in the struct.
-func structPointer_GetStructPointer(p structPointer, f field) structPointer {
- return structPointer{structPointer_field(p, f)}
-}
-
-// StructPointerSlice the address of a []*struct field in the struct.
-func structPointer_StructPointerSlice(p structPointer, f field) structPointerSlice {
- return structPointerSlice{structPointer_field(p, f)}
-}
-
-// A structPointerSlice represents the address of a slice of pointers to structs
-// (themselves messages or groups). That is, v.Type() is *[]*struct{...}.
-type structPointerSlice struct {
- v reflect.Value
-}
-
-func (p structPointerSlice) Len() int { return p.v.Len() }
-func (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} }
-func (p structPointerSlice) Append(q structPointer) {
- p.v.Set(reflect.Append(p.v, q.v))
-}
-
-var (
- int32Type = reflect.TypeOf(int32(0))
- uint32Type = reflect.TypeOf(uint32(0))
- float32Type = reflect.TypeOf(float32(0))
- int64Type = reflect.TypeOf(int64(0))
- uint64Type = reflect.TypeOf(uint64(0))
- float64Type = reflect.TypeOf(float64(0))
-)
-
-// A word32 represents a field of type *int32, *uint32, *float32, or *enum.
-// That is, v.Type() is *int32, *uint32, *float32, or *enum and v is assignable.
-type word32 struct {
- v reflect.Value
-}
-
-// IsNil reports whether p is nil.
-func word32_IsNil(p word32) bool {
- return p.v.IsNil()
-}
-
-// Set sets p to point at a newly allocated word with bits set to x.
-func word32_Set(p word32, o *Buffer, x uint32) {
- t := p.v.Type().Elem()
- switch t {
- case int32Type:
- if len(o.int32s) == 0 {
- o.int32s = make([]int32, uint32PoolSize)
- }
- o.int32s[0] = int32(x)
- p.v.Set(reflect.ValueOf(&o.int32s[0]))
- o.int32s = o.int32s[1:]
- return
- case uint32Type:
- if len(o.uint32s) == 0 {
- o.uint32s = make([]uint32, uint32PoolSize)
- }
- o.uint32s[0] = x
- p.v.Set(reflect.ValueOf(&o.uint32s[0]))
- o.uint32s = o.uint32s[1:]
- return
- case float32Type:
- if len(o.float32s) == 0 {
- o.float32s = make([]float32, uint32PoolSize)
- }
- o.float32s[0] = math.Float32frombits(x)
- p.v.Set(reflect.ValueOf(&o.float32s[0]))
- o.float32s = o.float32s[1:]
- return
- }
-
- // must be enum
- p.v.Set(reflect.New(t))
- p.v.Elem().SetInt(int64(int32(x)))
-}
-
-// Get gets the bits pointed at by p, as a uint32.
-func word32_Get(p word32) uint32 {
- elem := p.v.Elem()
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
-}
-
-// Word32 returns a reference to a *int32, *uint32, *float32, or *enum field in the struct.
-func structPointer_Word32(p structPointer, f field) word32 {
- return word32{structPointer_field(p, f)}
-}
-
-// A word32Val represents a field of type int32, uint32, float32, or enum.
-// That is, v.Type() is int32, uint32, float32, or enum and v is assignable.
-type word32Val struct {
- v reflect.Value
-}
-
-// Set sets *p to x.
-func word32Val_Set(p word32Val, x uint32) {
- switch p.v.Type() {
- case int32Type:
- p.v.SetInt(int64(x))
- return
- case uint32Type:
- p.v.SetUint(uint64(x))
- return
- case float32Type:
- p.v.SetFloat(float64(math.Float32frombits(x)))
- return
- }
-
- // must be enum
- p.v.SetInt(int64(int32(x)))
-}
-
-// Get gets the bits pointed at by p, as a uint32.
-func word32Val_Get(p word32Val) uint32 {
- elem := p.v
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
-}
-
-// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct.
-func structPointer_Word32Val(p structPointer, f field) word32Val {
- return word32Val{structPointer_field(p, f)}
-}
-
-// A word32Slice is a slice of 32-bit values.
-// That is, v.Type() is []int32, []uint32, []float32, or []enum.
-type word32Slice struct {
- v reflect.Value
-}
-
-func (p word32Slice) Append(x uint32) {
- n, m := p.v.Len(), p.v.Cap()
- if n < m {
- p.v.SetLen(n + 1)
- } else {
- t := p.v.Type().Elem()
- p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
- }
- elem := p.v.Index(n)
- switch elem.Kind() {
- case reflect.Int32:
- elem.SetInt(int64(int32(x)))
- case reflect.Uint32:
- elem.SetUint(uint64(x))
- case reflect.Float32:
- elem.SetFloat(float64(math.Float32frombits(x)))
- }
-}
-
-func (p word32Slice) Len() int {
- return p.v.Len()
-}
-
-func (p word32Slice) Index(i int) uint32 {
- elem := p.v.Index(i)
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
-}
-
-// Word32Slice returns a reference to a []int32, []uint32, []float32, or []enum field in the struct.
-func structPointer_Word32Slice(p structPointer, f field) word32Slice {
- return word32Slice{structPointer_field(p, f)}
-}
-
-// word64 is like word32 but for 64-bit values.
-type word64 struct {
- v reflect.Value
-}
-
-func word64_Set(p word64, o *Buffer, x uint64) {
- t := p.v.Type().Elem()
- switch t {
- case int64Type:
- if len(o.int64s) == 0 {
- o.int64s = make([]int64, uint64PoolSize)
- }
- o.int64s[0] = int64(x)
- p.v.Set(reflect.ValueOf(&o.int64s[0]))
- o.int64s = o.int64s[1:]
- return
- case uint64Type:
- if len(o.uint64s) == 0 {
- o.uint64s = make([]uint64, uint64PoolSize)
- }
- o.uint64s[0] = x
- p.v.Set(reflect.ValueOf(&o.uint64s[0]))
- o.uint64s = o.uint64s[1:]
- return
- case float64Type:
- if len(o.float64s) == 0 {
- o.float64s = make([]float64, uint64PoolSize)
- }
- o.float64s[0] = math.Float64frombits(x)
- p.v.Set(reflect.ValueOf(&o.float64s[0]))
- o.float64s = o.float64s[1:]
- return
- }
- panic("unreachable")
-}
-
-func word64_IsNil(p word64) bool {
- return p.v.IsNil()
-}
-
-func word64_Get(p word64) uint64 {
- elem := p.v.Elem()
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return elem.Uint()
- case reflect.Float64:
- return math.Float64bits(elem.Float())
- }
- panic("unreachable")
-}
-
-func structPointer_Word64(p structPointer, f field) word64 {
- return word64{structPointer_field(p, f)}
-}
-
-// word64Val is like word32Val but for 64-bit values.
-type word64Val struct {
- v reflect.Value
-}
-
-func word64Val_Set(p word64Val, o *Buffer, x uint64) {
- switch p.v.Type() {
- case int64Type:
- p.v.SetInt(int64(x))
- return
- case uint64Type:
- p.v.SetUint(x)
- return
- case float64Type:
- p.v.SetFloat(math.Float64frombits(x))
- return
- }
- panic("unreachable")
-}
-
-func word64Val_Get(p word64Val) uint64 {
- elem := p.v
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return elem.Uint()
- case reflect.Float64:
- return math.Float64bits(elem.Float())
- }
- panic("unreachable")
-}
-
-func structPointer_Word64Val(p structPointer, f field) word64Val {
- return word64Val{structPointer_field(p, f)}
-}
-
-type word64Slice struct {
- v reflect.Value
-}
-
-func (p word64Slice) Append(x uint64) {
- n, m := p.v.Len(), p.v.Cap()
- if n < m {
- p.v.SetLen(n + 1)
- } else {
- t := p.v.Type().Elem()
- p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
- }
- elem := p.v.Index(n)
- switch elem.Kind() {
- case reflect.Int64:
- elem.SetInt(int64(int64(x)))
- case reflect.Uint64:
- elem.SetUint(uint64(x))
- case reflect.Float64:
- elem.SetFloat(float64(math.Float64frombits(x)))
- }
-}
-
-func (p word64Slice) Len() int {
- return p.v.Len()
-}
-
-func (p word64Slice) Index(i int) uint64 {
- elem := p.v.Index(i)
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return uint64(elem.Uint())
- case reflect.Float64:
- return math.Float64bits(float64(elem.Float()))
- }
- panic("unreachable")
-}
-
-func structPointer_Word64Slice(p structPointer, f field) word64Slice {
- return word64Slice{structPointer_field(p, f)}
-}
diff --git a/vendor/github.com/google/go-github/github/activity_events.go b/vendor/github.com/google/go-github/github/activity_events.go
index 557001e..5cdcabe 100644
--- a/vendor/github.com/google/go-github/github/activity_events.go
+++ b/vendor/github.com/google/go-github/github/activity_events.go
@@ -63,6 +63,8 @@ func (e *Event) Payload() (payload interface{}) {
payload = &MembershipEvent{}
case "MilestoneEvent":
payload = &MilestoneEvent{}
+ case "OrganizationEvent":
+ payload = &OrganizationEvent{}
case "PageBuildEvent":
payload = &PageBuildEvent{}
case "PingEvent":
@@ -108,13 +110,13 @@ func (s *ActivityService) ListEvents(opt *ListOptions) ([]*Event, *Response, err
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListRepositoryEvents lists events for a repository.
@@ -132,13 +134,13 @@ func (s *ActivityService) ListRepositoryEvents(owner, repo string, opt *ListOpti
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListIssueEventsForRepository lists issue events for a repository.
@@ -156,13 +158,13 @@ func (s *ActivityService) ListIssueEventsForRepository(owner, repo string, opt *
return nil, nil, err
}
- events := new([]*IssueEvent)
- resp, err := s.client.Do(req, events)
+ var events []*IssueEvent
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListEventsForRepoNetwork lists public events for a network of repositories.
@@ -180,13 +182,13 @@ func (s *ActivityService) ListEventsForRepoNetwork(owner, repo string, opt *List
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListEventsForOrganization lists public events for an organization.
@@ -204,13 +206,13 @@ func (s *ActivityService) ListEventsForOrganization(org string, opt *ListOptions
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is
@@ -234,13 +236,13 @@ func (s *ActivityService) ListEventsPerformedByUser(user string, publicOnly bool
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListEventsReceivedByUser lists the events received by a user. If publicOnly is
@@ -264,13 +266,13 @@ func (s *ActivityService) ListEventsReceivedByUser(user string, publicOnly bool,
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
// ListUserEventsForOrganization provides the user’s organization dashboard. You
@@ -289,11 +291,11 @@ func (s *ActivityService) ListUserEventsForOrganization(org, user string, opt *L
return nil, nil, err
}
- events := new([]*Event)
- resp, err := s.client.Do(req, events)
+ var events []*Event
+ resp, err := s.client.Do(req, &events)
if err != nil {
return nil, resp, err
}
- return *events, resp, err
+ return events, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/activity_star.go b/vendor/github.com/google/go-github/github/activity_star.go
index 5df6814..edf20e8 100644
--- a/vendor/github.com/google/go-github/github/activity_star.go
+++ b/vendor/github.com/google/go-github/github/activity_star.go
@@ -37,13 +37,13 @@ func (s *ActivityService) ListStargazers(owner, repo string, opt *ListOptions) (
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeStarringPreview)
- stargazers := new([]*Stargazer)
- resp, err := s.client.Do(req, stargazers)
+ var stargazers []*Stargazer
+ resp, err := s.client.Do(req, &stargazers)
if err != nil {
return nil, resp, err
}
- return *stargazers, resp, err
+ return stargazers, resp, nil
}
// ActivityListStarredOptions specifies the optional parameters to the
@@ -84,13 +84,13 @@ func (s *ActivityService) ListStarred(user string, opt *ActivityListStarredOptio
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeStarringPreview)
- repos := new([]*StarredRepository)
- resp, err := s.client.Do(req, repos)
+ var repos []*StarredRepository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// IsStarred checks if a repository is starred by authenticated user.
diff --git a/vendor/github.com/google/go-github/github/activity_watching.go b/vendor/github.com/google/go-github/github/activity_watching.go
index 9a27541..ac77657 100644
--- a/vendor/github.com/google/go-github/github/activity_watching.go
+++ b/vendor/github.com/google/go-github/github/activity_watching.go
@@ -37,13 +37,13 @@ func (s *ActivityService) ListWatchers(owner, repo string, opt *ListOptions) ([]
return nil, nil, err
}
- watchers := new([]*User)
- resp, err := s.client.Do(req, watchers)
+ var watchers []*User
+ resp, err := s.client.Do(req, &watchers)
if err != nil {
return nil, resp, err
}
- return *watchers, resp, err
+ return watchers, resp, nil
}
// ListWatched lists the repositories the specified user is watching. Passing
@@ -67,13 +67,13 @@ func (s *ActivityService) ListWatched(user string, opt *ListOptions) ([]*Reposit
return nil, nil, err
}
- watched := new([]*Repository)
- resp, err := s.client.Do(req, watched)
+ var watched []*Repository
+ resp, err := s.client.Do(req, &watched)
if err != nil {
return nil, resp, err
}
- return *watched, resp, err
+ return watched, resp, nil
}
// GetRepositorySubscription returns the subscription for the specified
diff --git a/vendor/github.com/google/go-github/github/authorizations.go b/vendor/github.com/google/go-github/github/authorizations.go
index d5a5e63..9f2a1ec 100644
--- a/vendor/github.com/google/go-github/github/authorizations.go
+++ b/vendor/github.com/google/go-github/github/authorizations.go
@@ -146,12 +146,12 @@ func (s *AuthorizationsService) List(opt *ListOptions) ([]*Authorization, *Respo
return nil, nil, err
}
- auths := new([]*Authorization)
- resp, err := s.client.Do(req, auths)
+ var auths []*Authorization
+ resp, err := s.client.Do(req, &auths)
if err != nil {
return nil, resp, err
}
- return *auths, resp, err
+ return auths, resp, nil
}
// Get a single authorization.
diff --git a/vendor/github.com/google/go-github/github/event_types.go b/vendor/github.com/google/go-github/github/event_types.go
index a1ffa69..6dd7fe3 100644
--- a/vendor/github.com/google/go-github/github/event_types.go
+++ b/vendor/github.com/google/go-github/github/event_types.go
@@ -15,9 +15,10 @@ type CommitCommentEvent struct {
Comment *RepositoryComment `json:"comment,omitempty"`
// The following fields are only populated by Webhook events.
- Action *string `json:"action,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Action *string `json:"action,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// CreateEvent represents a created repository, branch, or tag.
@@ -36,9 +37,10 @@ type CreateEvent struct {
Description *string `json:"description,omitempty"`
// The following fields are only populated by Webhook events.
- PusherType *string `json:"pusher_type,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ PusherType *string `json:"pusher_type,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// DeleteEvent represents a deleted branch or tag.
@@ -54,9 +56,10 @@ type DeleteEvent struct {
RefType *string `json:"ref_type,omitempty"`
// The following fields are only populated by Webhook events.
- PusherType *string `json:"pusher_type,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ PusherType *string `json:"pusher_type,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// DeploymentEvent represents a deployment.
@@ -70,7 +73,8 @@ type DeploymentEvent struct {
Repo *Repository `json:"repository,omitempty"`
// The following fields are only populated by Webhook events.
- Sender *User `json:"sender,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// DeploymentStatusEvent represents a deployment status.
@@ -85,7 +89,8 @@ type DeploymentStatusEvent struct {
Repo *Repository `json:"repository,omitempty"`
// The following fields are only populated by Webhook events.
- Sender *User `json:"sender,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// ForkEvent is triggered when a user forks a repository.
@@ -97,8 +102,9 @@ type ForkEvent struct {
Forkee *Repository `json:"forkee,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// Page represents a single Wiki page.
@@ -119,8 +125,9 @@ type GollumEvent struct {
Pages []*Page `json:"pages,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// IssueActivityEvent represents the payload delivered by Issue webhook.
@@ -131,8 +138,9 @@ type IssueActivityEvent struct {
Issue *Issue `json:"issue,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// EditChange represents the changes when an issue, pull request, or comment has
@@ -154,8 +162,8 @@ type IntegrationInstallationEvent struct {
// The action that was performed. Possible values for an "integration_installation"
// event are: "created", "deleted".
Action *string `json:"action,omitempty"`
- Installation *Installation `json:"installation,omitempty"`
Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// IntegrationInstallationRepositoriesEvent is triggered when an integration repository
@@ -166,10 +174,10 @@ type IntegrationInstallationRepositoriesEvent struct {
// The action that was performed. Possible values for an "integration_installation_repositories"
// event are: "added", "removed".
Action *string `json:"action,omitempty"`
- Installation *Installation `json:"installation,omitempty"`
RepositoriesAdded []*Repository `json:"repositories_added,omitempty"`
RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"`
Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// IssueCommentEvent is triggered when an issue comment is created on an issue
@@ -185,9 +193,10 @@ type IssueCommentEvent struct {
Comment *IssueComment `json:"comment,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// IssuesEvent is triggered when an issue is assigned, unassigned, labeled,
@@ -204,9 +213,10 @@ type IssuesEvent struct {
Label *Label `json:"label,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// LabelEvent is triggered when a repository's label is created, edited, or deleted.
@@ -220,9 +230,10 @@ type LabelEvent struct {
Label *Label `json:"label,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Org *Organization `json:"organization,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Org *Organization `json:"organization,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// MemberEvent is triggered when a user is added as a collaborator to a repository.
@@ -235,8 +246,9 @@ type MemberEvent struct {
Member *User `json:"member,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// MembershipEvent is triggered when a user is added or removed from a team.
@@ -255,8 +267,9 @@ type MembershipEvent struct {
Team *Team `json:"team,omitempty"`
// The following fields are only populated by Webhook events.
- Org *Organization `json:"organization,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Org *Organization `json:"organization,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted.
@@ -270,10 +283,33 @@ type MilestoneEvent struct {
Milestone *Milestone `json:"milestone,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
- Org *Organization `json:"organization,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Org *Organization `json:"organization,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
+}
+
+// OrganizationEvent is triggered when a user is added, removed, or invited to an organization.
+// Events of this type are not visible in timelines. These events are only used to trigger organization hooks.
+// Webhook event name is "organization".
+//
+// Github docs: https://developer.github.com/v3/activity/events/types/#organizationevent
+type OrganizationEvent struct {
+ // Action is the action that was performed.
+ // Can be one of "member_added", "member_removed", or "member_invited".
+ Action *string `json:"action,omitempty"`
+
+ // Invitaion is the invitation for the user or email if the action is "member_invited".
+ Invitation *Invitation `json:"invitation,omitempty"`
+
+ // Membership is the membership between the user and the organization.
+ // Not present when the action is "member_invited".
+ Membership *Membership `json:"membership,omitempty"`
+
+ Organization *Organization `json:"organization,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PageBuildEvent represents an attempted build of a GitHub Pages site, whether
@@ -290,9 +326,10 @@ type PageBuildEvent struct {
Build *PagesBuild `json:"build,omitempty"`
// The following fields are only populated by Webhook events.
- ID *int `json:"id,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ ID *int `json:"id,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PingEvent is triggered when a Webhook is added to GitHub.
@@ -304,7 +341,8 @@ type PingEvent struct {
// The ID of the webhook that triggered the ping.
HookID *int `json:"hook_id,omitempty"`
// The webhook configuration.
- Hook *Hook `json:"hook,omitempty"`
+ Hook *Hook `json:"hook,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PublicEvent is triggered when a private repository is open sourced.
@@ -314,8 +352,9 @@ type PingEvent struct {
// GitHub docs: https://developer.github.com/v3/activity/events/types/#publicevent
type PublicEvent struct {
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PullRequestEvent is triggered when a pull request is assigned, unassigned,
@@ -334,9 +373,10 @@ type PullRequestEvent struct {
PullRequest *PullRequest `json:"pull_request,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PullRequestReviewEvent is triggered when a review is submitted on a pull
@@ -351,8 +391,9 @@ type PullRequestReviewEvent struct {
PullRequest *PullRequest `json:"pull_request,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
// The following field is only present when the webhook is triggered on
// a repository belonging to an organization.
@@ -372,34 +413,36 @@ type PullRequestReviewCommentEvent struct {
Comment *PullRequestComment `json:"comment,omitempty"`
// The following fields are only populated by Webhook events.
- Changes *EditChange `json:"changes,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Changes *EditChange `json:"changes,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// PushEvent represents a git push to a GitHub repository.
//
// GitHub API docs: http://developer.github.com/v3/activity/events/types/#pushevent
type PushEvent struct {
- PushID *int `json:"push_id,omitempty"`
- Head *string `json:"head,omitempty"`
- Ref *string `json:"ref,omitempty"`
- Size *int `json:"size,omitempty"`
- Commits []PushEventCommit `json:"commits,omitempty"`
- Repo *PushEventRepository `json:"repository,omitempty"`
- Before *string `json:"before,omitempty"`
- DistinctSize *int `json:"distinct_size,omitempty"`
+ PushID *int `json:"push_id,omitempty"`
+ Head *string `json:"head,omitempty"`
+ Ref *string `json:"ref,omitempty"`
+ Size *int `json:"size,omitempty"`
+ Commits []PushEventCommit `json:"commits,omitempty"`
+ Before *string `json:"before,omitempty"`
+ DistinctSize *int `json:"distinct_size,omitempty"`
// The following fields are only populated by Webhook events.
- After *string `json:"after,omitempty"`
- Created *bool `json:"created,omitempty"`
- Deleted *bool `json:"deleted,omitempty"`
- Forced *bool `json:"forced,omitempty"`
- BaseRef *string `json:"base_ref,omitempty"`
- Compare *string `json:"compare,omitempty"`
- HeadCommit *PushEventCommit `json:"head_commit,omitempty"`
- Pusher *User `json:"pusher,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ After *string `json:"after,omitempty"`
+ Created *bool `json:"created,omitempty"`
+ Deleted *bool `json:"deleted,omitempty"`
+ Forced *bool `json:"forced,omitempty"`
+ BaseRef *string `json:"base_ref,omitempty"`
+ Compare *string `json:"compare,omitempty"`
+ Repo *PushEventRepository `json:"repository,omitempty"`
+ HeadCommit *PushEventCommit `json:"head_commit,omitempty"`
+ Pusher *User `json:"pusher,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
func (p PushEvent) String() string {
@@ -430,7 +473,7 @@ func (p PushEventCommit) String() string {
return Stringify(p)
}
-// PushEventRepository represents the repo object in a PushEvent payload
+// PushEventRepository represents the repo object in a PushEvent payload.
type PushEventRepository struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
@@ -456,13 +499,16 @@ type PushEventRepository struct {
DefaultBranch *string `json:"default_branch,omitempty"`
MasterBranch *string `json:"master_branch,omitempty"`
Organization *string `json:"organization,omitempty"`
-
- // The following fields are only populated by Webhook events.
- URL *string `json:"url,omitempty"`
- HTMLURL *string `json:"html_url,omitempty"`
+ URL *string `json:"url,omitempty"`
+ HTMLURL *string `json:"html_url,omitempty"`
+ StatusesURL *string `json:"statuses_url,omitempty"`
+ GitURL *string `json:"git_url,omitempty"`
+ SSHURL *string `json:"ssh_url,omitempty"`
+ CloneURL *string `json:"clone_url,omitempty"`
+ SVNURL *string `json:"svn_url,omitempty"`
}
-// PushEventRepoOwner is a basic reporesntation of user/org in a PushEvent payload
+// PushEventRepoOwner is a basic representation of user/org in a PushEvent payload.
type PushEventRepoOwner struct {
Name *string `json:"name,omitempty"`
Email *string `json:"email,omitempty"`
@@ -478,8 +524,9 @@ type ReleaseEvent struct {
Release *RepositoryRelease `json:"release,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// RepositoryEvent is triggered when a repository is created.
@@ -496,8 +543,9 @@ type RepositoryEvent struct {
Repo *Repository `json:"repository,omitempty"`
// The following fields are only populated by Webhook events.
- Org *Organization `json:"organization,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Org *Organization `json:"organization,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// StatusEvent is triggered when the status of a Git commit changes.
@@ -516,14 +564,15 @@ type StatusEvent struct {
Branches []*Branch `json:"branches,omitempty"`
// The following fields are only populated by Webhook events.
- ID *int `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Context *string `json:"context,omitempty"`
- Commit *RepositoryCommit `json:"commit,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- UpdatedAt *Timestamp `json:"updated_at,omitempty"`
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ ID *int `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Context *string `json:"context,omitempty"`
+ Commit *RepositoryCommit `json:"commit,omitempty"`
+ CreatedAt *Timestamp `json:"created_at,omitempty"`
+ UpdatedAt *Timestamp `json:"updated_at,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// TeamAddEvent is triggered when a repository is added to a team.
@@ -538,8 +587,9 @@ type TeamAddEvent struct {
Repo *Repository `json:"repository,omitempty"`
// The following fields are only populated by Webhook events.
- Org *Organization `json:"organization,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Org *Organization `json:"organization,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
// WatchEvent is related to starring a repository, not watching. See this API
@@ -554,6 +604,7 @@ type WatchEvent struct {
Action *string `json:"action,omitempty"`
// The following fields are only populated by Webhook events.
- Repo *Repository `json:"repository,omitempty"`
- Sender *User `json:"sender,omitempty"`
+ Repo *Repository `json:"repository,omitempty"`
+ Sender *User `json:"sender,omitempty"`
+ Installation *Installation `json:"installation,omitempty"`
}
diff --git a/vendor/github.com/google/go-github/github/gists.go b/vendor/github.com/google/go-github/github/gists.go
index a3327f8..81f55b1 100644
--- a/vendor/github.com/google/go-github/github/gists.go
+++ b/vendor/github.com/google/go-github/github/gists.go
@@ -42,6 +42,7 @@ type GistFilename string
type GistFile struct {
Size *int `json:"size,omitempty"`
Filename *string `json:"filename,omitempty"`
+ Language *string `json:"language,omitempty"`
Type *string `json:"type,omitempty"`
RawURL *string `json:"raw_url,omitempty"`
Content *string `json:"content,omitempty"`
@@ -109,13 +110,13 @@ func (s *GistsService) List(user string, opt *GistListOptions) ([]*Gist, *Respon
return nil, nil, err
}
- gists := new([]*Gist)
- resp, err := s.client.Do(req, gists)
+ var gists []*Gist
+ resp, err := s.client.Do(req, &gists)
if err != nil {
return nil, resp, err
}
- return *gists, resp, err
+ return gists, resp, nil
}
// ListAll lists all public gists.
@@ -132,13 +133,13 @@ func (s *GistsService) ListAll(opt *GistListOptions) ([]*Gist, *Response, error)
return nil, nil, err
}
- gists := new([]*Gist)
- resp, err := s.client.Do(req, gists)
+ var gists []*Gist
+ resp, err := s.client.Do(req, &gists)
if err != nil {
return nil, resp, err
}
- return *gists, resp, err
+ return gists, resp, nil
}
// ListStarred lists starred gists of authenticated user.
@@ -155,13 +156,13 @@ func (s *GistsService) ListStarred(opt *GistListOptions) ([]*Gist, *Response, er
return nil, nil, err
}
- gists := new([]*Gist)
- resp, err := s.client.Do(req, gists)
+ var gists []*Gist
+ resp, err := s.client.Do(req, &gists)
if err != nil {
return nil, resp, err
}
- return *gists, resp, err
+ return gists, resp, nil
}
// Get a single gist.
@@ -246,13 +247,13 @@ func (s *GistsService) ListCommits(id string) ([]*GistCommit, *Response, error)
return nil, nil, err
}
- gistCommits := new([]*GistCommit)
- resp, err := s.client.Do(req, gistCommits)
+ var gistCommits []*GistCommit
+ resp, err := s.client.Do(req, &gistCommits)
if err != nil {
return nil, resp, err
}
- return *gistCommits, resp, err
+ return gistCommits, resp, nil
}
// Delete a gist.
@@ -334,11 +335,11 @@ func (s *GistsService) ListForks(id string) ([]*GistFork, *Response, error) {
return nil, nil, err
}
- gistForks := new([]*GistFork)
- resp, err := s.client.Do(req, gistForks)
+ var gistForks []*GistFork
+ resp, err := s.client.Do(req, &gistForks)
if err != nil {
return nil, resp, err
}
- return *gistForks, resp, err
+ return gistForks, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/gists_comments.go b/vendor/github.com/google/go-github/github/gists_comments.go
index 95a7fc7..71c1c01 100644
--- a/vendor/github.com/google/go-github/github/gists_comments.go
+++ b/vendor/github.com/google/go-github/github/gists_comments.go
@@ -38,13 +38,13 @@ func (s *GistsService) ListComments(gistID string, opt *ListOptions) ([]*GistCom
return nil, nil, err
}
- comments := new([]*GistComment)
- resp, err := s.client.Do(req, comments)
+ var comments []*GistComment
+ resp, err := s.client.Do(req, &comments)
if err != nil {
return nil, resp, err
}
- return *comments, resp, err
+ return comments, resp, nil
}
// GetComment retrieves a single comment from a gist.
diff --git a/vendor/github.com/google/go-github/github/github.go b/vendor/github.com/google/go-github/github/github.go
index 3d7421f..a58dbfb 100644
--- a/vendor/github.com/google/go-github/github/github.go
+++ b/vendor/github.com/google/go-github/github/github.go
@@ -85,14 +85,20 @@ const (
// https://developer.github.com/changes/2016-07-06-github-pages-preiew-api/
mediaTypePagesPreview = "application/vnd.github.mister-fantastic-preview+json"
- // https://developer.github.com/v3/repos/traffic/
- mediaTypeTrafficPreview = "application/vnd.github.spiderman-preview+json"
-
// https://developer.github.com/changes/2016-09-14-projects-api/
mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
// https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"
+
+ // https://developer.github.com/changes/2016-11-28-preview-org-membership/
+ mediaTypeOrgMembershipPreview = "application/vnd.github.korra-preview+json"
+
+ // https://developer.github.com/changes/2017-01-05-commit-search-api/
+ mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview+json"
+
+ // https://developer.github.com/changes/2016-12-14-reviews-api/
+ mediaTypePullRequestReviewsPreview = "application/vnd.github.black-cat-preview+json"
)
// A Client manages communication with the GitHub API.
@@ -406,6 +412,12 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
resp, err := c.client.Do(req)
if err != nil {
+ if e, ok := err.(*url.Error); ok {
+ if url, err := url.Parse(e.URL); err == nil {
+ e.URL = sanitizeURL(url).String()
+ return nil, e
+ }
+ }
return nil, err
}
@@ -550,7 +562,7 @@ func (r *AbuseRateLimitError) Error() string {
}
// sanitizeURL redacts the client_secret parameter from the URL which may be
-// exposed to the user, specifically in the ErrorResponse error message.
+// exposed to the user.
func sanitizeURL(uri *url.URL) *url.URL {
if uri == nil {
return nil
diff --git a/vendor/github.com/google/go-github/github/gitignore.go b/vendor/github.com/google/go-github/github/gitignore.go
index faaceb5..3f1f565 100644
--- a/vendor/github.com/google/go-github/github/gitignore.go
+++ b/vendor/github.com/google/go-github/github/gitignore.go
@@ -32,13 +32,13 @@ func (s GitignoresService) List() ([]string, *Response, error) {
return nil, nil, err
}
- availableTemplates := new([]string)
- resp, err := s.client.Do(req, availableTemplates)
+ var availableTemplates []string
+ resp, err := s.client.Do(req, &availableTemplates)
if err != nil {
return nil, resp, err
}
- return *availableTemplates, resp, err
+ return availableTemplates, resp, nil
}
// Get a Gitignore by name.
diff --git a/vendor/github.com/google/go-github/github/integration.go b/vendor/github.com/google/go-github/github/integration.go
index b8d77ca..033ee44 100644
--- a/vendor/github.com/google/go-github/github/integration.go
+++ b/vendor/github.com/google/go-github/github/integration.go
@@ -28,11 +28,11 @@ func (s *IntegrationsService) ListInstallations(opt *ListOptions) ([]*Installati
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeIntegrationPreview)
- i := new([]*Installation)
+ var i []*Installation
resp, err := s.client.Do(req, &i)
if err != nil {
return nil, resp, err
}
- return *i, resp, err
+ return i, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/issues.go b/vendor/github.com/google/go-github/github/issues.go
index d8e7d41..b14939e 100644
--- a/vendor/github.com/google/go-github/github/issues.go
+++ b/vendor/github.com/google/go-github/github/issues.go
@@ -141,13 +141,13 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, *
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- issues := new([]*Issue)
- resp, err := s.client.Do(req, issues)
+ var issues []*Issue
+ resp, err := s.client.Do(req, &issues)
if err != nil {
return nil, resp, err
}
- return *issues, resp, err
+ return issues, resp, nil
}
// IssueListByRepoOptions specifies the optional parameters to the
@@ -208,13 +208,13 @@ func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRe
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- issues := new([]*Issue)
- resp, err := s.client.Do(req, issues)
+ var issues []*Issue
+ resp, err := s.client.Do(req, &issues)
if err != nil {
return nil, resp, err
}
- return *issues, resp, err
+ return issues, resp, nil
}
// Get a single issue.
@@ -236,7 +236,7 @@ func (s *IssuesService) Get(owner string, repo string, number int) (*Issue, *Res
return nil, resp, err
}
- return issue, resp, err
+ return issue, resp, nil
}
// Create a new issue on the specified repository.
@@ -255,7 +255,7 @@ func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) (
return nil, resp, err
}
- return i, resp, err
+ return i, resp, nil
}
// Edit an issue.
@@ -274,7 +274,7 @@ func (s *IssuesService) Edit(owner string, repo string, number int, issue *Issue
return nil, resp, err
}
- return i, resp, err
+ return i, resp, nil
}
// Lock an issue's conversation.
diff --git a/vendor/github.com/google/go-github/github/issues_assignees.go b/vendor/github.com/google/go-github/github/issues_assignees.go
index 2503be1..1f06102 100644
--- a/vendor/github.com/google/go-github/github/issues_assignees.go
+++ b/vendor/github.com/google/go-github/github/issues_assignees.go
@@ -22,13 +22,13 @@ func (s *IssuesService) ListAssignees(owner, repo string, opt *ListOptions) ([]*
if err != nil {
return nil, nil, err
}
- assignees := new([]*User)
- resp, err := s.client.Do(req, assignees)
+ var assignees []*User
+ resp, err := s.client.Do(req, &assignees)
if err != nil {
return nil, resp, err
}
- return *assignees, resp, err
+ return assignees, resp, nil
}
// IsAssignee checks if a user is an assignee for the specified repository.
diff --git a/vendor/github.com/google/go-github/github/issues_comments.go b/vendor/github.com/google/go-github/github/issues_comments.go
index b24c5ae..7d46913 100644
--- a/vendor/github.com/google/go-github/github/issues_comments.go
+++ b/vendor/github.com/google/go-github/github/issues_comments.go
@@ -66,13 +66,13 @@ func (s *IssuesService) ListComments(owner string, repo string, number int, opt
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- comments := new([]*IssueComment)
- resp, err := s.client.Do(req, comments)
+ var comments []*IssueComment
+ resp, err := s.client.Do(req, &comments)
if err != nil {
return nil, resp, err
}
- return *comments, resp, err
+ return comments, resp, nil
}
// GetComment fetches the specified issue comment.
@@ -95,7 +95,7 @@ func (s *IssuesService) GetComment(owner string, repo string, id int) (*IssueCom
return nil, resp, err
}
- return comment, resp, err
+ return comment, resp, nil
}
// CreateComment creates a new comment on the specified issue.
@@ -113,7 +113,7 @@ func (s *IssuesService) CreateComment(owner string, repo string, number int, com
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// EditComment updates an issue comment.
@@ -131,7 +131,7 @@ func (s *IssuesService) EditComment(owner string, repo string, id int, comment *
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// DeleteComment deletes an issue comment.
diff --git a/vendor/github.com/google/go-github/github/issues_labels.go b/vendor/github.com/google/go-github/github/issues_labels.go
index c654547..46b2d6e 100644
--- a/vendor/github.com/google/go-github/github/issues_labels.go
+++ b/vendor/github.com/google/go-github/github/issues_labels.go
@@ -33,13 +33,13 @@ func (s *IssuesService) ListLabels(owner string, repo string, opt *ListOptions)
return nil, nil, err
}
- labels := new([]*Label)
- resp, err := s.client.Do(req, labels)
+ var labels []*Label
+ resp, err := s.client.Do(req, &labels)
if err != nil {
return nil, resp, err
}
- return *labels, resp, err
+ return labels, resp, nil
}
// GetLabel gets a single label.
@@ -58,7 +58,7 @@ func (s *IssuesService) GetLabel(owner string, repo string, name string) (*Label
return nil, resp, err
}
- return label, resp, err
+ return label, resp, nil
}
// CreateLabel creates a new label on the specified repository.
@@ -77,7 +77,7 @@ func (s *IssuesService) CreateLabel(owner string, repo string, label *Label) (*L
return nil, resp, err
}
- return l, resp, err
+ return l, resp, nil
}
// EditLabel edits a label.
@@ -96,7 +96,7 @@ func (s *IssuesService) EditLabel(owner string, repo string, name string, label
return nil, resp, err
}
- return l, resp, err
+ return l, resp, nil
}
// DeleteLabel deletes a label.
@@ -113,7 +113,7 @@ func (s *IssuesService) DeleteLabel(owner string, repo string, name string) (*Re
// ListLabelsByIssue lists all labels for an issue.
//
-// GitHub API docs: http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
+// GitHub API docs: https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue
func (s *IssuesService) ListLabelsByIssue(owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number)
u, err := addOptions(u, opt)
@@ -126,18 +126,18 @@ func (s *IssuesService) ListLabelsByIssue(owner string, repo string, number int,
return nil, nil, err
}
- labels := new([]*Label)
- resp, err := s.client.Do(req, labels)
+ var labels []*Label
+ resp, err := s.client.Do(req, &labels)
if err != nil {
return nil, resp, err
}
- return *labels, resp, err
+ return labels, resp, nil
}
// AddLabelsToIssue adds labels to an issue.
//
-// GitHub API docs: http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
+// GitHub API docs: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
func (s *IssuesService) AddLabelsToIssue(owner string, repo string, number int, labels []string) ([]*Label, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number)
req, err := s.client.NewRequest("POST", u, labels)
@@ -145,13 +145,13 @@ func (s *IssuesService) AddLabelsToIssue(owner string, repo string, number int,
return nil, nil, err
}
- l := new([]*Label)
- resp, err := s.client.Do(req, l)
+ var l []*Label
+ resp, err := s.client.Do(req, &l)
if err != nil {
return nil, resp, err
}
- return *l, resp, err
+ return l, resp, nil
}
// RemoveLabelForIssue removes a label for an issue.
@@ -176,13 +176,13 @@ func (s *IssuesService) ReplaceLabelsForIssue(owner string, repo string, number
return nil, nil, err
}
- l := new([]*Label)
- resp, err := s.client.Do(req, l)
+ var l []*Label
+ resp, err := s.client.Do(req, &l)
if err != nil {
return nil, resp, err
}
- return *l, resp, err
+ return l, resp, nil
}
// RemoveLabelsForIssue removes all labels for an issue.
@@ -212,11 +212,11 @@ func (s *IssuesService) ListLabelsForMilestone(owner string, repo string, number
return nil, nil, err
}
- labels := new([]*Label)
- resp, err := s.client.Do(req, labels)
+ var labels []*Label
+ resp, err := s.client.Do(req, &labels)
if err != nil {
return nil, resp, err
}
- return *labels, resp, err
+ return labels, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/issues_milestones.go b/vendor/github.com/google/go-github/github/issues_milestones.go
index b7621ac..0cc2d58 100644
--- a/vendor/github.com/google/go-github/github/issues_milestones.go
+++ b/vendor/github.com/google/go-github/github/issues_milestones.go
@@ -66,13 +66,13 @@ func (s *IssuesService) ListMilestones(owner string, repo string, opt *Milestone
return nil, nil, err
}
- milestones := new([]*Milestone)
- resp, err := s.client.Do(req, milestones)
+ var milestones []*Milestone
+ resp, err := s.client.Do(req, &milestones)
if err != nil {
return nil, resp, err
}
- return *milestones, resp, err
+ return milestones, resp, nil
}
// GetMilestone gets a single milestone.
@@ -91,7 +91,7 @@ func (s *IssuesService) GetMilestone(owner string, repo string, number int) (*Mi
return nil, resp, err
}
- return milestone, resp, err
+ return milestone, resp, nil
}
// CreateMilestone creates a new milestone on the specified repository.
@@ -110,7 +110,7 @@ func (s *IssuesService) CreateMilestone(owner string, repo string, milestone *Mi
return nil, resp, err
}
- return m, resp, err
+ return m, resp, nil
}
// EditMilestone edits a milestone.
@@ -129,7 +129,7 @@ func (s *IssuesService) EditMilestone(owner string, repo string, number int, mil
return nil, resp, err
}
- return m, resp, err
+ return m, resp, nil
}
// DeleteMilestone deletes a milestone.
diff --git a/vendor/github.com/google/go-github/github/licenses.go b/vendor/github.com/google/go-github/github/licenses.go
index 0b5e8b3..a1fec94 100644
--- a/vendor/github.com/google/go-github/github/licenses.go
+++ b/vendor/github.com/google/go-github/github/licenses.go
@@ -67,13 +67,13 @@ func (s *LicensesService) List() ([]*License, *Response, error) {
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeLicensesPreview)
- licenses := new([]*License)
- resp, err := s.client.Do(req, licenses)
+ var licenses []*License
+ resp, err := s.client.Do(req, &licenses)
if err != nil {
return nil, resp, err
}
- return *licenses, resp, err
+ return licenses, resp, nil
}
// Get extended metadata for one license.
diff --git a/vendor/github.com/google/go-github/github/messages.go b/vendor/github.com/google/go-github/github/messages.go
index 5e167ee..5f67ba5 100644
--- a/vendor/github.com/google/go-github/github/messages.go
+++ b/vendor/github.com/google/go-github/github/messages.go
@@ -53,6 +53,7 @@ var (
"member": "MemberEvent",
"membership": "MembershipEvent",
"milestone": "MilestoneEvent",
+ "organization": "OrganizationEvent",
"page_build": "PageBuildEvent",
"ping": "PingEvent",
"public": "PublicEvent",
diff --git a/vendor/github.com/google/go-github/github/migrations_source_import.go b/vendor/github.com/google/go-github/github/migrations_source_import.go
index 44505fa..451b13e 100644
--- a/vendor/github.com/google/go-github/github/migrations_source_import.go
+++ b/vendor/github.com/google/go-github/github/migrations_source_import.go
@@ -230,13 +230,13 @@ func (s *MigrationService) CommitAuthors(owner, repo string) ([]*SourceImportAut
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeImportPreview)
- authors := new([]*SourceImportAuthor)
- resp, err := s.client.Do(req, authors)
+ var authors []*SourceImportAuthor
+ resp, err := s.client.Do(req, &authors)
if err != nil {
return nil, resp, err
}
- return *authors, resp, err
+ return authors, resp, nil
}
// MapCommitAuthor updates an author's identity for the import. Your
@@ -300,13 +300,13 @@ func (s *MigrationService) LargeFiles(owner, repo string) ([]*LargeFile, *Respon
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeImportPreview)
- files := new([]*LargeFile)
- resp, err := s.client.Do(req, files)
+ var files []*LargeFile
+ resp, err := s.client.Do(req, &files)
if err != nil {
return nil, resp, err
}
- return *files, resp, err
+ return files, resp, nil
}
// CancelImport stops an import for a repository.
diff --git a/vendor/github.com/google/go-github/github/misc.go b/vendor/github.com/google/go-github/github/misc.go
index 8576a4c..89e1501 100644
--- a/vendor/github.com/google/go-github/github/misc.go
+++ b/vendor/github.com/google/go-github/github/misc.go
@@ -187,11 +187,11 @@ func (c *Client) ListServiceHooks() ([]*ServiceHook, *Response, error) {
return nil, nil, err
}
- hooks := new([]*ServiceHook)
- resp, err := c.Do(req, hooks)
+ var hooks []*ServiceHook
+ resp, err := c.Do(req, &hooks)
if err != nil {
return nil, resp, err
}
- return *hooks, resp, err
+ return hooks, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/orgs.go b/vendor/github.com/google/go-github/github/orgs.go
index d137e3e..696c2b7 100644
--- a/vendor/github.com/google/go-github/github/orgs.go
+++ b/vendor/github.com/google/go-github/github/orgs.go
@@ -125,13 +125,13 @@ func (s *OrganizationsService) List(user string, opt *ListOptions) ([]*Organizat
return nil, nil, err
}
- orgs := new([]*Organization)
- resp, err := s.client.Do(req, orgs)
+ var orgs []*Organization
+ resp, err := s.client.Do(req, &orgs)
if err != nil {
return nil, resp, err
}
- return *orgs, resp, err
+ return orgs, resp, nil
}
// Get fetches an organization by name.
diff --git a/vendor/github.com/google/go-github/github/orgs_hooks.go b/vendor/github.com/google/go-github/github/orgs_hooks.go
index 95b8322..4926311 100644
--- a/vendor/github.com/google/go-github/github/orgs_hooks.go
+++ b/vendor/github.com/google/go-github/github/orgs_hooks.go
@@ -22,13 +22,13 @@ func (s *OrganizationsService) ListHooks(org string, opt *ListOptions) ([]*Hook,
return nil, nil, err
}
- hooks := new([]*Hook)
- resp, err := s.client.Do(req, hooks)
+ var hooks []*Hook
+ resp, err := s.client.Do(req, &hooks)
if err != nil {
return nil, resp, err
}
- return *hooks, resp, err
+ return hooks, resp, nil
}
// GetHook returns a single specified Hook.
diff --git a/vendor/github.com/google/go-github/github/orgs_members.go b/vendor/github.com/google/go-github/github/orgs_members.go
index 80454ad..ea8a358 100644
--- a/vendor/github.com/google/go-github/github/orgs_members.go
+++ b/vendor/github.com/google/go-github/github/orgs_members.go
@@ -86,13 +86,13 @@ func (s *OrganizationsService) ListMembers(org string, opt *ListMembersOptions)
return nil, nil, err
}
- members := new([]*User)
- resp, err := s.client.Do(req, members)
+ var members []*User
+ resp, err := s.client.Do(req, &members)
if err != nil {
return nil, resp, err
}
- return *members, resp, err
+ return members, resp, nil
}
// IsMember checks if a user is a member of an organization.
@@ -270,3 +270,29 @@ func (s *OrganizationsService) RemoveOrgMembership(user, org string) (*Response,
return s.client.Do(req, nil)
}
+
+// ListPendingOrgInvitations returns a list of pending invitations.
+//
+// GitHub API docs: https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations
+func (s *OrganizationsService) ListPendingOrgInvitations(org int, opt *ListOptions) ([]*Invitation, *Response, error) {
+ u := fmt.Sprintf("orgs/%v/invitations", org)
+ u, err := addOptions(u, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeOrgMembershipPreview)
+
+ var pendingInvitations []*Invitation
+ resp, err := s.client.Do(req, &pendingInvitations)
+ if err != nil {
+ return nil, resp, err
+ }
+ return pendingInvitations, resp, nil
+}
diff --git a/vendor/github.com/google/go-github/github/orgs_teams.go b/vendor/github.com/google/go-github/github/orgs_teams.go
index 8e8550c..ce8cbec 100644
--- a/vendor/github.com/google/go-github/github/orgs_teams.go
+++ b/vendor/github.com/google/go-github/github/orgs_teams.go
@@ -5,7 +5,10 @@
package github
-import "fmt"
+import (
+ "fmt"
+ "time"
+)
// Team represents a team within a GitHub organization. Teams are used to
// manage access to an organization's repositories.
@@ -41,6 +44,21 @@ func (t Team) String() string {
return Stringify(t)
}
+// Invitation represents a team member's invitation status.
+type Invitation struct {
+ ID *int `json:"id,omitempty"`
+ Login *string `json:"login,omitempty"`
+ Email *string `json:"email,omitempty"`
+ // Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'.
+ Role *string `json:"role,omitempty"`
+ CreatedAt *time.Time `json:"created_at,omitempty"`
+ Inviter *User `json:"inviter,omitempty"`
+}
+
+func (i Invitation) String() string {
+ return Stringify(i)
+}
+
// ListTeams lists all of the teams for an organization.
//
// GitHub API docs: http://developer.github.com/v3/orgs/teams/#list-teams
@@ -56,13 +74,13 @@ func (s *OrganizationsService) ListTeams(org string, opt *ListOptions) ([]*Team,
return nil, nil, err
}
- teams := new([]*Team)
- resp, err := s.client.Do(req, teams)
+ var teams []*Team
+ resp, err := s.client.Do(req, &teams)
if err != nil {
return nil, resp, err
}
- return *teams, resp, err
+ return teams, resp, nil
}
// GetTeam fetches a team by ID.
@@ -161,13 +179,13 @@ func (s *OrganizationsService) ListTeamMembers(team int, opt *OrganizationListTe
return nil, nil, err
}
- members := new([]*User)
- resp, err := s.client.Do(req, members)
+ var members []*User
+ resp, err := s.client.Do(req, &members)
if err != nil {
return nil, resp, err
}
- return *members, resp, err
+ return members, resp, nil
}
// IsTeamMember checks if a user is a member of the specified team.
@@ -200,13 +218,13 @@ func (s *OrganizationsService) ListTeamRepos(team int, opt *ListOptions) ([]*Rep
return nil, nil, err
}
- repos := new([]*Repository)
- resp, err := s.client.Do(req, repos)
+ var repos []*Repository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// IsTeamRepo checks if a team manages the specified repository. If the
@@ -289,13 +307,13 @@ func (s *OrganizationsService) ListUserTeams(opt *ListOptions) ([]*Team, *Respon
return nil, nil, err
}
- teams := new([]*Team)
- resp, err := s.client.Do(req, teams)
+ var teams []*Team
+ resp, err := s.client.Do(req, &teams)
if err != nil {
return nil, resp, err
}
- return *teams, resp, err
+ return teams, resp, nil
}
// GetTeamMembership returns the membership status for a user in a team.
@@ -377,3 +395,32 @@ func (s *OrganizationsService) RemoveTeamMembership(team int, user string) (*Res
return s.client.Do(req, nil)
}
+
+// ListPendingTeamInvitations get pending invitaion list in team.
+// Warning: The API may change without advance notice during the preview period.
+// Preview features are not supported for production use.
+//
+// GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-pending-team-invitations
+func (s *OrganizationsService) ListPendingTeamInvitations(team int, opt *ListOptions) ([]*Invitation, *Response, error) {
+ u := fmt.Sprintf("teams/%v/invitations", team)
+ u, err := addOptions(u, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeOrgMembershipPreview)
+
+ var pendingInvitations []*Invitation
+ resp, err := s.client.Do(req, &pendingInvitations)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return pendingInvitations, resp, nil
+}
diff --git a/vendor/github.com/google/go-github/github/pulls.go b/vendor/github.com/google/go-github/github/pulls.go
index 51c6ccb..d3a9ae8 100644
--- a/vendor/github.com/google/go-github/github/pulls.go
+++ b/vendor/github.com/google/go-github/github/pulls.go
@@ -107,13 +107,13 @@ func (s *PullRequestsService) List(owner string, repo string, opt *PullRequestLi
return nil, nil, err
}
- pulls := new([]*PullRequest)
- resp, err := s.client.Do(req, pulls)
+ var pulls []*PullRequest
+ resp, err := s.client.Do(req, &pulls)
if err != nil {
return nil, resp, err
}
- return *pulls, resp, err
+ return pulls, resp, nil
}
// Get a single pull request.
@@ -132,7 +132,7 @@ func (s *PullRequestsService) Get(owner string, repo string, number int) (*PullR
return nil, resp, err
}
- return pull, resp, err
+ return pull, resp, nil
}
// GetRaw gets raw (diff or patch) format of a pull request.
@@ -158,7 +158,7 @@ func (s *PullRequestsService) GetRaw(owner string, repo string, number int, opt
return "", resp, err
}
- return ret.String(), resp, err
+ return ret.String(), resp, nil
}
// NewPullRequest represents a new pull request to be created.
@@ -186,15 +186,36 @@ func (s *PullRequestsService) Create(owner string, repo string, pull *NewPullReq
return nil, resp, err
}
- return p, resp, err
+ return p, resp, nil
+}
+
+type pullRequestUpdate struct {
+ Title *string `json:"title,omitempty"`
+ Body *string `json:"body,omitempty"`
+ State *string `json:"state,omitempty"`
+ Base *string `json:"base,omitempty"`
}
// Edit a pull request.
//
+// The following fields are editable: Title, Body, State, and Base.Ref.
+// Base.Ref updates the base branch of the pull request.
+//
// GitHub API docs: https://developer.github.com/v3/pulls/#update-a-pull-request
func (s *PullRequestsService) Edit(owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number)
- req, err := s.client.NewRequest("PATCH", u, pull)
+
+ update := new(pullRequestUpdate)
+ if pull != nil {
+ update.Title = pull.Title
+ update.Body = pull.Body
+ update.State = pull.State
+ if pull.Base != nil {
+ update.Base = pull.Base.Ref
+ }
+ }
+
+ req, err := s.client.NewRequest("PATCH", u, update)
if err != nil {
return nil, nil, err
}
@@ -205,7 +226,7 @@ func (s *PullRequestsService) Edit(owner string, repo string, number int, pull *
return nil, resp, err
}
- return p, resp, err
+ return p, resp, nil
}
// ListCommits lists the commits in a pull request.
@@ -223,13 +244,13 @@ func (s *PullRequestsService) ListCommits(owner string, repo string, number int,
return nil, nil, err
}
- commits := new([]*RepositoryCommit)
- resp, err := s.client.Do(req, commits)
+ var commits []*RepositoryCommit
+ resp, err := s.client.Do(req, &commits)
if err != nil {
return nil, resp, err
}
- return *commits, resp, err
+ return commits, resp, nil
}
// ListFiles lists the files in a pull request.
@@ -247,13 +268,13 @@ func (s *PullRequestsService) ListFiles(owner string, repo string, number int, o
return nil, nil, err
}
- commitFiles := new([]*CommitFile)
- resp, err := s.client.Do(req, commitFiles)
+ var commitFiles []*CommitFile
+ resp, err := s.client.Do(req, &commitFiles)
if err != nil {
return nil, resp, err
}
- return *commitFiles, resp, err
+ return commitFiles, resp, nil
}
// IsMerged checks if a pull request has been merged.
@@ -321,5 +342,5 @@ func (s *PullRequestsService) Merge(owner string, repo string, number int, commi
return nil, resp, err
}
- return mergeResult, resp, err
+ return mergeResult, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/pulls_comments.go b/vendor/github.com/google/go-github/github/pulls_comments.go
index c7af85a..51518f0 100644
--- a/vendor/github.com/google/go-github/github/pulls_comments.go
+++ b/vendor/github.com/google/go-github/github/pulls_comments.go
@@ -74,13 +74,13 @@ func (s *PullRequestsService) ListComments(owner string, repo string, number int
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- comments := new([]*PullRequestComment)
- resp, err := s.client.Do(req, comments)
+ var comments []*PullRequestComment
+ resp, err := s.client.Do(req, &comments)
if err != nil {
return nil, resp, err
}
- return *comments, resp, err
+ return comments, resp, nil
}
// GetComment fetches the specified pull request comment.
@@ -102,7 +102,7 @@ func (s *PullRequestsService) GetComment(owner string, repo string, number int)
return nil, resp, err
}
- return comment, resp, err
+ return comment, resp, nil
}
// CreateComment creates a new comment on the specified pull request.
@@ -121,7 +121,7 @@ func (s *PullRequestsService) CreateComment(owner string, repo string, number in
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// EditComment updates a pull request comment.
@@ -140,7 +140,7 @@ func (s *PullRequestsService) EditComment(owner string, repo string, number int,
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// DeleteComment deletes a pull request comment.
diff --git a/vendor/github.com/google/go-github/github/pulls_reviews.go b/vendor/github.com/google/go-github/github/pulls_reviews.go
index ae3cdd4..be57af8 100644
--- a/vendor/github.com/google/go-github/github/pulls_reviews.go
+++ b/vendor/github.com/google/go-github/github/pulls_reviews.go
@@ -5,15 +5,243 @@
package github
-import "time"
+import (
+ "fmt"
+ "time"
+)
// PullRequestReview represents a review of a pull request.
type PullRequestReview struct {
- ID *int `json:"id,omitempty"`
- User *User `json:"user,omitempty"`
- Body *string `json:"body,omitempty"`
- SubmittedAt *time.Time `json:"submitted_at,omitempty"`
+ ID *int `json:"id,omitempty"`
+ User *User `json:"user,omitempty"`
+ Body *string `json:"body,omitempty"`
+ SubmittedAt *time.Time `json:"submitted_at,omitempty"`
+ CommitID *string `json:"commit_id,omitempty"`
+ HTMLURL *string `json:"html_url,omitempty"`
+ PullRequestURL *string `json:"pull_request_url,omitempty"`
+ State *string `json:"state,omitempty"`
+}
+
+func (p PullRequestReview) String() string {
+ return Stringify(p)
+}
+
+// DraftReviewComment represents a comment part of the review.
+type DraftReviewComment struct {
+ Path *string `json:"path,omitempty"`
+ Position *int `json:"position,omitempty"`
+ Body *string `json:"body,omitempty"`
+}
+
+func (c DraftReviewComment) String() string {
+ return Stringify(c)
+}
+
+// PullRequestReviewRequest represents a request to create a review.
+type PullRequestReviewRequest struct {
+ Body *string `json:"body,omitempty"`
+ Event *string `json:"event,omitempty"`
+ Comments []*DraftReviewComment `json:"comments,omitempty"`
+}
+
+func (r PullRequestReviewRequest) String() string {
+ return Stringify(r)
+}
+
+// PullRequestReviewDismissalRequest represents a request to dismiss a review.
+type PullRequestReviewDismissalRequest struct {
+ Message *string `json:"message,omitempty"`
+}
+
+func (r PullRequestReviewDismissalRequest) String() string {
+ return Stringify(r)
+}
+
+// ListReviews lists all reviews on the specified pull request.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request
+func (s *PullRequestsService) ListReviews(owner, repo string, number int) ([]*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number)
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ var reviews []*PullRequestReview
+ resp, err := s.client.Do(req, &reviews)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return reviews, resp, nil
+}
+
+// GetReview fetches the specified pull request review.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#get-a-single-review
+func (s *PullRequestsService) GetReview(owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID)
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ review := new(PullRequestReview)
+ resp, err := s.client.Do(req, review)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return review, resp, nil
+}
+
+// DeletePendingReview deletes the specified pull request pending review.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review
+func (s *PullRequestsService) DeletePendingReview(owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID)
+
+ req, err := s.client.NewRequest("DELETE", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ review := new(PullRequestReview)
+ resp, err := s.client.Do(req, review)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return review, resp, nil
+}
+
+// ListReviewComments lists all the comments for the specified review.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#get-a-single-reviews-comments
+func (s *PullRequestsService) ListReviewComments(owner, repo string, number, reviewID int) ([]*PullRequestComment, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID)
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ var comments []*PullRequestComment
+ resp, err := s.client.Do(req, &comments)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return comments, resp, nil
+}
+
+// CreateReview creates a new review on the specified pull request.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review
+func (s *PullRequestsService) CreateReview(owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number)
+
+ req, err := s.client.NewRequest("POST", u, review)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ r := new(PullRequestReview)
+ resp, err := s.client.Do(req, r)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return r, resp, nil
+}
+
+// SubmitReview submits a specified review on the specified pull request.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review
+func (s *PullRequestsService) SubmitReview(owner, repo string, number, reviewID int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID)
+
+ req, err := s.client.NewRequest("POST", u, review)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ r := new(PullRequestReview)
+ resp, err := s.client.Do(req, r)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return r, resp, nil
+}
+
+// DismissReview dismisses a specified review on the specified pull request.
+//
+// TODO: Follow up with GitHub support about an issue with this method's
+// returned error format and remove this comment once it's fixed.
+// Read more about it here - https://github.com/google/go-github/issues/540
+//
+// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review
+func (s *PullRequestsService) DismissReview(owner, repo string, number, reviewID int, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID)
+
+ req, err := s.client.NewRequest("PUT", u, review)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches
+ req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
+
+ r := new(PullRequestReview)
+ resp, err := s.client.Do(req, r)
+ if err != nil {
+ return nil, resp, err
+ }
- // State can be "approved", "rejected", or "commented".
- State *string `json:"state,omitempty"`
+ return r, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/repos.go b/vendor/github.com/google/go-github/github/repos.go
index 040cd31..019a731 100644
--- a/vendor/github.com/google/go-github/github/repos.go
+++ b/vendor/github.com/google/go-github/github/repos.go
@@ -175,13 +175,13 @@ func (s *RepositoriesService) List(user string, opt *RepositoryListOptions) ([]*
// TODO: remove custom Accept header when license support fully launches
req.Header.Set("Accept", mediaTypeLicensesPreview)
- repos := new([]*Repository)
- resp, err := s.client.Do(req, repos)
+ var repos []*Repository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// RepositoryListByOrgOptions specifies the optional parameters to the
@@ -212,13 +212,13 @@ func (s *RepositoriesService) ListByOrg(org string, opt *RepositoryListByOrgOpti
// TODO: remove custom Accept header when license support fully launches
req.Header.Set("Accept", mediaTypeLicensesPreview)
- repos := new([]*Repository)
- resp, err := s.client.Do(req, repos)
+ var repos []*Repository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// RepositoryListAllOptions specifies the optional parameters to the
@@ -244,13 +244,13 @@ func (s *RepositoriesService) ListAll(opt *RepositoryListAllOptions) ([]*Reposit
return nil, nil, err
}
- repos := new([]*Repository)
- resp, err := s.client.Do(req, repos)
+ var repos []*Repository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// Create a new repository. If an organization is specified, the new
@@ -277,7 +277,7 @@ func (s *RepositoriesService) Create(org string, repo *Repository) (*Repository,
return nil, resp, err
}
- return r, resp, err
+ return r, resp, nil
}
// Get fetches a repository.
@@ -301,7 +301,7 @@ func (s *RepositoriesService) Get(owner, repo string) (*Repository, *Response, e
return nil, resp, err
}
- return repository, resp, err
+ return repository, resp, nil
}
// GetByID fetches a repository.
@@ -324,7 +324,7 @@ func (s *RepositoriesService) GetByID(id int) (*Repository, *Response, error) {
return nil, resp, err
}
- return repository, resp, err
+ return repository, resp, nil
}
// Edit updates a repository.
@@ -346,7 +346,7 @@ func (s *RepositoriesService) Edit(owner, repo string, repository *Repository) (
return nil, resp, err
}
- return r, resp, err
+ return r, resp, nil
}
// Delete a repository.
@@ -408,13 +408,13 @@ func (s *RepositoriesService) ListContributors(owner string, repository string,
return nil, nil, err
}
- contributor := new([]*Contributor)
- resp, err := s.client.Do(req, contributor)
+ var contributor []*Contributor
+ resp, err := s.client.Do(req, &contributor)
if err != nil {
return nil, nil, err
}
- return *contributor, resp, err
+ return contributor, resp, nil
}
// ListLanguages lists languages for the specified repository. The returned map
@@ -440,7 +440,7 @@ func (s *RepositoriesService) ListLanguages(owner string, repo string) (map[stri
return nil, resp, err
}
- return languages, resp, err
+ return languages, resp, nil
}
// ListTeams lists the teams for the specified repository.
@@ -458,13 +458,13 @@ func (s *RepositoriesService) ListTeams(owner string, repo string, opt *ListOpti
return nil, nil, err
}
- teams := new([]*Team)
- resp, err := s.client.Do(req, teams)
+ var teams []*Team
+ resp, err := s.client.Do(req, &teams)
if err != nil {
return nil, resp, err
}
- return *teams, resp, err
+ return teams, resp, nil
}
// RepositoryTag represents a repository tag.
@@ -490,13 +490,13 @@ func (s *RepositoriesService) ListTags(owner string, repo string, opt *ListOptio
return nil, nil, err
}
- tags := new([]*RepositoryTag)
- resp, err := s.client.Do(req, tags)
+ var tags []*RepositoryTag
+ resp, err := s.client.Do(req, &tags)
if err != nil {
return nil, resp, err
}
- return *tags, resp, err
+ return tags, resp, nil
}
// Branch represents a repository branch
@@ -508,34 +508,42 @@ type Branch struct {
// Protection represents a repository branch's protection.
type Protection struct {
- RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"`
- Restrictions *BranchRestrictions `json:"restrictions"`
+ RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"`
+ RequiredPullRequestReviews *RequiredPullRequestReviews `json:"required_pull_request_reviews"`
+ Restrictions *BranchRestrictions `json:"restrictions"`
}
// ProtectionRequest represents a request to create/edit a branch's protection.
type ProtectionRequest struct {
- RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"`
- Restrictions *BranchRestrictionsRequest `json:"restrictions"`
+ RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"`
+ RequiredPullRequestReviews *RequiredPullRequestReviews `json:"required_pull_request_reviews"`
+ Restrictions *BranchRestrictionsRequest `json:"restrictions"`
}
// RequiredStatusChecks represents the protection status of a individual branch.
type RequiredStatusChecks struct {
- // Enforce required status checks for repository administrators.
- IncludeAdmins *bool `json:"include_admins,omitempty"`
- // Require branches to be up to date before merging.
- Strict *bool `json:"strict,omitempty"`
+ // Enforce required status checks for repository administrators. (Required.)
+ IncludeAdmins bool `json:"include_admins"`
+ // Require branches to be up to date before merging. (Required.)
+ Strict bool `json:"strict"`
// The list of status checks to require in order to merge into this
- // branch.
- Contexts *[]string `json:"contexts,omitempty"`
+ // branch. (Required; use []string{} instead of nil for empty list.)
+ Contexts []string `json:"contexts"`
+}
+
+// RequiredPullRequestReviews represents the protection configuration for pull requests.
+type RequiredPullRequestReviews struct {
+ // Enforce pull request reviews for repository administrators. (Required.)
+ IncludeAdmins bool `json:"include_admins"`
}
// BranchRestrictions represents the restriction that only certain users or
// teams may push to a branch.
type BranchRestrictions struct {
// The list of user logins with push access.
- Users []*User `json:"users,omitempty"`
+ Users []*User `json:"users"`
// The list of team slugs with push access.
- Teams []*Team `json:"teams,omitempty"`
+ Teams []*Team `json:"teams"`
}
// BranchRestrictionsRequest represents the request to create/edit the
@@ -543,10 +551,10 @@ type BranchRestrictions struct {
// separate from BranchRestrictions above because the request structure is
// different from the response structure.
type BranchRestrictionsRequest struct {
- // The list of user logins with push access.
- Users *[]string `json:"users,omitempty"`
- // The list of team slugs with push access.
- Teams *[]string `json:"teams,omitempty"`
+ // The list of user logins with push access. (Required; use []string{} instead of nil for empty list.)
+ Users []string `json:"users"`
+ // The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.)
+ Teams []string `json:"teams"`
}
// ListBranches lists branches for the specified repository.
@@ -567,13 +575,13 @@ func (s *RepositoriesService) ListBranches(owner string, repo string, opt *ListO
// TODO: remove custom Accept header when this API fully launches
req.Header.Set("Accept", mediaTypeProtectedBranchesPreview)
- branches := new([]*Branch)
- resp, err := s.client.Do(req, branches)
+ var branches []*Branch
+ resp, err := s.client.Do(req, &branches)
if err != nil {
return nil, resp, err
}
- return *branches, resp, err
+ return branches, resp, nil
}
// GetBranch gets the specified branch for a repository.
@@ -595,7 +603,7 @@ func (s *RepositoriesService) GetBranch(owner, repo, branch string) (*Branch, *R
return nil, resp, err
}
- return b, resp, err
+ return b, resp, nil
}
// GetBranchProtection gets the protection of a given branch.
@@ -617,7 +625,7 @@ func (s *RepositoriesService) GetBranchProtection(owner, repo, branch string) (*
return nil, resp, err
}
- return p, resp, err
+ return p, resp, nil
}
// UpdateBranchProtection updates the protection of a given branch.
@@ -639,7 +647,7 @@ func (s *RepositoriesService) UpdateBranchProtection(owner, repo, branch string,
return nil, resp, err
}
- return p, resp, err
+ return p, resp, nil
}
// RemoveBranchProtection removes the protection of a given branch.
@@ -674,5 +682,5 @@ func (s *RepositoriesService) License(owner, repo string) (*RepositoryLicense, *
return nil, resp, err
}
- return r, resp, err
+ return r, resp, nil
}
diff --git a/vendor/github.com/google/go-github/github/repos_collaborators.go b/vendor/github.com/google/go-github/github/repos_collaborators.go
index 68a9f46..a19a14a 100644
--- a/vendor/github.com/google/go-github/github/repos_collaborators.go
+++ b/vendor/github.com/google/go-github/github/repos_collaborators.go
@@ -22,13 +22,13 @@ func (s *RepositoriesService) ListCollaborators(owner, repo string, opt *ListOpt
return nil, nil, err
}
- users := new([]*User)
- resp, err := s.client.Do(req, users)
+ var users []*User
+ resp, err := s.client.Do(req, &users)
if err != nil {
return nil, resp, err
}
- return *users, resp, err
+ return users, resp, nil
}
// IsCollaborator checks whether the specified Github user has collaborator
@@ -49,6 +49,35 @@ func (s *RepositoriesService) IsCollaborator(owner, repo, user string) (bool, *R
return isCollab, resp, err
}
+// RepositoryPermissionLevel represents the permission level an organization
+// member has for a given repository.
+type RepositoryPermissionLevel struct {
+ // Possible values: "admin", "write", "read", "none"
+ Permission *string `json:"permission,omitempty"`
+
+ User *User `json:"user,omitempty"`
+}
+
+// GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository.
+// GitHub API docs: https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
+func (s *RepositoriesService) GetPermissionLevel(owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user)
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeOrgMembershipPreview)
+
+ rpl := new(RepositoryPermissionLevel)
+ resp, err := s.client.Do(req, rpl)
+ if err != nil {
+ return nil, resp, err
+ }
+ return rpl, resp, nil
+}
+
// RepositoryAddCollaboratorOptions specifies the optional parameters to the
// RepositoriesService.AddCollaborator method.
type RepositoryAddCollaboratorOptions struct {
diff --git a/vendor/github.com/google/go-github/github/repos_comments.go b/vendor/github.com/google/go-github/github/repos_comments.go
index 34a8d02..7abedc8 100644
--- a/vendor/github.com/google/go-github/github/repos_comments.go
+++ b/vendor/github.com/google/go-github/github/repos_comments.go
@@ -50,13 +50,13 @@ func (s *RepositoriesService) ListComments(owner, repo string, opt *ListOptions)
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- comments := new([]*RepositoryComment)
- resp, err := s.client.Do(req, comments)
+ var comments []*RepositoryComment
+ resp, err := s.client.Do(req, &comments)
if err != nil {
return nil, resp, err
}
- return *comments, resp, err
+ return comments, resp, nil
}
// ListCommitComments lists all the comments for a given commit SHA.
@@ -77,13 +77,13 @@ func (s *RepositoriesService) ListCommitComments(owner, repo, sha string, opt *L
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeReactionsPreview)
- comments := new([]*RepositoryComment)
- resp, err := s.client.Do(req, comments)
+ var comments []*RepositoryComment
+ resp, err := s.client.Do(req, &comments)
if err != nil {
return nil, resp, err
}
- return *comments, resp, err
+ return comments, resp, nil
}
// CreateComment creates a comment for the given commit.
diff --git a/vendor/github.com/google/go-github/github/repos_commits.go b/vendor/github.com/google/go-github/github/repos_commits.go
index 22e8fca..bc0fbf9 100644
--- a/vendor/github.com/google/go-github/github/repos_commits.go
+++ b/vendor/github.com/google/go-github/github/repos_commits.go
@@ -120,13 +120,13 @@ func (s *RepositoriesService) ListCommits(owner, repo string, opt *CommitsListOp
return nil, nil, err
}
- commits := new([]*RepositoryCommit)
- resp, err := s.client.Do(req, commits)
+ var commits []*RepositoryCommit
+ resp, err := s.client.Do(req, &commits)
if err != nil {
return nil, resp, err
}
- return *commits, resp, err
+ return commits, resp, nil
}
// GetCommit fetches the specified commit, including all details about it.
diff --git a/vendor/github.com/google/go-github/github/repos_deployments.go b/vendor/github.com/google/go-github/github/repos_deployments.go
index 4b40fbe..32a9a25 100644
--- a/vendor/github.com/google/go-github/github/repos_deployments.go
+++ b/vendor/github.com/google/go-github/github/repos_deployments.go
@@ -73,19 +73,18 @@ func (s *RepositoriesService) ListDeployments(owner, repo string, opt *Deploymen
return nil, nil, err
}
- deployments := new([]*Deployment)
- resp, err := s.client.Do(req, deployments)
+ var deployments []*Deployment
+ resp, err := s.client.Do(req, &deployments)
if err != nil {
return nil, resp, err
}
- return *deployments, resp, err
+ return deployments, resp, nil
}
// GetDeployment returns a single deployment of a repository.
//
-// GitHub API docs: https://developer.github.com/v3/repos/deployments/
-// Note: GetDeployment uses the undocumented GitHub API endpoint /repos/:owner/:repo/deployments/:id.
+// GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment
func (s *RepositoriesService) GetDeployment(owner, repo string, deploymentID int) (*Deployment, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID)
@@ -167,13 +166,36 @@ func (s *RepositoriesService) ListDeploymentStatuses(owner, repo string, deploym
return nil, nil, err
}
- statuses := new([]*DeploymentStatus)
- resp, err := s.client.Do(req, statuses)
+ var statuses []*DeploymentStatus
+ resp, err := s.client.Do(req, &statuses)
if err != nil {
return nil, resp, err
}
- return *statuses, resp, err
+ return statuses, resp, nil
+}
+
+// GetDeploymentStatus returns a single deployment status of a repository.
+//
+// GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment-status
+func (s *RepositoriesService) GetDeploymentStatus(owner, repo string, deploymentID, deploymentStatusID int) (*DeploymentStatus, *Response, error) {
+ u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID)
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // TODO: remove custom Accept header when deployment support fully launches
+ req.Header.Set("Accept", mediaTypeDeploymentStatusPreview)
+
+ d := new(DeploymentStatus)
+ resp, err := s.client.Do(req, d)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return d, resp, err
}
// CreateDeploymentStatus creates a new status for a deployment.
diff --git a/vendor/github.com/google/go-github/github/repos_forks.go b/vendor/github.com/google/go-github/github/repos_forks.go
index c88f3d3..986559d 100644
--- a/vendor/github.com/google/go-github/github/repos_forks.go
+++ b/vendor/github.com/google/go-github/github/repos_forks.go
@@ -32,13 +32,13 @@ func (s *RepositoriesService) ListForks(owner, repo string, opt *RepositoryListF
return nil, nil, err
}
- repos := new([]*Repository)
- resp, err := s.client.Do(req, repos)
+ var repos []*Repository
+ resp, err := s.client.Do(req, &repos)
if err != nil {
return nil, resp, err
}
- return *repos, resp, err
+ return repos, resp, nil
}
// RepositoryCreateForkOptions specifies the optional parameters to the
diff --git a/vendor/github.com/google/go-github/github/repos_hooks.go b/vendor/github.com/google/go-github/github/repos_hooks.go
index fe725b4..25f50b2 100644
--- a/vendor/github.com/google/go-github/github/repos_hooks.go
+++ b/vendor/github.com/google/go-github/github/repos_hooks.go
@@ -117,13 +117,13 @@ func (s *RepositoriesService) ListHooks(owner, repo string, opt *ListOptions) ([
return nil, nil, err
}
- hooks := new([]*Hook)
- resp, err := s.client.Do(req, hooks)
+ var hooks []*Hook
+ resp, err := s.client.Do(req, &hooks)
if err != nil {
return nil, resp, err
}
- return *hooks, resp, err
+ return hooks, resp, nil
}
// GetHook returns a single specified Hook.
diff --git a/vendor/github.com/google/go-github/github/repos_keys.go b/vendor/github.com/google/go-github/github/repos_keys.go
index 0bb404a..f8f4f48 100644
--- a/vendor/github.com/google/go-github/github/repos_keys.go
+++ b/vendor/github.com/google/go-github/github/repos_keys.go
@@ -24,13 +24,13 @@ func (s *RepositoriesService) ListKeys(owner string, repo string, opt *ListOptio
return nil, nil, err
}
- keys := new([]*Key)
- resp, err := s.client.Do(req, keys)
+ var keys []*Key
+ resp, err := s.client.Do(req, &keys)
if err != nil {
return nil, resp, err
}
- return *keys, resp, err
+ return keys, resp, nil
}
// GetKey fetches a single deploy key.
diff --git a/vendor/github.com/google/go-github/github/repos_releases.go b/vendor/github.com/google/go-github/github/repos_releases.go
index 331a4b7..72d95eb 100644
--- a/vendor/github.com/google/go-github/github/repos_releases.go
+++ b/vendor/github.com/google/go-github/github/repos_releases.go
@@ -76,12 +76,12 @@ func (s *RepositoriesService) ListReleases(owner, repo string, opt *ListOptions)
return nil, nil, err
}
- releases := new([]*RepositoryRelease)
- resp, err := s.client.Do(req, releases)
+ var releases []*RepositoryRelease
+ resp, err := s.client.Do(req, &releases)
if err != nil {
return nil, resp, err
}
- return *releases, resp, err
+ return releases, resp, nil
}
// GetRelease fetches a single release.
@@ -188,12 +188,12 @@ func (s *RepositoriesService) ListReleaseAssets(owner, repo string, id int, opt
return nil, nil, err
}
- assets := new([]*ReleaseAsset)
- resp, err := s.client.Do(req, assets)
+ var assets []*ReleaseAsset
+ resp, err := s.client.Do(req, &assets)
if err != nil {
- return nil, resp, nil
+ return nil, resp, err
}
- return *assets, resp, err
+ return assets, resp, nil
}
// GetReleaseAsset fetches a single release asset.
@@ -210,7 +210,7 @@ func (s *RepositoriesService) GetReleaseAsset(owner, repo string, id int) (*Rele
asset := new(ReleaseAsset)
resp, err := s.client.Do(req, asset)
if err != nil {
- return nil, resp, nil
+ return nil, resp, err
}
return asset, resp, err
}
@@ -248,7 +248,7 @@ func (s *RepositoriesService) DownloadReleaseAsset(owner, repo string, id int) (
if !strings.Contains(err.Error(), "disable redirect") {
return nil, "", err
}
- return nil, loc, nil
+ return nil, loc, nil // Intentionally return no error with valid redirect URL.
}
if err := CheckResponse(resp); err != nil {
diff --git a/vendor/github.com/google/go-github/github/repos_statuses.go b/vendor/github.com/google/go-github/github/repos_statuses.go
index 6478ee2..1056eee 100644
--- a/vendor/github.com/google/go-github/github/repos_statuses.go
+++ b/vendor/github.com/google/go-github/github/repos_statuses.go
@@ -54,13 +54,13 @@ func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOpt
return nil, nil, err
}
- statuses := new([]*RepoStatus)
- resp, err := s.client.Do(req, statuses)
+ var statuses []*RepoStatus
+ resp, err := s.client.Do(req, &statuses)
if err != nil {
return nil, resp, err
}
- return *statuses, resp, err
+ return statuses, resp, nil
}
// CreateStatus creates a new status for a repository at the specified
diff --git a/vendor/github.com/google/go-github/github/repos_traffic.go b/vendor/github.com/google/go-github/github/repos_traffic.go
index 9688b58..0713c73 100644
--- a/vendor/github.com/google/go-github/github/repos_traffic.go
+++ b/vendor/github.com/google/go-github/github/repos_traffic.go
@@ -60,16 +60,13 @@ func (s *RepositoriesService) ListTrafficReferrers(owner, repo string) ([]*Traff
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
- trafficReferrers := new([]*TrafficReferrer)
+ var trafficReferrers []*TrafficReferrer
resp, err := s.client.Do(req, &trafficReferrers)
if err != nil {
return nil, resp, err
}
- return *trafficReferrers, resp, err
+ return trafficReferrers, resp, nil
}
// ListTrafficPaths list the top 10 popular content over the last 14 days.
@@ -83,16 +80,13 @@ func (s *RepositoriesService) ListTrafficPaths(owner, repo string) ([]*TrafficPa
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
- var paths = new([]*TrafficPath)
+ var paths []*TrafficPath
resp, err := s.client.Do(req, &paths)
if err != nil {
return nil, resp, err
}
- return *paths, resp, err
+ return paths, resp, nil
}
// ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week.
@@ -110,9 +104,6 @@ func (s *RepositoriesService) ListTrafficViews(owner, repo string, opt *TrafficB
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
trafficViews := new(TrafficViews)
resp, err := s.client.Do(req, &trafficViews)
if err != nil {
@@ -137,9 +128,6 @@ func (s *RepositoriesService) ListTrafficClones(owner, repo string, opt *Traffic
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
trafficClones := new(TrafficClones)
resp, err := s.client.Do(req, &trafficClones)
if err != nil {
diff --git a/vendor/github.com/google/go-github/github/search.go b/vendor/github.com/google/go-github/github/search.go
index 579a57d..8fd9430 100644
--- a/vendor/github.com/google/go-github/github/search.go
+++ b/vendor/github.com/google/go-github/github/search.go
@@ -21,6 +21,7 @@ type SearchService service
type SearchOptions struct {
// How to sort the search results. Possible values are:
// - for repositories: stars, fork, updated
+ // - for commits: author-date, committer-date
// - for code: indexed
// - for issues: comments, created, updated
// - for users: followers, repositories, joined
@@ -54,6 +55,37 @@ func (s *SearchService) Repositories(query string, opt *SearchOptions) (*Reposit
return result, resp, err
}
+// CommitsSearchResult represents the result of a commits search.
+type CommitsSearchResult struct {
+ Total *int `json:"total_count,omitempty"`
+ IncompleteResults *bool `json:"incomplete_results,omitempty"`
+ Commits []*CommitResult `json:"items,omitempty"`
+}
+
+// CommitResult represents a commit object as returned in commit search endpoint response.
+type CommitResult struct {
+ Hash *string `json:"hash,omitempty"`
+ Message *string `json:"message,omitempty"`
+ AuthorID *int `json:"author_id,omitempty"`
+ AuthorName *string `json:"author_name,omitempty"`
+ AuthorEmail *string `json:"author_email,omitempty"`
+ AuthorDate *Timestamp `json:"author_date,omitempty"`
+ CommitterID *int `json:"committer_id,omitempty"`
+ CommitterName *string `json:"committer_name,omitempty"`
+ CommitterEmail *string `json:"committer_email,omitempty"`
+ CommitterDate *Timestamp `json:"committer_date,omitempty"`
+ Repository *Repository `json:"repository,omitempty"`
+}
+
+// Commits searches commits via various criteria.
+//
+// GitHub API Docs: https://developer.github.com/v3/search/#search-commits
+func (s *SearchService) Commits(query string, opt *SearchOptions) (*CommitsSearchResult, *Response, error) {
+ result := new(CommitsSearchResult)
+ resp, err := s.search("commits", query, opt, result)
+ return result, resp, err
+}
+
// IssuesSearchResult represents the result of an issues search.
type IssuesSearchResult struct {
Total *int `json:"total_count,omitempty"`
@@ -136,7 +168,7 @@ func (s *SearchService) Code(query string, opt *SearchOptions) (*CodeSearchResul
}
// Helper function that executes search queries against different
-// GitHub search types (repositories, code, issues, users)
+// GitHub search types (repositories, commits, code, issues, users)
func (s *SearchService) search(searchType string, query string, opt *SearchOptions, result interface{}) (*Response, error) {
params, err := qs.Values(opt)
if err != nil {
@@ -150,7 +182,12 @@ func (s *SearchService) search(searchType string, query string, opt *SearchOptio
return nil, err
}
- if opt != nil && opt.TextMatch {
+ switch {
+ case searchType == "commits":
+ // Accept header for search commits preview endpoint
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeCommitSearchPreview)
+ case opt != nil && opt.TextMatch:
// Accept header defaults to "application/vnd.github.v3+json"
// We change it here to fetch back text-match metadata
req.Header.Set("Accept", "application/vnd.github.v3.text-match+json")
diff --git a/vendor/github.com/google/go-github/github/users.go b/vendor/github.com/google/go-github/github/users.go
index 8f63746..cd305a9 100644
--- a/vendor/github.com/google/go-github/github/users.go
+++ b/vendor/github.com/google/go-github/github/users.go
@@ -156,13 +156,13 @@ func (s *UsersService) ListAll(opt *UserListOptions) ([]*User, *Response, error)
return nil, nil, err
}
- users := new([]*User)
- resp, err := s.client.Do(req, users)
+ var users []*User
+ resp, err := s.client.Do(req, &users)
if err != nil {
return nil, resp, err
}
- return *users, resp, err
+ return users, resp, nil
}
// ListInvitations lists all currently-open repository invitations for the
diff --git a/vendor/github.com/google/go-github/github/users_emails.go b/vendor/github.com/google/go-github/github/users_emails.go
index e4a5898..4785946 100644
--- a/vendor/github.com/google/go-github/github/users_emails.go
+++ b/vendor/github.com/google/go-github/github/users_emails.go
@@ -27,13 +27,13 @@ func (s *UsersService) ListEmails(opt *ListOptions) ([]*UserEmail, *Response, er
return nil, nil, err
}
- emails := new([]*UserEmail)
- resp, err := s.client.Do(req, emails)
+ var emails []*UserEmail
+ resp, err := s.client.Do(req, &emails)
if err != nil {
return nil, resp, err
}
- return *emails, resp, err
+ return emails, resp, nil
}
// AddEmails adds email addresses of the authenticated user.
@@ -46,13 +46,13 @@ func (s *UsersService) AddEmails(emails []string) ([]*UserEmail, *Response, erro
return nil, nil, err
}
- e := new([]*UserEmail)
- resp, err := s.client.Do(req, e)
+ var e []*UserEmail
+ resp, err := s.client.Do(req, &e)
if err != nil {
return nil, resp, err
}
- return *e, resp, err
+ return e, resp, nil
}
// DeleteEmails deletes email addresses from authenticated user.
diff --git a/vendor/github.com/google/go-github/github/users_followers.go b/vendor/github.com/google/go-github/github/users_followers.go
index 38a1662..123b1c1 100644
--- a/vendor/github.com/google/go-github/github/users_followers.go
+++ b/vendor/github.com/google/go-github/github/users_followers.go
@@ -28,13 +28,13 @@ func (s *UsersService) ListFollowers(user string, opt *ListOptions) ([]*User, *R
return nil, nil, err
}
- users := new([]*User)
- resp, err := s.client.Do(req, users)
+ var users []*User
+ resp, err := s.client.Do(req, &users)
if err != nil {
return nil, resp, err
}
- return *users, resp, err
+ return users, resp, nil
}
// ListFollowing lists the people that a user is following. Passing the empty
@@ -58,13 +58,13 @@ func (s *UsersService) ListFollowing(user string, opt *ListOptions) ([]*User, *R
return nil, nil, err
}
- users := new([]*User)
- resp, err := s.client.Do(req, users)
+ var users []*User
+ resp, err := s.client.Do(req, &users)
if err != nil {
return nil, resp, err
}
- return *users, resp, err
+ return users, resp, nil
}
// IsFollowing checks if "user" is following "target". Passing the empty
diff --git a/vendor/github.com/google/go-github/github/users_keys.go b/vendor/github.com/google/go-github/github/users_keys.go
index e4c255f..59b1dc2 100644
--- a/vendor/github.com/google/go-github/github/users_keys.go
+++ b/vendor/github.com/google/go-github/github/users_keys.go
@@ -41,13 +41,13 @@ func (s *UsersService) ListKeys(user string, opt *ListOptions) ([]*Key, *Respons
return nil, nil, err
}
- keys := new([]*Key)
- resp, err := s.client.Do(req, keys)
+ var keys []*Key
+ resp, err := s.client.Do(req, &keys)
if err != nil {
return nil, resp, err
}
- return *keys, resp, err
+ return keys, resp, nil
}
// GetKey fetches a single public key.
diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go
index 19437b3..37080b1 100644
--- a/vendor/github.com/google/go-querystring/query/encode.go
+++ b/vendor/github.com/google/go-querystring/query/encode.go
@@ -217,11 +217,6 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error {
continue
}
- if sv.Type() == timeType {
- values.Add(name, valueString(sv, opts))
- continue
- }
-
for sv.Kind() == reflect.Ptr {
if sv.IsNil() {
break
@@ -229,6 +224,11 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error {
sv = sv.Elem()
}
+ if sv.Type() == timeType {
+ values.Add(name, valueString(sv, opts))
+ continue
+ }
+
if sv.Kind() == reflect.Struct {
reflectValue(values, sv, name)
continue
diff --git a/vendor/github.com/gorilla/handlers/handlers.go b/vendor/github.com/gorilla/handlers/handlers.go
index 9544d2f..551f8ff 100644
--- a/vendor/github.com/gorilla/handlers/handlers.go
+++ b/vendor/github.com/gorilla/handlers/handlers.go
@@ -94,7 +94,7 @@ func makeLogger(w http.ResponseWriter) loggingResponseWriter {
return logger
}
-type loggingResponseWriter interface {
+type commonLoggingResponseWriter interface {
http.ResponseWriter
http.Flusher
Status() int
diff --git a/vendor/github.com/gorilla/handlers/handlers_go18.go b/vendor/github.com/gorilla/handlers/handlers_go18.go
new file mode 100644
index 0000000..35eb8d4
--- /dev/null
+++ b/vendor/github.com/gorilla/handlers/handlers_go18.go
@@ -0,0 +1,21 @@
+// +build go1.8
+
+package handlers
+
+import (
+ "fmt"
+ "net/http"
+)
+
+type loggingResponseWriter interface {
+ commonLoggingResponseWriter
+ http.Pusher
+}
+
+func (l *responseLogger) Push(target string, opts *http.PushOptions) error {
+ p, ok := l.w.(http.Pusher)
+ if !ok {
+ return fmt.Errorf("responseLogger does not implement http.Pusher")
+ }
+ return p.Push(target, opts)
+}
diff --git a/vendor/github.com/gorilla/handlers/handlers_pre18.go b/vendor/github.com/gorilla/handlers/handlers_pre18.go
new file mode 100644
index 0000000..197836a
--- /dev/null
+++ b/vendor/github.com/gorilla/handlers/handlers_pre18.go
@@ -0,0 +1,7 @@
+// +build !go1.8
+
+package handlers
+
+type loggingResponseWriter interface {
+ commonLoggingResponseWriter
+}
diff --git a/vendor/github.com/gorilla/mux/README.md b/vendor/github.com/gorilla/mux/README.md
index fa79a6b..94d396c 100644
--- a/vendor/github.com/gorilla/mux/README.md
+++ b/vendor/github.com/gorilla/mux/README.md
@@ -23,6 +23,7 @@ The name mux stands for "HTTP request multiplexer". Like the standard `http.Serv
* [Install](#install)
* [Examples](#examples)
* [Matching Routes](#matching-routes)
+* [Listing Routes](#listing-routes)
* [Static Files](#static-files)
* [Registered URLs](#registered-urls)
* [Full Example](#full-example)
@@ -65,8 +66,11 @@ r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
The names are used to create a map of route variables which can be retrieved calling `mux.Vars()`:
```go
-vars := mux.Vars(request)
-category := vars["category"]
+func ArticlesCategoryHandler(w http.ResponseWriter, r *http.Request) {
+ vars := mux.Vars(r)
+ w.WriteHeader(http.StatusOK)
+ fmt.Fprintf(w, "Category: %v\n", vars["category"])
+}
```
And this is all you need to know about the basic usage. More advanced options are explained below.
@@ -164,6 +168,42 @@ s.HandleFunc("/{key}/", ProductHandler)
s.HandleFunc("/{key}/details", ProductDetailsHandler)
```
+### Listing Routes
+
+Routes on a mux can be listed using the Router.Walk method—useful for generating documentation:
+
+```go
+package main
+
+import (
+ "fmt"
+ "net/http"
+
+ "github.com/gorilla/mux"
+)
+
+func handler(w http.ResponseWriter, r *http.Request) {
+ return
+}
+
+func main() {
+ r := mux.NewRouter()
+ r.HandleFunc("/", handler)
+ r.HandleFunc("/products", handler)
+ r.HandleFunc("/articles", handler)
+ r.HandleFunc("/articles/{id}", handler)
+ r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
+ t, err := route.GetPathTemplate()
+ if err != nil {
+ return err
+ }
+ fmt.Println(t)
+ return nil
+ })
+ http.Handle("/", r)
+}
+```
+
### Static Files
Note that the path provided to `PathPrefix()` represents a "wildcard": calling
diff --git a/vendor/github.com/gorilla/mux/doc.go b/vendor/github.com/gorilla/mux/doc.go
index e9573dd..00daf4a 100644
--- a/vendor/github.com/gorilla/mux/doc.go
+++ b/vendor/github.com/gorilla/mux/doc.go
@@ -57,6 +57,11 @@ calling mux.Vars():
vars := mux.Vars(request)
category := vars["category"]
+Note that if any capturing groups are present, mux will panic() during parsing. To prevent
+this, convert any capturing groups to non-capturing, e.g. change "/{sort:(asc|desc)}" to
+"/{sort:(?:asc|desc)}". This is a change from prior versions which behaved unpredictably
+when capturing groups were present.
+
And this is all you need to know about the basic usage. More advanced options
are explained below.
diff --git a/vendor/github.com/gorilla/mux/regexp.go b/vendor/github.com/gorilla/mux/regexp.go
index fd8fe39..0189ad3 100644
--- a/vendor/github.com/gorilla/mux/regexp.go
+++ b/vendor/github.com/gorilla/mux/regexp.go
@@ -109,6 +109,13 @@ func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash,
if errCompile != nil {
return nil, errCompile
}
+
+ // Check for capturing groups which used to work in older versions
+ if reg.NumSubexp() != len(idxs)/2 {
+ panic(fmt.Sprintf("route %s contains capture groups in its regexp. ", template) +
+ "Only non-capturing groups are accepted: e.g. (?:pattern) instead of (pattern)")
+ }
+
// Done!
return &routeRegexp{
template: template,
diff --git a/vendor/github.com/gorilla/mux/route.go b/vendor/github.com/gorilla/mux/route.go
index 293b6d4..9221915 100644
--- a/vendor/github.com/gorilla/mux/route.go
+++ b/vendor/github.com/gorilla/mux/route.go
@@ -153,7 +153,7 @@ func (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery
}
r.regexp = r.getRegexpGroup()
if !matchHost && !matchQuery {
- if len(tpl) == 0 || tpl[0] != '/' {
+ if tpl == "/" && (len(tpl) == 0 || tpl[0] != '/') {
return fmt.Errorf("mux: path must start with a slash, got %q", tpl)
}
if r.regexp.path != nil {
diff --git a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go b/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go
index f4596d8..7d8a57c 100644
--- a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go
+++ b/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go
@@ -3,11 +3,12 @@ package cleanhttp
import (
"net"
"net/http"
+ "runtime"
"time"
)
-// DefaultTransport returns a new http.Transport with the same default values
-// as http.DefaultTransport, but with idle connections and keepalives disabled.
+// DefaultTransport returns a new http.Transport with similar default values to
+// http.DefaultTransport, but with idle connections and keepalives disabled.
func DefaultTransport() *http.Transport {
transport := DefaultPooledTransport()
transport.DisableKeepAlives = true
@@ -22,13 +23,15 @@ func DefaultTransport() *http.Transport {
func DefaultPooledTransport() *http.Transport {
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
- Dial: (&net.Dialer{
+ DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
- }).Dial,
- TLSHandshakeTimeout: 10 * time.Second,
- DisableKeepAlives: false,
- MaxIdleConnsPerHost: 1,
+ }).DialContext,
+ MaxIdleConns: 100,
+ IdleConnTimeout: 90 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1,
}
return transport
}
@@ -42,10 +45,10 @@ func DefaultClient() *http.Client {
}
}
-// DefaultPooledClient returns a new http.Client with the same default values
-// as http.Client, but with a shared Transport. Do not use this function
-// for transient clients as it can leak file descriptors over time. Only use
-// this for clients that will be re-used for the same host(s).
+// DefaultPooledClient returns a new http.Client with similar default values to
+// http.Client, but with a shared Transport. Do not use this function for
+// transient clients as it can leak file descriptors over time. Only use this
+// for clients that will be re-used for the same host(s).
func DefaultPooledClient() *http.Client {
return &http.Client{
Transport: DefaultPooledTransport(),
diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go
index 8dd73e0..6e54bed 100644
--- a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go
+++ b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go
@@ -389,9 +389,15 @@ func (p *Parser) listType() (*ast.ListType, error) {
l.Add(node)
needComma = true
case token.LBRACK:
- // TODO(arslan) should we support nested lists? Even though it's
- // written in README of HCL, it's not a part of the grammar
- // (not defined in parse.y)
+ node, err := p.listType()
+ if err != nil {
+ return nil, &PosError{
+ Pos: tok.Pos,
+ Err: fmt.Errorf(
+ "error while trying to parse list within list: %s", err),
+ }
+ }
+ l.Add(node)
case token.RBRACK:
// finished
l.Rbrack = p.tok.Pos
diff --git a/vendor/github.com/hashicorp/vault/api/client.go b/vendor/github.com/hashicorp/vault/api/client.go
index 88a8ea4..fa06d46 100644
--- a/vendor/github.com/hashicorp/vault/api/client.go
+++ b/vendor/github.com/hashicorp/vault/api/client.go
@@ -106,7 +106,7 @@ func DefaultConfig() *Config {
func (c *Config) ConfigureTLS(t *TLSConfig) error {
if c.HttpClient == nil {
- return fmt.Errorf("config HTTP Client must be set")
+ c.HttpClient = DefaultConfig().HttpClient
}
var clientCert tls.Certificate
diff --git a/vendor/github.com/hashicorp/vault/api/sys_seal.go b/vendor/github.com/hashicorp/vault/api/sys_seal.go
index b80e33a..97a49ae 100644
--- a/vendor/github.com/hashicorp/vault/api/sys_seal.go
+++ b/vendor/github.com/hashicorp/vault/api/sys_seal.go
@@ -53,6 +53,7 @@ type SealStatusResponse struct {
T int `json:"t"`
N int `json:"n"`
Progress int `json:"progress"`
+ Nonce string `json:"nonce"`
Version string `json:"version"`
ClusterName string `json:"cluster_name,omitempty"`
ClusterID string `json:"cluster_id,omitempty"`
diff --git a/vendor/github.com/jmoiron/sqlx/sqlx.go b/vendor/github.com/jmoiron/sqlx/sqlx.go
index c7a0bf3..4859d5a 100644
--- a/vendor/github.com/jmoiron/sqlx/sqlx.go
+++ b/vendor/github.com/jmoiron/sqlx/sqlx.go
@@ -10,6 +10,7 @@ import (
"path/filepath"
"reflect"
"strings"
+ "sync"
"github.com/jmoiron/sqlx/reflectx"
)
@@ -30,8 +31,14 @@ var origMapper = reflect.ValueOf(NameMapper)
// importers have time to customize the NameMapper.
var mpr *reflectx.Mapper
+// mprMu protects mpr.
+var mprMu sync.Mutex
+
// mapper returns a valid mapper using the configured NameMapper func.
func mapper() *reflectx.Mapper {
+ mprMu.Lock()
+ defer mprMu.Unlock()
+
if mpr == nil {
mpr = reflectx.NewMapperFunc("db", NameMapper)
} else if origMapper != reflect.ValueOf(NameMapper) {
diff --git a/vendor/github.com/magiconair/properties/CHANGELOG.md b/vendor/github.com/magiconair/properties/CHANGELOG.md
index 415b9f8..89ee938 100644
--- a/vendor/github.com/magiconair/properties/CHANGELOG.md
+++ b/vendor/github.com/magiconair/properties/CHANGELOG.md
@@ -2,7 +2,12 @@
### Unreleased
+ * [Issue #15](https://github.com/magiconair/properties/issues/15): Drop gocheck dependency
+
+### [1.7.1](https://github.com/magiconair/properties/tags/v1.7.1) - 13 Jan 2017
+
* [PR #16](https://github.com/magiconair/properties/pull/16): Keep gofmt happy
+ * [PR #18](https://github.com/magiconair/properties/pull/18): Fix Delete() function
### [1.7.0](https://github.com/magiconair/properties/tags/v1.7.0) - 20 Mar 2016
diff --git a/vendor/github.com/magiconair/properties/README.md b/vendor/github.com/magiconair/properties/README.md
index 1ae0035..5985911 100644
--- a/vendor/github.com/magiconair/properties/README.md
+++ b/vendor/github.com/magiconair/properties/README.md
@@ -1,7 +1,7 @@
Overview [![Build Status](https://travis-ci.org/magiconair/properties.svg?branch=master)](https://travis-ci.org/magiconair/properties)
========
-#### Current version: 1.7.0
+#### Current version: 1.7.1
properties is a Go library for reading and writing properties files.
diff --git a/vendor/github.com/magiconair/properties/decode.go b/vendor/github.com/magiconair/properties/decode.go
index b717a64..0a961bb 100644
--- a/vendor/github.com/magiconair/properties/decode.go
+++ b/vendor/github.com/magiconair/properties/decode.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -158,16 +158,16 @@ func dec(p *Properties, key string, def *string, opts map[string]string, v refle
// keydef returns the property key and the default value based on the
// name of the struct field and the options in the tag.
keydef := func(f reflect.StructField) (string, *string, map[string]string) {
- key, opts := parseTag(f.Tag.Get("properties"))
+ _key, _opts := parseTag(f.Tag.Get("properties"))
- var def *string
- if d, ok := opts["default"]; ok {
- def = &d
+ var _def *string
+ if d, ok := _opts["default"]; ok {
+ _def = &d
}
- if key != "" {
- return key, def, opts
+ if _key != "" {
+ return _key, _def, _opts
}
- return f.Name, def, opts
+ return f.Name, _def, _opts
}
switch {
@@ -223,7 +223,7 @@ func dec(p *Properties, key string, def *string, opts map[string]string, v refle
case isMap(t):
valT := t.Elem()
m := reflect.MakeMap(t)
- for postfix, _ := range p.FilterStripPrefix(key + ".").m {
+ for postfix := range p.FilterStripPrefix(key + ".").m {
pp := strings.SplitN(postfix, ".", 2)
mk, mv := pp[0], reflect.New(valT)
if err := dec(p, key+"."+mk, nil, nil, mv); err != nil {
@@ -274,7 +274,6 @@ func isArray(t reflect.Type) bool { return t.Kind() == reflect.Array || t.Kin
func isBool(t reflect.Type) bool { return t.Kind() == reflect.Bool }
func isDuration(t reflect.Type) bool { return t == reflect.TypeOf(time.Second) }
func isMap(t reflect.Type) bool { return t.Kind() == reflect.Map }
-func isNumeric(t reflect.Type) bool { return isInt(t) || isUint(t) || isFloat(t) }
func isPtr(t reflect.Type) bool { return t.Kind() == reflect.Ptr }
func isString(t reflect.Type) bool { return t.Kind() == reflect.String }
func isStruct(t reflect.Type) bool { return t.Kind() == reflect.Struct }
diff --git a/vendor/github.com/magiconair/properties/doc.go b/vendor/github.com/magiconair/properties/doc.go
index ed1ff51..36c8368 100644
--- a/vendor/github.com/magiconair/properties/doc.go
+++ b/vendor/github.com/magiconair/properties/doc.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/integrate.go b/vendor/github.com/magiconair/properties/integrate.go
index 37baaad..0d775e0 100644
--- a/vendor/github.com/magiconair/properties/integrate.go
+++ b/vendor/github.com/magiconair/properties/integrate.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/lex.go b/vendor/github.com/magiconair/properties/lex.go
index 014e63f..a3cba03 100644
--- a/vendor/github.com/magiconair/properties/lex.go
+++ b/vendor/github.com/magiconair/properties/lex.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
@@ -72,7 +72,7 @@ type lexer struct {
// next returns the next rune in the input.
func (l *lexer) next() rune {
- if int(l.pos) >= len(l.input) {
+ if l.pos >= len(l.input) {
l.width = 0
return eof
}
@@ -96,8 +96,8 @@ func (l *lexer) backup() {
// emit passes an item back to the client.
func (l *lexer) emit(t itemType) {
- item := item{t, l.start, string(l.runes)}
- l.items <- item
+ i := item{t, l.start, string(l.runes)}
+ l.items <- i
l.start = l.pos
l.runes = l.runes[:0]
}
@@ -114,7 +114,7 @@ func (l *lexer) appendRune(r rune) {
// accept consumes the next rune if it's from the valid set.
func (l *lexer) accept(valid string) bool {
- if strings.IndexRune(valid, l.next()) >= 0 {
+ if strings.ContainsRune(valid, l.next()) {
return true
}
l.backup()
@@ -123,7 +123,7 @@ func (l *lexer) accept(valid string) bool {
// acceptRun consumes a run of runes from the valid set.
func (l *lexer) acceptRun(valid string) {
- for strings.IndexRune(valid, l.next()) >= 0 {
+ for strings.ContainsRune(valid, l.next()) {
}
l.backup()
}
@@ -156,9 +156,9 @@ func (l *lexer) errorf(format string, args ...interface{}) stateFn {
// nextItem returns the next item from the input.
func (l *lexer) nextItem() item {
- item := <-l.items
- l.lastPos = item.pos
- return item
+ i := <-l.items
+ l.lastPos = i.pos
+ return i
}
// lex creates a new scanner for the input string.
@@ -279,8 +279,7 @@ func lexValue(l *lexer) stateFn {
for {
switch r := l.next(); {
case isEscape(r):
- r := l.peek()
- if isEOL(r) {
+ if isEOL(l.peek()) {
l.next()
l.acceptRun(whitespace)
} else {
diff --git a/vendor/github.com/magiconair/properties/load.go b/vendor/github.com/magiconair/properties/load.go
index 4300fec..701a86d 100644
--- a/vendor/github.com/magiconair/properties/load.go
+++ b/vendor/github.com/magiconair/properties/load.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -98,7 +98,7 @@ func MustLoadURL(url string) *Properties {
return must(LoadURL(url))
}
-// MustLoadFiles reads the content of multiple URLs in the given order into a
+// MustLoadURLs reads the content of multiple URLs in the given order into a
// Properties struct and panics on error. If 'ignoreMissing' is true then a 404
// status code will not be reported as error.
func MustLoadURLs(urls []string, ignoreMissing bool) *Properties {
@@ -172,10 +172,12 @@ func loadURL(url string, ignoreMissing bool) (*Properties, error) {
return nil, fmt.Errorf("properties: %s returned %d", url, resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
- resp.Body.Close()
if err != nil {
return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
}
+ if err = resp.Body.Close(); err != nil {
+ return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
+ }
ct := resp.Header.Get("Content-Type")
var enc Encoding
diff --git a/vendor/github.com/magiconair/properties/parser.go b/vendor/github.com/magiconair/properties/parser.go
index ff0e1e1..90f555c 100644
--- a/vendor/github.com/magiconair/properties/parser.go
+++ b/vendor/github.com/magiconair/properties/parser.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go
index 50209d8..80360c9 100644
--- a/vendor/github.com/magiconair/properties/properties.go
+++ b/vendor/github.com/magiconair/properties/properties.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -28,8 +28,10 @@ type ErrorHandlerFunc func(error)
// functions. The default is LogFatalHandler.
var ErrorHandler ErrorHandlerFunc = LogFatalHandler
+// LogHandlerFunc defines the function prototype for logging errors.
type LogHandlerFunc func(fmt string, args ...interface{})
+// LogPrintf defines a log handler which uses log.Printf.
var LogPrintf LogHandlerFunc = log.Printf
// LogFatalHandler handles the error by logging a fatal error and exiting.
@@ -444,6 +446,8 @@ func (p *Properties) FilterRegexp(re *regexp.Regexp) *Properties {
pp := NewProperties()
for _, k := range p.k {
if re.MatchString(k) {
+ // TODO(fs): we are ignoring the error which flags a circular reference.
+ // TODO(fs): since we are just copying a subset of keys this cannot happen (fingers crossed)
pp.Set(k, p.m[k])
}
}
@@ -456,6 +460,8 @@ func (p *Properties) FilterPrefix(prefix string) *Properties {
pp := NewProperties()
for _, k := range p.k {
if strings.HasPrefix(k, prefix) {
+ // TODO(fs): we are ignoring the error which flags a circular reference.
+ // TODO(fs): since we are just copying a subset of keys this cannot happen (fingers crossed)
pp.Set(k, p.m[k])
}
}
@@ -469,6 +475,9 @@ func (p *Properties) FilterStripPrefix(prefix string) *Properties {
n := len(prefix)
for _, k := range p.k {
if len(k) > len(prefix) && strings.HasPrefix(k, prefix) {
+ // TODO(fs): we are ignoring the error which flags a circular reference.
+ // TODO(fs): since we are modifying keys I am not entirely sure whether we can create a circular reference
+ // TODO(fs): this function should probably return an error but the signature is fixed
pp.Set(k[n:], p.m[k])
}
}
@@ -483,9 +492,7 @@ func (p *Properties) Len() int {
// Keys returns all keys in the same order as in the input.
func (p *Properties) Keys() []string {
keys := make([]string, len(p.k))
- for i, k := range p.k {
- keys[i] = k
- }
+ copy(keys, p.k)
return keys
}
@@ -624,7 +631,7 @@ func (p *Properties) Delete(key string) {
newKeys := []string{}
for _, k := range p.k {
if k != key {
- newKeys = append(newKeys, key)
+ newKeys = append(newKeys, k)
}
}
p.k = newKeys
diff --git a/vendor/github.com/magiconair/properties/rangecheck.go b/vendor/github.com/magiconair/properties/rangecheck.go
index d9ce280..2e907d5 100644
--- a/vendor/github.com/magiconair/properties/rangecheck.go
+++ b/vendor/github.com/magiconair/properties/rangecheck.go
@@ -1,4 +1,4 @@
-// Copyright 2016 Frank Schroeder. All rights reserved.
+// Copyright 2017 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/mattn/go-sqlite3/README.md b/vendor/github.com/mattn/go-sqlite3/README.md
index a875e31..825d3aa 100644
--- a/vendor/github.com/mattn/go-sqlite3/README.md
+++ b/vendor/github.com/mattn/go-sqlite3/README.md
@@ -48,16 +48,16 @@ FAQ
* Can't build go-sqlite3 on windows 64bit.
> Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit.
- > See: https://github.com/mattn/go-sqlite3/issues/27
+ > See: [#27](https://github.com/mattn/go-sqlite3/issues/27)
* Getting insert error while query is opened.
> You can pass some arguments into the connection string, for example, a URI.
- > See: https://github.com/mattn/go-sqlite3/issues/39
+ > See: [#39](https://github.com/mattn/go-sqlite3/issues/39)
* Do you want to cross compile? mingw on Linux or Mac?
- > See: https://github.com/mattn/go-sqlite3/issues/106
+ > See: [#106](https://github.com/mattn/go-sqlite3/issues/106)
> See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html
* Want to get time.Time with current locale
@@ -66,7 +66,16 @@ FAQ
* Can use this in multiple routines concurrently?
- Yes for readonly. But, No for writable. See #50, #51, #209.
+ Yes for readonly. But, No for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209).
+
+* Why is it racy if I use a `sql.Open("sqlite", ":memory:")` database?
+
+ Each connection to :memory: opens a brand new in-memory sql database, so if
+ the stdlib's sql engine happens to open another connection and you've only
+ specified ":memory:", that connection will see a brand new database. A
+ workaround is to use "file::memory:?mode=memory&cache=shared". Every
+ connection to this string will point to the same in-memory database. See
+ [#204](https://github.com/mattn/go-sqlite3/issues/204) for more info.
License
-------
diff --git a/vendor/github.com/mattn/go-sqlite3/doc.go b/vendor/github.com/mattn/go-sqlite3/doc.go
index 030cd93..c721f77 100644
--- a/vendor/github.com/mattn/go-sqlite3/doc.go
+++ b/vendor/github.com/mattn/go-sqlite3/doc.go
@@ -110,5 +110,3 @@ See the documentation of RegisterFunc for more details.
*/
package sqlite3
-
-import "C"
diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3.go b/vendor/github.com/mattn/go-sqlite3/sqlite3.go
index 64933f1..f5699e4 100644
--- a/vendor/github.com/mattn/go-sqlite3/sqlite3.go
+++ b/vendor/github.com/mattn/go-sqlite3/sqlite3.go
@@ -429,6 +429,7 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue)
if s.(*SQLiteStmt).s != nil {
na := s.NumInput()
if len(args) < na {
+ s.Close()
return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
}
for i := 0; i < na; i++ {
@@ -765,14 +766,18 @@ func (s *SQLiteStmt) query(ctx context.Context, args []namedValue) (driver.Rows,
done: make(chan struct{}),
}
- go func() {
+ go func(db *C.sqlite3) {
select {
case <-ctx.Done():
- C.sqlite3_interrupt(s.c.db)
- rows.Close()
+ select {
+ case <-rows.done:
+ default:
+ C.sqlite3_interrupt(s.c.db)
+ rows.Close()
+ }
case <-rows.done:
}
- }()
+ }(s.c.db)
return rows, nil
}
@@ -808,13 +813,13 @@ func (s *SQLiteStmt) exec(ctx context.Context, args []namedValue) (driver.Result
done := make(chan struct{})
defer close(done)
- go func() {
+ go func(db *C.sqlite3) {
select {
case <-ctx.Done():
- C.sqlite3_interrupt(s.c.db)
+ C.sqlite3_interrupt(db)
case <-done:
}
- }()
+ }(s.c.db)
var rowid, changes C.longlong
rv := C._sqlite3_step(s.s, &rowid, &changes)
diff --git a/vendor/github.com/mattn/go-sqlite3/tracecallback.go b/vendor/github.com/mattn/go-sqlite3/tracecallback.go
index 93688d4..de1d504 100644
--- a/vendor/github.com/mattn/go-sqlite3/tracecallback.go
+++ b/vendor/github.com/mattn/go-sqlite3/tracecallback.go
@@ -1,5 +1,4 @@
// Copyright (C) 2016 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
-// TODO: add "Gimpl do foo" team?
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go b/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go
deleted file mode 100644
index f270415..0000000
--- a/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// +build !trace
-
-package sqlite3
-
-import "errors"
-
-// RegisterAggregator register the aggregator.
-func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error {
- return errors.New("This feature is not implemented")
-}
diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
index b0ab9a3..1595982 100644
--- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go
+++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
@@ -202,7 +202,7 @@ func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error
d.config.DecodeHook,
dataVal.Type(), val.Type(), data)
if err != nil {
- return err
+ return fmt.Errorf("error decoding '%s': %s", name, err)
}
}
@@ -229,6 +229,8 @@ func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error
err = d.decodePtr(name, data, val)
case reflect.Slice:
err = d.decodeSlice(name, data, val)
+ case reflect.Func:
+ err = d.decodeFunc(name, data, val)
default:
// If we reached this point then we weren't able to decode it
return fmt.Errorf("%s: unsupported type: %s", name, dataKind)
@@ -547,7 +549,7 @@ func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) er
valType := val.Type()
valElemType := valType.Elem()
- realVal:=val
+ realVal := val
if realVal.IsNil() || d.config.ZeroFields {
realVal = reflect.New(valElemType)
}
@@ -560,6 +562,19 @@ func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) er
return nil
}
+func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) error {
+ // Create an element of the concrete (non pointer) type and decode
+ // into that. Then set the value of the pointer to this type.
+ dataVal := reflect.Indirect(reflect.ValueOf(data))
+ if val.Type() != dataVal.Type() {
+ return fmt.Errorf(
+ "'%s' expected type '%s', got unconvertible type '%s'",
+ name, val.Type(), dataVal.Type())
+ }
+ val.Set(dataVal)
+ return nil
+}
+
func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error {
dataVal := reflect.Indirect(reflect.ValueOf(data))
dataValKind := dataVal.Kind()
@@ -567,7 +582,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value)
valElemType := valType.Elem()
sliceType := reflect.SliceOf(valElemType)
- valSlice:=val
+ valSlice := val
if valSlice.IsNil() || d.config.ZeroFields {
// Check input type
@@ -591,6 +606,9 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value)
for i := 0; i < dataVal.Len(); i++ {
currentData := dataVal.Index(i).Interface()
+ for valSlice.Len() <= i {
+ valSlice = reflect.Append(valSlice, reflect.Zero(valElemType))
+ }
currentField := valSlice.Index(i)
fieldName := fmt.Sprintf("%s[%d]", name, i)
diff --git a/vendor/github.com/nsheridan/autocert-wkfs-cache/License.txt b/vendor/github.com/nsheridan/autocert-wkfs-cache/License.txt
new file mode 100644
index 0000000..09dc147
--- /dev/null
+++ b/vendor/github.com/nsheridan/autocert-wkfs-cache/License.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Niall Sheridan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/github.com/nsheridan/wkfs/License.txt b/vendor/github.com/nsheridan/wkfs/License.txt
new file mode 100644
index 0000000..09dc147
--- /dev/null
+++ b/vendor/github.com/nsheridan/wkfs/License.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Niall Sheridan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/github.com/pelletier/go-toml/LICENSE b/vendor/github.com/pelletier/go-toml/LICENSE
index 5f9f53d..583bdae 100644
--- a/vendor/github.com/pelletier/go-toml/LICENSE
+++ b/vendor/github.com/pelletier/go-toml/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2013 - 2016 Thomas Pelletier, Eric Anderton
+Copyright (c) 2013 - 2017 Thomas Pelletier, Eric Anderton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-
diff --git a/vendor/github.com/pelletier/go-toml/README.md b/vendor/github.com/pelletier/go-toml/README.md
index b511f39..b8137e0 100644
--- a/vendor/github.com/pelletier/go-toml/README.md
+++ b/vendor/github.com/pelletier/go-toml/README.md
@@ -6,7 +6,7 @@ This library supports TOML version
[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)
[![GoDoc](https://godoc.org/github.com/pelletier/go-toml?status.svg)](http://godoc.org/github.com/pelletier/go-toml)
-[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/goadesign/goa/blob/master/LICENSE)
+[![license](https://img.shields.io/github/license/pelletier/go-toml.svg)](https://github.com/pelletier/go-toml/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/pelletier/go-toml.svg?branch=master)](https://travis-ci.org/pelletier/go-toml)
[![Coverage Status](https://coveralls.io/repos/github/pelletier/go-toml/badge.svg?branch=master)](https://coveralls.io/github/pelletier/go-toml?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/pelletier/go-toml)](https://goreportcard.com/report/github.com/pelletier/go-toml)
@@ -96,7 +96,7 @@ Go-toml provides two handy command line tools:
* `tomljson`: Reads a TOML file and outputs its JSON representation.
```
- go install github.com/pelletier/go-toml/cmd/tomjson
+ go install github.com/pelletier/go-toml/cmd/tomljson
tomljson --help
```
diff --git a/vendor/github.com/pelletier/go-toml/doc.go b/vendor/github.com/pelletier/go-toml/doc.go
index c8c9add..9156b73 100644
--- a/vendor/github.com/pelletier/go-toml/doc.go
+++ b/vendor/github.com/pelletier/go-toml/doc.go
@@ -22,8 +22,8 @@
// After parsing TOML data with Load() or LoadFile(), use the Has() and Get()
// methods on the returned TomlTree, to find your way through the document data.
//
-// if tree.Has('foo') {
-// fmt.Prinln("foo is: %v", tree.Get('foo'))
+// if tree.Has("foo") {
+// fmt.Println("foo is:", tree.Get("foo"))
// }
//
// Working with Paths
@@ -44,10 +44,10 @@
// it avoids having to parse the passed key for '.' delimiters.
//
// // looks for a key named 'baz', within struct 'bar', within struct 'foo'
-// tree.HasPath(string{}{"foo","bar","baz"})
+// tree.HasPath([]string{"foo","bar","baz"})
//
// // returns the key at this path, if it is there
-// tree.GetPath(string{}{"foo","bar","baz"})
+// tree.GetPath([]string{"foo","bar","baz"})
//
// Note that this is distinct from the heavyweight query syntax supported by
// TomlTree.Query() and the Query() struct (see below).
diff --git a/vendor/github.com/pelletier/go-toml/lexer.go b/vendor/github.com/pelletier/go-toml/lexer.go
index 4b378d4..4ba134c 100644
--- a/vendor/github.com/pelletier/go-toml/lexer.go
+++ b/vendor/github.com/pelletier/go-toml/lexer.go
@@ -131,7 +131,7 @@ func (l *tomlLexer) lexVoid() tomlLexStateFn {
case '[':
return l.lexTableKey
case '#':
- return l.lexComment
+ return l.lexComment(l.lexVoid)
case '=':
return l.lexEqual
case '\r':
@@ -182,7 +182,7 @@ func (l *tomlLexer) lexRvalue() tomlLexStateFn {
case '}':
return l.lexRightCurlyBrace
case '#':
- return l.lexComment
+ return l.lexComment(l.lexRvalue)
case '"':
return l.lexString
case '\'':
@@ -309,15 +309,17 @@ func (l *tomlLexer) lexKey() tomlLexStateFn {
return l.lexVoid
}
-func (l *tomlLexer) lexComment() tomlLexStateFn {
- for next := l.peek(); next != '\n' && next != eof; next = l.peek() {
- if next == '\r' && l.follow("\r\n") {
- break
+func (l *tomlLexer) lexComment(previousState tomlLexStateFn) tomlLexStateFn {
+ return func() tomlLexStateFn {
+ for next := l.peek(); next != '\n' && next != eof; next = l.peek() {
+ if next == '\r' && l.follow("\r\n") {
+ break
+ }
+ l.next()
}
- l.next()
+ l.ignore()
+ return previousState
}
- l.ignore()
- return l.lexVoid
}
func (l *tomlLexer) lexLeftBracket() tomlLexStateFn {
diff --git a/vendor/github.com/pelletier/go-toml/tomltree_conversions.go b/vendor/github.com/pelletier/go-toml/tomltree_conversions.go
index db3da0d..fc8f22b 100644
--- a/vendor/github.com/pelletier/go-toml/tomltree_conversions.go
+++ b/vendor/github.com/pelletier/go-toml/tomltree_conversions.go
@@ -87,7 +87,7 @@ func toTomlValue(item interface{}, indent int) string {
case nil:
return ""
default:
- panic(fmt.Sprintf("unsupported value type %T: %v", value, value))
+ panic(fmt.Errorf("unsupported value type %T: %v", value, value))
}
}
@@ -154,6 +154,23 @@ func (t *TomlTree) toToml(indent, keyspace string) string {
return strings.Join(resultChunks, "")
}
+// Same as ToToml(), but does not panic and returns an error
+func (t *TomlTree) toTomlSafe(indent, keyspace string) (result string, err error) {
+ defer func() {
+ if r := recover(); r != nil {
+ result = ""
+ switch x := r.(type) {
+ case error:
+ err = x
+ default:
+ err = fmt.Errorf("unknown panic: %s", r)
+ }
+ }
+ }()
+ result = t.toToml(indent, keyspace)
+ return
+}
+
func convertMapStringString(in map[string]string) map[string]interface{} {
result := make(map[string]interface{}, len(in))
for k, v := range in {
@@ -170,15 +187,18 @@ func convertMapInterfaceInterface(in map[interface{}]interface{}) map[string]int
return result
}
-// ToString is an alias for String
-func (t *TomlTree) ToString() string {
- return t.String()
+// ToString generates a human-readable representation of the current tree.
+// Output spans multiple lines, and is suitable for ingest by a TOML parser.
+// If the conversion cannot be performed, ToString returns a non-nil error.
+func (t *TomlTree) ToString() (string, error) {
+ return t.toTomlSafe("", "")
}
// String generates a human-readable representation of the current tree.
-// Output spans multiple lines, and is suitable for ingest by a TOML parser
+// Alias of ToString.
func (t *TomlTree) String() string {
- return t.toToml("", "")
+ result, _ := t.ToString()
+ return result
}
// ToMap recursively generates a representation of the current tree using map[string]interface{}.
diff --git a/vendor/github.com/pkg/browser/browser_openbsd.go b/vendor/github.com/pkg/browser/browser_openbsd.go
new file mode 100644
index 0000000..3c64118
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_openbsd.go
@@ -0,0 +1,16 @@
+package browser
+
+import (
+ "errors"
+ "os/exec"
+)
+
+var errNoXdgOpen = errors.New("xdg-open: command not found - install xdg-utils from ports(8)")
+
+func openBrowser(url string) error {
+ err := runCmd("xdg-open", url)
+ if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
+ return errNoXdgOpen
+ }
+ return err
+}
diff --git a/vendor/github.com/pkg/browser/browser_unsupported.go b/vendor/github.com/pkg/browser/browser_unsupported.go
index 3bdc6ff..e29d220 100644
--- a/vendor/github.com/pkg/browser/browser_unsupported.go
+++ b/vendor/github.com/pkg/browser/browser_unsupported.go
@@ -1,4 +1,4 @@
-// +build !linux,!windows,!darwin
+// +build !linux,!windows,!darwin,!openbsd
package browser
diff --git a/vendor/github.com/sethgrid/pester/main.go b/vendor/github.com/sethgrid/pester/main.go
index 8eb91fe..2771a23 100644
--- a/vendor/github.com/sethgrid/pester/main.go
+++ b/vendor/github.com/sethgrid/pester/main.go
@@ -292,7 +292,7 @@ func (c *Client) pester(p params) (*http.Response, error) {
}
// prevent a 0 from causing the tick to block, pass additional microsecond
- <-time.Tick(c.Backoff(i) + 1*time.Microsecond)
+ <-time.After(c.Backoff(i) + 1*time.Microsecond)
}
}(req, p)
}
diff --git a/vendor/github.com/spf13/afero/basepath.go b/vendor/github.com/spf13/afero/basepath.go
index 6ec6ca9..5e4fc2e 100644
--- a/vendor/github.com/spf13/afero/basepath.go
+++ b/vendor/github.com/spf13/afero/basepath.go
@@ -52,7 +52,7 @@ func validateBasePathName(name string) error {
// On Windows a common mistake would be to provide an absolute OS path
// We could strip out the base part, but that would not be very portable.
if filepath.IsAbs(name) {
- return &os.PathError{"realPath", name, errors.New("got a real OS path instead of a virtual")}
+ return &os.PathError{Op: "realPath", Path: name, Err: errors.New("got a real OS path instead of a virtual")}
}
return nil
@@ -60,14 +60,14 @@ func validateBasePathName(name string) error {
func (b *BasePathFs) Chtimes(name string, atime, mtime time.Time) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"chtimes", name, err}
+ return &os.PathError{Op: "chtimes", Path: name, Err: err}
}
return b.source.Chtimes(name, atime, mtime)
}
func (b *BasePathFs) Chmod(name string, mode os.FileMode) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"chmod", name, err}
+ return &os.PathError{Op: "chmod", Path: name, Err: err}
}
return b.source.Chmod(name, mode)
}
@@ -78,66 +78,66 @@ func (b *BasePathFs) Name() string {
func (b *BasePathFs) Stat(name string) (fi os.FileInfo, err error) {
if name, err = b.RealPath(name); err != nil {
- return nil, &os.PathError{"stat", name, err}
+ return nil, &os.PathError{Op: "stat", Path: name, Err: err}
}
return b.source.Stat(name)
}
func (b *BasePathFs) Rename(oldname, newname string) (err error) {
if oldname, err = b.RealPath(oldname); err != nil {
- return &os.PathError{"rename", oldname, err}
+ return &os.PathError{Op: "rename", Path: oldname, Err: err}
}
if newname, err = b.RealPath(newname); err != nil {
- return &os.PathError{"rename", newname, err}
+ return &os.PathError{Op: "rename", Path: newname, Err: err}
}
return b.source.Rename(oldname, newname)
}
func (b *BasePathFs) RemoveAll(name string) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"remove_all", name, err}
+ return &os.PathError{Op: "remove_all", Path: name, Err: err}
}
return b.source.RemoveAll(name)
}
func (b *BasePathFs) Remove(name string) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"remove", name, err}
+ return &os.PathError{Op: "remove", Path: name, Err: err}
}
return b.source.Remove(name)
}
func (b *BasePathFs) OpenFile(name string, flag int, mode os.FileMode) (f File, err error) {
if name, err = b.RealPath(name); err != nil {
- return nil, &os.PathError{"openfile", name, err}
+ return nil, &os.PathError{Op: "openfile", Path: name, Err: err}
}
return b.source.OpenFile(name, flag, mode)
}
func (b *BasePathFs) Open(name string) (f File, err error) {
if name, err = b.RealPath(name); err != nil {
- return nil, &os.PathError{"open", name, err}
+ return nil, &os.PathError{Op: "open", Path: name, Err: err}
}
return b.source.Open(name)
}
func (b *BasePathFs) Mkdir(name string, mode os.FileMode) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"mkdir", name, err}
+ return &os.PathError{Op: "mkdir", Path: name, Err: err}
}
return b.source.Mkdir(name, mode)
}
func (b *BasePathFs) MkdirAll(name string, mode os.FileMode) (err error) {
if name, err = b.RealPath(name); err != nil {
- return &os.PathError{"mkdir", name, err}
+ return &os.PathError{Op: "mkdir", Path: name, Err: err}
}
return b.source.MkdirAll(name, mode)
}
func (b *BasePathFs) Create(name string) (f File, err error) {
if name, err = b.RealPath(name); err != nil {
- return nil, &os.PathError{"create", name, err}
+ return nil, &os.PathError{Op: "create", Path: name, Err: err}
}
return b.source.Create(name)
}
diff --git a/vendor/github.com/spf13/afero/mem/file.go b/vendor/github.com/spf13/afero/mem/file.go
index 3c1e09a..e41e012 100644
--- a/vendor/github.com/spf13/afero/mem/file.go
+++ b/vendor/github.com/spf13/afero/mem/file.go
@@ -186,7 +186,7 @@ func (f *File) Truncate(size int64) error {
return ErrFileClosed
}
if f.readOnly {
- return &os.PathError{"truncate", f.fileData.name, errors.New("file handle is read only")}
+ return &os.PathError{Op: "truncate", Path: f.fileData.name, Err: errors.New("file handle is read only")}
}
if size < 0 {
return ErrOutOfRange
@@ -218,7 +218,7 @@ func (f *File) Seek(offset int64, whence int) (int64, error) {
func (f *File) Write(b []byte) (n int, err error) {
if f.readOnly {
- return 0, &os.PathError{"write", f.fileData.name, errors.New("file handle is read only")}
+ return 0, &os.PathError{Op: "write", Path: f.fileData.name, Err: errors.New("file handle is read only")}
}
n = len(b)
cur := atomic.LoadInt64(&f.at)
diff --git a/vendor/github.com/spf13/afero/memmap.go b/vendor/github.com/spf13/afero/memmap.go
index 494ba54..767ac1d 100644
--- a/vendor/github.com/spf13/afero/memmap.go
+++ b/vendor/github.com/spf13/afero/memmap.go
@@ -45,7 +45,7 @@ func (m *MemMapFs) getData() map[string]*mem.FileData {
return m.data
}
-func (MemMapFs) Name() string { return "MemMapFS" }
+func (*MemMapFs) Name() string { return "MemMapFS" }
func (m *MemMapFs) Create(name string) (File, error) {
name = normalizePath(name)
@@ -108,7 +108,7 @@ func (m *MemMapFs) lockfreeMkdir(name string, perm os.FileMode) error {
x, ok := m.getData()[name]
if ok {
// Only return ErrFileExists if it's a file, not a directory.
- i := mem.FileInfo{x}
+ i := mem.FileInfo{FileData: x}
if !i.IsDir() {
return ErrFileExists
}
@@ -127,7 +127,7 @@ func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error {
_, ok := m.getData()[name]
m.mu.RUnlock()
if ok {
- return &os.PathError{"mkdir", name, ErrFileExists}
+ return &os.PathError{Op: "mkdir", Path: name, Err: ErrFileExists}
}
m.mu.Lock()
@@ -190,7 +190,7 @@ func (m *MemMapFs) open(name string) (*mem.FileData, error) {
f, ok := m.getData()[name]
m.mu.RUnlock()
if !ok {
- return nil, &os.PathError{"open", name, ErrFileNotFound}
+ return nil, &os.PathError{Op: "open", Path: name, Err: ErrFileNotFound}
}
return f, nil
}
@@ -247,11 +247,11 @@ func (m *MemMapFs) Remove(name string) error {
if _, ok := m.getData()[name]; ok {
err := m.unRegisterWithParent(name)
if err != nil {
- return &os.PathError{"remove", name, err}
+ return &os.PathError{Op: "remove", Path: name, Err: err}
}
delete(m.getData(), name)
} else {
- return &os.PathError{"remove", name, os.ErrNotExist}
+ return &os.PathError{Op: "remove", Path: name, Err: os.ErrNotExist}
}
return nil
}
@@ -299,7 +299,7 @@ func (m *MemMapFs) Rename(oldname, newname string) error {
m.mu.Unlock()
m.mu.RLock()
} else {
- return &os.PathError{"rename", oldname, ErrFileNotFound}
+ return &os.PathError{Op: "rename", Path: oldname, Err: ErrFileNotFound}
}
return nil
}
@@ -320,7 +320,7 @@ func (m *MemMapFs) Chmod(name string, mode os.FileMode) error {
f, ok := m.getData()[name]
m.mu.RUnlock()
if !ok {
- return &os.PathError{"chmod", name, ErrFileNotFound}
+ return &os.PathError{Op: "chmod", Path: name, Err: ErrFileNotFound}
}
m.mu.Lock()
@@ -337,7 +337,7 @@ func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error
f, ok := m.getData()[name]
m.mu.RUnlock()
if !ok {
- return &os.PathError{"chtimes", name, ErrFileNotFound}
+ return &os.PathError{Op: "chtimes", Path: name, Err: ErrFileNotFound}
}
m.mu.Lock()
@@ -349,7 +349,7 @@ func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error
func (m *MemMapFs) List() {
for _, x := range m.data {
- y := mem.FileInfo{x}
+ y := mem.FileInfo{FileData: x}
fmt.Println(x.Name(), y.Size())
}
}
diff --git a/vendor/github.com/spf13/cast/caste.go b/vendor/github.com/spf13/cast/caste.go
index 1aaa1ff..10acc44 100644
--- a/vendor/github.com/spf13/cast/caste.go
+++ b/vendor/github.com/spf13/cast/caste.go
@@ -510,16 +510,21 @@ func StringToDate(s string) (time.Time, error) {
time.RFC1123,
time.RFC822Z,
time.RFC822,
+ time.RFC850,
time.ANSIC,
time.UnixDate,
time.RubyDate,
- "2006-01-02 15:04:05Z07:00",
- "02 Jan 06 15:04 MST",
+ "2006-01-02 15:04:05.999999999 -0700 MST", // Time.String()
"2006-01-02",
"02 Jan 2006",
"2006-01-02 15:04:05 -07:00",
"2006-01-02 15:04:05 -0700",
"2006-01-02 15:04:05",
+ time.Kitchen,
+ time.Stamp,
+ time.StampMilli,
+ time.StampMicro,
+ time.StampNano,
})
}
diff --git a/vendor/github.com/spf13/jwalterweatherman/README.md b/vendor/github.com/spf13/jwalterweatherman/README.md
index c6f327c..350a968 100644
--- a/vendor/github.com/spf13/jwalterweatherman/README.md
+++ b/vendor/github.com/spf13/jwalterweatherman/README.md
@@ -44,7 +44,7 @@ Available Loggers are:
* FATAL
These each are loggers based on the log standard library and follow the
-standard usage. Eg..
+standard usage. Eg.
```go
import (
@@ -79,6 +79,13 @@ standard usage. Eg..
```
+NOTE: You can also use the library in a non-global setting by creating an instance of a Notebook:
+
+```go
+notepad = jww.NewNotepad(jww.LevelInfo, jww.LevelTrace, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime)
+notepad.WARN.Println("Some warning"")
+```
+
_Why 7 levels?_
Maybe you think that 7 levels are too much for any application... and you
@@ -118,35 +125,15 @@ verbosity.
Note that JWW's own internal output uses log levels as well, so set the log
level before making any other calls if you want to see what it's up to.
-### Using a temp log file
-
-JWW conveniently creates a temporary file and sets the log Handle to
-a io.Writer created for it. You should call this early in your application
-initialization routine as it will only log calls made after it is executed.
-When this option is used, the library will fmt.Println where to find the
-log file.
-
-```go
- import (
- jww "github.com/spf13/jwalterweatherman"
- )
-
- jww.UseTempLogFile("YourAppName")
-
-```
### Setting a log file
-JWW can log to any file you provide a path to (provided it’s writable).
-Will only append to this file.
+JWW can log to any `io.Writer`:
```go
- import (
- jww "github.com/spf13/jwalterweatherman"
- )
- jww.SetLogFile("/path/to/logfile")
+ jww.SetLogOutput(customWriter)
```
diff --git a/vendor/github.com/spf13/jwalterweatherman/default_notepad.go b/vendor/github.com/spf13/jwalterweatherman/default_notepad.go
new file mode 100644
index 0000000..bcb7634
--- /dev/null
+++ b/vendor/github.com/spf13/jwalterweatherman/default_notepad.go
@@ -0,0 +1,113 @@
+// Copyright © 2016 Steve Francia <spf@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package jwalterweatherman
+
+import (
+ "io"
+ "io/ioutil"
+ "log"
+ "os"
+)
+
+var (
+ TRACE *log.Logger
+ DEBUG *log.Logger
+ INFO *log.Logger
+ WARN *log.Logger
+ ERROR *log.Logger
+ CRITICAL *log.Logger
+ FATAL *log.Logger
+
+ LOG *log.Logger
+ FEEDBACK *Feedback
+
+ defaultNotepad *Notepad
+)
+
+func reloadDefaultNotepad() {
+ TRACE = defaultNotepad.TRACE
+ DEBUG = defaultNotepad.DEBUG
+ INFO = defaultNotepad.INFO
+ WARN = defaultNotepad.WARN
+ ERROR = defaultNotepad.ERROR
+ CRITICAL = defaultNotepad.CRITICAL
+ FATAL = defaultNotepad.FATAL
+
+ LOG = defaultNotepad.LOG
+ FEEDBACK = defaultNotepad.FEEDBACK
+}
+
+func init() {
+ defaultNotepad = NewNotepad(LevelError, LevelWarn, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime)
+ reloadDefaultNotepad()
+}
+
+// SetLogThreshold set the log threshold for the default notepad. Trace by default.
+func SetLogThreshold(threshold Threshold) {
+ defaultNotepad.SetLogThreshold(threshold)
+ reloadDefaultNotepad()
+}
+
+// SetLogOutput set the log output for the default notepad. Discarded by default.
+func SetLogOutput(handle io.Writer) {
+ defaultNotepad.SetLogOutput(handle)
+ reloadDefaultNotepad()
+}
+
+// SetStdoutThreshold set the standard output threshold for the default notepad.
+// Info by default.
+func SetStdoutThreshold(threshold Threshold) {
+ defaultNotepad.SetStdoutThreshold(threshold)
+ reloadDefaultNotepad()
+}
+
+// SetPrefix set the prefix for the default logger. Empty by default.
+func SetPrefix(prefix string) {
+ defaultNotepad.SetPrefix(prefix)
+ reloadDefaultNotepad()
+}
+
+// SetFlags set the flags for the default logger. "log.Ldate | log.Ltime" by default.
+func SetFlags(flags int) {
+ defaultNotepad.SetFlags(flags)
+ reloadDefaultNotepad()
+}
+
+// Level returns the current global log threshold.
+func LogThreshold() Threshold {
+ return defaultNotepad.logThreshold
+}
+
+// Level returns the current global output threshold.
+func StdoutThreshold() Threshold {
+ return defaultNotepad.stdoutThreshold
+}
+
+// GetStdoutThreshold returns the defined Treshold for the log logger.
+func GetLogThreshold() Threshold {
+ return defaultNotepad.GetLogThreshold()
+}
+
+// GetStdoutThreshold returns the Treshold for the stdout logger.
+func GetStdoutThreshold() Threshold {
+ return defaultNotepad.GetStdoutThreshold()
+}
+
+// LogCountForLevel returns the number of log invocations for a given threshold.
+func LogCountForLevel(l Threshold) uint64 {
+ return defaultNotepad.LogCountForLevel(l)
+}
+
+// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations
+// greater than or equal to a given threshold.
+func LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 {
+ return defaultNotepad.LogCountForLevelsGreaterThanorEqualTo(threshold)
+}
+
+// ResetLogCounters resets the invocation counters for all levels.
+func ResetLogCounters() {
+ defaultNotepad.ResetLogCounters()
+}
diff --git a/vendor/github.com/spf13/jwalterweatherman/log_counter.go b/vendor/github.com/spf13/jwalterweatherman/log_counter.go
new file mode 100644
index 0000000..570db1d
--- /dev/null
+++ b/vendor/github.com/spf13/jwalterweatherman/log_counter.go
@@ -0,0 +1,56 @@
+// Copyright © 2016 Steve Francia <spf@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package jwalterweatherman
+
+import (
+ "sync/atomic"
+)
+
+type logCounter struct {
+ counter uint64
+}
+
+func (c *logCounter) incr() {
+ atomic.AddUint64(&c.counter, 1)
+}
+
+func (c *logCounter) resetCounter() {
+ atomic.StoreUint64(&c.counter, 0)
+}
+
+func (c *logCounter) getCount() uint64 {
+ return atomic.LoadUint64(&c.counter)
+}
+
+func (c *logCounter) Write(p []byte) (n int, err error) {
+ c.incr()
+
+ return len(p), nil
+}
+
+// LogCountForLevel returns the number of log invocations for a given threshold.
+func (n *Notepad) LogCountForLevel(l Threshold) uint64 {
+ return n.logCounters[l].getCount()
+}
+
+// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations
+// greater than or equal to a given threshold.
+func (n *Notepad) LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 {
+ var cnt uint64
+
+ for i := int(threshold); i < len(n.logCounters); i++ {
+ cnt += n.LogCountForLevel(Threshold(i))
+ }
+
+ return cnt
+}
+
+// ResetLogCounters resets the invocation counters for all levels.
+func (n *Notepad) ResetLogCounters() {
+ for _, np := range n.logCounters {
+ np.resetCounter()
+ }
+}
diff --git a/vendor/github.com/spf13/jwalterweatherman/notepad.go b/vendor/github.com/spf13/jwalterweatherman/notepad.go
new file mode 100644
index 0000000..5a623f4
--- /dev/null
+++ b/vendor/github.com/spf13/jwalterweatherman/notepad.go
@@ -0,0 +1,195 @@
+// Copyright © 2016 Steve Francia <spf@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package jwalterweatherman
+
+import (
+ "fmt"
+ "io"
+ "log"
+ "os"
+)
+
+type Threshold int
+
+func (t Threshold) String() string {
+ return prefixes[t]
+}
+
+const (
+ LevelTrace Threshold = iota
+ LevelDebug
+ LevelInfo
+ LevelWarn
+ LevelError
+ LevelCritical
+ LevelFatal
+)
+
+var prefixes map[Threshold]string = map[Threshold]string{
+ LevelTrace: "TRACE",
+ LevelDebug: "DEBUG",
+ LevelInfo: "INFO",
+ LevelWarn: "WARN",
+ LevelError: "ERROR",
+ LevelCritical: "CRITICAL",
+ LevelFatal: "FATAL",
+}
+
+func prefix(t Threshold) string {
+ return t.String() + " "
+}
+
+// Notepad is where you leave a note !
+type Notepad struct {
+ TRACE *log.Logger
+ DEBUG *log.Logger
+ INFO *log.Logger
+ WARN *log.Logger
+ ERROR *log.Logger
+ CRITICAL *log.Logger
+ FATAL *log.Logger
+
+ LOG *log.Logger
+ FEEDBACK *Feedback
+
+ loggers []**log.Logger
+ logHandle io.Writer
+ outHandle io.Writer
+ logThreshold Threshold
+ stdoutThreshold Threshold
+ prefix string
+ flags int
+
+ // One per Threshold
+ logCounters [7]*logCounter
+}
+
+// NewNotepad create a new notepad.
+func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int) *Notepad {
+ n := &Notepad{}
+
+ n.loggers = append(n.loggers, &n.TRACE, &n.DEBUG, &n.INFO, &n.WARN, &n.ERROR, &n.CRITICAL, &n.FATAL)
+ n.logHandle = logHandle
+ n.outHandle = outHandle
+ n.logThreshold = logThreshold
+ n.stdoutThreshold = outThreshold
+
+ if len(prefix) != 0 {
+ n.prefix = "[" + prefix + "] "
+ } else {
+ n.prefix = ""
+ }
+
+ n.flags = flags
+
+ n.LOG = log.New(n.logHandle,
+ "LOG: ",
+ n.flags)
+
+ n.FEEDBACK = &Feedback{n}
+
+ n.init()
+
+ return n
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+type Feedback struct {
+ *Notepad
+}
+
+// init create the loggers for each level depending on the notepad thresholds
+func (n *Notepad) init() {
+ bothHandle := io.MultiWriter(n.outHandle, n.logHandle)
+
+ for t, logger := range n.loggers {
+ threshold := Threshold(t)
+ counter := &logCounter{}
+ n.logCounters[t] = counter
+
+ switch {
+ case threshold >= n.logThreshold && threshold >= n.stdoutThreshold:
+ *logger = log.New(io.MultiWriter(counter, bothHandle), n.prefix+prefix(threshold), n.flags)
+
+ case threshold >= n.logThreshold:
+ *logger = log.New(io.MultiWriter(counter, n.logHandle), n.prefix+prefix(threshold), n.flags)
+
+ case threshold >= n.stdoutThreshold:
+ *logger = log.New(io.MultiWriter(counter, os.Stdout), n.prefix+prefix(threshold), n.flags)
+
+ default:
+ *logger = log.New(counter, n.prefix+prefix(threshold), n.flags)
+ }
+ }
+}
+
+// SetLogThreshold change the threshold above which messages are written to the
+// log file
+func (n *Notepad) SetLogThreshold(threshold Threshold) {
+ n.logThreshold = threshold
+ n.init()
+}
+
+// SetLogOutput change the file where log messages are written
+func (n *Notepad) SetLogOutput(handle io.Writer) {
+ n.logHandle = handle
+ n.init()
+}
+
+// GetStdoutThreshold returns the defined Treshold for the log logger.
+func (n *Notepad) GetLogThreshold() Threshold {
+ return n.logThreshold
+}
+
+// SetStdoutThreshold change the threshold above which messages are written to the
+// standard output
+func (n *Notepad) SetStdoutThreshold(threshold Threshold) {
+ n.stdoutThreshold = threshold
+ n.init()
+}
+
+// GetStdoutThreshold returns the Treshold for the stdout logger.
+func (n *Notepad) GetStdoutThreshold() Threshold {
+ return n.stdoutThreshold
+}
+
+// SetPrefix change the prefix used by the notepad. Prefixes are displayed between
+// brackets at the begining of the line. An empty prefix won't be displayed at all.
+func (n *Notepad) SetPrefix(prefix string) {
+ if len(prefix) != 0 {
+ n.prefix = "[" + prefix + "] "
+ } else {
+ n.prefix = ""
+ }
+ n.init()
+}
+
+// SetFlags choose which flags the logger will display (after prefix and message
+// level). See the package log for more informations on this.
+func (n *Notepad) SetFlags(flags int) {
+ n.flags = flags
+ n.init()
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+func (fb *Feedback) Println(v ...interface{}) {
+ s := fmt.Sprintln(v...)
+ fmt.Print(s)
+ fb.LOG.Output(2, s)
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+func (fb *Feedback) Printf(format string, v ...interface{}) {
+ s := fmt.Sprintf(format, v...)
+ fmt.Print(s)
+ fb.LOG.Output(2, s)
+}
diff --git a/vendor/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go b/vendor/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
deleted file mode 100644
index b64ed46..0000000
--- a/vendor/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
+++ /dev/null
@@ -1,256 +0,0 @@
-// Copyright © 2016 Steve Francia <spf@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package jwalterweatherman
-
-import (
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "os"
- "sync/atomic"
-)
-
-// Level describes the chosen log level between
-// debug and critical.
-type Level int
-
-type NotePad struct {
- Handle io.Writer
- Level Level
- Prefix string
- Logger **log.Logger
- counter uint64
-}
-
-func (n *NotePad) incr() {
- atomic.AddUint64(&n.counter, 1)
-}
-
-func (n *NotePad) resetCounter() {
- atomic.StoreUint64(&n.counter, 0)
-}
-
-func (n *NotePad) getCount() uint64 {
- return atomic.LoadUint64(&n.counter)
-}
-
-type countingWriter struct {
- incrFunc func()
-}
-
-func (cw *countingWriter) Write(p []byte) (n int, err error) {
- cw.incrFunc()
-
- return 0, nil
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-type Feedback struct{}
-
-const (
- LevelTrace Level = iota
- LevelDebug
- LevelInfo
- LevelWarn
- LevelError
- LevelCritical
- LevelFatal
- DefaultLogThreshold = LevelWarn
- DefaultStdoutThreshold = LevelError
-)
-
-var (
- TRACE *log.Logger
- DEBUG *log.Logger
- INFO *log.Logger
- WARN *log.Logger
- ERROR *log.Logger
- CRITICAL *log.Logger
- FATAL *log.Logger
- LOG *log.Logger
- FEEDBACK Feedback
- LogHandle io.Writer = ioutil.Discard
- OutHandle io.Writer = os.Stdout
- BothHandle io.Writer = io.MultiWriter(LogHandle, OutHandle)
- NotePads []*NotePad = []*NotePad{trace, debug, info, warn, err, critical, fatal}
-
- trace *NotePad = &NotePad{Level: LevelTrace, Handle: os.Stdout, Logger: &TRACE, Prefix: "TRACE: "}
- debug *NotePad = &NotePad{Level: LevelDebug, Handle: os.Stdout, Logger: &DEBUG, Prefix: "DEBUG: "}
- info *NotePad = &NotePad{Level: LevelInfo, Handle: os.Stdout, Logger: &INFO, Prefix: "INFO: "}
- warn *NotePad = &NotePad{Level: LevelWarn, Handle: os.Stdout, Logger: &WARN, Prefix: "WARN: "}
- err *NotePad = &NotePad{Level: LevelError, Handle: os.Stdout, Logger: &ERROR, Prefix: "ERROR: "}
- critical *NotePad = &NotePad{Level: LevelCritical, Handle: os.Stdout, Logger: &CRITICAL, Prefix: "CRITICAL: "}
- fatal *NotePad = &NotePad{Level: LevelFatal, Handle: os.Stdout, Logger: &FATAL, Prefix: "FATAL: "}
- logThreshold Level = DefaultLogThreshold
- outputThreshold Level = DefaultStdoutThreshold
-)
-
-const (
- DATE = log.Ldate
- TIME = log.Ltime
- SFILE = log.Lshortfile
- LFILE = log.Llongfile
- MSEC = log.Lmicroseconds
-)
-
-var logFlags = DATE | TIME | SFILE
-
-func init() {
- SetStdoutThreshold(DefaultStdoutThreshold)
-}
-
-// initialize will setup the jWalterWeatherman standard approach of providing the user
-// some feedback and logging a potentially different amount based on independent log and output thresholds.
-// By default the output has a lower threshold than logged
-// Don't use if you have manually set the Handles of the different levels as it will overwrite them.
-func initialize() {
- BothHandle = io.MultiWriter(LogHandle, OutHandle)
-
- for _, n := range NotePads {
- if n.Level < outputThreshold && n.Level < logThreshold {
- n.Handle = ioutil.Discard
- } else if n.Level >= outputThreshold && n.Level >= logThreshold {
- n.Handle = BothHandle
- } else if n.Level >= outputThreshold && n.Level < logThreshold {
- n.Handle = OutHandle
- } else {
- n.Handle = LogHandle
- }
- }
-
- for _, n := range NotePads {
- n.Handle = io.MultiWriter(n.Handle, &countingWriter{n.incr})
- *n.Logger = log.New(n.Handle, n.Prefix, logFlags)
- }
-
- LOG = log.New(LogHandle,
- "LOG: ",
- logFlags)
-}
-
-// Set the log Flags (Available flag: DATE, TIME, SFILE, LFILE and MSEC)
-func SetLogFlag(flags int) {
- logFlags = flags
- initialize()
-}
-
-// Level returns the current global log threshold.
-func LogThreshold() Level {
- return logThreshold
-}
-
-// Level returns the current global output threshold.
-func StdoutThreshold() Level {
- return outputThreshold
-}
-
-// Ensures that the level provided is within the bounds of available levels
-func levelCheck(level Level) Level {
- switch {
- case level <= LevelTrace:
- return LevelTrace
- case level >= LevelFatal:
- return LevelFatal
- default:
- return level
- }
-}
-
-// Establishes a threshold where anything matching or above will be logged
-func SetLogThreshold(level Level) {
- logThreshold = levelCheck(level)
- initialize()
-}
-
-// Establishes a threshold where anything matching or above will be output
-func SetStdoutThreshold(level Level) {
- outputThreshold = levelCheck(level)
- initialize()
-}
-
-// Conveniently Sets the Log Handle to a io.writer created for the file behind the given filepath
-// Will only append to this file
-func SetLogFile(path string) {
- file, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
- if err != nil {
- CRITICAL.Println("Failed to open log file:", path, err)
- os.Exit(-1)
- }
-
- INFO.Println("Logging to", file.Name())
-
- LogHandle = file
- initialize()
-}
-
-// Conveniently Creates a temporary file and sets the Log Handle to a io.writer created for it
-func UseTempLogFile(prefix string) {
- file, err := ioutil.TempFile(os.TempDir(), prefix)
- if err != nil {
- CRITICAL.Println(err)
- }
-
- INFO.Println("Logging to", file.Name())
-
- LogHandle = file
- initialize()
-}
-
-// LogCountForLevel returns the number of log invocations for a given level.
-func LogCountForLevel(l Level) uint64 {
- for _, np := range NotePads {
- if np.Level == l {
- return np.getCount()
- }
- }
- return 0
-}
-
-// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations
-// greater than or equal to a given level threshold.
-func LogCountForLevelsGreaterThanorEqualTo(threshold Level) uint64 {
- var cnt uint64
- for _, np := range NotePads {
- if np.Level >= threshold {
- cnt += np.getCount()
- }
- }
- return cnt
-}
-
-// ResetLogCounters resets the invocation counters for all levels.
-func ResetLogCounters() {
- for _, np := range NotePads {
- np.resetCounter()
- }
-}
-
-// Disables logging for the entire JWW system
-func DiscardLogging() {
- LogHandle = ioutil.Discard
- initialize()
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-func (fb *Feedback) Println(v ...interface{}) {
- s := fmt.Sprintln(v...)
- fmt.Print(s)
- LOG.Output(2, s)
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-func (fb *Feedback) Printf(format string, v ...interface{}) {
- s := fmt.Sprintf(format, v...)
- fmt.Print(s)
- LOG.Output(2, s)
-}
diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md
index 93d6d77..eefb46d 100644
--- a/vendor/github.com/spf13/pflag/README.md
+++ b/vendor/github.com/spf13/pflag/README.md
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)
+[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag)
+[![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag)
## Description
diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go
new file mode 100644
index 0000000..5af02f1
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/bool_slice.go
@@ -0,0 +1,147 @@
+package pflag
+
+import (
+ "io"
+ "strconv"
+ "strings"
+)
+
+// -- boolSlice Value
+type boolSliceValue struct {
+ value *[]bool
+ changed bool
+}
+
+func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue {
+ bsv := new(boolSliceValue)
+ bsv.value = p
+ *bsv.value = val
+ return bsv
+}
+
+// Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag.
+// If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended.
+func (s *boolSliceValue) Set(val string) error {
+
+ // remove all quote characters
+ rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
+
+ // read flag arguments with CSV parser
+ boolStrSlice, err := readAsCSV(rmQuote.Replace(val))
+ if err != nil && err != io.EOF {
+ return err
+ }
+
+ // parse boolean values into slice
+ out := make([]bool, 0, len(boolStrSlice))
+ for _, boolStr := range boolStrSlice {
+ b, err := strconv.ParseBool(strings.TrimSpace(boolStr))
+ if err != nil {
+ return err
+ }
+ out = append(out, b)
+ }
+
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+
+ s.changed = true
+
+ return nil
+}
+
+// Type returns a string that uniquely represents this flag's type.
+func (s *boolSliceValue) Type() string {
+ return "boolSlice"
+}
+
+// String defines a "native" format for this boolean slice flag value.
+func (s *boolSliceValue) String() string {
+
+ boolStrSlice := make([]string, len(*s.value))
+ for i, b := range *s.value {
+ boolStrSlice[i] = strconv.FormatBool(b)
+ }
+
+ out, _ := writeAsCSV(boolStrSlice)
+
+ return "[" + out + "]"
+}
+
+func boolSliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []bool{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]bool, len(ss))
+ for i, t := range ss {
+ var err error
+ out[i], err = strconv.ParseBool(t)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return out, nil
+}
+
+// GetBoolSlice returns the []bool value of a flag with the given name.
+func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
+ val, err := f.getFlagType(name, "boolSlice", boolSliceConv)
+ if err != nil {
+ return []bool{}, err
+ }
+ return val.([]bool), nil
+}
+
+// BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string.
+// The argument p points to a []bool variable in which to store the value of the flag.
+func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
+ f.VarP(newBoolSliceValue(value, p), name, "", usage)
+}
+
+// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
+ f.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
+}
+
+// BoolSliceVar defines a []bool flag with specified name, default value, and usage string.
+// The argument p points to a []bool variable in which to store the value of the flag.
+func BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
+ CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage)
+}
+
+// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
+ CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
+}
+
+// BoolSlice defines a []bool flag with specified name, default value, and usage string.
+// The return value is the address of a []bool variable that stores the value of the flag.
+func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool {
+ p := []bool{}
+ f.BoolSliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
+ p := []bool{}
+ f.BoolSliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// BoolSlice defines a []bool flag with specified name, default value, and usage string.
+// The return value is the address of a []bool variable that stores the value of the flag.
+func BoolSlice(name string, value []bool, usage string) *[]bool {
+ return CommandLine.BoolSliceP(name, "", value, usage)
+}
+
+// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
+func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
+ return CommandLine.BoolSliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
index fa81564..746af63 100644
--- a/vendor/github.com/spf13/pflag/flag.go
+++ b/vendor/github.com/spf13/pflag/flag.go
@@ -487,9 +487,76 @@ func UnquoteUsage(flag *Flag) (name string, usage string) {
return
}
-// FlagUsages Returns a string containing the usage information for all flags in
-// the FlagSet
-func (f *FlagSet) FlagUsages() string {
+// Splits the string `s` on whitespace into an initial substring up to
+// `i` runes in length and the remainder. Will go `slop` over `i` if
+// that encompasses the entire string (which allows the caller to
+// avoid short orphan words on the final line).
+func wrapN(i, slop int, s string) (string, string) {
+ if i+slop > len(s) {
+ return s, ""
+ }
+
+ w := strings.LastIndexAny(s[:i], " \t")
+ if w <= 0 {
+ return s, ""
+ }
+
+ return s[:w], s[w+1:]
+}
+
+// Wraps the string `s` to a maximum width `w` with leading indent
+// `i`. The first line is not indented (this is assumed to be done by
+// caller). Pass `w` == 0 to do no wrapping
+func wrap(i, w int, s string) string {
+ if w == 0 {
+ return s
+ }
+
+ // space between indent i and end of line width w into which
+ // we should wrap the text.
+ wrap := w - i
+
+ var r, l string
+
+ // Not enough space for sensible wrapping. Wrap as a block on
+ // the next line instead.
+ if wrap < 24 {
+ i = 16
+ wrap = w - i
+ r += "\n" + strings.Repeat(" ", i)
+ }
+ // If still not enough space then don't even try to wrap.
+ if wrap < 24 {
+ return s
+ }
+
+ // Try to avoid short orphan words on the final line, by
+ // allowing wrapN to go a bit over if that would fit in the
+ // remainder of the line.
+ slop := 5
+ wrap = wrap - slop
+
+ // Handle first line, which is indented by the caller (or the
+ // special case above)
+ l, s = wrapN(wrap, slop, s)
+ r = r + l
+
+ // Now wrap the rest
+ for s != "" {
+ var t string
+
+ t, s = wrapN(wrap, slop, s)
+ r = r + "\n" + strings.Repeat(" ", i) + t
+ }
+
+ return r
+
+}
+
+// FlagUsagesWrapped returns a string containing the usage information
+// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no
+// wrapping)
+func (f *FlagSet) FlagUsagesWrapped(cols int) string {
x := new(bytes.Buffer)
lines := make([]string, 0, len(f.formal))
@@ -546,12 +613,19 @@ func (f *FlagSet) FlagUsages() string {
for _, line := range lines {
sidx := strings.Index(line, "\x00")
spacing := strings.Repeat(" ", maxlen-sidx)
- fmt.Fprintln(x, line[:sidx], spacing, line[sidx+1:])
+ // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx
+ fmt.Fprintln(x, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:]))
}
return x.String()
}
+// FlagUsages returns a string containing the usage information for all flags in
+// the FlagSet
+func (f *FlagSet) FlagUsages() string {
+ return f.FlagUsagesWrapped(0)
+}
+
// PrintDefaults prints to standard error the default values of all defined command-line flags.
func PrintDefaults() {
CommandLine.PrintDefaults()
@@ -635,7 +709,7 @@ func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
- _ = f.VarPF(value, name, shorthand, usage)
+ f.VarPF(value, name, shorthand, usage)
}
// AddFlag will add the flag to the FlagSet
@@ -752,7 +826,7 @@ func containsShorthand(arg, shorthand string) bool {
return strings.Contains(arg, shorthand)
}
-func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) {
+func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) {
a = args
name := s[2:]
if len(name) == 0 || name[0] == '-' || name[0] == '=' {
@@ -786,11 +860,11 @@ func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error)
err = f.failf("flag needs an argument: %s", s)
return
}
- err = f.setFlag(flag, value, s)
+ err = fn(flag, value, s)
return
}
-func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShorts string, outArgs []string, err error) {
+func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
if strings.HasPrefix(shorthands, "test.") {
return
}
@@ -825,16 +899,16 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShor
err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
return
}
- err = f.setFlag(flag, value, shorthands)
+ err = fn(flag, value, shorthands)
return
}
-func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error) {
+func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) {
a = args
shorthands := s[1:]
for len(shorthands) > 0 {
- shorthands, a, err = f.parseSingleShortArg(shorthands, args)
+ shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn)
if err != nil {
return
}
@@ -843,7 +917,7 @@ func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error)
return
}
-func (f *FlagSet) parseArgs(args []string) (err error) {
+func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
for len(args) > 0 {
s := args[0]
args = args[1:]
@@ -863,9 +937,9 @@ func (f *FlagSet) parseArgs(args []string) (err error) {
f.args = append(f.args, args...)
break
}
- args, err = f.parseLongArg(s, args)
+ args, err = f.parseLongArg(s, args, fn)
} else {
- args, err = f.parseShortArg(s, args)
+ args, err = f.parseShortArg(s, args, fn)
}
if err != nil {
return
@@ -881,7 +955,41 @@ func (f *FlagSet) parseArgs(args []string) (err error) {
func (f *FlagSet) Parse(arguments []string) error {
f.parsed = true
f.args = make([]string, 0, len(arguments))
- err := f.parseArgs(arguments)
+
+ assign := func(flag *Flag, value, origArg string) error {
+ return f.setFlag(flag, value, origArg)
+ }
+
+ err := f.parseArgs(arguments, assign)
+ if err != nil {
+ switch f.errorHandling {
+ case ContinueOnError:
+ return err
+ case ExitOnError:
+ os.Exit(2)
+ case PanicOnError:
+ panic(err)
+ }
+ }
+ return nil
+}
+
+type parseFunc func(flag *Flag, value, origArg string) error
+
+// ParseAll parses flag definitions from the argument list, which should not
+// include the command name. The arguments for fn are flag and value. Must be
+// called after all flags in the FlagSet are defined and before flags are
+// accessed by the program. The return value will be ErrHelp if -help was set
+// but not defined.
+func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error {
+ f.parsed = true
+ f.args = make([]string, 0, len(arguments))
+
+ assign := func(flag *Flag, value, origArg string) error {
+ return fn(flag, value)
+ }
+
+ err := f.parseArgs(arguments, assign)
if err != nil {
switch f.errorHandling {
case ContinueOnError:
@@ -907,6 +1015,14 @@ func Parse() {
CommandLine.Parse(os.Args[1:])
}
+// ParseAll parses the command-line flags from os.Args[1:] and called fn for each.
+// The arguments for fn are flag and value. Must be called after all flags are
+// defined and before flags are accessed by the program.
+func ParseAll(fn func(flag *Flag, value string) error) {
+ // Ignore errors; CommandLine is set for ExitOnError.
+ CommandLine.ParseAll(os.Args[1:], fn)
+}
+
// SetInterspersed sets whether to support interspersed option/non-option arguments.
func SetInterspersed(interspersed bool) {
CommandLine.SetInterspersed(interspersed)
diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go
index b056147..c4f47eb 100644
--- a/vendor/github.com/spf13/pflag/golangflag.go
+++ b/vendor/github.com/spf13/pflag/golangflag.go
@@ -6,13 +6,10 @@ package pflag
import (
goflag "flag"
- "fmt"
"reflect"
"strings"
)
-var _ = fmt.Print
-
// flagValueWrapper implements pflag.Value around a flag.Value. The main
// difference here is the addition of the Type method that returns a string
// name of the type. As this is generally unknown, we approximate that with
diff --git a/vendor/github.com/spf13/pflag/ip.go b/vendor/github.com/spf13/pflag/ip.go
index 88a1743..3d414ba 100644
--- a/vendor/github.com/spf13/pflag/ip.go
+++ b/vendor/github.com/spf13/pflag/ip.go
@@ -6,8 +6,6 @@ import (
"strings"
)
-var _ = strings.TrimSpace
-
// -- net.IP value
type ipValue net.IP
diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go
new file mode 100644
index 0000000..7dd196f
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/ip_slice.go
@@ -0,0 +1,148 @@
+package pflag
+
+import (
+ "fmt"
+ "io"
+ "net"
+ "strings"
+)
+
+// -- ipSlice Value
+type ipSliceValue struct {
+ value *[]net.IP
+ changed bool
+}
+
+func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue {
+ ipsv := new(ipSliceValue)
+ ipsv.value = p
+ *ipsv.value = val
+ return ipsv
+}
+
+// Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag.
+// If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended.
+func (s *ipSliceValue) Set(val string) error {
+
+ // remove all quote characters
+ rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
+
+ // read flag arguments with CSV parser
+ ipStrSlice, err := readAsCSV(rmQuote.Replace(val))
+ if err != nil && err != io.EOF {
+ return err
+ }
+
+ // parse ip values into slice
+ out := make([]net.IP, 0, len(ipStrSlice))
+ for _, ipStr := range ipStrSlice {
+ ip := net.ParseIP(strings.TrimSpace(ipStr))
+ if ip == nil {
+ return fmt.Errorf("invalid string being converted to IP address: %s", ipStr)
+ }
+ out = append(out, ip)
+ }
+
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+
+ s.changed = true
+
+ return nil
+}
+
+// Type returns a string that uniquely represents this flag's type.
+func (s *ipSliceValue) Type() string {
+ return "ipSlice"
+}
+
+// String defines a "native" format for this net.IP slice flag value.
+func (s *ipSliceValue) String() string {
+
+ ipStrSlice := make([]string, len(*s.value))
+ for i, ip := range *s.value {
+ ipStrSlice[i] = ip.String()
+ }
+
+ out, _ := writeAsCSV(ipStrSlice)
+
+ return "[" + out + "]"
+}
+
+func ipSliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Emtpy string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []net.IP{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]net.IP, len(ss))
+ for i, sval := range ss {
+ ip := net.ParseIP(strings.TrimSpace(sval))
+ if ip == nil {
+ return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
+ }
+ out[i] = ip
+ }
+ return out, nil
+}
+
+// GetIPSlice returns the []net.IP value of a flag with the given name
+func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) {
+ val, err := f.getFlagType(name, "ipSlice", ipSliceConv)
+ if err != nil {
+ return []net.IP{}, err
+ }
+ return val.([]net.IP), nil
+}
+
+// IPSliceVar defines a ipSlice flag with specified name, default value, and usage string.
+// The argument p points to a []net.IP variable in which to store the value of the flag.
+func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
+ f.VarP(newIPSliceValue(value, p), name, "", usage)
+}
+
+// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
+ f.VarP(newIPSliceValue(value, p), name, shorthand, usage)
+}
+
+// IPSliceVar defines a []net.IP flag with specified name, default value, and usage string.
+// The argument p points to a []net.IP variable in which to store the value of the flag.
+func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
+ CommandLine.VarP(newIPSliceValue(value, p), name, "", usage)
+}
+
+// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
+ CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage)
+}
+
+// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
+// The return value is the address of a []net.IP variable that stores the value of that flag.
+func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP {
+ p := []net.IP{}
+ f.IPSliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
+ p := []net.IP{}
+ f.IPSliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
+// The return value is the address of a []net.IP variable that stores the value of the flag.
+func IPSlice(name string, value []net.IP, usage string) *[]net.IP {
+ return CommandLine.IPSliceP(name, "", value, usage)
+}
+
+// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
+func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
+ return CommandLine.IPSliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/ipnet.go b/vendor/github.com/spf13/pflag/ipnet.go
index 149b764..e2c1b8b 100644
--- a/vendor/github.com/spf13/pflag/ipnet.go
+++ b/vendor/github.com/spf13/pflag/ipnet.go
@@ -27,8 +27,6 @@ func (*ipNetValue) Type() string {
return "ipNet"
}
-var _ = strings.TrimSpace
-
func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
*p = val
return (*ipNetValue)(p)
diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go
index 93b4e43..276b7ed 100644
--- a/vendor/github.com/spf13/pflag/string_array.go
+++ b/vendor/github.com/spf13/pflag/string_array.go
@@ -1,11 +1,5 @@
package pflag
-import (
- "fmt"
-)
-
-var _ = fmt.Fprint
-
// -- stringArray Value
type stringArrayValue struct {
value *[]string
diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go
index 7829cfa..05eee75 100644
--- a/vendor/github.com/spf13/pflag/string_slice.go
+++ b/vendor/github.com/spf13/pflag/string_slice.go
@@ -3,12 +3,9 @@ package pflag
import (
"bytes"
"encoding/csv"
- "fmt"
"strings"
)
-var _ = fmt.Fprint
-
// -- stringSlice Value
type stringSliceValue struct {
value *[]string
@@ -39,7 +36,7 @@ func writeAsCSV(vals []string) (string, error) {
return "", err
}
w.Flush()
- return strings.TrimSuffix(b.String(), fmt.Sprintln()), nil
+ return strings.TrimSuffix(b.String(), "\n"), nil
}
func (s *stringSliceValue) Set(val string) error {
diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go
new file mode 100644
index 0000000..edd94c6
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/uint_slice.go
@@ -0,0 +1,126 @@
+package pflag
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- uintSlice Value
+type uintSliceValue struct {
+ value *[]uint
+ changed bool
+}
+
+func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
+ uisv := new(uintSliceValue)
+ uisv.value = p
+ *uisv.value = val
+ return uisv
+}
+
+func (s *uintSliceValue) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make([]uint, len(ss))
+ for i, d := range ss {
+ u, err := strconv.ParseUint(d, 10, 0)
+ if err != nil {
+ return err
+ }
+ out[i] = uint(u)
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *uintSliceValue) Type() string {
+ return "uintSlice"
+}
+
+func (s *uintSliceValue) String() string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = fmt.Sprintf("%d", d)
+ }
+ return "[" + strings.Join(out, ",") + "]"
+}
+
+func uintSliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []uint{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]uint, len(ss))
+ for i, d := range ss {
+ u, err := strconv.ParseUint(d, 10, 0)
+ if err != nil {
+ return nil, err
+ }
+ out[i] = uint(u)
+ }
+ return out, nil
+}
+
+// GetUintSlice returns the []uint value of a flag with the given name.
+func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
+ val, err := f.getFlagType(name, "uintSlice", uintSliceConv)
+ if err != nil {
+ return []uint{}, err
+ }
+ return val.([]uint), nil
+}
+
+// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
+// The argument p points to a []uint variable in which to store the value of the flag.
+func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) {
+ f.VarP(newUintSliceValue(value, p), name, "", usage)
+}
+
+// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
+ f.VarP(newUintSliceValue(value, p), name, shorthand, usage)
+}
+
+// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
+// The argument p points to a uint[] variable in which to store the value of the flag.
+func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
+ CommandLine.VarP(newUintSliceValue(value, p), name, "", usage)
+}
+
+// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
+ CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage)
+}
+
+// UintSlice defines a []uint flag with specified name, default value, and usage string.
+// The return value is the address of a []uint variable that stores the value of the flag.
+func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint {
+ p := []uint{}
+ f.UintSliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
+ p := []uint{}
+ f.UintSliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// UintSlice defines a []uint flag with specified name, default value, and usage string.
+// The return value is the address of a []uint variable that stores the value of the flag.
+func UintSlice(name string, value []uint, usage string) *[]uint {
+ return CommandLine.UintSliceP(name, "", value, usage)
+}
+
+// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
+func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
+ return CommandLine.UintSliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go
index eb0ca76..296e32c 100644
--- a/vendor/github.com/xanzy/go-gitlab/gitlab.go
+++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go
@@ -137,6 +137,7 @@ type Client struct {
Settings *SettingsService
SystemHooks *SystemHooksService
Tags *TagsService
+ TimeStats *TimeStatsService
Users *UsersService
}
@@ -197,6 +198,7 @@ func newClient(httpClient *http.Client, tokenType tokenType, token string) *Clie
c.Settings = &SettingsService{client: c}
c.SystemHooks = &SystemHooksService{client: c}
c.Tags = &TagsService{client: c}
+ c.TimeStats = &TimeStatsService{client: c}
c.Users = &UsersService{client: c}
return c
diff --git a/vendor/github.com/xanzy/go-gitlab/merge_requests.go b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
index a419f92..b135d9d 100644
--- a/vendor/github.com/xanzy/go-gitlab/merge_requests.go
+++ b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
@@ -91,6 +91,7 @@ type MergeRequest struct {
RenamedFile bool `json:"renamed_file"`
DeletedFile bool `json:"deleted_file"`
} `json:"changes"`
+ WebURL string `json:"web_url"`
}
func (m MergeRequest) String() string {
diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go
index c3dcc79..c0a64d8 100644
--- a/vendor/github.com/xanzy/go-gitlab/projects.go
+++ b/vendor/github.com/xanzy/go-gitlab/projects.go
@@ -796,6 +796,7 @@ type AddProjectHookOptions struct {
PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
EnableSSLVerification *bool `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
+ Token *string `url:"token,omitempty" json:"token,omitempty"`
}
// AddProjectHook adds a hook to a specified project.
@@ -840,6 +841,7 @@ type EditProjectHookOptions struct {
PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
EnableSSLVerification *bool `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
+ Token *string `url:"token,omitempty" json:"token,omitempty"`
}
// EditProjectHook edits a hook for a specified project.
diff --git a/vendor/github.com/xanzy/go-gitlab/time_stats.go b/vendor/github.com/xanzy/go-gitlab/time_stats.go
new file mode 100644
index 0000000..a346389
--- /dev/null
+++ b/vendor/github.com/xanzy/go-gitlab/time_stats.go
@@ -0,0 +1,183 @@
+package gitlab
+
+import (
+ "fmt"
+ "net/url"
+)
+
+// TimeStatsService handles communication with the time tracking related
+// methods of the GitLab API.
+//
+// GitLab docs: https://docs.gitlab.com/ce/workflow/time_tracking.html
+// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html
+type TimeStatsService struct {
+ client *Client
+}
+
+// TimeStats represents the time estimates and time spent for an issue.
+//
+// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html
+type TimeStats struct {
+ HumanTimeEstimate string `json:"human_time_estimate"`
+ HumanTotalTimeSpent string `json:"human_total_time_spent"`
+ TimeEstimate int `json:"time_estimate"`
+ TotalTimeSpent int `json:"total_time_spent"`
+}
+
+func (t TimeStats) String() string {
+ return Stringify(t)
+}
+
+// SetTimeEstimateOptions represents the available SetTimeEstimate()
+// options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#set-a-time-estimate-for-an-issue
+type SetTimeEstimateOptions struct {
+ Duration *string `url:"duration,omitempty" json:"duration,omitempty"`
+}
+
+// SetTimeEstimate sets the time estimate for a single project issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#set-a-time-estimate-for-an-issue
+func (s *TimeStatsService) SetTimeEstimate(
+ pid interface{},
+ issue int,
+ opt *SetTimeEstimateOptions) (*TimeStats, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/time_estimate", url.QueryEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ t := new(TimeStats)
+ resp, err := s.client.Do(req, t)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return t, resp, err
+}
+
+// ResetTimeEstimate resets the time estimate for a single project issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#reset-the-time-estimate-for-an-issue
+func (s *TimeStatsService) ResetTimeEstimate(
+ pid interface{},
+ issue int) (*TimeStats, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/reset_time_estimate", url.QueryEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ t := new(TimeStats)
+ resp, err := s.client.Do(req, t)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return t, resp, err
+}
+
+// AddSpentTimeOptions represents the available AddSpentTime() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#add-spent-time-for-an-issue
+type AddSpentTimeOptions struct {
+ Duration *string `url:"duration,omitempty" json:"duration,omitempty"`
+}
+
+// AddSpentTime adds spent time for a single project issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#add-spent-time-for-an-issue
+func (s *TimeStatsService) AddSpentTime(
+ pid interface{},
+ issue int,
+ opt *AddSpentTimeOptions) (*TimeStats, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/add_spent_time", url.QueryEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ t := new(TimeStats)
+ resp, err := s.client.Do(req, t)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return t, resp, err
+}
+
+// ResetSpentTime resets the spent time for a single project issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#reset-spent-time-for-an-issue
+func (s *TimeStatsService) ResetSpentTime(
+ pid interface{},
+ issue int) (*TimeStats, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/reset_spent_time", url.QueryEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ t := new(TimeStats)
+ resp, err := s.client.Do(req, t)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return t, resp, err
+}
+
+// GetTimeSpent gets the spent time for a single project issue.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/issues.html#get-time-tracking-stats
+func (s *TimeStatsService) GetTimeSpent(
+ pid interface{},
+ issue int) (*TimeStats, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/time_stats", url.QueryEscape(project), issue)
+
+ req, err := s.client.NewRequest("GET", u, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ t := new(TimeStats)
+ resp, err := s.client.Do(req, t)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return t, resp, err
+}