Update dependencies

This commit is contained in:
Alexander Neumann
2017-09-13 14:09:48 +02:00
parent f3b49987f8
commit fda563d606
926 changed files with 189726 additions and 98666 deletions

View File

@@ -34,8 +34,7 @@ func insertXGoog(ctx context.Context, val []string) context.Context {
return metadata.NewOutgoingContext(ctx, md)
}
// DefaultAuthScopes reports the authentication scopes required
// by this package.
// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func DefaultAuthScopes() []string {
return []string{
"https://www.googleapis.com/auth/cloud-platform",

View File

@@ -32,11 +32,6 @@ import (
"google.golang.org/grpc/codes"
)
var (
groupProjectPathTemplate = gax.MustCompilePathTemplate("projects/{project}")
groupGroupPathTemplate = gax.MustCompilePathTemplate("projects/{project}/groups/{group}")
)
// GroupCallOptions contains the retry settings for each method of GroupClient.
type GroupCallOptions struct {
ListGroups []gax.CallOption
@@ -97,7 +92,7 @@ type GroupClient struct {
// NewGroupClient creates a new group service client.
//
// The Group API lets you inspect and manage your
// [groups](google.monitoring.v3.Group).
// groups (at google.monitoring.v3.Group).
//
// A group is a named filter that is used to identify
// a collection of monitored resources. Groups are typically used to
@@ -119,7 +114,7 @@ func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupCli
groupClient: monitoringpb.NewGroupServiceClient(conn),
}
c.SetGoogleClientInfo()
c.setGoogleClientInfo()
return c, nil
}
@@ -134,10 +129,10 @@ func (c *GroupClient) Close() error {
return c.conn.Close()
}
// SetGoogleClientInfo sets the name and version of the application in
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *GroupClient) SetGoogleClientInfo(keyval ...string) {
func (c *GroupClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", version.Go()}, keyval...)
kv = append(kv, "gapic", version.Repo, "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeader = []string{gax.XGoogHeader(kv...)}
@@ -145,25 +140,20 @@ func (c *GroupClient) SetGoogleClientInfo(keyval ...string) {
// GroupProjectPath returns the path for the project resource.
func GroupProjectPath(project string) string {
path, err := groupProjectPathTemplate.Render(map[string]string{
"project": project,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
""
}
// GroupGroupPath returns the path for the group resource.
func GroupGroupPath(project, group string) string {
path, err := groupGroupPathTemplate.Render(map[string]string{
"project": project,
"group": group,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
"/groups/" +
group +
""
}
// ListGroups lists the existing groups.
@@ -234,7 +224,7 @@ func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateG
}
// UpdateGroup updates an existing group.
// You can change any group attributes except `name`.
// You can change any group attributes except name.
func (c *GroupClient) UpdateGroup(ctx context.Context, req *monitoringpb.UpdateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error) {
ctx = insertXGoog(ctx, c.xGoogHeader)
opts = append(c.CallOptions.UpdateGroup[0:len(c.CallOptions.UpdateGroup):len(c.CallOptions.UpdateGroup)], opts...)

View File

@@ -33,12 +33,6 @@ import (
"google.golang.org/grpc/codes"
)
var (
metricProjectPathTemplate = gax.MustCompilePathTemplate("projects/{project}")
metricMetricDescriptorPathTemplate = gax.MustCompilePathTemplate("projects/{project}/metricDescriptors/{metric_descriptor=**}")
metricMonitoredResourceDescriptorPathTemplate = gax.MustCompilePathTemplate("projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}")
)
// MetricCallOptions contains the retry settings for each method of MetricClient.
type MetricCallOptions struct {
ListMonitoredResourceDescriptors []gax.CallOption
@@ -115,7 +109,7 @@ func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricC
metricClient: monitoringpb.NewMetricServiceClient(conn),
}
c.SetGoogleClientInfo()
c.setGoogleClientInfo()
return c, nil
}
@@ -130,10 +124,10 @@ func (c *MetricClient) Close() error {
return c.conn.Close()
}
// SetGoogleClientInfo sets the name and version of the application in
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *MetricClient) SetGoogleClientInfo(keyval ...string) {
func (c *MetricClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", version.Go()}, keyval...)
kv = append(kv, "gapic", version.Repo, "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeader = []string{gax.XGoogHeader(kv...)}
@@ -141,37 +135,30 @@ func (c *MetricClient) SetGoogleClientInfo(keyval ...string) {
// MetricProjectPath returns the path for the project resource.
func MetricProjectPath(project string) string {
path, err := metricProjectPathTemplate.Render(map[string]string{
"project": project,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
""
}
// MetricMetricDescriptorPath returns the path for the metric descriptor resource.
func MetricMetricDescriptorPath(project, metricDescriptor string) string {
path, err := metricMetricDescriptorPathTemplate.Render(map[string]string{
"project": project,
"metric_descriptor": metricDescriptor,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
"/metricDescriptors/" +
metricDescriptor +
""
}
// MetricMonitoredResourceDescriptorPath returns the path for the monitored resource descriptor resource.
func MetricMonitoredResourceDescriptorPath(project, monitoredResourceDescriptor string) string {
path, err := metricMonitoredResourceDescriptorPathTemplate.Render(map[string]string{
"project": project,
"monitored_resource_descriptor": monitoredResourceDescriptor,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
"/monitoredResourceDescriptors/" +
monitoredResourceDescriptor +
""
}
// ListMonitoredResourceDescriptors lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
@@ -278,7 +265,7 @@ func (c *MetricClient) GetMetricDescriptor(ctx context.Context, req *monitoringp
// CreateMetricDescriptor creates a new metric descriptor.
// User-created metric descriptors define
// [custom metrics](/monitoring/custom-metrics).
// custom metrics (at /monitoring/custom-metrics).
func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitoringpb.CreateMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error) {
ctx = insertXGoog(ctx, c.xGoogHeader)
opts = append(c.CallOptions.CreateMetricDescriptor[0:len(c.CallOptions.CreateMetricDescriptor):len(c.CallOptions.CreateMetricDescriptor)], opts...)
@@ -295,7 +282,7 @@ func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitori
}
// DeleteMetricDescriptor deletes a metric descriptor. Only user-created
// [custom metrics](/monitoring/custom-metrics) can be deleted.
// custom metrics (at /monitoring/custom-metrics) can be deleted.
func (c *MetricClient) DeleteMetricDescriptor(ctx context.Context, req *monitoringpb.DeleteMetricDescriptorRequest, opts ...gax.CallOption) error {
ctx = insertXGoog(ctx, c.xGoogHeader)
opts = append(c.CallOptions.DeleteMetricDescriptor[0:len(c.CallOptions.DeleteMetricDescriptor):len(c.CallOptions.DeleteMetricDescriptor)], opts...)