diff --git a/GNUmakefile b/GNUmakefile index 7737f978d..578e826c5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -12,7 +12,8 @@ GOTOOLS = \ github.com/hashicorp/protoc-gen-go-binary@master \ github.com/vektra/mockery/cmd/mockery@master \ github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1 \ - github.com/hashicorp/lint-consul-retry@master + github.com/hashicorp/lint-consul-retry@master \ + github.com/favadi/protoc-go-inject-tag@v1.3.0 GOTAGS ?= GOPATH=$(shell go env GOPATH) @@ -346,7 +347,7 @@ proto: $(PROTOGOFILES) $(PROTOGOBINFILES) %.pb.go %.pb.binary.go: %.proto - @$(SHELL) $(CURDIR)/build-support/scripts/proto-gen.sh --grpc --import-replace "$<" + @$(SHELL) $(CURDIR)/build-support/scripts/proto-gen-entry.sh --grpc --import-replace "$<" .PHONY: module-versions # Print a list of modules which can be updated. diff --git a/agent/auto-config/config_translate_test.go b/agent/auto-config/config_translate_test.go index c60b84a9c..ed605672d 100644 --- a/agent/auto-config/config_translate_test.go +++ b/agent/auto-config/config_translate_test.go @@ -38,7 +38,7 @@ func mustTranslateCARootsToProtobuf(t *testing.T, in *structs.IndexedCARoots) *p } func mustTranslateIssuedCertToProtobuf(t *testing.T, in *structs.IssuedCert) *pbconnect.IssuedCert { - out, err := pbconnect.NewIssuedCertFromStructs(in) + var out, err = pbconnect.NewIssuedCertFromStructs(in) require.NoError(t, err) return out } diff --git a/agent/connect/testing_ca.go b/agent/connect/testing_ca.go index 1bbfdc18c..16ffb6536 100644 --- a/agent/connect/testing_ca.go +++ b/agent/connect/testing_ca.go @@ -118,6 +118,7 @@ func testCA(t testing.T, xc *structs.CARoot, keyType string, keyBits int, ttl ti result.NotAfter = template.NotAfter.UTC() result.PrivateKeyType = keyType result.PrivateKeyBits = keyBits + result.IntermediateCerts = []string{} // If there is a prior CA to cross-sign with, then we need to create that // and set it as the signing cert. diff --git a/agent/grpc/private/services/subscribe/subscribe_test.go b/agent/grpc/private/services/subscribe/subscribe_test.go index b11438d7e..a084b6f55 100644 --- a/agent/grpc/private/services/subscribe/subscribe_test.go +++ b/agent/grpc/private/services/subscribe/subscribe_test.go @@ -24,7 +24,7 @@ import ( grpc "github.com/hashicorp/consul/agent/grpc/private" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" "github.com/hashicorp/consul/proto/pbservice" "github.com/hashicorp/consul/proto/pbsubscribe" "github.com/hashicorp/consul/types" @@ -122,7 +122,7 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { streamHandle, err := streamClient.Subscribe(ctx, &pbsubscribe.SubscribeRequest{ Topic: pbsubscribe.Topic_ServiceHealth, Key: "redis", - Namespace: pbcommon.DefaultEnterpriseMeta.Namespace, + Namespace: pbcommongogo.DefaultEnterpriseMeta.Namespace, }) require.NoError(t, err) @@ -159,7 +159,7 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Expose: pbservice.ExposeConfig{}, }, RaftIndex: raftIndex(ids, "reg2", "reg2"), - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, }, }, @@ -190,7 +190,7 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Expose: pbservice.ExposeConfig{}, }, RaftIndex: raftIndex(ids, "reg3", "reg3"), - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, }, }, @@ -240,7 +240,7 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { Expose: pbservice.ExposeConfig{}, }, RaftIndex: raftIndex(ids, "reg3", "reg3"), - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, Checks: []*pbservice.HealthCheck{ { @@ -251,7 +251,7 @@ func TestServer_Subscribe_IntegrationWithBackend(t *testing.T) { ServiceID: "redis1", ServiceName: "redis", RaftIndex: raftIndex(ids, "update", "update"), - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, }, }, @@ -395,8 +395,8 @@ func newCounter() *counter { return &counter{labels: make(map[string]uint64)} } -func raftIndex(ids *counter, created, modified string) pbcommon.RaftIndex { - return pbcommon.RaftIndex{ +func raftIndex(ids *counter, created, modified string) pbcommongogo.RaftIndex { + return pbcommongogo.RaftIndex{ CreateIndex: ids.For(created), ModifyIndex: ids.For(modified), } @@ -475,7 +475,7 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { Topic: pbsubscribe.Topic_ServiceHealth, Key: "redis", Datacenter: "dc2", - Namespace: pbcommon.DefaultEnterpriseMeta.Namespace, + Namespace: pbcommongogo.DefaultEnterpriseMeta.Namespace, }) require.NoError(t, err) go recvEvents(chEvents, streamHandle) @@ -511,7 +511,7 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { MeshGateway: pbservice.MeshGatewayConfig{}, Expose: pbservice.ExposeConfig{}, }, - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, RaftIndex: raftIndex(ids, "reg2", "reg2"), }, }, @@ -542,7 +542,7 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { MeshGateway: pbservice.MeshGatewayConfig{}, Expose: pbservice.ExposeConfig{}, }, - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, RaftIndex: raftIndex(ids, "reg3", "reg3"), }, }, @@ -593,7 +593,7 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { MeshGateway: pbservice.MeshGatewayConfig{}, Expose: pbservice.ExposeConfig{}, }, - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, Checks: []*pbservice.HealthCheck{ { @@ -604,7 +604,7 @@ func TestServer_Subscribe_IntegrationWithBackend_ForwardToDC(t *testing.T) { ServiceID: "redis1", ServiceName: "redis", RaftIndex: raftIndex(ids, "update", "update"), - EnterpriseMeta: pbcommon.DefaultEnterpriseMeta, + EnterpriseMeta: pbcommongogo.DefaultEnterpriseMeta, }, }, }, @@ -720,7 +720,7 @@ node "node1" { Topic: pbsubscribe.Topic_ServiceHealth, Key: "foo", Token: token, - Namespace: pbcommon.DefaultEnterpriseMeta.Namespace, + Namespace: pbcommongogo.DefaultEnterpriseMeta.Namespace, }) require.NoError(t, err) diff --git a/agent/http.go b/agent/http.go index e899d2420..90885bc3f 100644 --- a/agent/http.go +++ b/agent/http.go @@ -31,7 +31,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/logging" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" ) var HTTPSummaries = []prometheus.SummaryDefinition{ @@ -981,7 +981,7 @@ func (s *HTTPHandlers) parseConsistency(resp http.ResponseWriter, req *http.Requ } // parseConsistencyReadRequest is used to parse the ?consistent query param. -func parseConsistencyReadRequest(resp http.ResponseWriter, req *http.Request, b *pbcommon.ReadRequest) { +func parseConsistencyReadRequest(resp http.ResponseWriter, req *http.Request, b *pbcommongogo.ReadRequest) { query := req.URL.Query() if _, ok := query["consistent"]; ok { b.RequireConsistent = true diff --git a/agent/rpcclient/health/view_test.go b/agent/rpcclient/health/view_test.go index 841669858..bc5795c05 100644 --- a/agent/rpcclient/health/view_test.go +++ b/agent/rpcclient/health/view_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/submatview" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" "github.com/hashicorp/consul/proto/pbservice" "github.com/hashicorp/consul/proto/pbsubscribe" "github.com/hashicorp/consul/types" @@ -74,7 +74,7 @@ func TestHealthView_IntegrationWithStore_WithEmptySnapshot(t *testing.T) { t.Skip("too slow for testing.Short") } - namespace := getNamespace(pbcommon.DefaultEnterpriseMeta.Namespace) + namespace := getNamespace(pbcommongogo.DefaultEnterpriseMeta.Namespace) streamClient := newStreamClient(validateNamespace(namespace)) ctx, cancel := context.WithCancel(context.Background()) @@ -572,7 +572,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub Node: node, Address: addr, Datacenter: "dc1", - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -581,7 +581,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub ID: svc, Service: svc, Port: 8080, - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -612,7 +612,7 @@ func newEventServiceHealthDeregister(index uint64, nodeNum int, svc string) *pbs Passing: 1, Warning: 1, }, - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ // The original insertion index since a delete doesn't update // this. This magic value came from state store tests where we // setup at index 10 and then mutate at index 100. It can be diff --git a/agent/structs/protobuf_compat.go b/agent/structs/protobuf_compat.go index 1517b03cf..93358e8e3 100644 --- a/agent/structs/protobuf_compat.go +++ b/agent/structs/protobuf_compat.go @@ -5,7 +5,7 @@ import ( ) // QueryOptionsCompat is the interface that both the structs.QueryOptions -// and the proto/pbcommon.QueryOptions structs need to implement so that they +// and the proto/pbcommongogo.QueryOptions structs need to implement so that they // can be operated on interchangeably type QueryOptionsCompat interface { GetToken() string @@ -33,7 +33,7 @@ type QueryOptionsCompat interface { } // QueryMetaCompat is the interface that both the structs.QueryMeta -// and the proto/pbcommon.QueryMeta structs need to implement so that they +// and the proto/pbcommongogo.QueryMeta structs need to implement so that they // can be operated on interchangeably type QueryMetaCompat interface { GetLastContact() (time.Duration, error) @@ -50,7 +50,7 @@ type QueryMetaCompat interface { } // GetToken helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetToken() string { if m != nil { return m.Token @@ -59,7 +59,7 @@ func (m *QueryOptions) GetToken() string { } // GetMinQueryIndex helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetMinQueryIndex() uint64 { if m != nil { return m.MinQueryIndex @@ -68,7 +68,7 @@ func (m *QueryOptions) GetMinQueryIndex() uint64 { } // GetMaxQueryTime helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetMaxQueryTime() (time.Duration, error) { if m != nil { return m.MaxQueryTime, nil @@ -77,7 +77,7 @@ func (m *QueryOptions) GetMaxQueryTime() (time.Duration, error) { } // GetAllowStale helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetAllowStale() bool { if m != nil { return m.AllowStale @@ -86,7 +86,7 @@ func (m *QueryOptions) GetAllowStale() bool { } // GetRequireConsistent helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetRequireConsistent() bool { if m != nil { return m.RequireConsistent @@ -95,7 +95,7 @@ func (m *QueryOptions) GetRequireConsistent() bool { } // GetUseCache helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetUseCache() bool { if m != nil { return m.UseCache @@ -104,7 +104,7 @@ func (m *QueryOptions) GetUseCache() bool { } // GetMaxStaleDuration helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetMaxStaleDuration() (time.Duration, error) { if m != nil { return m.MaxStaleDuration, nil @@ -113,7 +113,7 @@ func (m *QueryOptions) GetMaxStaleDuration() (time.Duration, error) { } // GetMaxAge helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetMaxAge() (time.Duration, error) { if m != nil { return m.MaxAge, nil @@ -122,7 +122,7 @@ func (m *QueryOptions) GetMaxAge() (time.Duration, error) { } // GetMustRevalidate helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetMustRevalidate() bool { if m != nil { return m.MustRevalidate @@ -131,7 +131,7 @@ func (m *QueryOptions) GetMustRevalidate() bool { } // GetStaleIfError helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetStaleIfError() (time.Duration, error) { if m != nil { return m.StaleIfError, nil @@ -140,7 +140,7 @@ func (m *QueryOptions) GetStaleIfError() (time.Duration, error) { } // GetFilter helps implement the QueryOptionsCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryOptions) GetFilter() string { if m != nil { return m.Filter @@ -149,67 +149,67 @@ func (m *QueryOptions) GetFilter() string { } // SetToken is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetToken(token string) { q.Token = token } // SetMinQueryIndex is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64) { q.MinQueryIndex = minQueryIndex } // SetMaxQueryTime is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration) { q.MaxQueryTime = maxQueryTime } // SetAllowStale is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetAllowStale(allowStale bool) { q.AllowStale = allowStale } // SetRequireConsistent is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetRequireConsistent(requireConsistent bool) { q.RequireConsistent = requireConsistent } // SetUseCache is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetUseCache(useCache bool) { q.UseCache = useCache } // SetMaxStaleDuration is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration) { q.MaxStaleDuration = maxStaleDuration } // SetMaxAge is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetMaxAge(maxAge time.Duration) { q.MaxAge = maxAge } // SetMustRevalidate is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool) { q.MustRevalidate = mustRevalidate } // SetStaleIfError is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration) { q.StaleIfError = staleIfError } // SetFilter is needed to implement the structs.QueryOptionsCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryOptions) SetFilter(filter string) { q.Filter = filter } @@ -223,7 +223,7 @@ func (m *QueryMeta) GetIndex() uint64 { } // GetLastContact helps implement the QueryMetaCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryMeta) GetLastContact() (time.Duration, error) { if m != nil { return m.LastContact, nil @@ -232,7 +232,7 @@ func (m *QueryMeta) GetLastContact() (time.Duration, error) { } // GetKnownLeader helps implement the QueryMetaCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryMeta) GetKnownLeader() bool { if m != nil { return m.KnownLeader @@ -241,7 +241,7 @@ func (m *QueryMeta) GetKnownLeader() bool { } // GetConsistencyLevel helps implement the QueryMetaCompat interface -// Copied from proto/pbcommon/common.pb.go +// Copied from proto/pbcommongogo/common.pb.go func (m *QueryMeta) GetConsistencyLevel() string { if m != nil { return m.ConsistencyLevel @@ -250,25 +250,25 @@ func (m *QueryMeta) GetConsistencyLevel() string { } // SetLastContact is needed to implement the structs.QueryMetaCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryMeta) SetLastContact(lastContact time.Duration) { q.LastContact = lastContact } // SetKnownLeader is needed to implement the structs.QueryMetaCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryMeta) SetKnownLeader(knownLeader bool) { q.KnownLeader = knownLeader } // SetIndex is needed to implement the structs.QueryMetaCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryMeta) SetIndex(index uint64) { q.Index = index } // SetConsistencyLevel is needed to implement the structs.QueryMetaCompat interface -// Copied from proto/pbcommon/common.go +// Copied from proto/pbcommongogo/common.go func (q *QueryMeta) SetConsistencyLevel(consistencyLevel string) { q.ConsistencyLevel = consistencyLevel } diff --git a/agent/structs/structs.go b/agent/structs/structs.go index 9a6d69f47..9efd02c9b 100644 --- a/agent/structs/structs.go +++ b/agent/structs/structs.go @@ -6,6 +6,8 @@ import ( "crypto/sha256" "encoding/json" "fmt" + "github.com/golang/protobuf/ptypes/duration" + "github.com/golang/protobuf/ptypes/timestamp" "math/rand" "reflect" "regexp" @@ -19,6 +21,8 @@ import ( "github.com/hashicorp/serf/coordinate" "github.com/mitchellh/hashstructure" + gtype "github.com/gogo/protobuf/types" + ptypes "github.com/golang/protobuf/ptypes" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/cache" "github.com/hashicorp/consul/api" @@ -2677,3 +2681,42 @@ func (m MessageType) String() string { return "Unknown(" + strconv.Itoa(int(m)) + ")" } + +func DurationToProtoGogo(d time.Duration) gtype.Duration { + return *gtype.DurationProto(d) +} + +func DurationFromProtoGogo(d gtype.Duration) time.Duration { + duration, _ := gtype.DurationFromProto(&d) + return duration +} + +func TimeFromProtoGogo(s *gtype.Timestamp) time.Time { + time, _ := gtype.TimestampFromProto(s) + return time +} + +func TimeToProtoGogo(s time.Time) *gtype.Timestamp { + proto, _ := gtype.TimestampProto(s) + return proto +} + +func DurationToProto(d time.Duration) *duration.Duration { + return ptypes.DurationProto(d) +} + +func DurationFromProto(d *duration.Duration) time.Duration { + ret, _ := ptypes.Duration(d) + return ret + +} + +func TimeFromProto(s *timestamp.Timestamp) time.Time { + ret, _ := ptypes.Timestamp(s) + return ret +} + +func TimeToProto(s time.Time) *timestamp.Timestamp { + ret, _ := ptypes.TimestampProto(s) + return ret +} diff --git a/agent/submatview/store_test.go b/agent/submatview/store_test.go index 93b04d1e8..2055cf911 100644 --- a/agent/submatview/store_test.go +++ b/agent/submatview/store_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/agent/cache" "github.com/hashicorp/consul/lib/ttlcache" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" "github.com/hashicorp/consul/proto/pbservice" "github.com/hashicorp/consul/proto/pbsubscribe" "github.com/hashicorp/consul/sdk/testutil/retry" @@ -25,7 +25,7 @@ func TestStore_Get(t *testing.T) { go store.Run(ctx) req := &fakeRequest{ - client: NewTestStreamingClient(pbcommon.DefaultEnterpriseMeta.Namespace), + client: NewTestStreamingClient(pbcommongogo.DefaultEnterpriseMeta.Namespace), } req.client.QueueEvents( newEndOfSnapshotEvent(2), @@ -232,7 +232,7 @@ func (r *fakeRequest) NewMaterializer() (*Materializer, error) { Token: "abcd", Datacenter: "dc1", Index: index, - Namespace: pbcommon.DefaultEnterpriseMeta.Namespace, + Namespace: pbcommongogo.DefaultEnterpriseMeta.Namespace, } return req }, @@ -292,7 +292,7 @@ func TestStore_Notify(t *testing.T) { go store.Run(ctx) req := &fakeRequest{ - client: NewTestStreamingClient(pbcommon.DefaultEnterpriseMeta.Namespace), + client: NewTestStreamingClient(pbcommongogo.DefaultEnterpriseMeta.Namespace), } req.client.QueueEvents( newEndOfSnapshotEvent(2), @@ -361,7 +361,7 @@ func TestStore_Notify_ManyRequests(t *testing.T) { go store.Run(ctx) req := &fakeRequest{ - client: NewTestStreamingClient(pbcommon.DefaultEnterpriseMeta.Namespace), + client: NewTestStreamingClient(pbcommongogo.DefaultEnterpriseMeta.Namespace), } req.client.QueueEvents(newEndOfSnapshotEvent(2)) @@ -473,7 +473,7 @@ func TestStore_Run_ExpiresEntries(t *testing.T) { go store.Run(ctx) req := &fakeRequest{ - client: NewTestStreamingClient(pbcommon.DefaultEnterpriseMeta.Namespace), + client: NewTestStreamingClient(pbcommongogo.DefaultEnterpriseMeta.Namespace), } req.client.QueueEvents(newEndOfSnapshotEvent(2)) diff --git a/agent/submatview/streaming_test.go b/agent/submatview/streaming_test.go index 80fec094f..be484cac6 100644 --- a/agent/submatview/streaming_test.go +++ b/agent/submatview/streaming_test.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" "github.com/hashicorp/consul/proto/pbservice" "github.com/hashicorp/consul/proto/pbsubscribe" "github.com/hashicorp/consul/types" @@ -120,7 +120,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub Node: node, Address: addr, Datacenter: "dc1", - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -129,7 +129,7 @@ func newEventServiceHealthRegister(index uint64, nodeNum int, svc string) *pbsub ID: svc, Service: svc, Port: 8080, - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ CreateIndex: index, ModifyIndex: index, }, @@ -160,7 +160,7 @@ func newEventServiceHealthDeregister(index uint64, nodeNum int, svc string) *pbs Passing: 1, Warning: 1, }, - RaftIndex: pbcommon.RaftIndex{ + RaftIndex: pbcommongogo.RaftIndex{ // The original insertion index since a delete doesn't update // this. This magic value came from state store tests where we // setup at index 10 and then mutate at index 100. It can be diff --git a/build-support/scripts/proto-gen-entry.sh b/build-support/scripts/proto-gen-entry.sh new file mode 100644 index 000000000..c02df1b5a --- /dev/null +++ b/build-support/scripts/proto-gen-entry.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +FILENAME=$3 +echo $PWD +if [[ "$FILENAME" =~ .*pbcommon/.* ]]; then + echo "$FILENAME no gogo" + ./build-support/scripts/proto-gen-no-gogo.sh $1 $2 $3 +else + echo "$FILENAME gogo" + ./build-support/scripts/proto-gen.sh $1 $2 $3 +fi \ No newline at end of file diff --git a/build-support/scripts/proto-gen-no-gogo.sh b/build-support/scripts/proto-gen-no-gogo.sh new file mode 100755 index 000000000..c736d49de --- /dev/null +++ b/build-support/scripts/proto-gen-no-gogo.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +SCRIPT_NAME="$(basename ${BASH_SOURCE[0]})" +pushd $(dirname ${BASH_SOURCE[0]}) > /dev/null +SCRIPT_DIR=$(pwd) +pushd ../.. > /dev/null +SOURCE_DIR=$(pwd) +popd > /dev/null +pushd ../functions > /dev/null +FN_DIR=$(pwd) +popd > /dev/null +popd > /dev/null + +source "${SCRIPT_DIR}/functions.sh" + +function usage { +cat <<-EOF +Usage: ${SCRIPT_NAME} [] + +Description: + Generate the Go files from protobuf definitions. In addition to + running the protoc generator it will also fixup build tags in the + generated code. + +Options: + --import-replace Replace imports of google types with those from the protobuf repo. + --grpc Enable the gRPC plugin + -h | --help Print this help text. +EOF +} + +function err_usage { + err "$1" + err "" + err "$(usage)" +} + +function main { + local -i grpc=0 + local -i imp_replace=0 + local proto_path= + + while test $# -gt 0 + do + case "$1" in + -h | --help ) + usage + return 0 + ;; + --grpc ) + grpc=1 + shift + ;; + --import-replace ) + imp_replace=1 + shift + ;; + * ) + proto_path="$1" + shift + ;; + esac + done + + if test -z "${proto_path}" + then + err_usage "ERROR: No proto file specified" + return 1 + fi + + local golang_proto_path=$(go list -f '{{ .Dir }}' -m github.com/golang/protobuf) + local golang_proto_mod_path=$(sed -e 's,\(.*\)github.com.*,\1,' <<< "${golang_proto_path}") + + + local golang_proto_imp_replace="Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp" + golang_proto_imp_replace="${golang_proto_imp_replace},Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration" + + local proto_go_path=${proto_path%%.proto}.pb.go + local proto_go_bin_path=${proto_path%%.proto}.pb.binary.go + + local go_proto_out="paths=source_relative" + if is_set "${grpc}" + then + go_proto_out="${go_proto_out},plugins=grpc" + fi + + if is_set "${imp_replace}" + then + go_proto_out="${go_proto_out},${golang_proto_imp_replace}" + fi + + if test -n "${go_proto_out}" + then + go_proto_out="${go_proto_out}:" + fi + + # How we run protoc probably needs some documentation. + # + # This is the path to where + # -I="${golang_proto_path}/protobuf" \ + local -i ret=0 + status_stage "Generating ${proto_path} into ${proto_go_path} and ${proto_go_bin_path} (NO GOGO)" + debug_run protoc \ + -I="${golang_proto_path}" \ + -I="${golang_proto_mod_path}" \ + -I="${SOURCE_DIR}" \ + --go_out="${go_proto_out}${SOURCE_DIR}" \ + --go-binary_out="${SOURCE_DIR}" \ + "${proto_path}" + debug_run protoc-go-inject-tag \ + -input="${proto_go_path}" + + echo "debug_run protoc \ + -I=\"${golang_proto_path}\" \ + -I=\"${golang_proto_mod_path}\" \ + -I=\"${SOURCE_DIR}\" \ + --go_out=\"${go_proto_out}${SOURCE_DIR}\" \ + --go-binary_out=\"${SOURCE_DIR}\" \ + \"${proto_path}\"" + if test $? -ne 0 + then + err "Failed to generate outputs from ${proto_path}" + return 1 + fi + + BUILD_TAGS=$(sed -e '/^[[:space:]]*$/,$d' < "${proto_path}" | grep '// +build') + if test -n "${BUILD_TAGS}" + then + echo -e "${BUILD_TAGS}\n" >> "${proto_go_path}.new" + cat "${proto_go_path}" >> "${proto_go_path}.new" + mv "${proto_go_path}.new" "${proto_go_path}" + + echo -e "${BUILD_TAGS}\n" >> "${proto_go_bin_path}.new" + cat "${proto_go_bin_path}" >> "${proto_go_bin_path}.new" + mv "${proto_go_bin_path}.new" "${proto_go_bin_path}" + fi + + return 0 +} + +main "$@" +exit $? diff --git a/proto/pbcommon/common.gen.go b/proto/pbcommon/common.gen.go new file mode 100644 index 000000000..14aa7128b --- /dev/null +++ b/proto/pbcommon/common.gen.go @@ -0,0 +1,56 @@ +// Code generated by mog. DO NOT EDIT. + +package pbcommon + +import "github.com/hashicorp/consul/agent/structs" + +func QueryMetaToStructs(s *QueryMeta, t *structs.QueryMeta) { + if s == nil { + return + } + t.Index = s.Index + t.LastContact = structs.DurationFromProto(s.LastContact) + t.KnownLeader = s.KnownLeader + t.ConsistencyLevel = s.ConsistencyLevel + t.ResultsFilteredByACLs = s.ResultsFilteredByACLs +} +func QueryMetaFromStructs(t *structs.QueryMeta, s *QueryMeta) { + if s == nil { + return + } + s.Index = t.Index + s.LastContact = structs.DurationToProto(t.LastContact) + s.KnownLeader = t.KnownLeader + s.ConsistencyLevel = t.ConsistencyLevel + s.ResultsFilteredByACLs = t.ResultsFilteredByACLs +} +func QueryOptionsToStructs(s *QueryOptions, t *structs.QueryOptions) { + if s == nil { + return + } + t.Token = s.Token + t.MinQueryIndex = s.MinQueryIndex + t.MaxQueryTime = structs.DurationFromProto(s.MaxQueryTime) + t.AllowStale = s.AllowStale + t.RequireConsistent = s.RequireConsistent + t.UseCache = s.UseCache + t.MaxStaleDuration = structs.DurationFromProto(s.MaxStaleDuration) + t.MaxAge = structs.DurationFromProto(s.MaxAge) + t.MustRevalidate = s.MustRevalidate + t.Filter = s.Filter +} +func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions) { + if s == nil { + return + } + s.Token = t.Token + s.MinQueryIndex = t.MinQueryIndex + s.MaxQueryTime = structs.DurationToProto(t.MaxQueryTime) + s.AllowStale = t.AllowStale + s.RequireConsistent = t.RequireConsistent + s.UseCache = t.UseCache + s.MaxStaleDuration = structs.DurationToProto(t.MaxStaleDuration) + s.MaxAge = structs.DurationToProto(t.MaxAge) + s.MustRevalidate = t.MustRevalidate + s.Filter = t.Filter +} diff --git a/proto/pbcommon/common.go b/proto/pbcommon/common.go index 1925aedda..fbff7e4ae 100644 --- a/proto/pbcommon/common.go +++ b/proto/pbcommon/common.go @@ -4,7 +4,6 @@ import ( "time" "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbutil" ) // IsRead is always true for QueryOption @@ -37,7 +36,7 @@ func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64) { // SetMaxQueryTime is needed to implement the structs.QueryOptionsCompat interface func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration) { - q.MaxQueryTime = *pbutil.DurationToProto(maxQueryTime) + q.MaxQueryTime = structs.DurationToProto(maxQueryTime) } // SetAllowStale is needed to implement the structs.QueryOptionsCompat interface @@ -57,12 +56,12 @@ func (q *QueryOptions) SetUseCache(useCache bool) { // SetMaxStaleDuration is needed to implement the structs.QueryOptionsCompat interface func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration) { - q.MaxStaleDuration = *pbutil.DurationToProto(maxStaleDuration) + q.MaxStaleDuration = structs.DurationToProto(maxStaleDuration) } // SetMaxAge is needed to implement the structs.QueryOptionsCompat interface func (q *QueryOptions) SetMaxAge(maxAge time.Duration) { - q.MaxAge = *pbutil.DurationToProto(maxAge) + q.MaxAge = structs.DurationToProto(maxAge) } // SetMustRevalidate is needed to implement the structs.QueryOptionsCompat interface @@ -72,15 +71,11 @@ func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool) { // SetStaleIfError is needed to implement the structs.QueryOptionsCompat interface func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration) { - q.StaleIfError = *pbutil.DurationToProto(staleIfError) + q.StaleIfError = structs.DurationToProto(staleIfError) } func (q QueryOptions) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error) { - maxTime, err := pbutil.DurationFromProto(&q.MaxQueryTime) - if err != nil { - return false, err - } - + maxTime := structs.DurationFromProto(q.MaxQueryTime) o := structs.QueryOptions{ MaxQueryTime: maxTime, MinQueryIndex: q.MinQueryIndex, @@ -93,97 +88,9 @@ func (q *QueryOptions) SetFilter(filter string) { q.Filter = filter } -// GetMaxQueryTime is required to implement blockingQueryOptions -func (q *QueryOptions) GetMaxQueryTime() (time.Duration, error) { - if q != nil { - return pbutil.DurationFromProto(&q.MaxQueryTime) - } - return 0, nil -} - -// GetMinQueryIndex is required to implement blockingQueryOptions -func (q *QueryOptions) GetMinQueryIndex() uint64 { - if q != nil { - return q.MinQueryIndex - } - return 0 -} - -// GetRequireConsistent is required to implement blockingQueryOptions -func (q *QueryOptions) GetRequireConsistent() bool { - if q != nil { - return q.RequireConsistent - } - return false -} - -// GetToken is required to implement blockingQueryOptions -func (q *QueryOptions) GetToken() string { - if q != nil { - return q.Token - } - return "" -} - -// GetAllowStale is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetAllowStale() bool { - if q != nil { - return q.AllowStale - } - return false -} - -// GetFilter is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetFilter() string { - if q != nil { - return q.Filter - } - return "" -} - -// GetMaxAge is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetMaxAge() (time.Duration, error) { - if q != nil { - return pbutil.DurationFromProto(&q.MaxAge) - } - return 0, nil -} - -// GetMaxStaleDuration is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetMaxStaleDuration() (time.Duration, error) { - if q != nil { - return pbutil.DurationFromProto(&q.MaxStaleDuration) - } - return 0, nil -} - -// GetMustRevalidate is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetMustRevalidate() bool { - if q != nil { - return q.MustRevalidate - } - return false -} - -// GetStaleIfError is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetStaleIfError() (time.Duration, error) { - if q != nil { - return pbutil.DurationFromProto(&q.StaleIfError) - } - return 0, nil -} - -// GetUseCache is required to implement structs.QueryOptionsCompat -func (q *QueryOptions) GetUseCache() bool { - if q != nil { - return q.UseCache - } - return false -} - // SetLastContact is needed to implement the structs.QueryMetaCompat interface func (q *QueryMeta) SetLastContact(lastContact time.Duration) { - q.LastContact = *pbutil.DurationToProto(lastContact) + q.LastContact = structs.DurationToProto(lastContact) } // SetKnownLeader is needed to implement the structs.QueryMetaCompat interface @@ -210,46 +117,6 @@ func (q *QueryMeta) SetResultsFilteredByACLs(v bool) { q.ResultsFilteredByACLs = v } -// GetIndex is required to implement blockingQueryResponseMeta -func (q *QueryMeta) GetIndex() uint64 { - if q != nil { - return q.Index - } - return 0 -} - -// GetConsistencyLevel is required to implement structs.QueryMetaCompat -func (q *QueryMeta) GetConsistencyLevel() string { - if q != nil { - return q.ConsistencyLevel - } - return "" -} - -// GetKnownLeader is required to implement structs.QueryMetaCompat -func (q *QueryMeta) GetKnownLeader() bool { - if q != nil { - return q.KnownLeader - } - return false -} - -// GetLastContact is required to implement structs.QueryMetaCompat -func (q *QueryMeta) GetLastContact() (time.Duration, error) { - if q != nil { - return pbutil.DurationFromProto(&q.LastContact) - } - return 0, nil -} - -// GetResultsFilteredByACLs is required to implement structs.QueryMetaCompat -func (q *QueryMeta) GetResultsFilteredByACLs() bool { - if q != nil { - return q.ResultsFilteredByACLs - } - return false -} - // WriteRequest only applies to writes, always false // // IsRead implements structs.RPCInfo @@ -309,45 +176,3 @@ func (r *ReadRequest) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, func (td TargetDatacenter) RequestDatacenter() string { return td.Datacenter } - -func QueryMetaToStructs(s *QueryMeta) (structs.QueryMeta, error) { - var t structs.QueryMeta - if s == nil { - return t, nil - } - t.Index = s.Index - lastContact, err := pbutil.DurationFromProto(&s.LastContact) - if err != nil { - return t, err - } - t.LastContact = lastContact - t.KnownLeader = s.KnownLeader - t.ConsistencyLevel = s.ConsistencyLevel - return t, nil -} - -func NewQueryMetaFromStructs(s structs.QueryMeta) (*QueryMeta, error) { - var t QueryMeta - t.Index = s.Index - t.LastContact = *pbutil.DurationToProto(s.LastContact) - t.KnownLeader = s.KnownLeader - t.ConsistencyLevel = s.ConsistencyLevel - return &t, nil -} - -func RaftIndexToStructs(s *RaftIndex) structs.RaftIndex { - if s == nil { - return structs.RaftIndex{} - } - return structs.RaftIndex{ - CreateIndex: s.CreateIndex, - ModifyIndex: s.ModifyIndex, - } -} - -func NewRaftIndexFromStructs(s structs.RaftIndex) *RaftIndex { - return &RaftIndex{ - CreateIndex: s.CreateIndex, - ModifyIndex: s.ModifyIndex, - } -} diff --git a/proto/pbcommon/common.pb.go b/proto/pbcommon/common.pb.go index 11441c577..21f3b1dee 100644 --- a/proto/pbcommon/common.pb.go +++ b/proto/pbcommon/common.pb.go @@ -1,16 +1,13 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/pbcommon/common.proto package pbcommon import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" - io "io" + duration "github.com/golang/protobuf/ptypes/duration" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -27,8 +24,13 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // RaftIndex is used to track the index used while creating // or modifying a given struct type. type RaftIndex struct { + // @gotags: bexpr:"-" CreateIndex uint64 `protobuf:"varint,1,opt,name=CreateIndex,proto3" json:"CreateIndex,omitempty" bexpr:"-"` - ModifyIndex uint64 `protobuf:"varint,2,opt,name=ModifyIndex,proto3" json:"ModifyIndex,omitempty" bexpr:"-"` + // @gotags: bexpr:"-" + ModifyIndex uint64 `protobuf:"varint,2,opt,name=ModifyIndex,proto3" json:"ModifyIndex,omitempty" bexpr:"-"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *RaftIndex) Reset() { *m = RaftIndex{} } @@ -37,26 +39,18 @@ func (*RaftIndex) ProtoMessage() {} func (*RaftIndex) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{0} } + func (m *RaftIndex) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_RaftIndex.Unmarshal(m, b) } func (m *RaftIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftIndex.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_RaftIndex.Marshal(b, m, deterministic) } func (m *RaftIndex) XXX_Merge(src proto.Message) { xxx_messageInfo_RaftIndex.Merge(m, src) } func (m *RaftIndex) XXX_Size() int { - return m.Size() + return xxx_messageInfo_RaftIndex.Size(m) } func (m *RaftIndex) XXX_DiscardUnknown() { xxx_messageInfo_RaftIndex.DiscardUnknown(m) @@ -64,10 +58,27 @@ func (m *RaftIndex) XXX_DiscardUnknown() { var xxx_messageInfo_RaftIndex proto.InternalMessageInfo +func (m *RaftIndex) GetCreateIndex() uint64 { + if m != nil { + return m.CreateIndex + } + return 0 +} + +func (m *RaftIndex) GetModifyIndex() uint64 { + if m != nil { + return m.ModifyIndex + } + return 0 +} + // TargetDatacenter is intended to be used within other messages used for RPC routing // amongst the various Consul datacenters type TargetDatacenter struct { - Datacenter string `protobuf:"bytes,1,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` + Datacenter string `protobuf:"bytes,1,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *TargetDatacenter) Reset() { *m = TargetDatacenter{} } @@ -76,26 +87,18 @@ func (*TargetDatacenter) ProtoMessage() {} func (*TargetDatacenter) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{1} } + func (m *TargetDatacenter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_TargetDatacenter.Unmarshal(m, b) } func (m *TargetDatacenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TargetDatacenter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_TargetDatacenter.Marshal(b, m, deterministic) } func (m *TargetDatacenter) XXX_Merge(src proto.Message) { xxx_messageInfo_TargetDatacenter.Merge(m, src) } func (m *TargetDatacenter) XXX_Size() int { - return m.Size() + return xxx_messageInfo_TargetDatacenter.Size(m) } func (m *TargetDatacenter) XXX_DiscardUnknown() { xxx_messageInfo_TargetDatacenter.DiscardUnknown(m) @@ -103,10 +106,20 @@ func (m *TargetDatacenter) XXX_DiscardUnknown() { var xxx_messageInfo_TargetDatacenter proto.InternalMessageInfo +func (m *TargetDatacenter) GetDatacenter() string { + if m != nil { + return m.Datacenter + } + return "" +} + type WriteRequest struct { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. - Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *WriteRequest) Reset() { *m = WriteRequest{} } @@ -115,26 +128,18 @@ func (*WriteRequest) ProtoMessage() {} func (*WriteRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{2} } + func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_WriteRequest.Unmarshal(m, b) } func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) } func (m *WriteRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_WriteRequest.Merge(m, src) } func (m *WriteRequest) XXX_Size() int { - return m.Size() + return xxx_messageInfo_WriteRequest.Size(m) } func (m *WriteRequest) XXX_DiscardUnknown() { xxx_messageInfo_WriteRequest.DiscardUnknown(m) @@ -142,6 +147,13 @@ func (m *WriteRequest) XXX_DiscardUnknown() { var xxx_messageInfo_WriteRequest proto.InternalMessageInfo +func (m *WriteRequest) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + // ReadRequest is a type that may be embedded into any requests for read // operations. // It is a replacement for QueryOptions now that we no longer need any of those @@ -153,7 +165,10 @@ type ReadRequest struct { // token is assumed for backwards compatibility. Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` // RequireConsistent indicates that the request must be sent to the leader. - RequireConsistent bool `protobuf:"varint,2,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` + RequireConsistent bool `protobuf:"varint,2,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ReadRequest) Reset() { *m = ReadRequest{} } @@ -162,26 +177,18 @@ func (*ReadRequest) ProtoMessage() {} func (*ReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{3} } + func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_ReadRequest.Unmarshal(m, b) } func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) } func (m *ReadRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ReadRequest.Merge(m, src) } func (m *ReadRequest) XXX_Size() int { - return m.Size() + return xxx_messageInfo_ReadRequest.Size(m) } func (m *ReadRequest) XXX_DiscardUnknown() { xxx_messageInfo_ReadRequest.DiscardUnknown(m) @@ -189,7 +196,28 @@ func (m *ReadRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ReadRequest proto.InternalMessageInfo +func (m *ReadRequest) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *ReadRequest) GetRequireConsistent() bool { + if m != nil { + return m.RequireConsistent + } + return false +} + // QueryOptions is used to specify various flags for read queries +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryOptions +// output=common.gen.go +// name=Structs +// ignore-fields=StaleIfError,AllowNotModifiedResponse,state,sizeCache,unknownFields type QueryOptions struct { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. @@ -198,7 +226,8 @@ type QueryOptions struct { // with MaxQueryTime. MinQueryIndex uint64 `protobuf:"varint,2,opt,name=MinQueryIndex,proto3" json:"MinQueryIndex,omitempty"` // Provided with MinQueryIndex to wait for change. - MaxQueryTime types.Duration `protobuf:"bytes,3,opt,name=MaxQueryTime,proto3" json:"MaxQueryTime"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + MaxQueryTime *duration.Duration `protobuf:"bytes,3,opt,name=MaxQueryTime,proto3" json:"MaxQueryTime,omitempty"` // If set, any follower can service the request. Results // may be arbitrarily stale. AllowStale bool `protobuf:"varint,4,opt,name=AllowStale,proto3" json:"AllowStale,omitempty"` @@ -216,7 +245,8 @@ type QueryOptions struct { // If set and AllowStale is true, will try first a stale // read, and then will perform a consistent read if stale // read is older than value. - MaxStaleDuration types.Duration `protobuf:"bytes,7,opt,name=MaxStaleDuration,proto3" json:"MaxStaleDuration"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + MaxStaleDuration *duration.Duration `protobuf:"bytes,7,opt,name=MaxStaleDuration,proto3" json:"MaxStaleDuration,omitempty"` // MaxAge limits how old a cached value will be returned if UseCache is true. // If there is a cached response that is older than the MaxAge, it is treated // as a cache miss and a new fetch invoked. If the fetch fails, the error is @@ -224,7 +254,8 @@ type QueryOptions struct { // StaleIfError to a longer duration to change this behavior. It is ignored // if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. - MaxAge types.Duration `protobuf:"bytes,8,opt,name=MaxAge,proto3" json:"MaxAge"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + MaxAge *duration.Duration `protobuf:"bytes,8,opt,name=MaxAge,proto3" json:"MaxAge,omitempty"` // MustRevalidate forces the agent to fetch a fresh version of a cached // resource or at least validate that the cached version is still fresh. It is // implied by either max-age=0 or must-revalidate Cache-Control headers. It @@ -236,10 +267,13 @@ type QueryOptions struct { // UseCache is true and MaxAge is set to a lower, non-zero value. It is // ignored if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. - StaleIfError types.Duration `protobuf:"bytes,10,opt,name=StaleIfError,proto3" json:"StaleIfError"` + StaleIfError *duration.Duration `protobuf:"bytes,10,opt,name=StaleIfError,proto3" json:"StaleIfError,omitempty"` // Filter specifies the go-bexpr filter expression to be used for // filtering the data prior to returning a response - Filter string `protobuf:"bytes,11,opt,name=Filter,proto3" json:"Filter,omitempty"` + Filter string `protobuf:"bytes,11,opt,name=Filter,proto3" json:"Filter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *QueryOptions) Reset() { *m = QueryOptions{} } @@ -248,26 +282,18 @@ func (*QueryOptions) ProtoMessage() {} func (*QueryOptions) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{4} } + func (m *QueryOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_QueryOptions.Unmarshal(m, b) } func (m *QueryOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_QueryOptions.Marshal(b, m, deterministic) } func (m *QueryOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryOptions.Merge(m, src) } func (m *QueryOptions) XXX_Size() int { - return m.Size() + return xxx_messageInfo_QueryOptions.Size(m) } func (m *QueryOptions) XXX_DiscardUnknown() { xxx_messageInfo_QueryOptions.DiscardUnknown(m) @@ -275,15 +301,100 @@ func (m *QueryOptions) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOptions proto.InternalMessageInfo +func (m *QueryOptions) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *QueryOptions) GetMinQueryIndex() uint64 { + if m != nil { + return m.MinQueryIndex + } + return 0 +} + +func (m *QueryOptions) GetMaxQueryTime() *duration.Duration { + if m != nil { + return m.MaxQueryTime + } + return nil +} + +func (m *QueryOptions) GetAllowStale() bool { + if m != nil { + return m.AllowStale + } + return false +} + +func (m *QueryOptions) GetRequireConsistent() bool { + if m != nil { + return m.RequireConsistent + } + return false +} + +func (m *QueryOptions) GetUseCache() bool { + if m != nil { + return m.UseCache + } + return false +} + +func (m *QueryOptions) GetMaxStaleDuration() *duration.Duration { + if m != nil { + return m.MaxStaleDuration + } + return nil +} + +func (m *QueryOptions) GetMaxAge() *duration.Duration { + if m != nil { + return m.MaxAge + } + return nil +} + +func (m *QueryOptions) GetMustRevalidate() bool { + if m != nil { + return m.MustRevalidate + } + return false +} + +func (m *QueryOptions) GetStaleIfError() *duration.Duration { + if m != nil { + return m.StaleIfError + } + return nil +} + +func (m *QueryOptions) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + // QueryMeta allows a query response to include potentially // useful metadata about a query +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryMeta +// output=common.gen.go +// name=Structs +// ignore-fields=NotModified,Backend,state,sizeCache,unknownFields type QueryMeta struct { // This is the index associated with the read Index uint64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"` // If AllowStale is used, this is time elapsed since // last contact between the follower and leader. This // can be used to gauge staleness. - LastContact types.Duration `protobuf:"bytes,2,opt,name=LastContact,proto3" json:"LastContact"` + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + LastContact *duration.Duration `protobuf:"bytes,2,opt,name=LastContact,proto3" json:"LastContact,omitempty"` // Used to indicate if there is a known leader node KnownLeader bool `protobuf:"varint,3,opt,name=KnownLeader,proto3" json:"KnownLeader,omitempty"` // Consistencylevel returns the consistency used to serve the query @@ -293,7 +404,10 @@ type QueryMeta struct { // ResultsFilteredByACLs is true when some of the query's results were // filtered out by enforcing ACLs. It may be false because nothing was // removed, or because the endpoint does not yet support this flag. - ResultsFilteredByACLs bool `protobuf:"varint,7,opt,name=ResultsFilteredByACLs,proto3" json:"ResultsFilteredByACLs,omitempty"` + ResultsFilteredByACLs bool `protobuf:"varint,7,opt,name=ResultsFilteredByACLs,proto3" json:"ResultsFilteredByACLs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *QueryMeta) Reset() { *m = QueryMeta{} } @@ -302,26 +416,18 @@ func (*QueryMeta) ProtoMessage() {} func (*QueryMeta) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{5} } + func (m *QueryMeta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_QueryMeta.Unmarshal(m, b) } func (m *QueryMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMeta.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_QueryMeta.Marshal(b, m, deterministic) } func (m *QueryMeta) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMeta.Merge(m, src) } func (m *QueryMeta) XXX_Size() int { - return m.Size() + return xxx_messageInfo_QueryMeta.Size(m) } func (m *QueryMeta) XXX_DiscardUnknown() { xxx_messageInfo_QueryMeta.DiscardUnknown(m) @@ -329,13 +435,51 @@ func (m *QueryMeta) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMeta proto.InternalMessageInfo +func (m *QueryMeta) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *QueryMeta) GetLastContact() *duration.Duration { + if m != nil { + return m.LastContact + } + return nil +} + +func (m *QueryMeta) GetKnownLeader() bool { + if m != nil { + return m.KnownLeader + } + return false +} + +func (m *QueryMeta) GetConsistencyLevel() string { + if m != nil { + return m.ConsistencyLevel + } + return "" +} + +func (m *QueryMeta) GetResultsFilteredByACLs() bool { + if m != nil { + return m.ResultsFilteredByACLs + } + return false +} + // EnterpriseMeta contains metadata that is only used by the Enterprise version // of Consul. type EnterpriseMeta struct { // Namespace in which the entity exists. Namespace string `protobuf:"bytes,1,opt,name=Namespace,proto3" json:"Namespace,omitempty"` // Partition in which the entity exists. - Partition string `protobuf:"bytes,2,opt,name=Partition,proto3" json:"Partition,omitempty"` + Partition string `protobuf:"bytes,2,opt,name=Partition,proto3" json:"Partition,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *EnterpriseMeta) Reset() { *m = EnterpriseMeta{} } @@ -344,26 +488,18 @@ func (*EnterpriseMeta) ProtoMessage() {} func (*EnterpriseMeta) Descriptor() ([]byte, []int) { return fileDescriptor_a6f5ac44994d718c, []int{6} } + func (m *EnterpriseMeta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return xxx_messageInfo_EnterpriseMeta.Unmarshal(m, b) } func (m *EnterpriseMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic) } func (m *EnterpriseMeta) XXX_Merge(src proto.Message) { xxx_messageInfo_EnterpriseMeta.Merge(m, src) } func (m *EnterpriseMeta) XXX_Size() int { - return m.Size() + return xxx_messageInfo_EnterpriseMeta.Size(m) } func (m *EnterpriseMeta) XXX_DiscardUnknown() { xxx_messageInfo_EnterpriseMeta.DiscardUnknown(m) @@ -371,6 +507,20 @@ func (m *EnterpriseMeta) XXX_DiscardUnknown() { var xxx_messageInfo_EnterpriseMeta proto.InternalMessageInfo +func (m *EnterpriseMeta) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *EnterpriseMeta) GetPartition() string { + if m != nil { + return m.Partition + } + return "" +} + func init() { proto.RegisterType((*RaftIndex)(nil), "common.RaftIndex") proto.RegisterType((*TargetDatacenter)(nil), "common.TargetDatacenter") @@ -381,1632 +531,45 @@ func init() { proto.RegisterType((*EnterpriseMeta)(nil), "common.EnterpriseMeta") } -func init() { proto.RegisterFile("proto/pbcommon/common.proto", fileDescriptor_a6f5ac44994d718c) } +func init() { + proto.RegisterFile("proto/pbcommon/common.proto", fileDescriptor_a6f5ac44994d718c) +} var fileDescriptor_a6f5ac44994d718c = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0x8e, 0xfb, 0xa7, 0xae, 0xbd, 0x69, 0xab, 0xfc, 0xab, 0x82, 0x4c, 0x41, 0x6e, 0x65, 0x55, - 0xa8, 0xaa, 0x20, 0x96, 0x0a, 0x12, 0x12, 0xb7, 0x24, 0x2d, 0x52, 0xdb, 0x18, 0xe8, 0x52, 0x84, - 0xc4, 0x6d, 0x63, 0x4f, 0x1c, 0x0b, 0xc7, 0x6b, 0x76, 0xd7, 0x6d, 0x72, 0xe7, 0x01, 0x38, 0xf2, - 0x48, 0x3d, 0xf6, 0xc8, 0xa9, 0x82, 0xe6, 0x0d, 0x10, 0x0f, 0x80, 0xbc, 0x4e, 0x5b, 0x97, 0xa6, - 0x28, 0xa7, 0xe4, 0xfb, 0xf6, 0x9b, 0xd9, 0x99, 0xf9, 0x66, 0x8d, 0x1e, 0xa6, 0x9c, 0x49, 0xe6, - 0xa6, 0x5d, 0x9f, 0x0d, 0x06, 0x2c, 0x71, 0x8b, 0x9f, 0x86, 0x62, 0xb1, 0x5e, 0xa0, 0x55, 0x3b, - 0x64, 0x2c, 0x8c, 0xc1, 0x55, 0x6c, 0x37, 0xeb, 0xb9, 0x41, 0xc6, 0xa9, 0x8c, 0x2e, 0x75, 0xab, - 0x2b, 0x21, 0x0b, 0x59, 0x91, 0x28, 0xff, 0x57, 0xb0, 0xce, 0x00, 0x99, 0x84, 0xf6, 0xe4, 0x5e, - 0x12, 0xc0, 0x10, 0xbb, 0xa8, 0xd6, 0xe6, 0x40, 0x25, 0x28, 0x68, 0x69, 0xeb, 0xda, 0x66, 0xb5, - 0xb5, 0xf4, 0xeb, 0x7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af, 0x22, 0xe3, 0xbd, 0x80, 0x36, 0xf5, 0xfb, - 0x60, 0xe9, 0x4a, 0x74, 0x85, 0xf1, 0x01, 0xaa, 0x7b, 0x74, 0xa8, 0xb2, 0x5e, 0x56, 0x64, 0x2d, - 0xcc, 0x56, 0xf2, 0xad, 0x40, 0xfc, 0x02, 0xe9, 0x1e, 0x1d, 0x36, 0x43, 0xb0, 0x8c, 0xd9, 0x52, - 0x4c, 0xe4, 0xf8, 0x31, 0x5a, 0xf6, 0x32, 0x21, 0x09, 0x1c, 0xd3, 0x38, 0x0a, 0xa8, 0x04, 0xcb, - 0x54, 0x75, 0xfe, 0xc5, 0xe6, 0xc3, 0x55, 0x37, 0xee, 0xf5, 0x76, 0x39, 0x67, 0xdc, 0x42, 0x33, - 0x0e, 0xb7, 0x1c, 0x84, 0xef, 0x23, 0xfd, 0x55, 0x14, 0xe7, 0x3b, 0x58, 0x53, 0xf6, 0x4e, 0x90, - 0xf3, 0x5b, 0x43, 0xa6, 0xb2, 0xc0, 0x03, 0x49, 0xf3, 0x1d, 0x28, 0xbd, 0x0e, 0x52, 0x00, 0xdc, - 0x44, 0xb5, 0x0e, 0x15, 0xb2, 0xcd, 0x12, 0x49, 0xfd, 0x62, 0xa5, 0x66, 0xb8, 0xbf, 0x1c, 0x83, - 0xd7, 0x51, 0xed, 0x20, 0x61, 0x27, 0x49, 0x07, 0x68, 0x00, 0x5c, 0xed, 0x87, 0x41, 0xca, 0x14, - 0xde, 0x42, 0xf5, 0x2b, 0xf7, 0xfc, 0x51, 0x07, 0x8e, 0x21, 0x56, 0x3b, 0x60, 0x92, 0x5b, 0x3c, - 0x7e, 0x8e, 0xee, 0x11, 0x10, 0x59, 0x2c, 0x45, 0xd1, 0x05, 0x04, 0xad, 0x51, 0xb3, 0xdd, 0x11, - 0xca, 0x44, 0x83, 0x4c, 0x3f, 0xdc, 0xaf, 0x1a, 0xf3, 0x75, 0x7d, 0xbf, 0x6a, 0xe8, 0xf5, 0x05, - 0xa7, 0x83, 0x96, 0x77, 0xf3, 0xf7, 0x97, 0xf2, 0x48, 0x80, 0x6a, 0xfd, 0x11, 0x32, 0x5f, 0xd3, - 0x01, 0x88, 0x94, 0xfa, 0x30, 0x79, 0x02, 0xd7, 0x44, 0x7e, 0xfa, 0x96, 0x72, 0x19, 0xa9, 0x55, - 0x99, 0x2b, 0x4e, 0xaf, 0x88, 0x56, 0xe7, 0xf4, 0xa7, 0x5d, 0x39, 0xbd, 0xb0, 0xb5, 0xb3, 0x0b, - 0x5b, 0xfb, 0x71, 0x61, 0x6b, 0x5f, 0xc7, 0x76, 0xe5, 0xdb, 0xd8, 0xae, 0x9c, 0x8d, 0xed, 0xca, - 0xf7, 0xb1, 0x5d, 0xf9, 0xb8, 0x15, 0x46, 0xb2, 0x9f, 0x75, 0x1b, 0x3e, 0x1b, 0xb8, 0x7d, 0x2a, - 0xfa, 0x91, 0xcf, 0x78, 0xea, 0xfa, 0x2c, 0x11, 0x59, 0xec, 0xde, 0xfc, 0x00, 0x76, 0x75, 0x85, - 0x9f, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x69, 0xe7, 0xf4, 0x19, 0x05, 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x51, 0x6f, 0xd3, 0x30, + 0x10, 0x56, 0xb7, 0x2e, 0x4b, 0xae, 0x65, 0x2a, 0x16, 0xa0, 0x30, 0xd0, 0x54, 0x45, 0x13, 0x9a, + 0xa6, 0xa9, 0x11, 0x83, 0x37, 0xc4, 0x43, 0xd7, 0x15, 0x69, 0xa3, 0x61, 0xcc, 0x14, 0x21, 0xf1, + 0xe6, 0x26, 0xd7, 0xd6, 0x22, 0x8d, 0x83, 0xed, 0x6c, 0xed, 0x7f, 0x46, 0xfc, 0x06, 0x14, 0xa7, + 0xed, 0x52, 0xba, 0xad, 0x4f, 0xd1, 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 0x29, 0x9c, 0xf5, 0xf0, 0x06, 0x63, 0xe3, 0xb5, 0x43, 0xd7, 0x78, 0xf2, 0x1e, 0x9e, + 0x53, 0x54, 0x59, 0xac, 0x55, 0x51, 0x3f, 0x46, 0x67, 0xb3, 0x76, 0xa7, 0xa7, 0x8c, 0x59, 0x36, + 0xbd, 0x3f, 0x78, 0x59, 0xb5, 0x77, 0x1a, 0xd6, 0x65, 0xd5, 0xb6, 0x1a, 0xbb, 0x5e, 0x0f, 0xf6, + 0xba, 0xf9, 0x0b, 0x4b, 0x25, 0x57, 0x68, 0x9a, 0x7e, 0x0d, 0xce, 0x17, 0x36, 0x41, 0x95, 0xb2, + 0x10, 0xe7, 0x4b, 0x7e, 0x47, 0xe4, 0xd1, 0xaf, 0x4c, 0x6a, 0x6e, 0x56, 0x62, 0xab, 0x88, 0x2e, + 0x89, 0xb3, 0x93, 0x9f, 0xc7, 0x23, 0xae, 0xc7, 0xd9, 0xa0, 0x15, 0x8a, 0x89, 0x3f, 0x66, 0x6a, + 0xcc, 0x43, 0x21, 0x53, 0x3f, 0x14, 0x89, 0xca, 0x62, 0x7f, 0xf5, 0x77, 0x34, 0xb0, 0x0c, 0x7e, + 0xf7, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x35, 0xe5, 0x62, 0x05, 0xa7, 0x04, 0x00, 0x00, } - -func (m *RaftIndex) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RaftIndex) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RaftIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ModifyIndex != 0 { - i = encodeVarintCommon(dAtA, i, uint64(m.ModifyIndex)) - i-- - dAtA[i] = 0x10 - } - if m.CreateIndex != 0 { - i = encodeVarintCommon(dAtA, i, uint64(m.CreateIndex)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TargetDatacenter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TargetDatacenter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TargetDatacenter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Datacenter) > 0 { - i -= len(m.Datacenter) - copy(dAtA[i:], m.Datacenter) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Datacenter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WriteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ReadRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RequireConsistent { - i-- - if m.RequireConsistent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Filter) > 0 { - i -= len(m.Filter) - copy(dAtA[i:], m.Filter) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Filter))) - i-- - dAtA[i] = 0x5a - } - { - size, err := m.StaleIfError.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommon(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if m.MustRevalidate { - i-- - if m.MustRevalidate { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - { - size, err := m.MaxAge.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommon(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - { - size, err := m.MaxStaleDuration.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommon(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if m.UseCache { - i-- - if m.UseCache { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.RequireConsistent { - i-- - if m.RequireConsistent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.AllowStale { - i-- - if m.AllowStale { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - { - size, err := m.MaxQueryTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommon(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.MinQueryIndex != 0 { - i = encodeVarintCommon(dAtA, i, uint64(m.MinQueryIndex)) - i-- - dAtA[i] = 0x10 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryMeta) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryMeta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ResultsFilteredByACLs { - i-- - if m.ResultsFilteredByACLs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if len(m.ConsistencyLevel) > 0 { - i -= len(m.ConsistencyLevel) - copy(dAtA[i:], m.ConsistencyLevel) - i = encodeVarintCommon(dAtA, i, uint64(len(m.ConsistencyLevel))) - i-- - dAtA[i] = 0x22 - } - if m.KnownLeader { - i-- - if m.KnownLeader { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size, err := m.LastContact.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommon(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Index != 0 { - i = encodeVarintCommon(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EnterpriseMeta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EnterpriseMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Partition) > 0 { - i -= len(m.Partition) - copy(dAtA[i:], m.Partition) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Partition))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintCommon(dAtA []byte, offset int, v uint64) int { - offset -= sovCommon(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RaftIndex) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreateIndex != 0 { - n += 1 + sovCommon(uint64(m.CreateIndex)) - } - if m.ModifyIndex != 0 { - n += 1 + sovCommon(uint64(m.ModifyIndex)) - } - return n -} - -func (m *TargetDatacenter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Datacenter) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - return n -} - -func (m *WriteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Token) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - return n -} - -func (m *ReadRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Token) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - if m.RequireConsistent { - n += 2 - } - return n -} - -func (m *QueryOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Token) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - if m.MinQueryIndex != 0 { - n += 1 + sovCommon(uint64(m.MinQueryIndex)) - } - l = m.MaxQueryTime.Size() - n += 1 + l + sovCommon(uint64(l)) - if m.AllowStale { - n += 2 - } - if m.RequireConsistent { - n += 2 - } - if m.UseCache { - n += 2 - } - l = m.MaxStaleDuration.Size() - n += 1 + l + sovCommon(uint64(l)) - l = m.MaxAge.Size() - n += 1 + l + sovCommon(uint64(l)) - if m.MustRevalidate { - n += 2 - } - l = m.StaleIfError.Size() - n += 1 + l + sovCommon(uint64(l)) - l = len(m.Filter) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - return n -} - -func (m *QueryMeta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovCommon(uint64(m.Index)) - } - l = m.LastContact.Size() - n += 1 + l + sovCommon(uint64(l)) - if m.KnownLeader { - n += 2 - } - l = len(m.ConsistencyLevel) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - if m.ResultsFilteredByACLs { - n += 2 - } - return n -} - -func (m *EnterpriseMeta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - l = len(m.Partition) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - return n -} - -func sovCommon(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCommon(x uint64) (n int) { - return sovCommon(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RaftIndex) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RaftIndex: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftIndex: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateIndex", wireType) - } - m.CreateIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreateIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModifyIndex", wireType) - } - m.ModifyIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ModifyIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TargetDatacenter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TargetDatacenter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TargetDatacenter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Datacenter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Datacenter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WriteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequireConsistent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RequireConsistent = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryOptions) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinQueryIndex", wireType) - } - m.MinQueryIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinQueryIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxQueryTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxQueryTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowStale", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowStale = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequireConsistent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RequireConsistent = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UseCache", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UseCache = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxStaleDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxStaleDuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxAge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MustRevalidate", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.MustRevalidate = bool(v != 0) - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StaleIfError", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StaleIfError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Filter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMeta) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryMeta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMeta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastContact", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastContact.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KnownLeader", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.KnownLeader = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsistencyLevel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsistencyLevel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultsFilteredByACLs", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ResultsFilteredByACLs = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EnterpriseMeta) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EnterpriseMeta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EnterpriseMeta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Partition = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCommon(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCommon - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCommon - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCommon - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCommon - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCommon - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCommon - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCommon = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCommon = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCommon = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/pbcommon/common.proto b/proto/pbcommon/common.proto index a3ec852b6..b38e77fda 100644 --- a/proto/pbcommon/common.proto +++ b/proto/pbcommon/common.proto @@ -5,23 +5,15 @@ package common; option go_package = "github.com/hashicorp/consul/proto/pbcommon"; import "google/protobuf/duration.proto"; -// Go Modules now includes the version in the filepath for packages within GOPATH/pkg/mode -// Therefore unless we want to hardcode a version here like -// github.com/gogo/protobuf@v1.3.0/gogoproto/gogo.proto then the only other choice is to -// have a more relative import and pass the right import path to protoc. I don't like it -// but its necessary. -import "gogoproto/gogo.proto"; -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_sizecache_all) = false; // RaftIndex is used to track the index used while creating // or modifying a given struct type. message RaftIndex { - uint64 CreateIndex = 1 [(gogoproto.moretags) = "bexpr:\"-\""]; - uint64 ModifyIndex = 2 [(gogoproto.moretags) = "bexpr:\"-\""]; + // @gotags: bexpr:"-" + uint64 CreateIndex = 1; + // @gotags: bexpr:"-" + uint64 ModifyIndex = 2; } // TargetDatacenter is intended to be used within other messages used for RPC routing @@ -53,6 +45,13 @@ message ReadRequest { // QueryOptions is used to specify various flags for read queries +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryOptions +// output=common.gen.go +// name=Structs +// ignore-fields=StaleIfError,AllowNotModifiedResponse,state,sizeCache,unknownFields message QueryOptions { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. @@ -63,8 +62,8 @@ message QueryOptions { uint64 MinQueryIndex = 2; // Provided with MinQueryIndex to wait for change. - google.protobuf.Duration MaxQueryTime = 3 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration MaxQueryTime = 3; // If set, any follower can service the request. Results // may be arbitrarily stale. @@ -86,8 +85,8 @@ message QueryOptions { // If set and AllowStale is true, will try first a stale // read, and then will perform a consistent read if stale // read is older than value. - google.protobuf.Duration MaxStaleDuration = 7 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration MaxStaleDuration = 7; // MaxAge limits how old a cached value will be returned if UseCache is true. // If there is a cached response that is older than the MaxAge, it is treated @@ -96,8 +95,8 @@ message QueryOptions { // StaleIfError to a longer duration to change this behavior. It is ignored // if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. - google.protobuf.Duration MaxAge = 8 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration MaxAge = 8; // MustRevalidate forces the agent to fetch a fresh version of a cached // resource or at least validate that the cached version is still fresh. It is @@ -111,8 +110,7 @@ message QueryOptions { // UseCache is true and MaxAge is set to a lower, non-zero value. It is // ignored if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. - google.protobuf.Duration StaleIfError = 10 - [(gogoproto.nullable) = false]; + google.protobuf.Duration StaleIfError = 10; // Filter specifies the go-bexpr filter expression to be used for // filtering the data prior to returning a response @@ -121,6 +119,13 @@ message QueryOptions { // QueryMeta allows a query response to include potentially // useful metadata about a query +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryMeta +// output=common.gen.go +// name=Structs +// ignore-fields=NotModified,Backend,state,sizeCache,unknownFields message QueryMeta { // This is the index associated with the read uint64 Index = 1; @@ -128,8 +133,8 @@ message QueryMeta { // If AllowStale is used, this is time elapsed since // last contact between the follower and leader. This // can be used to gauge staleness. - google.protobuf.Duration LastContact = 2 - [(gogoproto.nullable) = false]; + // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto + google.protobuf.Duration LastContact = 2; // Used to indicate if there is a known leader node bool KnownLeader = 3; diff --git a/proto/pbcommon/common_oss.go b/proto/pbcommon/common_oss.go index 06c9dbdd3..e96c1a4b3 100644 --- a/proto/pbcommon/common_oss.go +++ b/proto/pbcommon/common_oss.go @@ -9,10 +9,16 @@ import ( var DefaultEnterpriseMeta = EnterpriseMeta{} -func EnterpriseMetaToStructs(_ *EnterpriseMeta) structs.EnterpriseMeta { - return *structs.DefaultEnterpriseMetaInDefaultPartition() -} - func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) *EnterpriseMeta { return &EnterpriseMeta{} } +func EnterpriseMetaToStructs(s *EnterpriseMeta, t *structs.EnterpriseMeta) { + if s == nil { + return + } +} +func EnterpriseMetaFromStructs(t *structs.EnterpriseMeta, s *EnterpriseMeta) { + if s == nil { + return + } +} diff --git a/proto/pbcommongogo/common.gen.go b/proto/pbcommongogo/common.gen.go new file mode 100644 index 000000000..925ebb70d --- /dev/null +++ b/proto/pbcommongogo/common.gen.go @@ -0,0 +1,70 @@ +// Code generated by mog. DO NOT EDIT. + +package pbcommongogo + +import "github.com/hashicorp/consul/agent/structs" + +func QueryMetaToStructs(s *QueryMeta, t *structs.QueryMeta) { + if s == nil { + return + } + t.Index = s.Index + t.LastContact = structs.DurationFromProtoGogo(s.LastContact) + t.KnownLeader = s.KnownLeader + t.ConsistencyLevel = s.ConsistencyLevel + t.ResultsFilteredByACLs = s.ResultsFilteredByACLs +} +func QueryMetaFromStructs(t *structs.QueryMeta, s *QueryMeta) { + if s == nil { + return + } + s.Index = t.Index + s.LastContact = structs.DurationToProtoGogo(t.LastContact) + s.KnownLeader = t.KnownLeader + s.ConsistencyLevel = t.ConsistencyLevel + s.ResultsFilteredByACLs = t.ResultsFilteredByACLs +} +func QueryOptionsToStructs(s *QueryOptions, t *structs.QueryOptions) { + if s == nil { + return + } + t.Token = s.Token + t.MinQueryIndex = s.MinQueryIndex + t.MaxQueryTime = structs.DurationFromProtoGogo(s.MaxQueryTime) + t.AllowStale = s.AllowStale + t.RequireConsistent = s.RequireConsistent + t.UseCache = s.UseCache + t.MaxStaleDuration = structs.DurationFromProtoGogo(s.MaxStaleDuration) + t.MaxAge = structs.DurationFromProtoGogo(s.MaxAge) + t.MustRevalidate = s.MustRevalidate + t.Filter = s.Filter +} +func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions) { + if s == nil { + return + } + s.Token = t.Token + s.MinQueryIndex = t.MinQueryIndex + s.MaxQueryTime = structs.DurationToProtoGogo(t.MaxQueryTime) + s.AllowStale = t.AllowStale + s.RequireConsistent = t.RequireConsistent + s.UseCache = t.UseCache + s.MaxStaleDuration = structs.DurationToProtoGogo(t.MaxStaleDuration) + s.MaxAge = structs.DurationToProtoGogo(t.MaxAge) + s.MustRevalidate = t.MustRevalidate + s.Filter = t.Filter +} +func RaftIndexToStructs(s *RaftIndex, t *structs.RaftIndex) { + if s == nil { + return + } + t.CreateIndex = s.CreateIndex + t.ModifyIndex = s.ModifyIndex +} +func RaftIndexFromStructs(t *structs.RaftIndex, s *RaftIndex) { + if s == nil { + return + } + s.CreateIndex = t.CreateIndex + s.ModifyIndex = t.ModifyIndex +} diff --git a/proto/pbcommongogo/common.go b/proto/pbcommongogo/common.go new file mode 100644 index 000000000..5cd6d4d64 --- /dev/null +++ b/proto/pbcommongogo/common.go @@ -0,0 +1,303 @@ +package pbcommongogo + +import ( + "time" + + "github.com/hashicorp/consul/agent/structs" +) + +// IsRead is always true for QueryOption +func (q *QueryOptions) IsRead() bool { + return true +} + +// AllowStaleRead returns whether a stale read should be allowed +func (q *QueryOptions) AllowStaleRead() bool { + return q.AllowStale +} + +func (q *QueryOptions) TokenSecret() string { + return q.Token +} + +func (q *QueryOptions) SetTokenSecret(s string) { + q.Token = s +} + +// SetToken is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetToken(token string) { + q.Token = token +} + +// SetMinQueryIndex is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64) { + q.MinQueryIndex = minQueryIndex +} + +// SetMaxQueryTime is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration) { + q.MaxQueryTime = structs.DurationToProtoGogo(maxQueryTime) +} + +// SetAllowStale is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetAllowStale(allowStale bool) { + q.AllowStale = allowStale +} + +// SetRequireConsistent is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetRequireConsistent(requireConsistent bool) { + q.RequireConsistent = requireConsistent +} + +// SetUseCache is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetUseCache(useCache bool) { + q.UseCache = useCache +} + +// SetMaxStaleDuration is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration) { + q.MaxStaleDuration = structs.DurationToProtoGogo(maxStaleDuration) +} + +// SetMaxAge is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetMaxAge(maxAge time.Duration) { + q.MaxAge = structs.DurationToProtoGogo(maxAge) +} + +// SetMustRevalidate is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool) { + q.MustRevalidate = mustRevalidate +} + +// SetStaleIfError is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration) { + q.StaleIfError = structs.DurationToProtoGogo(staleIfError) +} + +func (q QueryOptions) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error) { + maxTime := structs.DurationFromProtoGogo(q.MaxQueryTime) + o := structs.QueryOptions{ + MaxQueryTime: maxTime, + MinQueryIndex: q.MinQueryIndex, + } + return o.HasTimedOut(start, rpcHoldTimeout, maxQueryTime, defaultQueryTime) +} + +// SetFilter is needed to implement the structs.QueryOptionsCompat interface +func (q *QueryOptions) SetFilter(filter string) { + q.Filter = filter +} + +// GetMaxQueryTime is required to implement blockingQueryOptions +func (q *QueryOptions) GetMaxQueryTime() (time.Duration, error) { + return structs.DurationFromProtoGogo(q.MaxQueryTime), nil +} + +// GetMinQueryIndex is required to implement blockingQueryOptions +func (q *QueryOptions) GetMinQueryIndex() uint64 { + if q != nil { + return q.MinQueryIndex + } + return 0 +} + +// GetRequireConsistent is required to implement blockingQueryOptions +func (q *QueryOptions) GetRequireConsistent() bool { + if q != nil { + return q.RequireConsistent + } + return false +} + +// GetToken is required to implement blockingQueryOptions +func (q *QueryOptions) GetToken() string { + if q != nil { + return q.Token + } + return "" +} + +// GetAllowStale is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetAllowStale() bool { + if q != nil { + return q.AllowStale + } + return false +} + +// GetFilter is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetFilter() string { + if q != nil { + return q.Filter + } + return "" +} + +// GetMaxAge is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetMaxAge() (time.Duration, error) { + if q != nil { + return structs.DurationFromProtoGogo(q.MaxAge), nil + } + return 0, nil +} + +// GetMaxStaleDuration is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetMaxStaleDuration() (time.Duration, error) { + if q != nil { + return structs.DurationFromProtoGogo(q.MaxStaleDuration), nil + } + return 0, nil +} + +// GetMustRevalidate is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetMustRevalidate() bool { + if q != nil { + return q.MustRevalidate + } + return false +} + +// GetStaleIfError is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetStaleIfError() (time.Duration, error) { + if q != nil { + return structs.DurationFromProtoGogo(q.StaleIfError), nil + } + return 0, nil +} + +// GetUseCache is required to implement structs.QueryOptionsCompat +func (q *QueryOptions) GetUseCache() bool { + if q != nil { + return q.UseCache + } + return false +} + +// SetLastContact is needed to implement the structs.QueryMetaCompat interface +func (q *QueryMeta) SetLastContact(lastContact time.Duration) { + q.LastContact = structs.DurationToProtoGogo(lastContact) +} + +// SetKnownLeader is needed to implement the structs.QueryMetaCompat interface +func (q *QueryMeta) SetKnownLeader(knownLeader bool) { + q.KnownLeader = knownLeader +} + +// SetIndex is needed to implement the structs.QueryMetaCompat interface +func (q *QueryMeta) SetIndex(index uint64) { + q.Index = index +} + +// SetConsistencyLevel is needed to implement the structs.QueryMetaCompat interface +func (q *QueryMeta) SetConsistencyLevel(consistencyLevel string) { + q.ConsistencyLevel = consistencyLevel +} + +func (q *QueryMeta) GetBackend() structs.QueryBackend { + return structs.QueryBackend(0) +} + +// SetResultsFilteredByACLs is needed to implement the structs.QueryMetaCompat interface +func (q *QueryMeta) SetResultsFilteredByACLs(v bool) { + q.ResultsFilteredByACLs = v +} + +// GetIndex is required to implement blockingQueryResponseMeta +func (q *QueryMeta) GetIndex() uint64 { + if q != nil { + return q.Index + } + return 0 +} + +// GetConsistencyLevel is required to implement structs.QueryMetaCompat +func (q *QueryMeta) GetConsistencyLevel() string { + if q != nil { + return q.ConsistencyLevel + } + return "" +} + +// GetKnownLeader is required to implement structs.QueryMetaCompat +func (q *QueryMeta) GetKnownLeader() bool { + if q != nil { + return q.KnownLeader + } + return false +} + +// GetLastContact is required to implement structs.QueryMetaCompat +func (q *QueryMeta) GetLastContact() (time.Duration, error) { + if q != nil { + return structs.DurationFromProtoGogo(q.LastContact), nil + } + return 0, nil +} + +// GetResultsFilteredByACLs is required to implement structs.QueryMetaCompat +func (q *QueryMeta) GetResultsFilteredByACLs() bool { + if q != nil { + return q.ResultsFilteredByACLs + } + return false +} + +// WriteRequest only applies to writes, always false +// +// IsRead implements structs.RPCInfo +func (w WriteRequest) IsRead() bool { + return false +} + +// SetTokenSecret implements structs.RPCInfo +func (w WriteRequest) TokenSecret() string { + return w.Token +} + +// SetTokenSecret implements structs.RPCInfo +func (w *WriteRequest) SetTokenSecret(s string) { + w.Token = s +} + +// AllowStaleRead returns whether a stale read should be allowed +// +// AllowStaleRead implements structs.RPCInfo +func (w WriteRequest) AllowStaleRead() bool { + return false +} + +// HasTimedOut implements structs.RPCInfo +func (w WriteRequest) HasTimedOut(start time.Time, rpcHoldTimeout, _, _ time.Duration) (bool, error) { + return time.Since(start) > rpcHoldTimeout, nil +} + +// IsRead implements structs.RPCInfo +func (r *ReadRequest) IsRead() bool { + return true +} + +// AllowStaleRead implements structs.RPCInfo +func (r *ReadRequest) AllowStaleRead() bool { + // TODO(partitions): plumb this? + return false +} + +// TokenSecret implements structs.RPCInfo +func (r *ReadRequest) TokenSecret() string { + return r.Token +} + +// SetTokenSecret implements structs.RPCInfo +func (r *ReadRequest) SetTokenSecret(token string) { + r.Token = token +} + +// HasTimedOut implements structs.RPCInfo +func (r *ReadRequest) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error) { + return time.Since(start) > rpcHoldTimeout, nil +} + +// RequestDatacenter implements structs.RPCInfo +func (td TargetDatacenter) RequestDatacenter() string { + return td.Datacenter +} diff --git a/proto/pbcommongogo/common.pb.binary.go b/proto/pbcommongogo/common.pb.binary.go new file mode 100644 index 000000000..2e6b57496 --- /dev/null +++ b/proto/pbcommongogo/common.pb.binary.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-go-binary. DO NOT EDIT. +// source: proto/pbcommongogo/common.proto + +package pbcommongogo + +import ( + "github.com/golang/protobuf/proto" +) + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *RaftIndex) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *RaftIndex) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *TargetDatacenter) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *TargetDatacenter) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *WriteRequest) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *WriteRequest) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *ReadRequest) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *ReadRequest) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *QueryOptions) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *QueryOptions) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *QueryMeta) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *QueryMeta) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *EnterpriseMeta) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *EnterpriseMeta) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} diff --git a/proto/pbcommongogo/common.pb.go b/proto/pbcommongogo/common.pb.go new file mode 100644 index 000000000..07db0feaa --- /dev/null +++ b/proto/pbcommongogo/common.pb.go @@ -0,0 +1,2036 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/pbcommongogo/common.proto + +package pbcommongogo + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + types "github.com/gogo/protobuf/types" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// RaftIndex is used to track the index used while creating +// or modifying a given struct type. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.RaftIndex +// output=common.gen.go +// name=Structs +type RaftIndex struct { + CreateIndex uint64 `protobuf:"varint,1,opt,name=CreateIndex,proto3" json:"CreateIndex,omitempty" bexpr:"-"` + ModifyIndex uint64 `protobuf:"varint,2,opt,name=ModifyIndex,proto3" json:"ModifyIndex,omitempty" bexpr:"-"` +} + +func (m *RaftIndex) Reset() { *m = RaftIndex{} } +func (m *RaftIndex) String() string { return proto.CompactTextString(m) } +func (*RaftIndex) ProtoMessage() {} +func (*RaftIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{0} +} +func (m *RaftIndex) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RaftIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RaftIndex.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RaftIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_RaftIndex.Merge(m, src) +} +func (m *RaftIndex) XXX_Size() int { + return m.Size() +} +func (m *RaftIndex) XXX_DiscardUnknown() { + xxx_messageInfo_RaftIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_RaftIndex proto.InternalMessageInfo + +// TargetDatacenter is intended to be used within other messages used for RPC routing +// amongst the various Consul datacenters +type TargetDatacenter struct { + Datacenter string `protobuf:"bytes,1,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` +} + +func (m *TargetDatacenter) Reset() { *m = TargetDatacenter{} } +func (m *TargetDatacenter) String() string { return proto.CompactTextString(m) } +func (*TargetDatacenter) ProtoMessage() {} +func (*TargetDatacenter) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{1} +} +func (m *TargetDatacenter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TargetDatacenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TargetDatacenter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TargetDatacenter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TargetDatacenter.Merge(m, src) +} +func (m *TargetDatacenter) XXX_Size() int { + return m.Size() +} +func (m *TargetDatacenter) XXX_DiscardUnknown() { + xxx_messageInfo_TargetDatacenter.DiscardUnknown(m) +} + +var xxx_messageInfo_TargetDatacenter proto.InternalMessageInfo + +type WriteRequest struct { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` +} + +func (m *WriteRequest) Reset() { *m = WriteRequest{} } +func (m *WriteRequest) String() string { return proto.CompactTextString(m) } +func (*WriteRequest) ProtoMessage() {} +func (*WriteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{2} +} +func (m *WriteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WriteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteRequest.Merge(m, src) +} +func (m *WriteRequest) XXX_Size() int { + return m.Size() +} +func (m *WriteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WriteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteRequest proto.InternalMessageInfo + +// ReadRequest is a type that may be embedded into any requests for read +// operations. +// It is a replacement for QueryOptions now that we no longer need any of those +// fields because we are moving away from using blocking queries. +// It is also similar to WriteRequest. It is a separate type so that in the +// future we can introduce fields that may only be relevant for reads. +type ReadRequest struct { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` + // RequireConsistent indicates that the request must be sent to the leader. + RequireConsistent bool `protobuf:"varint,2,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` +} + +func (m *ReadRequest) Reset() { *m = ReadRequest{} } +func (m *ReadRequest) String() string { return proto.CompactTextString(m) } +func (*ReadRequest) ProtoMessage() {} +func (*ReadRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{3} +} +func (m *ReadRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ReadRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadRequest.Merge(m, src) +} +func (m *ReadRequest) XXX_Size() int { + return m.Size() +} +func (m *ReadRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadRequest proto.InternalMessageInfo + +// QueryOptions is used to specify various flags for read queries +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryOptions +// output=common.gen.go +// name=Structs +// ignore-fields=StaleIfError,AllowNotModifiedResponse +type QueryOptions struct { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` + // If set, wait until query exceeds given index. Must be provided + // with MaxQueryTime. + MinQueryIndex uint64 `protobuf:"varint,2,opt,name=MinQueryIndex,proto3" json:"MinQueryIndex,omitempty"` + // Provided with MinQueryIndex to wait for change. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + MaxQueryTime types.Duration `protobuf:"bytes,3,opt,name=MaxQueryTime,proto3" json:"MaxQueryTime"` + // If set, any follower can service the request. Results + // may be arbitrarily stale. + AllowStale bool `protobuf:"varint,4,opt,name=AllowStale,proto3" json:"AllowStale,omitempty"` + // If set, the leader must verify leadership prior to + // servicing the request. Prevents a stale read. + RequireConsistent bool `protobuf:"varint,5,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` + // If set, the local agent may respond with an arbitrarily stale locally + // cached response. The semantics differ from AllowStale since the agent may + // be entirely partitioned from the servers and still considered "healthy" by + // operators. Stale responses from Servers are also arbitrarily stale, but can + // provide additional bounds on the last contact time from the leader. It's + // expected that servers that are partitioned are noticed and replaced in a + // timely way by operators while the same may not be true for client agents. + UseCache bool `protobuf:"varint,6,opt,name=UseCache,proto3" json:"UseCache,omitempty"` + // If set and AllowStale is true, will try first a stale + // read, and then will perform a consistent read if stale + // read is older than value. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + MaxStaleDuration types.Duration `protobuf:"bytes,7,opt,name=MaxStaleDuration,proto3" json:"MaxStaleDuration"` + // MaxAge limits how old a cached value will be returned if UseCache is true. + // If there is a cached response that is older than the MaxAge, it is treated + // as a cache miss and a new fetch invoked. If the fetch fails, the error is + // returned. Clients that wish to allow for stale results on error can set + // StaleIfError to a longer duration to change this behavior. It is ignored + // if the endpoint supports background refresh caching. See + // https://www.consul.io/api/index.html#agent-caching for more details. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + MaxAge types.Duration `protobuf:"bytes,8,opt,name=MaxAge,proto3" json:"MaxAge"` + // MustRevalidate forces the agent to fetch a fresh version of a cached + // resource or at least validate that the cached version is still fresh. It is + // implied by either max-age=0 or must-revalidate Cache-Control headers. It + // only makes sense when UseCache is true. We store it since MaxAge = 0 is the + // default unset value. + MustRevalidate bool `protobuf:"varint,9,opt,name=MustRevalidate,proto3" json:"MustRevalidate,omitempty"` + // StaleIfError specifies how stale the client will accept a cached response + // if the servers are unavailable to fetch a fresh one. Only makes sense when + // UseCache is true and MaxAge is set to a lower, non-zero value. It is + // ignored if the endpoint supports background refresh caching. See + // https://www.consul.io/api/index.html#agent-caching for more details. + StaleIfError types.Duration `protobuf:"bytes,10,opt,name=StaleIfError,proto3" json:"StaleIfError"` + // Filter specifies the go-bexpr filter expression to be used for + // filtering the data prior to returning a response + Filter string `protobuf:"bytes,11,opt,name=Filter,proto3" json:"Filter,omitempty"` +} + +func (m *QueryOptions) Reset() { *m = QueryOptions{} } +func (m *QueryOptions) String() string { return proto.CompactTextString(m) } +func (*QueryOptions) ProtoMessage() {} +func (*QueryOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{4} +} +func (m *QueryOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOptions.Merge(m, src) +} +func (m *QueryOptions) XXX_Size() int { + return m.Size() +} +func (m *QueryOptions) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOptions proto.InternalMessageInfo + +// QueryMeta allows a query response to include potentially +// useful metadata about a query +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryMeta +// output=common.gen.go +// name=Structs +// ignore-fields=NotModified,Backend +type QueryMeta struct { + // This is the index associated with the read + Index uint64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"` + // If AllowStale is used, this is time elapsed since + // last contact between the follower and leader. This + // can be used to gauge staleness. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + LastContact types.Duration `protobuf:"bytes,2,opt,name=LastContact,proto3" json:"LastContact"` + // Used to indicate if there is a known leader node + KnownLeader bool `protobuf:"varint,3,opt,name=KnownLeader,proto3" json:"KnownLeader,omitempty"` + // Consistencylevel returns the consistency used to serve the query + // Having `discovery_max_stale` on the agent can affect whether + // the request was served by a leader. + ConsistencyLevel string `protobuf:"bytes,4,opt,name=ConsistencyLevel,proto3" json:"ConsistencyLevel,omitempty"` + // ResultsFilteredByACLs is true when some of the query's results were + // filtered out by enforcing ACLs. It may be false because nothing was + // removed, or because the endpoint does not yet support this flag. + ResultsFilteredByACLs bool `protobuf:"varint,7,opt,name=ResultsFilteredByACLs,proto3" json:"ResultsFilteredByACLs,omitempty"` +} + +func (m *QueryMeta) Reset() { *m = QueryMeta{} } +func (m *QueryMeta) String() string { return proto.CompactTextString(m) } +func (*QueryMeta) ProtoMessage() {} +func (*QueryMeta) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{5} +} +func (m *QueryMeta) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMeta.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMeta) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMeta.Merge(m, src) +} +func (m *QueryMeta) XXX_Size() int { + return m.Size() +} +func (m *QueryMeta) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMeta.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMeta proto.InternalMessageInfo + +// EnterpriseMeta contains metadata that is only used by the Enterprise version +// of Consul. +type EnterpriseMeta struct { + // Namespace in which the entity exists. + Namespace string `protobuf:"bytes,1,opt,name=Namespace,proto3" json:"Namespace,omitempty"` + // Partition in which the entity exists. + Partition string `protobuf:"bytes,2,opt,name=Partition,proto3" json:"Partition,omitempty"` +} + +func (m *EnterpriseMeta) Reset() { *m = EnterpriseMeta{} } +func (m *EnterpriseMeta) String() string { return proto.CompactTextString(m) } +func (*EnterpriseMeta) ProtoMessage() {} +func (*EnterpriseMeta) Descriptor() ([]byte, []int) { + return fileDescriptor_a834024536145257, []int{6} +} +func (m *EnterpriseMeta) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnterpriseMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnterpriseMeta) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnterpriseMeta.Merge(m, src) +} +func (m *EnterpriseMeta) XXX_Size() int { + return m.Size() +} +func (m *EnterpriseMeta) XXX_DiscardUnknown() { + xxx_messageInfo_EnterpriseMeta.DiscardUnknown(m) +} + +var xxx_messageInfo_EnterpriseMeta proto.InternalMessageInfo + +func init() { + proto.RegisterType((*RaftIndex)(nil), "commongogo.RaftIndex") + proto.RegisterType((*TargetDatacenter)(nil), "commongogo.TargetDatacenter") + proto.RegisterType((*WriteRequest)(nil), "commongogo.WriteRequest") + proto.RegisterType((*ReadRequest)(nil), "commongogo.ReadRequest") + proto.RegisterType((*QueryOptions)(nil), "commongogo.QueryOptions") + proto.RegisterType((*QueryMeta)(nil), "commongogo.QueryMeta") + proto.RegisterType((*EnterpriseMeta)(nil), "commongogo.EnterpriseMeta") +} + +func init() { proto.RegisterFile("proto/pbcommongogo/common.proto", fileDescriptor_a834024536145257) } + +var fileDescriptor_a834024536145257 = []byte{ + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x4d, 0x4a, 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, 0x7f, 0x99, 0x85, 0xd3, 0x0b, 0xb3, 0x78, 0x76, 0x61, + 0x16, 0x7f, 0x5e, 0x98, 0xc5, 0x6f, 0x63, 0xb3, 0xf0, 0x7d, 0x6c, 0x16, 0xce, 0xc6, 0x66, 0xe1, + 0xc7, 0xd8, 0x2c, 0x7c, 0x6a, 0xf8, 0x81, 0xea, 0x27, 0xdd, 0x86, 0xcb, 0x07, 0x76, 0x9f, 0xc9, + 0x7e, 0xe0, 0x72, 0x11, 0xdb, 0x2e, 0x8f, 0x64, 0x12, 0xda, 0xd3, 0x3f, 0xc2, 0x6e, 0x59, 0x63, + 0x2f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x17, 0x8b, 0xc5, 0x82, 0x25, 0x05, 0x00, 0x00, +} + +func (m *RaftIndex) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ModifyIndex != 0 { + i = encodeVarintCommon(dAtA, i, uint64(m.ModifyIndex)) + i-- + dAtA[i] = 0x10 + } + if m.CreateIndex != 0 { + i = encodeVarintCommon(dAtA, i, uint64(m.CreateIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TargetDatacenter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TargetDatacenter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TargetDatacenter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Datacenter) > 0 { + i -= len(m.Datacenter) + copy(dAtA[i:], m.Datacenter) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Datacenter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WriteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ReadRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RequireConsistent { + i-- + if m.RequireConsistent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Filter) > 0 { + i -= len(m.Filter) + copy(dAtA[i:], m.Filter) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Filter))) + i-- + dAtA[i] = 0x5a + } + { + size, err := m.StaleIfError.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + if m.MustRevalidate { + i-- + if m.MustRevalidate { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + { + size, err := m.MaxAge.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.MaxStaleDuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if m.UseCache { + i-- + if m.UseCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.RequireConsistent { + i-- + if m.RequireConsistent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.AllowStale { + i-- + if m.AllowStale { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size, err := m.MaxQueryTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.MinQueryIndex != 0 { + i = encodeVarintCommon(dAtA, i, uint64(m.MinQueryIndex)) + i-- + dAtA[i] = 0x10 + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMeta) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryMeta) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResultsFilteredByACLs { + i-- + if m.ResultsFilteredByACLs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.ConsistencyLevel) > 0 { + i -= len(m.ConsistencyLevel) + copy(dAtA[i:], m.ConsistencyLevel) + i = encodeVarintCommon(dAtA, i, uint64(len(m.ConsistencyLevel))) + i-- + dAtA[i] = 0x22 + } + if m.KnownLeader { + i-- + if m.KnownLeader { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + { + size, err := m.LastContact.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Index != 0 { + i = encodeVarintCommon(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnterpriseMeta) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnterpriseMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Partition) > 0 { + i -= len(m.Partition) + copy(dAtA[i:], m.Partition) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Partition))) + i-- + dAtA[i] = 0x12 + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintCommon(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCommon(dAtA []byte, offset int, v uint64) int { + offset -= sovCommon(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RaftIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreateIndex != 0 { + n += 1 + sovCommon(uint64(m.CreateIndex)) + } + if m.ModifyIndex != 0 { + n += 1 + sovCommon(uint64(m.ModifyIndex)) + } + return n +} + +func (m *TargetDatacenter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Datacenter) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + return n +} + +func (m *WriteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Token) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + return n +} + +func (m *ReadRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Token) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + if m.RequireConsistent { + n += 2 + } + return n +} + +func (m *QueryOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Token) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + if m.MinQueryIndex != 0 { + n += 1 + sovCommon(uint64(m.MinQueryIndex)) + } + l = m.MaxQueryTime.Size() + n += 1 + l + sovCommon(uint64(l)) + if m.AllowStale { + n += 2 + } + if m.RequireConsistent { + n += 2 + } + if m.UseCache { + n += 2 + } + l = m.MaxStaleDuration.Size() + n += 1 + l + sovCommon(uint64(l)) + l = m.MaxAge.Size() + n += 1 + l + sovCommon(uint64(l)) + if m.MustRevalidate { + n += 2 + } + l = m.StaleIfError.Size() + n += 1 + l + sovCommon(uint64(l)) + l = len(m.Filter) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + return n +} + +func (m *QueryMeta) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovCommon(uint64(m.Index)) + } + l = m.LastContact.Size() + n += 1 + l + sovCommon(uint64(l)) + if m.KnownLeader { + n += 2 + } + l = len(m.ConsistencyLevel) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + if m.ResultsFilteredByACLs { + n += 2 + } + return n +} + +func (m *EnterpriseMeta) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Namespace) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + l = len(m.Partition) + if l > 0 { + n += 1 + l + sovCommon(uint64(l)) + } + return n +} + +func sovCommon(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCommon(x uint64) (n int) { + return sovCommon(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RaftIndex) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftIndex: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateIndex", wireType) + } + m.CreateIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreateIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ModifyIndex", wireType) + } + m.ModifyIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ModifyIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TargetDatacenter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TargetDatacenter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TargetDatacenter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Datacenter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Datacenter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WriteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReadRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReadRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequireConsistent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RequireConsistent = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinQueryIndex", wireType) + } + m.MinQueryIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinQueryIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxQueryTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxQueryTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowStale", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowStale = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequireConsistent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RequireConsistent = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseCache", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UseCache = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxStaleDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxStaleDuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAge", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxAge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MustRevalidate", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MustRevalidate = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StaleIfError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StaleIfError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMeta) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryMeta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMeta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastContact", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastContact.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KnownLeader", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.KnownLeader = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsistencyLevel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsistencyLevel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResultsFilteredByACLs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ResultsFilteredByACLs = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnterpriseMeta) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnterpriseMeta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnterpriseMeta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommon + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommon + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommon + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Partition = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommon(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommon + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCommon(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommon + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommon + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommon + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCommon + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCommon + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCommon + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCommon = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCommon = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCommon = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proto/pbcommongogo/common.proto b/proto/pbcommongogo/common.proto new file mode 100644 index 000000000..30cd847f3 --- /dev/null +++ b/proto/pbcommongogo/common.proto @@ -0,0 +1,182 @@ +syntax = "proto3"; + +package commongogo; + +option go_package = "github.com/hashicorp/consul/proto/pbcommongogo"; + +import "google/protobuf/duration.proto"; +// Go Modules now includes the version in the filepath for packages within GOPATH/pkg/mode +// Therefore unless we want to hardcode a version here like +// github.com/gogo/protobuf@v1.3.0/gogoproto/gogo.proto then the only other choice is to +// have a more relative import and pass the right import path to protoc. I don't like it +// but its necessary. +import "gogoproto/gogo.proto"; + +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_sizecache_all) = false; + +// RaftIndex is used to track the index used while creating +// or modifying a given struct type. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.RaftIndex +// output=common.gen.go +// name=Structs +message RaftIndex { + uint64 CreateIndex = 1 [(gogoproto.moretags) = "bexpr:\"-\""]; + uint64 ModifyIndex = 2 [(gogoproto.moretags) = "bexpr:\"-\""]; +} + +// TargetDatacenter is intended to be used within other messages used for RPC routing +// amongst the various Consul datacenters +message TargetDatacenter { + string Datacenter = 1; +} + +message WriteRequest { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + string Token = 1; +} + +// ReadRequest is a type that may be embedded into any requests for read +// operations. +// It is a replacement for QueryOptions now that we no longer need any of those +// fields because we are moving away from using blocking queries. +// It is also similar to WriteRequest. It is a separate type so that in the +// future we can introduce fields that may only be relevant for reads. +message ReadRequest { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + string Token = 1; + + // RequireConsistent indicates that the request must be sent to the leader. + bool RequireConsistent = 2; +} + + +// QueryOptions is used to specify various flags for read queries +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryOptions +// output=common.gen.go +// name=Structs +// ignore-fields=StaleIfError,AllowNotModifiedResponse +message QueryOptions { + // Token is the ACL token ID. If not provided, the 'anonymous' + // token is assumed for backwards compatibility. + string Token = 1; + + // If set, wait until query exceeds given index. Must be provided + // with MaxQueryTime. + uint64 MinQueryIndex = 2; + + // Provided with MinQueryIndex to wait for change. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + google.protobuf.Duration MaxQueryTime = 3 + [(gogoproto.nullable) = false]; + + // If set, any follower can service the request. Results + // may be arbitrarily stale. + bool AllowStale = 4; + + // If set, the leader must verify leadership prior to + // servicing the request. Prevents a stale read. + bool RequireConsistent = 5; + + // If set, the local agent may respond with an arbitrarily stale locally + // cached response. The semantics differ from AllowStale since the agent may + // be entirely partitioned from the servers and still considered "healthy" by + // operators. Stale responses from Servers are also arbitrarily stale, but can + // provide additional bounds on the last contact time from the leader. It's + // expected that servers that are partitioned are noticed and replaced in a + // timely way by operators while the same may not be true for client agents. + bool UseCache = 6; + + // If set and AllowStale is true, will try first a stale + // read, and then will perform a consistent read if stale + // read is older than value. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + google.protobuf.Duration MaxStaleDuration = 7 + [(gogoproto.nullable) = false]; + + // MaxAge limits how old a cached value will be returned if UseCache is true. + // If there is a cached response that is older than the MaxAge, it is treated + // as a cache miss and a new fetch invoked. If the fetch fails, the error is + // returned. Clients that wish to allow for stale results on error can set + // StaleIfError to a longer duration to change this behavior. It is ignored + // if the endpoint supports background refresh caching. See + // https://www.consul.io/api/index.html#agent-caching for more details. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + google.protobuf.Duration MaxAge = 8 + [(gogoproto.nullable) = false]; + + // MustRevalidate forces the agent to fetch a fresh version of a cached + // resource or at least validate that the cached version is still fresh. It is + // implied by either max-age=0 or must-revalidate Cache-Control headers. It + // only makes sense when UseCache is true. We store it since MaxAge = 0 is the + // default unset value. + bool MustRevalidate = 9; + + // StaleIfError specifies how stale the client will accept a cached response + // if the servers are unavailable to fetch a fresh one. Only makes sense when + // UseCache is true and MaxAge is set to a lower, non-zero value. It is + // ignored if the endpoint supports background refresh caching. See + // https://www.consul.io/api/index.html#agent-caching for more details. + google.protobuf.Duration StaleIfError = 10 + [(gogoproto.nullable) = false]; + + // Filter specifies the go-bexpr filter expression to be used for + // filtering the data prior to returning a response + string Filter = 11; +} + +// QueryMeta allows a query response to include potentially +// useful metadata about a query +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.QueryMeta +// output=common.gen.go +// name=Structs +// ignore-fields=NotModified,Backend +message QueryMeta { + // This is the index associated with the read + uint64 Index = 1; + + // If AllowStale is used, this is time elapsed since + // last contact between the follower and leader. This + // can be used to gauge staleness. + // mog: func-to=structs.DurationFromProtoGogo func-from=structs.DurationToProtoGogo + google.protobuf.Duration LastContact = 2 + [(gogoproto.nullable) = false]; + + // Used to indicate if there is a known leader node + bool KnownLeader = 3; + + // Consistencylevel returns the consistency used to serve the query + // Having `discovery_max_stale` on the agent can affect whether + // the request was served by a leader. + string ConsistencyLevel = 4; + + // Reserved for NotModified and Backend. + reserved 5, 6; + + // ResultsFilteredByACLs is true when some of the query's results were + // filtered out by enforcing ACLs. It may be false because nothing was + // removed, or because the endpoint does not yet support this flag. + bool ResultsFilteredByACLs = 7; +} + +// EnterpriseMeta contains metadata that is only used by the Enterprise version +// of Consul. +message EnterpriseMeta { + // Namespace in which the entity exists. + string Namespace = 1; + // Partition in which the entity exists. + string Partition = 2; +} diff --git a/proto/pbcommongogo/common_oss.go b/proto/pbcommongogo/common_oss.go new file mode 100644 index 000000000..d24b27b69 --- /dev/null +++ b/proto/pbcommongogo/common_oss.go @@ -0,0 +1,25 @@ +//go:build !consulent +// +build !consulent + +package pbcommongogo + +import ( + "github.com/hashicorp/consul/agent/structs" +) + +var DefaultEnterpriseMeta = EnterpriseMeta{} + +func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) *EnterpriseMeta { + return &EnterpriseMeta{} +} + +func EnterpriseMetaToStructs(s *EnterpriseMeta, t *structs.EnterpriseMeta) { + if s == nil { + return + } +} +func EnterpriseMetaFromStructs(t *structs.EnterpriseMeta, s *EnterpriseMeta) { + if s == nil { + return + } +} diff --git a/proto/pbconnect/connect.gen.go b/proto/pbconnect/connect.gen.go new file mode 100644 index 000000000..433a065b7 --- /dev/null +++ b/proto/pbconnect/connect.gen.go @@ -0,0 +1,116 @@ +// Code generated by mog. DO NOT EDIT. + +package pbconnect + +import "github.com/hashicorp/consul/agent/structs" + +func CARootToStructsCARoot(s *CARoot, t *structs.CARoot) { + if s == nil { + return + } + t.ID = s.ID + t.Name = s.Name + t.SerialNumber = s.SerialNumber + t.SigningKeyID = s.SigningKeyID + t.ExternalTrustDomain = s.ExternalTrustDomain + t.NotBefore = structs.TimeFromProtoGogo(s.NotBefore) + t.NotAfter = structs.TimeFromProtoGogo(s.NotAfter) + t.RootCert = s.RootCert + t.IntermediateCerts = s.IntermediateCerts + t.SigningCert = s.SigningCert + t.SigningKey = s.SigningKey + t.Active = s.Active + t.RotatedOutAt = structs.TimeFromProtoGogo(s.RotatedOutAt) + t.PrivateKeyType = s.PrivateKeyType + t.PrivateKeyBits = int(s.PrivateKeyBits) + t.RaftIndex = RaftIndexTo(s.RaftIndex) +} +func CARootFromStructsCARoot(t *structs.CARoot, s *CARoot) { + if s == nil { + return + } + s.ID = t.ID + s.Name = t.Name + s.SerialNumber = t.SerialNumber + s.SigningKeyID = t.SigningKeyID + s.ExternalTrustDomain = t.ExternalTrustDomain + s.NotBefore = structs.TimeToProtoGogo(t.NotBefore) + s.NotAfter = structs.TimeToProtoGogo(t.NotAfter) + s.RootCert = t.RootCert + s.IntermediateCerts = t.IntermediateCerts + s.SigningCert = t.SigningCert + s.SigningKey = t.SigningKey + s.Active = t.Active + s.RotatedOutAt = structs.TimeToProtoGogo(t.RotatedOutAt) + s.PrivateKeyType = t.PrivateKeyType + s.PrivateKeyBits = int32(t.PrivateKeyBits) + s.RaftIndex = RaftIndexFrom(t.RaftIndex) +} +func CARootsToStructsIndexedCARoots(s *CARoots, t *structs.IndexedCARoots) { + if s == nil { + return + } + t.ActiveRootID = s.ActiveRootID + t.TrustDomain = s.TrustDomain + { + t.Roots = make([]*structs.CARoot, len(s.Roots)) + for i := range s.Roots { + if s.Roots[i] != nil { + var x structs.CARoot + CARootToStructsCARoot(s.Roots[i], &x) + t.Roots[i] = &x + } + } + } + t.QueryMeta = QueryMetaTo(s.QueryMeta) +} +func CARootsFromStructsIndexedCARoots(t *structs.IndexedCARoots, s *CARoots) { + if s == nil { + return + } + s.ActiveRootID = t.ActiveRootID + s.TrustDomain = t.TrustDomain + { + s.Roots = make([]*CARoot, len(t.Roots)) + for i := range t.Roots { + if t.Roots[i] != nil { + var x CARoot + CARootFromStructsCARoot(t.Roots[i], &x) + s.Roots[i] = &x + } + } + } + s.QueryMeta = QueryMetaFrom(t.QueryMeta) +} +func IssuedCertToStructsIssuedCert(s *IssuedCert, t *structs.IssuedCert) { + if s == nil { + return + } + t.SerialNumber = s.SerialNumber + t.CertPEM = s.CertPEM + t.PrivateKeyPEM = s.PrivateKeyPEM + t.Service = s.Service + t.ServiceURI = s.ServiceURI + t.Agent = s.Agent + t.AgentURI = s.AgentURI + t.ValidAfter = structs.TimeFromProtoGogo(s.ValidAfter) + t.ValidBefore = structs.TimeFromProtoGogo(s.ValidBefore) + t.EnterpriseMeta = EnterpriseMetaTo(s.EnterpriseMeta) + t.RaftIndex = RaftIndexTo(s.RaftIndex) +} +func IssuedCertFromStructsIssuedCert(t *structs.IssuedCert, s *IssuedCert) { + if s == nil { + return + } + s.SerialNumber = t.SerialNumber + s.CertPEM = t.CertPEM + s.PrivateKeyPEM = t.PrivateKeyPEM + s.Service = t.Service + s.ServiceURI = t.ServiceURI + s.Agent = t.Agent + s.AgentURI = t.AgentURI + s.ValidAfter = structs.TimeToProtoGogo(t.ValidAfter) + s.ValidBefore = structs.TimeToProtoGogo(t.ValidBefore) + s.EnterpriseMeta = EnterpriseMetaFrom(t.EnterpriseMeta) + s.RaftIndex = RaftIndexFrom(t.RaftIndex) +} diff --git a/proto/pbconnect/connect.go b/proto/pbconnect/connect.go index f499ecc31..c61ca7c8a 100644 --- a/proto/pbconnect/connect.go +++ b/proto/pbconnect/connect.go @@ -2,184 +2,77 @@ package pbconnect import ( "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbcommon" - "github.com/hashicorp/consul/proto/pbutil" + "github.com/hashicorp/consul/proto/pbcommongogo" ) -func CARootsToStructs(s *CARoots) (*structs.IndexedCARoots, error) { - if s == nil { - return nil, nil - } - var t structs.IndexedCARoots - t.ActiveRootID = s.ActiveRootID - t.TrustDomain = s.TrustDomain - t.Roots = make([]*structs.CARoot, len(s.Roots)) - for i := range s.Roots { - root, err := CARootToStructs(s.Roots[i]) - if err != nil { - return &t, err - } - t.Roots[i] = root - } - queryMeta, err := pbcommon.QueryMetaToStructs(s.QueryMeta) - if err != nil { - return &t, nil - } - t.QueryMeta = queryMeta - return &t, nil +func QueryMetaFrom(f structs.QueryMeta) *pbcommongogo.QueryMeta { + t := new(pbcommongogo.QueryMeta) + pbcommongogo.QueryMetaFromStructs(&f, t) + return t } -func NewCARootsFromStructs(s *structs.IndexedCARoots) (*CARoots, error) { - if s == nil { - return nil, nil - } - var t CARoots - t.ActiveRootID = s.ActiveRootID - t.TrustDomain = s.TrustDomain - t.Roots = make([]*CARoot, len(s.Roots)) - for i := range s.Roots { - root, err := NewCARootFromStructs(s.Roots[i]) - if err != nil { - return &t, err - } - t.Roots[i] = root - } - queryMeta, err := pbcommon.NewQueryMetaFromStructs(s.QueryMeta) - if err != nil { - return &t, nil - } - t.QueryMeta = queryMeta - return &t, nil +func QueryMetaTo(f *pbcommongogo.QueryMeta) structs.QueryMeta { + t := new(structs.QueryMeta) + pbcommongogo.QueryMetaToStructs(f, t) + return *t } -func CARootToStructs(s *CARoot) (*structs.CARoot, error) { - if s == nil { - return nil, nil - } - var t structs.CARoot - t.ID = s.ID - t.Name = s.Name - t.SerialNumber = s.SerialNumber - t.SigningKeyID = s.SigningKeyID - t.ExternalTrustDomain = s.ExternalTrustDomain - notBefore, err := pbutil.TimeFromProto(s.NotBefore) - if err != nil { - return &t, nil - } - t.NotBefore = notBefore - notAfter, err := pbutil.TimeFromProto(s.NotAfter) - if err != nil { - return &t, nil - } - t.NotAfter = notAfter - t.RootCert = s.RootCert - if len(s.IntermediateCerts) > 0 { - t.IntermediateCerts = make([]string, len(s.IntermediateCerts)) - copy(t.IntermediateCerts, s.IntermediateCerts) - } - t.SigningCert = s.SigningCert - t.SigningKey = s.SigningKey - t.Active = s.Active - rotatedOutAt, err := pbutil.TimeFromProto(s.RotatedOutAt) - if err != nil { - return &t, nil - } - t.RotatedOutAt = rotatedOutAt - t.PrivateKeyType = s.PrivateKeyType - t.PrivateKeyBits = int(s.PrivateKeyBits) - t.RaftIndex = pbcommon.RaftIndexToStructs(s.RaftIndex) - return &t, nil +func RaftIndexFrom(f structs.RaftIndex) *pbcommongogo.RaftIndex { + t := new(pbcommongogo.RaftIndex) + pbcommongogo.RaftIndexFromStructs(&f, t) + return t } -func NewCARootFromStructs(s *structs.CARoot) (*CARoot, error) { - if s == nil { - return nil, nil - } - var t CARoot - t.ID = s.ID - t.Name = s.Name - t.SerialNumber = s.SerialNumber - t.SigningKeyID = s.SigningKeyID - t.ExternalTrustDomain = s.ExternalTrustDomain - notBefore, err := pbutil.TimeToProto(s.NotBefore) - if err != nil { - return &t, err - } - t.NotBefore = notBefore - notAfter, err := pbutil.TimeToProto(s.NotAfter) - if err != nil { - return &t, err - } - t.NotAfter = notAfter - t.RootCert = s.RootCert - if len(s.IntermediateCerts) > 0 { - t.IntermediateCerts = make([]string, len(s.IntermediateCerts)) - copy(t.IntermediateCerts, s.IntermediateCerts) - } - t.SigningCert = s.SigningCert - t.SigningKey = s.SigningKey - t.Active = s.Active - rotatedOutAt, err := pbutil.TimeToProto(s.RotatedOutAt) - if err != nil { - return &t, err - } - t.RotatedOutAt = rotatedOutAt - t.PrivateKeyType = s.PrivateKeyType - t.PrivateKeyBits = int32(s.PrivateKeyBits) - t.RaftIndex = pbcommon.NewRaftIndexFromStructs(s.RaftIndex) - return &t, nil +func RaftIndexTo(f *pbcommongogo.RaftIndex) structs.RaftIndex { + t := new(structs.RaftIndex) + pbcommongogo.RaftIndexToStructs(f, t) + return *t } -func IssuedCertToStructs(s *IssuedCert) (*structs.IssuedCert, error) { - if s == nil { - return nil, nil - } - var t structs.IssuedCert - t.SerialNumber = s.SerialNumber - t.CertPEM = s.CertPEM - t.PrivateKeyPEM = s.PrivateKeyPEM - t.Service = s.Service - t.ServiceURI = s.ServiceURI - t.Agent = s.Agent - t.AgentURI = s.AgentURI - validAfter, err := pbutil.TimeFromProto(s.ValidAfter) - if err != nil { - return &t, err - } - t.ValidAfter = validAfter - validBefore, err := pbutil.TimeFromProto(s.ValidBefore) - if err != nil { - return &t, err - } - t.ValidBefore = validBefore - t.EnterpriseMeta = pbcommon.EnterpriseMetaToStructs(s.EnterpriseMeta) - t.RaftIndex = pbcommon.RaftIndexToStructs(s.RaftIndex) - return &t, nil +func EnterpriseMetaFrom(f structs.EnterpriseMeta) *pbcommongogo.EnterpriseMeta { + t := new(pbcommongogo.EnterpriseMeta) + pbcommongogo.EnterpriseMetaFromStructs(&f, t) + return t } -func NewIssuedCertFromStructs(s *structs.IssuedCert) (*IssuedCert, error) { - if s == nil { - return nil, nil - } - var t IssuedCert - t.SerialNumber = s.SerialNumber - t.CertPEM = s.CertPEM - t.PrivateKeyPEM = s.PrivateKeyPEM - t.Service = s.Service - t.ServiceURI = s.ServiceURI - t.Agent = s.Agent - t.AgentURI = s.AgentURI - validAfter, err := pbutil.TimeToProto(s.ValidAfter) - if err != nil { - return &t, err - } - t.ValidAfter = validAfter - validBefore, err := pbutil.TimeToProto(s.ValidBefore) - if err != nil { - return &t, err - } - t.ValidBefore = validBefore - t.EnterpriseMeta = pbcommon.NewEnterpriseMetaFromStructs(s.EnterpriseMeta) - t.RaftIndex = pbcommon.NewRaftIndexFromStructs(s.RaftIndex) - return &t, nil +func EnterpriseMetaTo(f *pbcommongogo.EnterpriseMeta) structs.EnterpriseMeta { + t := new(structs.EnterpriseMeta) + pbcommongogo.EnterpriseMetaToStructs(f, t) + return *t +} + +func NewIssuedCertFromStructs(in *structs.IssuedCert) (*IssuedCert, error) { + t := new(IssuedCert) + IssuedCertFromStructsIssuedCert(in, t) + return t, nil +} + +func NewCARootsFromStructs(in *structs.IndexedCARoots) (*CARoots, error) { + t := new(CARoots) + CARootsFromStructsIndexedCARoots(in, t) + return t, nil +} + +func CARootsToStructs(in *CARoots) (*structs.IndexedCARoots, error) { + t := new(structs.IndexedCARoots) + CARootsToStructsIndexedCARoots(in, t) + return t, nil +} + +func NewCARootFromStructs(in *structs.CARoot) (*CARoot, error) { + t := new(CARoot) + CARootFromStructsCARoot(in, t) + return t, nil +} + +func CARootToStructs(in *CARoot) (*structs.CARoot, error) { + t := new(structs.CARoot) + CARootToStructsCARoot(in, t) + return t, nil +} + +func IssuedCertToStructs(in *IssuedCert) (*structs.IssuedCert, error) { + t := new(structs.IssuedCert) + IssuedCertToStructsIssuedCert(in, t) + return t, nil } diff --git a/proto/pbconnect/connect.pb.go b/proto/pbconnect/connect.pb.go index 73081a696..64a6738f9 100644 --- a/proto/pbconnect/connect.pb.go +++ b/proto/pbconnect/connect.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" - pbcommon "github.com/hashicorp/consul/proto/pbcommon" + pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" io "io" math "math" math_bits "math/bits" @@ -25,6 +25,12 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // CARoots is the list of all currently trusted CA Roots. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.IndexedCARoots +// output=connect.gen.go +// name=StructsIndexedCARoots type CARoots struct { // ActiveRootID is the ID of a root in Roots that is the active CA root. // Other roots are still valid if they're in the Roots list but are in @@ -57,10 +63,11 @@ type CARoots struct { Roots []*CARoot `protobuf:"bytes,3,rep,name=Roots,proto3" json:"Roots,omitempty"` // QueryMeta here is mainly used to contain the latest Raft Index that could // be used to perform a blocking query. - QueryMeta *pbcommon.QueryMeta `protobuf:"bytes,4,opt,name=QueryMeta,proto3" json:"QueryMeta,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // mog: func-to=QueryMetaTo func-from=QueryMetaFrom + QueryMeta *pbcommongogo.QueryMeta `protobuf:"bytes,4,opt,name=QueryMeta,proto3" json:"QueryMeta,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CARoots) Reset() { *m = CARoots{} } @@ -117,13 +124,20 @@ func (m *CARoots) GetRoots() []*CARoot { return nil } -func (m *CARoots) GetQueryMeta() *pbcommon.QueryMeta { +func (m *CARoots) GetQueryMeta() *pbcommongogo.QueryMeta { if m != nil { return m.QueryMeta } return nil } +// CARoot is the trusted CA Root. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.CARoot +// output=connect.gen.go +// name=StructsCARoot type CARoot struct { // ID is a globally unique ID (UUID) representing this CA root. ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -146,8 +160,10 @@ type CARoot struct { // future flexibility. ExternalTrustDomain string `protobuf:"bytes,5,opt,name=ExternalTrustDomain,proto3" json:"ExternalTrustDomain,omitempty"` // Time validity bounds. + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo NotBefore *types.Timestamp `protobuf:"bytes,6,opt,name=NotBefore,proto3" json:"NotBefore,omitempty"` - NotAfter *types.Timestamp `protobuf:"bytes,7,opt,name=NotAfter,proto3" json:"NotAfter,omitempty"` + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo + NotAfter *types.Timestamp `protobuf:"bytes,7,opt,name=NotAfter,proto3" json:"NotAfter,omitempty"` // RootCert is the PEM-encoded public certificate. RootCert string `protobuf:"bytes,8,opt,name=RootCert,proto3" json:"RootCert,omitempty"` // IntermediateCerts is a list of PEM-encoded intermediate certs to @@ -166,6 +182,7 @@ type CARoot struct { // RotatedOutAt is the time at which this CA was removed from the state. // This will only be set on roots that have been rotated out from being the // active root. + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo RotatedOutAt *types.Timestamp `protobuf:"bytes,13,opt,name=RotatedOutAt,proto3" json:"RotatedOutAt,omitempty"` // PrivateKeyType is the type of the private key used to sign certificates. It // may be "rsa" or "ec". This is provided as a convenience to avoid parsing @@ -174,11 +191,13 @@ type CARoot struct { // PrivateKeyBits is the length of the private key used to sign certificates. // This is provided as a convenience to avoid parsing the public key from the // certificate to infer the type. - PrivateKeyBits int32 `protobuf:"varint,15,opt,name=PrivateKeyBits,proto3" json:"PrivateKeyBits,omitempty"` - RaftIndex *pbcommon.RaftIndex `protobuf:"bytes,16,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // mog: func-to=int func-from=int32 + PrivateKeyBits int32 `protobuf:"varint,15,opt,name=PrivateKeyBits,proto3" json:"PrivateKeyBits,omitempty"` + // mog: func-to=RaftIndexTo func-from=RaftIndexFrom + RaftIndex *pbcommongogo.RaftIndex `protobuf:"bytes,16,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CARoot) Reset() { *m = CARoot{} } @@ -319,13 +338,19 @@ func (m *CARoot) GetPrivateKeyBits() int32 { return 0 } -func (m *CARoot) GetRaftIndex() *pbcommon.RaftIndex { +func (m *CARoot) GetRaftIndex() *pbcommongogo.RaftIndex { if m != nil { return m.RaftIndex } return nil } +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.IssuedCert +// output=connect.gen.go +// name=StructsIssuedCert type IssuedCert struct { // SerialNumber is the unique serial number for this certificate. // This is encoded in standard hex separated by :. @@ -345,14 +370,18 @@ type IssuedCert struct { AgentURI string `protobuf:"bytes,7,opt,name=AgentURI,proto3" json:"AgentURI,omitempty"` // ValidAfter and ValidBefore are the validity periods for the // certificate. - ValidAfter *types.Timestamp `protobuf:"bytes,8,opt,name=ValidAfter,proto3" json:"ValidAfter,omitempty"` + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo + ValidAfter *types.Timestamp `protobuf:"bytes,8,opt,name=ValidAfter,proto3" json:"ValidAfter,omitempty"` + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo ValidBefore *types.Timestamp `protobuf:"bytes,9,opt,name=ValidBefore,proto3" json:"ValidBefore,omitempty"` // EnterpriseMeta is the Consul Enterprise specific metadata - EnterpriseMeta *pbcommon.EnterpriseMeta `protobuf:"bytes,10,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` - RaftIndex *pbcommon.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // mog: func-to=EnterpriseMetaTo func-from=EnterpriseMetaFrom + EnterpriseMeta *pbcommongogo.EnterpriseMeta `protobuf:"bytes,10,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta,omitempty"` + // mog: func-to=RaftIndexTo func-from=RaftIndexFrom + RaftIndex *pbcommongogo.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3" json:"RaftIndex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *IssuedCert) Reset() { *m = IssuedCert{} } @@ -451,14 +480,14 @@ func (m *IssuedCert) GetValidBefore() *types.Timestamp { return nil } -func (m *IssuedCert) GetEnterpriseMeta() *pbcommon.EnterpriseMeta { +func (m *IssuedCert) GetEnterpriseMeta() *pbcommongogo.EnterpriseMeta { if m != nil { return m.EnterpriseMeta } return nil } -func (m *IssuedCert) GetRaftIndex() *pbcommon.RaftIndex { +func (m *IssuedCert) GetRaftIndex() *pbcommongogo.RaftIndex { if m != nil { return m.RaftIndex } @@ -474,49 +503,49 @@ func init() { func init() { proto.RegisterFile("proto/pbconnect/connect.proto", fileDescriptor_80627e709958eb04) } var fileDescriptor_80627e709958eb04 = []byte{ - // 659 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdd, 0x6a, 0xdb, 0x4a, - 0x10, 0x3e, 0x8a, 0x7f, 0x35, 0x4e, 0x9c, 0x93, 0x3d, 0x87, 0xb0, 0xf8, 0x70, 0x5c, 0x61, 0xda, - 0x62, 0x68, 0xb1, 0x4a, 0x0a, 0xa5, 0x94, 0x36, 0xe0, 0xc4, 0xb9, 0x10, 0x21, 0x6e, 0xba, 0x49, - 0x7b, 0xd1, 0x3b, 0xd9, 0x1e, 0x3b, 0x0b, 0x96, 0xd6, 0xac, 0x56, 0x21, 0x7e, 0x93, 0xbe, 0x41, - 0x1f, 0xa5, 0xbd, 0xec, 0x23, 0x94, 0xf4, 0x39, 0x0a, 0x65, 0x57, 0x92, 0x2d, 0xb9, 0x05, 0x5f, - 0x79, 0xe7, 0x9b, 0x6f, 0x46, 0x33, 0xfb, 0x7d, 0x5e, 0xf8, 0x7f, 0x21, 0x85, 0x12, 0xee, 0x62, - 0x34, 0x16, 0x61, 0x88, 0x63, 0xe5, 0xa6, 0xbf, 0x3d, 0x83, 0x93, 0x5a, 0x1a, 0xb6, 0x1e, 0xcc, - 0x84, 0x98, 0xcd, 0xd1, 0x35, 0xf0, 0x28, 0x9e, 0xba, 0x8a, 0x07, 0x18, 0x29, 0x3f, 0x58, 0x24, - 0xcc, 0xd6, 0x7f, 0xeb, 0x46, 0x41, 0x20, 0x42, 0x37, 0xf9, 0x49, 0x92, 0x9d, 0xcf, 0x16, 0xd4, - 0x4e, 0xfb, 0x4c, 0x08, 0x15, 0x91, 0x0e, 0xec, 0xf6, 0xc7, 0x8a, 0xdf, 0xa2, 0x0e, 0xb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0x73, 0x08, 0xf9, 0x17, 0x2a, - 0xfd, 0x19, 0x86, 0xca, 0xf8, 0xcf, 0x66, 0x49, 0xa0, 0x7d, 0x62, 0x0e, 0xba, 0xa6, 0x96, 0xf8, - 0x24, 0x8b, 0xc9, 0x2b, 0x80, 0x0f, 0xfe, 0x9c, 0x4f, 0x12, 0xf7, 0xd5, 0xb7, 0xaa, 0x93, 0x63, - 0x93, 0xd7, 0xd0, 0x30, 0x51, 0xea, 0x79, 0x7b, 0x6b, 0x71, 0x9e, 0x4e, 0x8e, 0xa1, 0x79, 0xa6, - 0x8d, 0xb8, 0x90, 0x3c, 0x42, 0xf3, 0x1c, 0x80, 0x69, 0x70, 0x98, 0xc9, 0x51, 0xcc, 0xb2, 0x0d, - 0x76, 0x51, 0xc9, 0xc6, 0x76, 0x25, 0x4f, 0xde, 0x7c, 0xbd, 0x6f, 0x5b, 0xdf, 0xee, 0xdb, 0xd6, - 0xf7, 0xfb, 0xb6, 0xf5, 0xe9, 0x47, 0xfb, 0xaf, 0x8f, 0x4f, 0x66, 0x5c, 0xdd, 0xc4, 0x23, 0x5d, - 0xe5, 0xde, 0xf8, 0xd1, 0x0d, 0x1f, 0x0b, 0xb9, 0xd0, 0x0f, 0x6e, 0x14, 0xcf, 0xdd, 0x8d, 0x77, - 0x78, 0x54, 0x35, 0xc0, 0xf3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x98, 0x92, 0x5c, 0xa1, - 0x05, 0x00, 0x00, + // 661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0x4d, 0xf3, 0xe3, 0x49, 0x9b, 0xc2, 0xf2, 0xa3, 0x55, 0x24, 0x52, 0x2b, 0x02, 0x14, + 0x09, 0x94, 0xa0, 0x56, 0x42, 0x08, 0x01, 0x52, 0xd2, 0xf4, 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x49, 0x9e, + 0xc1, 0xd6, 0x2a, 0xf2, 0x8a, 0x56, 0xff, 0x4f, 0xd1, 0xde, 0xbb, 0x1f, 0x37, 0x0d, 0xeb, 0xd7, + 0x4d, 0xc3, 0xfa, 0x7d, 0xd3, 0xb0, 0xbe, 0xfd, 0x69, 0xdc, 0xf9, 0xf2, 0xdc, 0xe3, 0xea, 0x32, + 0x1a, 0xe9, 0xca, 0xce, 0xa5, 0x1b, 0x5e, 0xf2, 0xb1, 0x90, 0x73, 0xfd, 0x08, 0x87, 0xd1, 0xac, + 0xb3, 0xf6, 0x36, 0x8f, 0x4a, 0x06, 0x38, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xda, 0x8a, 0x91, + 0x6e, 0xb5, 0x05, 0x00, 0x00, } func (m *CARoots) Marshal() (dAtA []byte, err error) { @@ -1207,7 +1236,7 @@ func (m *CARoots) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.QueryMeta == nil { - m.QueryMeta = &pbcommon.QueryMeta{} + m.QueryMeta = &pbcommongogo.QueryMeta{} } if err := m.QueryMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1748,7 +1777,7 @@ func (m *CARoot) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.RaftIndex == nil { - m.RaftIndex = &pbcommon.RaftIndex{} + m.RaftIndex = &pbcommongogo.RaftIndex{} } if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2131,7 +2160,7 @@ func (m *IssuedCert) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.EnterpriseMeta == nil { - m.EnterpriseMeta = &pbcommon.EnterpriseMeta{} + m.EnterpriseMeta = &pbcommongogo.EnterpriseMeta{} } if err := m.EnterpriseMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2167,7 +2196,7 @@ func (m *IssuedCert) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.RaftIndex == nil { - m.RaftIndex = &pbcommon.RaftIndex{} + m.RaftIndex = &pbcommongogo.RaftIndex{} } if err := m.RaftIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/pbconnect/connect.proto b/proto/pbconnect/connect.proto index 0b2d10b46..129fa5385 100644 --- a/proto/pbconnect/connect.proto +++ b/proto/pbconnect/connect.proto @@ -5,9 +5,15 @@ package connect; option go_package = "github.com/hashicorp/consul/proto/pbconnect"; import "google/protobuf/timestamp.proto"; -import "proto/pbcommon/common.proto"; +import "proto/pbcommongogo/common.proto"; // CARoots is the list of all currently trusted CA Roots. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.IndexedCARoots +// output=connect.gen.go +// name=StructsIndexedCARoots message CARoots { // ActiveRootID is the ID of a root in Roots that is the active CA root. // Other roots are still valid if they're in the Roots list but are in @@ -43,9 +49,17 @@ message CARoots { // QueryMeta here is mainly used to contain the latest Raft Index that could // be used to perform a blocking query. - common.QueryMeta QueryMeta = 4; + // mog: func-to=QueryMetaTo func-from=QueryMetaFrom + commongogo.QueryMeta QueryMeta = 4; } +// CARoot is the trusted CA Root. +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.CARoot +// output=connect.gen.go +// name=StructsCARoot message CARoot { // ID is a globally unique ID (UUID) representing this CA root. string ID = 1; @@ -73,7 +87,9 @@ message CARoot { string ExternalTrustDomain = 5; // Time validity bounds. + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo google.protobuf.Timestamp NotBefore = 6; + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo google.protobuf.Timestamp NotAfter = 7; // RootCert is the PEM-encoded public certificate. @@ -98,6 +114,7 @@ message CARoot { // RotatedOutAt is the time at which this CA was removed from the state. // This will only be set on roots that have been rotated out from being the // active root. + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo google.protobuf.Timestamp RotatedOutAt = 13; // PrivateKeyType is the type of the private key used to sign certificates. It @@ -108,11 +125,19 @@ message CARoot { // PrivateKeyBits is the length of the private key used to sign certificates. // This is provided as a convenience to avoid parsing the public key from the // certificate to infer the type. + // mog: func-to=int func-from=int32 int32 PrivateKeyBits = 15; - - common.RaftIndex RaftIndex = 16; + + // mog: func-to=RaftIndexTo func-from=RaftIndexFrom + commongogo.RaftIndex RaftIndex = 16; } +// +// mog annotation: +// +// target=github.com/hashicorp/consul/agent/structs.IssuedCert +// output=connect.gen.go +// name=StructsIssuedCert message IssuedCert { // SerialNumber is the unique serial number for this certificate. // This is encoded in standard hex separated by :. @@ -136,11 +161,15 @@ message IssuedCert { // ValidAfter and ValidBefore are the validity periods for the // certificate. + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo google.protobuf.Timestamp ValidAfter = 8; + // mog: func-to=structs.TimeFromProtoGogo func-from=structs.TimeToProtoGogo google.protobuf.Timestamp ValidBefore = 9; // EnterpriseMeta is the Consul Enterprise specific metadata - common.EnterpriseMeta EnterpriseMeta = 10; + // mog: func-to=EnterpriseMetaTo func-from=EnterpriseMetaFrom + commongogo.EnterpriseMeta EnterpriseMeta = 10; - common.RaftIndex RaftIndex = 11; + // mog: func-to=RaftIndexTo func-from=RaftIndexFrom + commongogo.RaftIndex RaftIndex = 11; } \ No newline at end of file diff --git a/proto/pbservice/convert.go b/proto/pbservice/convert.go index 6f679d237..a68c22b8f 100644 --- a/proto/pbservice/convert.go +++ b/proto/pbservice/convert.go @@ -2,18 +2,18 @@ package pbservice import ( "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" ) -func RaftIndexToStructs(s pbcommon.RaftIndex) structs.RaftIndex { +func RaftIndexToStructs(s pbcommongogo.RaftIndex) structs.RaftIndex { return structs.RaftIndex{ CreateIndex: s.CreateIndex, ModifyIndex: s.ModifyIndex, } } -func NewRaftIndexFromStructs(s structs.RaftIndex) pbcommon.RaftIndex { - return pbcommon.RaftIndex{ +func NewRaftIndexFromStructs(s structs.RaftIndex) pbcommongogo.RaftIndex { + return pbcommongogo.RaftIndex{ CreateIndex: s.CreateIndex, ModifyIndex: s.ModifyIndex, } diff --git a/proto/pbservice/convert_oss.go b/proto/pbservice/convert_oss.go index 215a2dc5f..214cf69ad 100644 --- a/proto/pbservice/convert_oss.go +++ b/proto/pbservice/convert_oss.go @@ -5,13 +5,13 @@ package pbservice import ( "github.com/hashicorp/consul/agent/structs" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" ) -func EnterpriseMetaToStructs(_ pbcommon.EnterpriseMeta) structs.EnterpriseMeta { +func EnterpriseMetaToStructs(_ pbcommongogo.EnterpriseMeta) structs.EnterpriseMeta { return structs.EnterpriseMeta{} } -func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) pbcommon.EnterpriseMeta { - return pbcommon.EnterpriseMeta{} +func NewEnterpriseMetaFromStructs(_ structs.EnterpriseMeta) pbcommongogo.EnterpriseMeta { + return pbcommongogo.EnterpriseMeta{} } diff --git a/proto/pbservice/healthcheck.pb.go b/proto/pbservice/healthcheck.pb.go index cd06be937..cb9eed6f8 100644 --- a/proto/pbservice/healthcheck.pb.go +++ b/proto/pbservice/healthcheck.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" - pbcommon "github.com/hashicorp/consul/proto/pbcommon" + pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" io "io" math "math" @@ -46,9 +46,9 @@ type HealthCheck struct { Type string `protobuf:"bytes,12,opt,name=Type,proto3" json:"Type,omitempty"` Definition HealthCheckDefinition `protobuf:"bytes,10,opt,name=Definition,proto3" json:"Definition"` // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - pbcommon.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + pbcommongogo.RaftIndex `protobuf:"bytes,11,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta pbcommongogo.EnterpriseMeta `protobuf:"bytes,13,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` // mog: func-to=int func-from=int32 ExposedPort int32 `protobuf:"varint,14,opt,name=ExposedPort,proto3" json:"ExposedPort,omitempty"` Interval string `protobuf:"bytes,15,opt,name=Interval,proto3" json:"Interval,omitempty"` @@ -290,76 +290,76 @@ func init() { func init() { proto.RegisterFile("proto/pbservice/healthcheck.proto", fileDescriptor_8a6f7448747c9fbe) } var fileDescriptor_8a6f7448747c9fbe = []byte{ - // 1092 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x4f, 0xe3, 0x46, - 0x14, 0x8e, 0x09, 0x49, 0xf0, 0x04, 0x58, 0x98, 0x05, 0x3a, 0xcb, 0x6e, 0x4d, 0x4a, 0xf7, 0x40, - 0x55, 0x9a, 0xa8, 0xb4, 0xaa, 0xba, 0xad, 0x54, 0x89, 0x10, 0x16, 0x52, 0x01, 0x4d, 0x9d, 0x74, - 0x2b, 0xf5, 0x66, 0x9c, 0x89, 0x63, 0x91, 0x78, 0xa2, 0xf1, 0x18, 0x91, 0xfe, 0x8a, 0x1e, 0xfb, - 0x03, 0xfa, 0x63, 0x38, 0x72, 0xac, 0x54, 0x09, 0xb5, 0xf0, 0x1b, 0x7a, 0xe9, 0xa9, 0x9a, 0x37, - 0x76, 0x62, 0x6f, 0xbc, 0x24, 0x2b, 0xed, 0x9e, 0x32, 0xef, 0x7d, 0xef, 0x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 0xe4, 0x6a, 0x53, 0xfe, 0xca, 0xea, - 0x05, 0x54, 0xf6, 0x14, 0x16, 0x44, 0x83, 0xfa, 0x2a, 0x63, 0xfb, 0x8f, 0x02, 0x5a, 0x4f, 0xad, - 0x94, 0xac, 0xf9, 0x71, 0xab, 0xd5, 0x88, 0xc8, 0x28, 0xd7, 0xf8, 0x39, 0x5a, 0x6a, 0x9d, 0x34, - 0x65, 0x67, 0x28, 0x87, 0x6e, 0x3e, 0x06, 0x30, 0xe9, 0x8c, 0xa2, 0x2e, 0xdc, 0xc1, 0x2b, 0xca, - 0xdd, 0xce, 0x10, 0x88, 0xbb, 0x60, 0x26, 0x9d, 0xf8, 0x7b, 0x94, 0x57, 0x9f, 0x47, 0xb2, 0xa5, - 0xec, 0x4e, 0x71, 0x6f, 0x77, 0x5a, 0xef, 0xca, 0x2a, 0xfc, 0xd0, 0x13, 0x7c, 0x18, 0x96, 0x32, - 0xdc, 0x41, 0x32, 0xf3, 0x94, 0x8a, 0x2e, 0x6b, 0x47, 0x3c, 0x56, 0x96, 0xbc, 0x43, 0x95, 0xb5, - 0x87, 0x04, 0xab, 0x3b, 0xc8, 0x35, 0x5e, 0x41, 0xd9, 0xd6, 0x41, 0x23, 0x64, 0xb6, 0x5c, 0xe2, - 0x6f, 0x63, 0xe5, 0xcd, 0x43, 0x03, 0x9f, 0x94, 0x95, 0xd8, 0xcb, 0x91, 0xd8, 0xcb, 0xb5, 0x50, - 0xec, 0xe1, 0xc1, 0xe3, 0xfa, 0x3f, 0x47, 0x4b, 0x4a, 0x06, 0xa7, 0xd6, 0x55, 0xd3, 0xfd, 0x95, - 0x12, 0xbd, 0xa4, 0xed, 0x2c, 0x99, 0x49, 0x27, 0x7e, 0x31, 0xee, 0x52, 0x61, 0xb6, 0x13, 0xa2, - 0x78, 0xec, 0x20, 0xa3, 0x46, 0x39, 0x75, 0x5c, 0x5f, 0x50, 0x7e, 0xc0, 0x5d, 0xe1, 0xda, 0x56, - 0x2f, 0x14,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0xc5, 0xa8, 0x91, 0x63, - 0x84, 0x42, 0xcb, 0x48, 0x0c, 0x85, 0xbe, 0x4d, 0x7f, 0x1a, 0x1e, 0xbf, 0x9b, 0xa7, 0x61, 0xe2, - 0x91, 0x7b, 0x02, 0x77, 0x4a, 0x3a, 0xdf, 0xc3, 0xdc, 0xab, 0x9e, 0x5e, 0xff, 0x63, 0x64, 0xae, - 0xef, 0x0c, 0xed, 0xe6, 0xce, 0xd0, 0xfe, 0xbe, 0x33, 0xb4, 0xdf, 0xee, 0x8d, 0xcc, 0xef, 0xf7, - 0x46, 0xe6, 0xe6, 0xde, 0xc8, 0xfc, 0x79, 0x6f, 0x64, 0x7e, 0xf9, 0xf4, 0xa1, 0xb1, 0xf7, 0xda, - 0x1f, 0xfc, 0xf3, 0x3c, 0x38, 0xbe, 0xf8, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x43, 0x4c, 0xaf, - 0xfa, 0x0b, 0x00, 0x00, + // 1096 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x4e, 0xe3, 0xc6, + 0x17, 0x8f, 0x09, 0x49, 0xf0, 0x64, 0x61, 0x97, 0x59, 0xe0, 0x3f, 0x9b, 0xff, 0xd6, 0xa4, 0x74, + 0x2f, 0xa8, 0x4a, 0x1d, 0x95, 0x56, 0x55, 0x3f, 0xd4, 0x4a, 0x84, 0xb0, 0x90, 0x0a, 0x68, 0xea, + 0xa4, 0x5b, 0xa9, 0x77, 0xc6, 0x99, 0x38, 0x16, 0x89, 0x27, 0x1a, 0x8f, 0x11, 0xe9, 0x53, 0xf4, + 0xb2, 0x0f, 0xd0, 0x87, 0xe1, 0x92, 0xcb, 0x5e, 0xa1, 0x16, 0x9e, 0xa1, 0x37, 0xbd, 0xaa, 0xe6, + 0x8c, 0x9d, 0xd8, 0x1b, 0x2f, 0x64, 0xa5, 0xed, 0x55, 0xce, 0xf9, 0x9d, 0x8f, 0x19, 0x9f, 0x73, + 0x7e, 0x67, 0x82, 0xde, 0x1f, 0x71, 0x26, 0x58, 0x6d, 0x74, 0x16, 0x50, 0x7e, 0xe1, 0x39, 0xb4, + 0xd6, 0xa7, 0xf6, 0x40, 0xf4, 0x9d, 0x3e, 0x75, 0xce, 0x4d, 0xb0, 0x61, 0x7d, 0x62, 0xac, 0x18, + 0x2e, 0x63, 0xee, 0x80, 0xd6, 0xc0, 0x70, 0x16, 0xf6, 0x6a, 0xdd, 0x90, 0xdb, 0xc2, 0x63, 0xbe, + 0x72, 0xad, 0x6c, 0xc6, 0xd9, 0x1c, 0x36, 0x1c, 0x32, 0xdf, 0x65, 0x2e, 0xab, 0x29, 0x31, 0x72, + 0x58, 0x93, 0x90, 0x72, 0x92, 0x92, 0x42, 0xb7, 0xee, 0x16, 0x51, 0xf9, 0x08, 0xce, 0xdd, 0x97, + 0xe7, 0x62, 0x8c, 0x16, 0x4f, 0x59, 0x97, 0x12, 0xad, 0xaa, 0x6d, 0xeb, 0x16, 0xc8, 0xf8, 0x10, + 0x95, 0xc0, 0xd8, 0x6c, 0x90, 0x05, 0x09, 0xd7, 0x3f, 0xfe, 0xe7, 0x66, 0xf3, 0x43, 0xd7, 0x13, + 0xfd, 0xf0, 0xcc, 0x74, 0xd8, 0xb0, 0xd6, 0xb7, 0x83, 0xbe, 0xe7, 0x30, 0x3e, 0xaa, 0x39, 0xcc, + 0x0f, 0xc2, 0x41, 0x4d, 0x8c, 0x47, 0x34, 0x30, 0xa3, 0x20, 0x2b, 0x8e, 0x86, 0xe4, 0xf6, 0x90, + 0x92, 0x7c, 0x94, 0xdc, 0x1e, 0x52, 0xbc, 0x81, 0x8a, 0x6d, 0x61, 0x8b, 0x30, 0x20, 0x8b, 0x80, + 0x46, 0x1a, 0x5e, 0x43, 0x85, 0x53, 0x26, 0x68, 0x40, 0x0a, 0x00, 0x2b, 0x45, 0x7a, 0x7f, 0x1f, + 0x8a, 0x51, 0x28, 0x48, 0x51, 0x79, 0x2b, 0x0d, 0x3f, 0x47, 0x7a, 0x5b, 0x15, 0xaa, 0xd9, 0x20, + 0x25, 0x30, 0x4d, 0x01, 0x5c, 0x45, 0xe5, 0x48, 0x81, 0xe3, 0x97, 0xc0, 0x9e, 0x84, 0x12, 0x1e, + 0x1d, 0xdb, 0x0d, 0x88, 0x5e, 0xcd, 0x27, 0x3c, 0x24, 0x24, 0xef, 0xde, 0x19, 0x8f, 0x28, 0x79, + 0xa4, 0xee, 0x2e, 0x65, 0xfc, 0x12, 0xa1, 0x06, 0xed, 0x79, 0xbe, 0x27, 0xfb, 0x40, 0x50, 0x55, + 0xdb, 0x2e, 0xef, 0x56, 0xcd, 0x49, 0xcf, 0xcc, 0x44, 0x61, 0xa7, 0x7e, 0xf5, 0xc5, 0xab, 0x9b, + 0xcd, 0x9c, 0x95, 0x88, 0xc4, 0xdf, 0x20, 0xdd, 0xb2, 0x7b, 0xa2, 0xe9, 0x77, 0xe9, 0x25, 0x29, + 0x43, 0x9a, 0x75, 0x73, 0xda, 0x47, 0x73, 0x62, 0xac, 0x2f, 0xc9, 0xd8, 0xeb, 0x9b, 0x4d, 0xcd, + 0x9a, 0x46, 0xe0, 0x23, 0xb4, 0x72, 0xe0, 0x0b, 0xca, 0x47, 0xdc, 0x0b, 0xe8, 0x09, 0x15, 0x36, + 0x59, 0x86, 0x1c, 0x95, 0x64, 0x8e, 0xb4, 0x47, 0x74, 0x89, 0xd7, 0xe2, 0x64, 0x19, 0x0e, 0x2e, + 0x47, 0x2c, 0xa0, 0xdd, 0x16, 0xe3, 0x82, 0xac, 0x54, 0xb5, 0xed, 0x82, 0x95, 0x84, 0x70, 0x05, + 0x2d, 0x35, 0x65, 0xcc, 0x85, 0x3d, 0x20, 0x8f, 0xa1, 0x14, 0x13, 0x1d, 0x13, 0x54, 0xea, 0x78, + 0x43, 0xca, 0x42, 0x41, 0x9e, 0x80, 0x29, 0x56, 0xb7, 0x3e, 0x80,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0x3d, 0x88, 0x48, 0xb2, 0xd7, 0x13, 0x94, 0x03, 0xb5, 0xe6, 0xc8, 0xf8, 0x40, 0x1a, 0x6c, 0x20, + 0xd4, 0x76, 0xb8, 0x37, 0x12, 0x7b, 0xdc, 0x0d, 0x08, 0x82, 0x29, 0x49, 0x20, 0x78, 0x07, 0xad, + 0x36, 0x98, 0x73, 0x4e, 0xf9, 0x3e, 0xf3, 0x85, 0xed, 0xf9, 0x94, 0x37, 0x1b, 0x40, 0x1c, 0xdd, + 0x9a, 0x35, 0xc8, 0x71, 0x6b, 0xf7, 0xe9, 0x60, 0x10, 0x71, 0x57, 0x29, 0xb2, 0x51, 0x47, 0xbb, + 0xad, 0xe6, 0xe9, 0x21, 0x59, 0x53, 0x8d, 0x52, 0x1a, 0xde, 0x42, 0x8f, 0x8e, 0x76, 0x5b, 0x9e, + 0xef, 0xfe, 0x18, 0xd0, 0xce, 0x71, 0x9b, 0xac, 0xc3, 0xc4, 0xa4, 0x30, 0xd9, 0xcc, 0x43, 0xab, + 0xb5, 0x0f, 0x3c, 0xd3, 0x2d, 0x90, 0xe5, 0x9d, 0xe5, 0x6f, 0x14, 0xb5, 0x02, 0x51, 0x09, 0x44, + 0xae, 0xa8, 0xbd, 0x81, 0x67, 0x07, 0xb0, 0x5e, 0x15, 0x75, 0xa6, 0x80, 0x3c, 0x15, 0x94, 0xa8, + 0x0c, 0x11, 0x81, 0x52, 0x18, 0xfe, 0x04, 0xe5, 0x3b, 0x9d, 0x63, 0xb2, 0x3a, 0x5f, 0x8d, 0xa5, + 0x6f, 0xe5, 0x87, 0x98, 0x78, 0x30, 0xaa, 0x72, 0xe0, 0xce, 0xe9, 0x38, 0xe2, 0x91, 0x14, 0xf1, + 0x0e, 0x2a, 0x5c, 0x00, 0x15, 0x17, 0x20, 0xeb, 0x46, 0x7a, 0xf2, 0x63, 0xc6, 0x5a, 0xca, 0xe9, + 0xab, 0x85, 0x2f, 0xb4, 0xad, 0xbf, 0x75, 0xa4, 0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0x18, 0x58, 0xf2, 0x3f, 0x35, + 0x51, 0x13, 0x60, 0x62, 0x85, 0x96, 0x91, 0x84, 0x15, 0xfa, 0xf6, 0xf0, 0xd3, 0xf0, 0xf4, 0xdd, + 0x3c, 0x0d, 0x33, 0x8f, 0xdc, 0x33, 0xf8, 0xa6, 0x34, 0xf8, 0x1f, 0xec, 0xbd, 0xfa, 0xc9, 0xd5, + 0x5f, 0x46, 0xee, 0xea, 0xd6, 0xd0, 0xae, 0x6f, 0x0d, 0xed, 0xcf, 0x5b, 0x43, 0xfb, 0xf5, 0xce, + 0xc8, 0xfd, 0x76, 0x67, 0xe4, 0xae, 0xef, 0x8c, 0xdc, 0x1f, 0x77, 0x46, 0xee, 0xe7, 0x8f, 0xee, + 0x5b, 0x7b, 0xaf, 0xfd, 0xd9, 0x3f, 0x2b, 0x02, 0xf0, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x87, 0x18, 0xc2, 0xd7, 0x06, 0x0c, 0x00, 0x00, } func (m *HealthCheck) Marshal() (dAtA []byte, err error) { diff --git a/proto/pbservice/healthcheck.proto b/proto/pbservice/healthcheck.proto index 6a8fb5906..15a5d3dce 100644 --- a/proto/pbservice/healthcheck.proto +++ b/proto/pbservice/healthcheck.proto @@ -5,7 +5,7 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; import "google/protobuf/duration.proto"; -import "proto/pbcommon/common.proto"; +import "proto/pbcommongogo/common.proto"; // This fake import path is replaced by the build script with a versioned path import "gogoproto/gogo.proto"; @@ -37,10 +37,10 @@ message HealthCheck { HealthCheckDefinition Definition = 10 [(gogoproto.nullable) = false]; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - common.RaftIndex RaftIndex = 11 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + commongogo.RaftIndex RaftIndex = 11 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - common.EnterpriseMeta EnterpriseMeta = 13 [(gogoproto.nullable) = false]; + commongogo.EnterpriseMeta EnterpriseMeta = 13 [(gogoproto.nullable) = false]; // mog: func-to=int func-from=int32 int32 ExposedPort = 14; diff --git a/proto/pbservice/ids_test.go b/proto/pbservice/ids_test.go index ae425e05c..2856aa70a 100644 --- a/proto/pbservice/ids_test.go +++ b/proto/pbservice/ids_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hashicorp/consul/proto/pbcommon" + "github.com/hashicorp/consul/proto/pbcommongogo" ) func TestCheckServiceNode_UniqueID(t *testing.T) { @@ -25,7 +25,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) { Node: &Node{Node: "the-node-name"}, Service: &NodeService{ ID: "the-service-id", - EnterpriseMeta: pbcommon.EnterpriseMeta{Namespace: "the-namespace"}, + EnterpriseMeta: pbcommongogo.EnterpriseMeta{Namespace: "the-namespace"}, }, }, expected: "/the-node-name/the-namespace/the-service-id", @@ -35,7 +35,7 @@ func TestCheckServiceNode_UniqueID(t *testing.T) { csn: CheckServiceNode{ Service: &NodeService{ ID: "the-service-id", - EnterpriseMeta: pbcommon.EnterpriseMeta{Namespace: "the-namespace"}, + EnterpriseMeta: pbcommongogo.EnterpriseMeta{Namespace: "the-namespace"}, }, }, expected: "/the-namespace/the-service-id", diff --git a/proto/pbservice/node.pb.go b/proto/pbservice/node.pb.go index 98f1e4732..a93dc6da1 100644 --- a/proto/pbservice/node.pb.go +++ b/proto/pbservice/node.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/golang/protobuf/proto" github_com_hashicorp_consul_agent_structs "github.com/hashicorp/consul/agent/structs" - pbcommon "github.com/hashicorp/consul/proto/pbcommon" + pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" github_com_hashicorp_consul_types "github.com/hashicorp/consul/types" io "io" math "math" @@ -83,7 +83,7 @@ type Node struct { TaggedAddresses map[string]string `protobuf:"bytes,5,rep,name=TaggedAddresses,proto3" json:"TaggedAddresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Meta map[string]string `protobuf:"bytes,6,rep,name=Meta,proto3" json:"Meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - pbcommon.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + pbcommongogo.RaftIndex `protobuf:"bytes,7,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` } func (m *Node) Reset() { *m = Node{} } @@ -177,9 +177,9 @@ type NodeService struct { // somewhere this is used in API output. LocallyRegisteredAsSidecar bool `protobuf:"varint,13,opt,name=LocallyRegisteredAsSidecar,proto3" json:"LocallyRegisteredAsSidecar,omitempty"` // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta pbcommongogo.EnterpriseMeta `protobuf:"bytes,16,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - pbcommon.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` + pbcommongogo.RaftIndex `protobuf:"bytes,14,opt,name=RaftIndex,proto3,embedded=RaftIndex" json:"RaftIndex"` } func (m *NodeService) Reset() { *m = NodeService{} } @@ -228,56 +228,56 @@ func init() { func init() { proto.RegisterFile("proto/pbservice/node.proto", fileDescriptor_bbc215b78fa95fe5) } var fileDescriptor_bbc215b78fa95fe5 = []byte{ - // 773 bytes of a gzipped FileDescriptorProto + // 777 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x13, 0xa7, 0x69, 0x26, 0xf7, 0xf6, 0x67, 0x54, 0x5d, 0xcd, 0xcd, 0xbd, 0x75, 0x42, - 0x61, 0x51, 0xa9, 0xc5, 0x46, 0x05, 0x04, 0x41, 0x08, 0xa9, 0x69, 0x2a, 0x11, 0x41, 0x4b, 0xe4, + 0x14, 0x8e, 0x13, 0xa7, 0x69, 0x26, 0xf7, 0xf6, 0x67, 0xd4, 0x7b, 0x35, 0x37, 0xba, 0x75, 0x42, + 0x61, 0x51, 0xa9, 0xc5, 0x46, 0x05, 0x04, 0x45, 0x80, 0xd4, 0x34, 0x95, 0x1a, 0x41, 0x4b, 0xe4, 0x56, 0x42, 0x02, 0xb1, 0x98, 0xd8, 0x53, 0xdb, 0x6a, 0xea, 0x89, 0xc6, 0x93, 0xaa, 0x79, 0x0b, - 0x96, 0xf0, 0x02, 0x3c, 0x4b, 0x97, 0x5d, 0xb2, 0x8a, 0xa0, 0x59, 0xf0, 0x0e, 0x5d, 0xa1, 0x19, - 0x4f, 0x12, 0xc7, 0x0d, 0x15, 0x95, 0x58, 0xcd, 0xf8, 0x7c, 0xdf, 0x39, 0x73, 0x66, 0xbe, 0xef, - 0x24, 0xa0, 0xdc, 0x65, 0x94, 0x53, 0xab, 0xdb, 0x8e, 0x08, 0x3b, 0x0d, 0x1c, 0x62, 0x85, 0xd4, - 0x25, 0xa6, 0x0c, 0xc2, 0xe2, 0x38, 0x5a, 0xfe, 0x6f, 0x44, 0x73, 0xe8, 0xc9, 0x09, 0x0d, 0xad, - 0x78, 0x89, 0x79, 0xe5, 0x3b, 0xe9, 0x1a, 0x3e, 0xc1, 0x1d, 0xee, 0x3b, 0x3e, 0x71, 0x8e, 0x15, - 0x65, 0x35, 0x4d, 0x51, 0xab, 0x82, 0x57, 0x3c, 0xea, 0xd1, 0x98, 0x22, 0x76, 0x71, 0x74, 0xed, - 0xb3, 0x06, 0x96, 0x76, 0x44, 0x91, 0x83, 0x98, 0xbc, 0x4f, 0x5d, 0x02, 0xef, 0x02, 0x5d, 0xac, - 0x48, 0xab, 0x6a, 0xeb, 0xa5, 0xad, 0x45, 0x73, 0x5c, 0xd2, 0x14, 0x61, 0x5b, 0x82, 0xf0, 0x01, - 0x28, 0xa8, 0x1c, 0x94, 0x95, 0xbc, 0x7f, 0x52, 0x3c, 0x85, 0xda, 0x23, 0x1a, 0x34, 0xc1, 0x9c, - 0x3c, 0x2a, 0x42, 0xb9, 0x6a, 0x2e, 0x95, 0xf0, 0x52, 0x5e, 0x47, 0xc2, 0xb6, 0x62, 0xad, 0xfd, - 0xc8, 0xc5, 0x7d, 0xc0, 0xe7, 0x20, 0xdb, 0x6c, 0xc8, 0x6e, 0x8a, 0xf5, 0xcd, 0xab, 0x41, 0x65, - 0xdd, 0x0b, 0xb8, 0xdf, 0x6b, 0x9b, 0x0e, 0x3d, 0xb1, 0x7c, 0x1c, 0xf9, 0x81, 0x43, 0x59, 0xd7, - 0x72, 0x68, 0x18, 0xf5, 0x3a, 0x16, 0xef, 0x77, 0x49, 0x24, 0x1b, 0x68, 0x36, 0xec, 0x6c, 0xb3, - 0x01, 0xa1, 0xba, 0x8d, 0xe8, 0xb2, 0xa8, 0x9a, 0xff, 0x1f, 0x14, 0x5b, 0x98, 0xf1, 0x80, 0x07, - 0x34, 0x44, 0xf3, 0x12, 0x98, 0x04, 0x20, 0x02, 0x85, 0x6d, 0xd7, 0x65, 0x24, 0x12, 0x9d, 0x0a, - 0x6c, 0xf4, 0x09, 0x0d, 0x00, 0x1a, 0x98, 0x63, 0x87, 0x84, 0x9c, 0x30, 0xa4, 0x4b, 0x30, 0x11, - 0x81, 0xfb, 0x60, 0xf1, 0x10, 0x7b, 0x1e, 0x71, 0x55, 0x02, 0x89, 0x50, 0x5e, 0xde, 0xf5, 0x5e, - 0xea, 0x71, 0xcc, 0x14, 0x6d,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0xb6, 0x5a, 0xda, 0x98, 0x37, 0x47, 0x94, 0xa6, 0x48, 0xdb, 0xb2, 0x08, + 0x1f, 0x80, 0x82, 0xea, 0x41, 0x59, 0x89, 0xfb, 0x37, 0x85, 0x53, 0x55, 0x7b, 0x08, 0x83, 0x26, + 0x98, 0x91, 0x47, 0x45, 0x28, 0x57, 0xcd, 0xa5, 0x1a, 0x76, 0xe5, 0x75, 0x64, 0xd9, 0x56, 0xa8, + 0x95, 0x1f, 0xb9, 0x78, 0x0e, 0xf8, 0x1c, 0x64, 0x1b, 0x75, 0x39, 0x4d, 0xb1, 0xb6, 0x7e, 0xd5, + 0xaf, 0xac, 0x7a, 0x01, 0xf7, 0xbb, 0x2d, 0xd3, 0xa1, 0x27, 0x96, 0x8f, 0x23, 0x3f, 0x70, 0x28, + 0xeb, 0x58, 0x0e, 0x0d, 0xa3, 0x6e, 0xdb, 0xe2, 0xbd, 0x0e, 0x89, 0xe4, 0x00, 0x8d, 0xba, 0x9d, + 0x6d, 0xd4, 0x21, 0x54, 0xb7, 0x11, 0x53, 0x16, 0xd5, 0xf0, 0xff, 0x83, 0x62, 0x13, 0x33, 0x1e, + 0xf0, 0x80, 0x86, 0x68, 0x56, 0x16, 0xc6, 0x09, 0x88, 0x40, 0x61, 0xcb, 0x75, 0x19, 0x89, 0xc4, + 0xa4, 0xa2, 0x36, 0xfc, 0x84, 0x06, 0x00, 0x75, 0xcc, 0xb1, 0x43, 0x42, 0x4e, 0x18, 0xd2, 0x65, + 0x31, 0x91, 0x81, 0xfb, 0x60, 0xfe, 0x10, 0x7b, 0x1e, 0x71, 0x55, 0x03, 0x89, 0x50, 0x5e, 0xde, + 0xf5, 0x5e, 0xea, 0x71, 0xcc, 0x14, 0x6c, 0x27, 0xe4, 0xac, 0x67, 0xa7, 0x9b, 0xe1, 0x7d, 0xa0, + 0xef, 0x11, 0x8e, 0xd1, 0x8c, 0x24, 0xf9, 0x2f, 0x4d, 0x22, 0x6a, 0x71, 0xa7, 0x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 0x69, 0x68, 0xdf, 0x2e, 0x0d, + 0xed, 0xe3, 0xc0, 0xc8, 0x7c, 0x1a, 0x18, 0x99, 0x8b, 0x81, 0x91, 0xf9, 0x3a, 0x30, 0x32, 0xef, + 0xd6, 0x6e, 0x5a, 0xd8, 0xd4, 0xbf, 0x55, 0x6b, 0x46, 0x26, 0x1e, 0xfe, 0x0c, 0x00, 0x00, 0xff, + 0xff, 0xf9, 0x3e, 0x1b, 0x2c, 0x32, 0x07, 0x00, 0x00, } func (m *CheckServiceNode) Marshal() (dAtA []byte, err error) { diff --git a/proto/pbservice/node.proto b/proto/pbservice/node.proto index 2600e7b14..c07e809a8 100644 --- a/proto/pbservice/node.proto +++ b/proto/pbservice/node.proto @@ -4,7 +4,7 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; -import "proto/pbcommon/common.proto"; +import "proto/pbcommongogo/common.proto"; import "proto/pbservice/healthcheck.proto"; import "proto/pbservice/service.proto"; @@ -42,7 +42,7 @@ message Node { map Meta = 6; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - common.RaftIndex RaftIndex = 7 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + commongogo.RaftIndex RaftIndex = 7 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } // NodeService is a service provided by a node @@ -109,8 +109,8 @@ message NodeService { bool LocallyRegisteredAsSidecar = 13; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - common.EnterpriseMeta EnterpriseMeta = 16 [(gogoproto.nullable) = false]; + commongogo.EnterpriseMeta EnterpriseMeta = 16 [(gogoproto.nullable) = false]; // mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs - common.RaftIndex RaftIndex = 14 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + commongogo.RaftIndex RaftIndex = 14 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } diff --git a/proto/pbservice/service.pb.go b/proto/pbservice/service.pb.go index 9bd4b381c..ca5761fdc 100644 --- a/proto/pbservice/service.pb.go +++ b/proto/pbservice/service.pb.go @@ -9,7 +9,7 @@ import ( types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" github_com_hashicorp_consul_agent_structs "github.com/hashicorp/consul/agent/structs" - pbcommon "github.com/hashicorp/consul/proto/pbcommon" + pbcommongogo "github.com/hashicorp/consul/proto/pbcommongogo" io "io" math "math" math_bits "math/bits" @@ -483,7 +483,7 @@ type ServiceDefinition struct { // mog: func-to=ConnectProxyConfigPtrToStructs func-from=NewConnectProxyConfigPtrFromStructs Proxy *ConnectProxyConfig `protobuf:"bytes,14,opt,name=Proxy,proto3" json:"Proxy,omitempty"` // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - EnterpriseMeta pbcommon.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` + EnterpriseMeta pbcommongogo.EnterpriseMeta `protobuf:"bytes,17,opt,name=EnterpriseMeta,proto3" json:"EnterpriseMeta"` // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs Connect *ServiceConnect `protobuf:"bytes,15,opt,name=Connect,proto3" json:"Connect,omitempty"` } @@ -620,83 +620,83 @@ func init() { func init() { proto.RegisterFile("proto/pbservice/service.proto", fileDescriptor_cbb99233b75fb80b) } var fileDescriptor_cbb99233b75fb80b = []byte{ - // 1212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcd, 0x6e, 0x1b, 0x37, - 0x10, 0xc7, 0xb5, 0xfa, 0xb0, 0x24, 0xda, 0xf5, 0x07, 0xad, 0xba, 0x5b, 0x37, 0x91, 0x1d, 0xa1, - 0x08, 0x8c, 0xd6, 0x90, 0x12, 0x1b, 0xa9, 0x9b, 0x00, 0x29, 0x50, 0x5b, 0x6e, 0x11, 0x24, 0x4e, - 0xd4, 0xb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f7, 0x08, 0xa7, 0x4a, 0x79, 0x4d, 0x78, 0xa0, 0x14, 0x1d, 0x1b, 0x4e, - 0xf7, 0x8f, 0xce, 0xff, 0xa9, 0xe7, 0xce, 0x2f, 0xeb, 0xd6, 0xdb, 0xcb, 0xba, 0xf5, 0xf7, 0x65, - 0xdd, 0xfa, 0xe5, 0xaa, 0x9e, 0xfb, 0xf5, 0xaa, 0x9e, 0x7b, 0x7b, 0x55, 0xcf, 0xfd, 0x75, 0x55, - 0xcf, 0xfd, 0xf8, 0xf9, 0x6d, 0xcd, 0x21, 0xf1, 0x5f, 0xbf, 0x37, 0x07, 0x86, 0xdd, 0x7f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x93, 0xfb, 0xcc, 0xfb, 0x6a, 0x0c, 0x00, 0x00, + // 1216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xdf, 0x6e, 0x13, 0x47, + 0x17, 0xc0, 0xb3, 0x89, 0x1d, 0xdb, 0x27, 0x7c, 0x21, 0x19, 0xf2, 0xd1, 0xad, 0x05, 0x4e, 0xb0, + 0x2a, 0x14, 0xb5, 0xc8, 0x06, 0x22, 0x4a, 0x41, 0xa2, 0x52, 0x13, 0xa7, 0x2d, 0x82, 0x80, 0xbb, + 0x71, 0x85, 0x5a, 0xa9, 0x17, 0xe3, 0xf5, 0x64, 0xbd, 0x8a, 0xbd, 0x63, 0xcd, 0x8c, 0x53, 0xfc, + 0x16, 0xbd, 0xec, 0x0b, 0x70, 0xdf, 0xc7, 0x40, 0xea, 0x0d, 0x97, 0xbd, 0x8a, 0x5a, 0xf2, 0x16, + 0x5c, 0x55, 0x73, 0x66, 0x76, 0xbd, 0xde, 0xdd, 0x22, 0xda, 0x2b, 0xcf, 0x9c, 0x7f, 0x33, 0x7b, + 0xce, 0xef, 0x9c, 0x31, 0x5c, 0x9f, 0x08, 0xae, 0x78, 0x7b, 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 0xfc, 0xdf, 0xef, 0xaf, 0xa2, + 0x60, 0xef, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x83, 0xcc, 0x12, 0x72, 0x0c, 0x00, 0x00, } func (m *ConnectProxyConfig) Marshal() (dAtA []byte, err error) { diff --git a/proto/pbservice/service.proto b/proto/pbservice/service.proto index 5faf9fe92..360e3e3ff 100644 --- a/proto/pbservice/service.proto +++ b/proto/pbservice/service.proto @@ -5,7 +5,7 @@ package pbservice; option go_package = "github.com/hashicorp/consul/proto/pbservice"; import "google/protobuf/struct.proto"; -import "proto/pbcommon/common.proto"; +import "proto/pbcommongogo/common.proto"; import "proto/pbservice/healthcheck.proto"; // This fake import path is replaced by the build script with a versioned path @@ -269,7 +269,7 @@ message ServiceDefinition { ConnectProxyConfig Proxy = 14; // mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs - common.EnterpriseMeta EnterpriseMeta = 17 [(gogoproto.nullable) = false]; + commongogo.EnterpriseMeta EnterpriseMeta = 17 [(gogoproto.nullable) = false]; // mog: func-to=ServiceConnectPtrToStructs func-from=NewServiceConnectPtrFromStructs ServiceConnect Connect = 15;