diff --git a/examples/.github/workflows/tests.yml b/examples/.github/workflows/tests.yml deleted file mode 100644 index afe896e9..00000000 --- a/examples/.github/workflows/tests.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Run tests -on: [push, pull_request] - -jobs: - - test: - name: Test repo - runs-on: ubuntu-latest - steps: - - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Get dependencies - run: | - go get -v -t -d ./... - - - name: Run tests - id: tests - env: - IN_TRAVIS_CI: yes - run: go test -v ./... - - - name: Notify of test failure - if: failure() - uses: rtCamp/action-slack-notify@v2.0.0 - env: - SLACK_CHANNEL: build - SLACK_COLOR: '#BF280A' - SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png - SLACK_TITLE: Tests Failed - SLACK_USERNAME: GitHub Actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} - - - name: Notify of test success - if: success() - uses: rtCamp/action-slack-notify@v2.0.0 - env: - SLACK_CHANNEL: build - SLACK_COLOR: '#1FAD2B' - SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png - SLACK_TITLE: Tests Passed - SLACK_USERNAME: GitHub Actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} - diff --git a/examples/LICENSE b/examples/LICENSE deleted file mode 100644 index 7d74e027..00000000 --- a/examples/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Asim Aslam. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 4d65e86e..00000000 --- a/examples/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Examples - -This is a repository for go-micro examples. Feel free to contribute. - -## Contents - -- [broker](broker) - A example of using Broker for Publish and Subscribing. -- [cache](cache) - Usage of the Cache package to create a cache service. -- [client](client) - Usage of the Client package to call a service. -- [config](config) - Using Go Config for dynamic config -- [event](event) - Using the API Gateway event handler -- [filter](filter) - Filter nodes of a service when requesting -- [flags](flags) - Using command line flags with a service -- [function](function) - Example of using Function programming model -- [getip](getip) - Get the local and remote ip from metadata -- [graceful](graceful) - Demonstrates graceful shutdown of a service -- [greeter](greeter) - A complete greeter example (includes python, ruby examples) -- [heartbeat](heartbeat) - Make services heartbeat with discovery for high availability -- [helloworld](helloworld) - Hello world using micro -- [metadata](metadata) - Extracting metadata from context of a request -- [mocking](mocking) - Demonstrate mocking helloworld service -- [noproto](noproto) - Use micro without protobuf or code generation, only go types -- [options](options) - Setting options in the go-micro framework -- [plugins](plugins) - How to use plugins -- [pubsub](pubsub) - Example of using pubsub at the client/server level -- [redirect](redirect) - An example of how to http redirect using an API service -- [roundrobin](roundrobin) - A stateful client wrapper for true round robin of requests -- [secure](secure) - Demonstrates use of transport secure option for self signed certs -- [server](server) - Use of the Server package directly to server requests. -- [service](service) - Example of the top level Service in go-micro. -- [sharding](sharding) - An example of how to shard requests or use session affinity -- [shutdown](shutdown) - Demonstrates graceful shutdown via context cancellation -- [stream](stream) - An example of a streaming service and client -- [waitgroup](waitgroup) - Demonstrates how to use a waitgroup with a service -- [wrapper](wrapper) - A simple example of using a log wrapper diff --git a/examples/_config.yml b/examples/_config.yml deleted file mode 100644 index 3397c9a4..00000000 --- a/examples/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-architect \ No newline at end of file diff --git a/examples/broker/README.md b/examples/broker/README.md deleted file mode 100644 index 22002ee9..00000000 --- a/examples/broker/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Broker - -The [broker](https://godoc.org/github.com/asim/go-micro/broker#Broker) is an interface for PubSub. - -## Contents - -- main.go - uns pub-sub as two go routines for 10 seconds. -- producer - publishes messages to the broker every second -- consumer - consumes any messages sent by the producer diff --git a/examples/broker/consumer/consumer.go b/examples/broker/consumer/consumer.go deleted file mode 100644 index a3ed93c7..00000000 --- a/examples/broker/consumer/consumer.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "go-micro.dev/v4/broker" - "go-micro.dev/v4/cmd" - // To enable rabbitmq plugin uncomment - //_ "github.com/micro/go-plugins/broker/rabbitmq" -) - -var ( - topic = "go.micro.topic.foo" -) - -// Example of a shared subscription which receives a subset of messages -func sharedSub() { - _, err := broker.Subscribe(topic, func(p broker.Event) error { - fmt.Println("[sub] received message:", string(p.Message().Body), "header", p.Message().Header) - return nil - }, broker.Queue("consumer")) - if err != nil { - fmt.Println(err) - } -} - -// Example of a subscription which receives all the messages -func sub() { - _, err := broker.Subscribe(topic, func(p broker.Event) error { - fmt.Println("[sub] received message:", string(p.Message().Body), "header", p.Message().Header) - return nil - }) - if err != nil { - fmt.Println(err) - } -} - -func main() { - cmd.Init() - - if err := broker.Init(); err != nil { - log.Fatalf("Broker Init error: %v", err) - } - if err := broker.Connect(); err != nil { - log.Fatalf("Broker Connect error: %v", err) - } - - sub() - select {} -} diff --git a/examples/broker/main.go b/examples/broker/main.go deleted file mode 100644 index 053e601a..00000000 --- a/examples/broker/main.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "go-micro.dev/v4/broker" - "go-micro.dev/v4/cmd" -) - -var ( - topic = "go.micro.topic.foo" -) - -func pub() { - tick := time.NewTicker(time.Second) - i := 0 - for _ = range tick.C { - msg := &broker.Message{ - Header: map[string]string{ - "id": fmt.Sprintf("%d", i), - }, - Body: []byte(fmt.Sprintf("%d: %s", i, time.Now().String())), - } - if err := broker.Publish(topic, msg); err != nil { - log.Printf("[pub] failed: %v", err) - } else { - fmt.Println("[pub] pubbed message:", string(msg.Body)) - } - i++ - } -} - -func sub() { - _, err := broker.Subscribe(topic, func(p broker.Event) error { - fmt.Println("[sub] received message:", string(p.Message().Body), "header", p.Message().Header) - return nil - }) - if err != nil { - fmt.Println(err) - } -} - -func main() { - cmd.Init() - - if err := broker.Init(); err != nil { - log.Fatalf("Broker Init error: %v", err) - } - if err := broker.Connect(); err != nil { - log.Fatalf("Broker Connect error: %v", err) - } - - go pub() - go sub() - - <-time.After(time.Second * 10) -} diff --git a/examples/broker/producer/producer.go b/examples/broker/producer/producer.go deleted file mode 100644 index 4f578a25..00000000 --- a/examples/broker/producer/producer.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "go-micro.dev/v4/broker" - "go-micro.dev/v4/cmd" - // To enable rabbitmq plugin uncomment - //_ "github.com/micro/go-plugins/broker/rabbitmq" -) - -var ( - topic = "go.micro.topic.foo" -) - -func pub() { - tick := time.NewTicker(time.Second) - i := 0 - for _ = range tick.C { - msg := &broker.Message{ - Header: map[string]string{ - "id": fmt.Sprintf("%d", i), - }, - Body: []byte(fmt.Sprintf("%d: %s", i, time.Now().String())), - } - if err := broker.Publish(topic, msg); err != nil { - log.Printf("[pub] failed: %v", err) - } else { - fmt.Println("[pub] pubbed message:", string(msg.Body)) - } - i++ - } -} - -func main() { - cmd.Init() - - if err := broker.Init(); err != nil { - log.Fatalf("Broker Init error: %v", err) - } - - if err := broker.Connect(); err != nil { - log.Fatalf("Broker Connect error: %v", err) - } - - pub() -} diff --git a/examples/cache/README.md b/examples/cache/README.md deleted file mode 100644 index a28b5f91..00000000 --- a/examples/cache/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Cache - -This is an example of a cache service using the [asim/go-micro/cache][1] package. - -## Contents - -This project was generated using [Gomu][2]. - -* handler - contains the service handler -* proto - contains the protocol buffer and generated code - -## Usage - -Run the `go.micro.srv.cache` service using [Gomu][2]. - -```bash -gomu run -``` - -You can also run it using plain Go. - -```bash -go run main.go -``` - -We'll be using [Gomu][2] to call the service. You can store a new key-value -pair in the cache. - -```bash -gomu call go.micro.srv.cache Cache.Put '{"key":"test","value":"hello go-micro","duration":"12h"}' -``` - -You can get values from the cache. - -```bash -$ gomu call go.micro.srv.cache Cache.Get '{"key":"test"}' -{"expiration":"2021-09-01 22:42:24.2370591 +0200 CEST","value":"hello go-micro"} -``` - -Finally you can delete keys from the cache. - -```bash -gomu call go.micro.srv.cache Cache.Delete '{"key":"test"}' -``` - -[1]: https://github.com/asim/go-micro/tree/master/cache -[2]: https://github.com/asim/go-micro/tree/master/cmd/gomu diff --git a/examples/cache/handler/cache.go b/examples/cache/handler/cache.go deleted file mode 100644 index 47bcebf8..00000000 --- a/examples/cache/handler/cache.go +++ /dev/null @@ -1,60 +0,0 @@ -package handler - -import ( - "context" - "fmt" - "time" - - "go-micro.dev/v4/cache" - log "go-micro.dev/v4/logger" - - pb "github.com/asim/go-micro/examples/v4/cache/proto" -) - -type Cache struct { - cache cache.Cache -} - -func NewCache(opts ...cache.Option) *Cache { - c := cache.NewCache(opts...) - return &Cache{c} -} - -func (c *Cache) Get(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse) error { - log.Infof("Received Cache.Get request: %v", req) - - v, e, err := c.cache.Context(ctx).Get(req.Key) - if err != nil { - return err - } - - rsp.Value = fmt.Sprintf("%v", v) - rsp.Expiration = e.String() - - return nil -} - -func (c *Cache) Put(ctx context.Context, req *pb.PutRequest, rsp *pb.PutResponse) error { - log.Infof("Received Cache.Put request: %v", req) - - d, err := time.ParseDuration(req.Duration) - if err != nil { - return err - } - - if err := c.cache.Context(ctx).Put(req.Key, req.Value, d); err != nil { - return err - } - - return nil -} - -func (c *Cache) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.DeleteResponse) error { - log.Infof("Received Cache.Delete request: %v", req) - - if err := c.cache.Context(ctx).Delete(req.Key); err != nil { - return err - } - - return nil -} diff --git a/examples/cache/main.go b/examples/cache/main.go deleted file mode 100644 index 5344469a..00000000 --- a/examples/cache/main.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "github.com/asim/go-micro/examples/v4/cache/handler" - pb "github.com/asim/go-micro/examples/v4/cache/proto" - - "go-micro.dev/v4" - log "go-micro.dev/v4/logger" -) - -var ( - service = "go.micro.srv.cache" - version = "latest" -) - -func main() { - // Create service - srv := micro.NewService( - micro.Name(service), - micro.Version(version), - ) - srv.Init() - - // Register handler - pb.RegisterCacheHandler(srv.Server(), handler.NewCache()) - - // Run service - if err := srv.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/cache/proto/cache.pb.go b/examples/cache/proto/cache.pb.go deleted file mode 100644 index 513080f7..00000000 --- a/examples/cache/proto/cache.pb.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.6.1 -// source: proto/cache.proto - -package cache - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The key to fetch from the cache. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{0} -} - -func (x *GetRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The value retrieved from the cache. - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - // The value's expiration datetime. - Expiration string `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{1} -} - -func (x *GetResponse) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *GetResponse) GetExpiration() string { - if x != nil { - return x.Expiration - } - return "" -} - -type PutRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The key to store in the cache. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // The value to store in the cache. - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // The value's time to live. Parsed using time.ParseDuration. 0 means - // it doesn't expire. - Duration string `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` -} - -func (x *PutRequest) Reset() { - *x = PutRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest) ProtoMessage() {} - -func (x *PutRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. -func (*PutRequest) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{2} -} - -func (x *PutRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *PutRequest) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *PutRequest) GetDuration() string { - if x != nil { - return x.Duration - } - return "" -} - -type PutResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PutResponse) Reset() { - *x = PutResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutResponse) ProtoMessage() {} - -func (x *PutResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. -func (*PutResponse) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{3} -} - -type DeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The key to remove from the cache. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_cache_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_cache_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_proto_cache_proto_rawDescGZIP(), []int{5} -} - -var File_proto_cache_proto protoreflect.FileDescriptor - -var file_proto_cache_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x22, 0x1e, 0x0a, 0x0a, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x43, 0x0a, 0x0b, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x50, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x21, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, - 0x2e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x2e, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x11, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x50, - 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x37, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x15, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x3b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_proto_cache_proto_rawDescOnce sync.Once - file_proto_cache_proto_rawDescData = file_proto_cache_proto_rawDesc -) - -func file_proto_cache_proto_rawDescGZIP() []byte { - file_proto_cache_proto_rawDescOnce.Do(func() { - file_proto_cache_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_cache_proto_rawDescData) - }) - return file_proto_cache_proto_rawDescData -} - -var file_proto_cache_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_proto_cache_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: cache.GetRequest - (*GetResponse)(nil), // 1: cache.GetResponse - (*PutRequest)(nil), // 2: cache.PutRequest - (*PutResponse)(nil), // 3: cache.PutResponse - (*DeleteRequest)(nil), // 4: cache.DeleteRequest - (*DeleteResponse)(nil), // 5: cache.DeleteResponse -} -var file_proto_cache_proto_depIdxs = []int32{ - 0, // 0: cache.Cache.Get:input_type -> cache.GetRequest - 2, // 1: cache.Cache.Put:input_type -> cache.PutRequest - 4, // 2: cache.Cache.Delete:input_type -> cache.DeleteRequest - 1, // 3: cache.Cache.Get:output_type -> cache.GetResponse - 3, // 4: cache.Cache.Put:output_type -> cache.PutResponse - 5, // 5: cache.Cache.Delete:output_type -> cache.DeleteResponse - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_proto_cache_proto_init() } -func file_proto_cache_proto_init() { - if File_proto_cache_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_cache_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_cache_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_cache_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_cache_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_cache_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_cache_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_cache_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_cache_proto_goTypes, - DependencyIndexes: file_proto_cache_proto_depIdxs, - MessageInfos: file_proto_cache_proto_msgTypes, - }.Build() - File_proto_cache_proto = out.File - file_proto_cache_proto_rawDesc = nil - file_proto_cache_proto_goTypes = nil - file_proto_cache_proto_depIdxs = nil -} diff --git a/examples/cache/proto/cache.pb.micro.go b/examples/cache/proto/cache.pb.micro.go deleted file mode 100644 index 6d75d948..00000000 --- a/examples/cache/proto/cache.pb.micro.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/cache.proto - -package cache - -import ( - fmt "fmt" - proto "google.golang.org/protobuf/proto" - math "math" -) - -import ( - context "context" - api "go-micro.dev/v4/api" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Cache service - -func NewCacheEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Cache service - -type CacheService interface { - // Get receives a value and its time to live by key from the cache. - Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) - // Put stores a value and its time to live in the cache. - Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error) - // Delete removes a key from the cache. - Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) -} - -type cacheService struct { - c client.Client - name string -} - -func NewCacheService(name string, c client.Client) CacheService { - return &cacheService{ - c: c, - name: name, - } -} - -func (c *cacheService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) { - req := c.c.NewRequest(c.name, "Cache.Get", in) - out := new(GetResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cacheService) Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error) { - req := c.c.NewRequest(c.name, "Cache.Put", in) - out := new(PutResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cacheService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) { - req := c.c.NewRequest(c.name, "Cache.Delete", in) - out := new(DeleteResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Cache service - -type CacheHandler interface { - // Get receives a value and its time to live by key from the cache. - Get(context.Context, *GetRequest, *GetResponse) error - // Put stores a value and its time to live in the cache. - Put(context.Context, *PutRequest, *PutResponse) error - // Delete removes a key from the cache. - Delete(context.Context, *DeleteRequest, *DeleteResponse) error -} - -func RegisterCacheHandler(s server.Server, hdlr CacheHandler, opts ...server.HandlerOption) error { - type cache interface { - Get(ctx context.Context, in *GetRequest, out *GetResponse) error - Put(ctx context.Context, in *PutRequest, out *PutResponse) error - Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error - } - type Cache struct { - cache - } - h := &cacheHandler{hdlr} - return s.Handle(s.NewHandler(&Cache{h}, opts...)) -} - -type cacheHandler struct { - CacheHandler -} - -func (h *cacheHandler) Get(ctx context.Context, in *GetRequest, out *GetResponse) error { - return h.CacheHandler.Get(ctx, in, out) -} - -func (h *cacheHandler) Put(ctx context.Context, in *PutRequest, out *PutResponse) error { - return h.CacheHandler.Put(ctx, in, out) -} - -func (h *cacheHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error { - return h.CacheHandler.Delete(ctx, in, out) -} diff --git a/examples/cache/proto/cache.proto b/examples/cache/proto/cache.proto deleted file mode 100644 index aa590667..00000000 --- a/examples/cache/proto/cache.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package cache; - -option go_package = "./proto;cache"; - -// Cache offers a cache as a service functionality. -service Cache { - // Get receives a value and its time to live by key from the cache. - rpc Get(GetRequest) returns (GetResponse) {} - // Put stores a value and its time to live in the cache. - rpc Put(PutRequest) returns (PutResponse) {} - // Delete removes a key from the cache. - rpc Delete(DeleteRequest) returns (DeleteResponse) {} -} - -message GetRequest { - // The key to fetch from the cache. - string key = 1; -} - -message GetResponse { - // The value retrieved from the cache. - string value = 1; - // The value's expiration datetime. - string expiration = 2; -} - -message PutRequest { - // The key to store in the cache. - string key = 1; - // The value to store in the cache. - string value = 2; - // The value's time to live. Parsed using time.ParseDuration. 0 means - // it doesn't expire. - string duration = 3; -} - -message PutResponse {} - -message DeleteRequest { - // The key to remove from the cache. - string key = 1; -} - -message DeleteResponse {} diff --git a/examples/client/README.md b/examples/client/README.md deleted file mode 100644 index ead74863..00000000 --- a/examples/client/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Client - -## Contents - -- main.go - calls each of the go.micro.srv.example handlers and includes the use of the streaming handler -- codegen - demonstrates how to use code generation to remove boilerplate code -- dc_filter - shows how to use Select filters inside a call wrapper for filtering to the local DC -- dc_selector - is the same as dc_filter but as a Selector implementation itself -- pub - publishes messages using the Publish method. By default encoding in protobuf -- selector - shows how to write and load your own Selector -- wrapper - provides examples for how to use client Wrappers (middleware) - diff --git a/examples/client/codegen/README.md b/examples/client/codegen/README.md deleted file mode 100644 index 92dbb508..00000000 --- a/examples/client/codegen/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# Code Generation [Experimental] - -We're experimenting with code generation to reduce the amount of boiler plate code written. - -## Example - -Going from this -```golang -req := client.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", -}) - -rsp := &example.Response{} - -if err := client.Call(context.Background(), req, rsp); err != nil { - return err -} -``` - -To - -```golang -rsp, err := cl.Call(context.Background(), &example.Request{Name: "John"}) -if err != nil { - return err -} -``` - -## Generation of stub code for the example service - -```shell -go get github.com/micro/protobuf/protoc-gen-go -cd examples/server/proto/example -protoc --go_out=plugins=micro:. example.proto -``` - -Look at examples/server/proto/example/example.pb.go -to see the generated code. - -## Guide - -### Download the protoc-gen-go code - -```shell -go get github.com/micro/protobuf/protoc-gen-go -``` - -### Define your proto service. - -hello.proto -```shell -syntax = "proto3"; - -// package name is used as the service name for discovery -// if service name is not passed in when initialising the -// client -package go.micro.srv.greeter; - -service Say { - rpc Hello(Request) returns (Response) {} -} - -message Request { - optional string name = 1; -} - -message Response { - optional string msg = 1; -} -``` - -**Note: Remember to set package name in the proto, it's used to generate -the service for discovery.** - -### Generate code - -```shell -protoc --go_out=plugins=micro:. hello.proto -``` - -### Generated code - -```shell -// Client API for Say service - -type SayClient interface { - Hello(ctx context.Context, in *Request) (*Response, error) -} - -type sayClient struct { - c client.Client - serviceName string -} - -func NewSayClient(serviceName string, c client.Client) SayClient { - if c == nil { - c = client.NewClient() - } - if len(serviceName) == 0 { - serviceName = "go.micro.srv.greeter" - } - return &sayClient{ - c: c, - serviceName: serviceName, - } -} - -func (c *sayClient) Hello(ctx context.Context, in *Request) (*Response, error) { - req := c.c.NewRequest(c.serviceName, "Say.Hello", in) - out := new(Response) - err := c.c.Call(ctx, req, out) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Say service - -type SayHandler interface { - Hello(context.Context, *Request, *Response) error -} - -func RegisterSayHandler(s server.Server, hdlr SayHandler) { - s.Handle(s.NewHandler(hdlr)) -} -``` - -### Use the client -```golang - -import ( - "fmt" - - "context" - "go-micro.dev/v4/client" - hello "path/to/hello/proto" -) - -func main() { - cl := hello.NewSayClient("go.micro.srv.greeter", client.DefaultClient) - // alternative initialisation - // cl := hello.NewSayClient("", nil) - - rsp, err := cl.Hello(contex.Background(), &hello.Request{"Name": "John"}) - if err != nil { - fmt.Println(err) - } -} -``` diff --git a/examples/client/codegen/codegen.go b/examples/client/codegen/codegen.go deleted file mode 100644 index 71d61ab3..00000000 --- a/examples/client/codegen/codegen.go +++ /dev/null @@ -1,79 +0,0 @@ -package main - -import ( - "fmt" - - "context" - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4/cmd" -) - -var ( - cl = example.NewExampleService("go.micro.srv.example", nil) -) - -func call(i int) { - rsp, err := cl.Call(context.Background(), &example.Request{Name: "John"}) - if err != nil { - fmt.Println("call err: ", err, rsp) - return - } - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func stream(i int) { - stream, err := cl.Stream(context.Background(), &example.StreamingRequest{Count: int64(i)}) - if err != nil { - fmt.Println("err:", err) - return - } - for j := 0; j < i; j++ { - rsp, err := stream.Recv() - if err != nil { - fmt.Println("err:", err) - break - } - fmt.Println("Stream: rsp:", rsp.Count) - } - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func pingPong(i int) { - stream, err := cl.PingPong(context.Background()) - if err != nil { - fmt.Println("err:", err) - return - } - for j := 0; j < i; j++ { - if err := stream.Send(&example.Ping{Stroke: int64(j)}); err != nil { - fmt.Println("err:", err) - return - } - rsp, err := stream.Recv() - if err != nil { - fmt.Println("recv err", err) - break - } - fmt.Printf("Sent ping %v got pong %v\n", j, rsp.Stroke) - } - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func main() { - cmd.Init() - - fmt.Println("\n--- Call example ---") - for i := 0; i < 10; i++ { - call(i) - } - - fmt.Println("\n--- Streamer example ---") - stream(10) - - fmt.Println("\n--- Ping Pong example ---") - pingPong(10) -} diff --git a/examples/client/dc_filter/dc_filter.go b/examples/client/dc_filter/dc_filter.go deleted file mode 100644 index 34945032..00000000 --- a/examples/client/dc_filter/dc_filter.go +++ /dev/null @@ -1,88 +0,0 @@ -package main - -import ( - "context" - "fmt" - "math/rand" - "time" - - "go-micro.dev/v4/client" - "go-micro.dev/v4/selector" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/metadata" - "go-micro.dev/v4/registry" - - example "github.com/asim/go-micro/examples/v4/server/proto/example" -) - -func init() { - rand.Seed(time.Now().Unix()) -} - -// A Wrapper that creates a Datacenter Selector Option -type dcWrapper struct { - client.Client -} - -func (dc *dcWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { - md, _ := metadata.FromContext(ctx) - - filter := func(services []*registry.Service) []*registry.Service { - for _, service := range services { - var nodes []*registry.Node - for _, node := range service.Nodes { - if node.Metadata["datacenter"] == md["datacenter"] { - nodes = append(nodes, node) - } - } - service.Nodes = nodes - } - return services - } - - callOptions := append(opts, client.WithSelectOption( - selector.WithFilter(filter), - )) - - fmt.Printf("[DC Wrapper] filtering for datacenter %s\n", md["datacenter"]) - return dc.Client.Call(ctx, req, rsp, callOptions...) -} - -func NewDCWrapper(c client.Client) client.Client { - return &dcWrapper{c} -} - -func call(i int) { - // Create new request to service go.micro.srv.example, method Example.Call - req := client.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", - }) - - // create context with metadata - ctx := metadata.NewContext(context.Background(), map[string]string{ - "datacenter": "local", - }) - - rsp := &example.Response{} - - // Call service - if err := client.Call(ctx, req, rsp); err != nil { - fmt.Println("call err: ", err, rsp) - return - } - - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func main() { - cmd.Init() - - client.DefaultClient = client.NewClient( - client.Wrap(NewDCWrapper), - ) - - fmt.Println("\n--- Call example ---") - for i := 0; i < 10; i++ { - call(i) - } -} diff --git a/examples/client/dc_selector/dc_selector.go b/examples/client/dc_selector/dc_selector.go deleted file mode 100644 index d0c699f8..00000000 --- a/examples/client/dc_selector/dc_selector.go +++ /dev/null @@ -1,134 +0,0 @@ -package main - -import ( - "context" - "fmt" - "math/rand" - "sync" - "time" - - "go-micro.dev/v4/client" - "go-micro.dev/v4/selector" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/registry" - - example "github.com/asim/go-micro/examples/v4/server/proto/example" -) - -// Built in random hashed node selector -type dcSelector struct { - opts selector.Options -} - -var ( - datacenter = "local" -) - -func init() { - rand.Seed(time.Now().Unix()) -} - -func (n *dcSelector) Init(opts ...selector.Option) error { - for _, o := range opts { - o(&n.opts) - } - return nil -} - -func (n *dcSelector) Options() selector.Options { - return n.opts -} - -func (n *dcSelector) Select(service string, opts ...selector.SelectOption) (selector.Next, error) { - services, err := n.opts.Registry.GetService(service) - if err != nil { - return nil, err - } - - if len(services) == 0 { - return nil, selector.ErrNotFound - } - - var nodes []*registry.Node - - // Filter the nodes for datacenter - for _, service := range services { - for _, node := range service.Nodes { - if node.Metadata["datacenter"] == datacenter { - nodes = append(nodes, node) - } - } - } - - if len(nodes) == 0 { - return nil, selector.ErrNotFound - } - - var i int - var mtx sync.Mutex - - return func() (*registry.Node, error) { - mtx.Lock() - defer mtx.Unlock() - i++ - return nodes[i%len(nodes)], nil - }, nil -} - -func (n *dcSelector) Mark(service string, node *registry.Node, err error) { - return -} - -func (n *dcSelector) Reset(service string) { - return -} - -func (n *dcSelector) Close() error { - return nil -} - -func (n *dcSelector) String() string { - return "dc" -} - -// Return a new first node selector -func DCSelector(opts ...selector.Option) selector.Selector { - var sopts selector.Options - for _, opt := range opts { - opt(&sopts) - } - if sopts.Registry == nil { - sopts.Registry = registry.DefaultRegistry - } - return &dcSelector{sopts} -} - -func call(i int) { - // Create new request to service go.micro.srv.example, method Example.Call - req := client.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", - }) - - rsp := &example.Response{} - - // Call service - if err := client.Call(context.Background(), req, rsp); err != nil { - fmt.Println("call err: ", err, rsp) - return - } - - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func main() { - cmd.Init() - - client.DefaultClient = client.NewClient( - client.Selector(DCSelector()), - ) - - fmt.Println("\n--- Call example ---") - for i := 0; i < 10; i++ { - call(i) - } -} diff --git a/examples/client/main.go b/examples/client/main.go deleted file mode 100644 index 381c9277..00000000 --- a/examples/client/main.go +++ /dev/null @@ -1,139 +0,0 @@ -package main - -import ( - "fmt" - - "context" - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4" - "go-micro.dev/v4/client" - "go-micro.dev/v4/metadata" -) - -// publishes a message -func pub(p micro.Publisher) { - msg := &example.Message{ - Say: "This is an async message", - } - - if err := p.Publish(context.TODO(), msg); err != nil { - fmt.Println("pub err: ", err) - return - } - - fmt.Printf("Published: %v\n", msg) -} - -func call(i int, c client.Client) { - // Create new request to service go.micro.srv.example, method Example.Call - req := c.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", - }) - - // create context with metadata - ctx := metadata.NewContext(context.Background(), map[string]string{ - "X-User-Id": "john", - "X-From-Id": "script", - }) - - rsp := &example.Response{} - - // Call service - if err := c.Call(ctx, req, rsp); err != nil { - fmt.Println("call err: ", err, rsp) - return - } - - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func stream(i int, c client.Client) { - // Create new request to service go.micro.srv.example, method Example.Call - // Request can be empty as its actually ignored and merely used to call the handler - req := c.NewRequest("go.micro.srv.example", "Example.Stream", &example.StreamingRequest{}) - - stream, err := c.Stream(context.Background(), req) - if err != nil { - fmt.Println("err:", err) - return - } - if err := stream.Send(&example.StreamingRequest{Count: int64(i)}); err != nil { - fmt.Println("err:", err) - return - } - for stream.Error() == nil { - rsp := &example.StreamingResponse{} - err := stream.Recv(rsp) - if err != nil { - fmt.Println("recv err", err) - break - } - fmt.Println("Stream: rsp:", rsp.Count) - } - - if stream.Error() != nil { - fmt.Println("stream err:", err) - return - } - - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func pingPong(i int, c client.Client) { - // Create new request to service go.micro.srv.example, method Example.Call - // Request can be empty as its actually ignored and merely used to call the handler - req := c.NewRequest("go.micro.srv.example", "Example.PingPong", &example.StreamingRequest{}) - - stream, err := c.Stream(context.Background(), req) - if err != nil { - fmt.Println("err:", err) - return - } - - for j := 0; j < i; j++ { - if err := stream.Send(&example.Ping{Stroke: int64(j + 1)}); err != nil { - fmt.Println("err:", err) - return - } - rsp := &example.Pong{} - err := stream.Recv(rsp) - if err != nil { - fmt.Println("recv err", err) - break - } - fmt.Printf("Sent ping %v got pong %v\n", j+1, rsp.Stroke) - } - - if stream.Error() != nil { - fmt.Println("stream err:", err) - return - } - - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func main() { - service := micro.NewService() - service.Init() - - p := micro.NewPublisher("topic.example", service.Client()) - - fmt.Println("\n--- Publisher example ---") - pub(p) - - fmt.Println("\n--- Call example ---") - for i := 0; i < 10; i++ { - call(i, service.Client()) - } - - fmt.Println("\n--- Streamer example ---") - stream(10, service.Client()) - - fmt.Println("\n--- Ping Pong example ---") - pingPong(10, service.Client()) - -} diff --git a/examples/client/pub/pub.go b/examples/client/pub/pub.go deleted file mode 100644 index 48185a11..00000000 --- a/examples/client/pub/pub.go +++ /dev/null @@ -1,36 +0,0 @@ -package main - -import ( - "fmt" - - "context" - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4" -) - -// publishes a message -func pub(i int, p micro.Publisher) { - msg := &example.Message{ - Say: fmt.Sprintf("This is an async message %d", i), - } - - if err := p.Publish(context.TODO(), msg); err != nil { - fmt.Println("pub err: ", err) - return - } - - fmt.Printf("Published %d: %v\n", i, msg) -} - -func main() { - service := micro.NewService() - service.Init() - - p := micro.NewPublisher("example", service.Client()) - - fmt.Println("\n--- Publisher example ---") - - for i := 0; i < 10; i++ { - pub(i, p) - } -} diff --git a/examples/client/selector/selector.go b/examples/client/selector/selector.go deleted file mode 100644 index 7cfb3d19..00000000 --- a/examples/client/selector/selector.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - "context" - "fmt" - "math/rand" - "time" - - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4/client" - "go-micro.dev/v4/selector" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/registry" -) - -func init() { - rand.Seed(time.Now().Unix()) -} - -// Built in random hashed node selector -type firstNodeSelector struct { - opts selector.Options -} - -func (n *firstNodeSelector) Init(opts ...selector.Option) error { - for _, o := range opts { - o(&n.opts) - } - return nil -} - -func (n *firstNodeSelector) Options() selector.Options { - return n.opts -} - -func (n *firstNodeSelector) Select(service string, opts ...selector.SelectOption) (selector.Next, error) { - services, err := n.opts.Registry.GetService(service) - if err != nil { - return nil, err - } - - if len(services) == 0 { - return nil, selector.ErrNotFound - } - - var sopts selector.SelectOptions - for _, opt := range opts { - opt(&sopts) - } - - for _, filter := range sopts.Filters { - services = filter(services) - } - - if len(services) == 0 { - return nil, selector.ErrNotFound - } - - if len(services[0].Nodes) == 0 { - return nil, selector.ErrNotFound - } - - return func() (*registry.Node, error) { - return services[0].Nodes[0], nil - }, nil -} - -func (n *firstNodeSelector) Mark(service string, node *registry.Node, err error) { - return -} - -func (n *firstNodeSelector) Reset(service string) { - return -} - -func (n *firstNodeSelector) Close() error { - return nil -} - -func (n *firstNodeSelector) String() string { - return "first" -} - -// Return a new first node selector -func FirstNodeSelector(opts ...selector.Option) selector.Selector { - var sopts selector.Options - for _, opt := range opts { - opt(&sopts) - } - if sopts.Registry == nil { - sopts.Registry = registry.DefaultRegistry - } - return &firstNodeSelector{sopts} -} - -func call(i int) { - // Create new request to service go.micro.srv.example, method Example.Call - req := client.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", - }) - - rsp := &example.Response{} - - // Call service - if err := client.Call(context.Background(), req, rsp); err != nil { - fmt.Println("call err: ", err, rsp) - return - } - - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func main() { - cmd.Init() - - client.DefaultClient = client.NewClient( - client.Selector(FirstNodeSelector()), - ) - - fmt.Println("\n--- Call example ---") - for i := 0; i < 10; i++ { - call(i) - } -} diff --git a/examples/client/wrapper/wrapper.go b/examples/client/wrapper/wrapper.go deleted file mode 100644 index a224cc57..00000000 --- a/examples/client/wrapper/wrapper.go +++ /dev/null @@ -1,110 +0,0 @@ -package main - -import ( - "fmt" - "time" - - "context" - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4/client" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/metadata" - "go-micro.dev/v4/registry" -) - -// wrapper example code - -// log wrapper logs every time a request is made -type logWrapper struct { - client.Client -} - -func (l *logWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { - md, _ := metadata.FromContext(ctx) - fmt.Printf("[Log Wrapper] ctx: %v service: %s method: %s\n", md, req.Service(), req.Endpoint()) - return l.Client.Call(ctx, req, rsp) -} - -// trace wrapper attaches a unique trace ID - timestamp -type traceWrapper struct { - client.Client -} - -func (t *traceWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { - ctx = metadata.NewContext(ctx, map[string]string{ - "X-Trace-Id": fmt.Sprintf("%d", time.Now().Unix()), - }) - return t.Client.Call(ctx, req, rsp) -} - -// Implements client.Wrapper as logWrapper -func logWrap(c client.Client) client.Client { - return &logWrapper{c} -} - -// Implements client.Wrapper as traceWrapper -func traceWrap(c client.Client) client.Client { - return &traceWrapper{c} -} - -func metricsWrap(cf client.CallFunc) client.CallFunc { - return func(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) error { - t := time.Now() - err := cf(ctx, node, req, rsp, opts) - fmt.Printf("[Metrics Wrapper] called: %v %s.%s duration: %v\n", node, req.Service(), req.Endpoint(), time.Since(t)) - return err - } -} - -func call(i int) { - // Create new request to service go.micro.srv.example, method Example.Call - req := client.NewRequest("go.micro.srv.example", "Example.Call", &example.Request{ - Name: "John", - }) - - // create context with metadata - ctx := metadata.NewContext(context.Background(), map[string]string{ - "X-User-Id": "john", - "X-From-Id": "script", - }) - - rsp := &example.Response{} - - // Call service - if err := client.Call(ctx, req, rsp); err != nil { - fmt.Println("call err: ", err, rsp) - return - } - - fmt.Println("Call:", i, "rsp:", rsp.Msg) -} - -func main() { - cmd.Init() - - fmt.Println("\n--- Log Wrapper example ---") - - // Wrap the default client - client.DefaultClient = logWrap(client.DefaultClient) - - call(0) - - fmt.Println("\n--- Log+Trace Wrapper example ---") - - // Wrap using client.Wrap option - client.DefaultClient = client.NewClient( - client.Wrap(traceWrap), - client.Wrap(logWrap), - ) - - call(1) - - fmt.Println("\n--- Metrics Wrapper example ---") - - // Wrap using client.Wrap option - client.DefaultClient = client.NewClient( - client.WrapCall(metricsWrap), - ) - - call(2) -} diff --git a/examples/config/README.md b/examples/config/README.md deleted file mode 100644 index ce9b3fe0..00000000 --- a/examples/config/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Go Config - -This example demonstrates how to use Go Config for dynamic configuration. - diff --git a/examples/config/file/config.json b/examples/config/file/config.json deleted file mode 100644 index 4effd88c..00000000 --- a/examples/config/file/config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "hosts": { - "database": { - "address": "10.0.0.1", - "port": 3306 - }, - "cache": { - "address": "10.0.0.2", - "port": 6379 - } - } -} diff --git a/examples/config/file/main.go b/examples/config/file/main.go deleted file mode 100644 index b4e16b6f..00000000 --- a/examples/config/file/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "fmt" - - "go-micro.dev/v4/config" - "go-micro.dev/v4/config/source/file" -) - -func main() { - // load the config from a file source - if err := config.Load(file.NewSource( - file.WithPath("./config.json"), - )); err != nil { - fmt.Println(err) - return - } - - // define our own host type - type Host struct { - Address string `json:"address"` - Port int `json:"port"` - } - - var host Host - - // read a database host - if err := config.Get("hosts", "database").Scan(&host); err != nil { - fmt.Println(err) - return - } - - fmt.Println(host.Address, host.Port) -} diff --git a/examples/config/grpc/README.md b/examples/config/grpc/README.md deleted file mode 100644 index 83d45489..00000000 --- a/examples/config/grpc/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# gRPC Config Server - -This is an example implementation of a grpc config server - -## Get Started - -### Run Server - -```bash -go run srv/main.go -``` - -### Run Client - -```bash -go run client/main.go -``` - -### Edit Config - -Change values in srv/conf/micro.yml - -```bash -micro: - name: Micro - version: 1.0.0 - message: hello -``` - -to - -```bash -micro: - name: Micro - version: 1.0.0 - message: hello john -``` - -The output from watching config after an edit - -```bash -2019/04/28 10:57:15 Watch changes: {"message":"hello john","name":"Micro","version":"1.0.0"} -``` diff --git a/examples/config/grpc/client/main.go b/examples/config/grpc/client/main.go deleted file mode 100644 index 8597eccb..00000000 --- a/examples/config/grpc/client/main.go +++ /dev/null @@ -1,58 +0,0 @@ -package main - -import ( - grpcConfig "github.com/asim/go-micro/plugins/config/source/grpc/v4" - "go-micro.dev/v4/config" - log "go-micro.dev/v4/logger" -) - -type Micro struct { - Info -} - -type Info struct { - Name string `json:"name,omitempty"` - Version string `json:"version,omitempty"` - Message string `json:"message,omitempty"` - Age int `json:"age,omitempty"` -} - -func main() { - // create new source - source := grpcConfig.NewSource( - grpcConfig.WithAddress("127.0.0.1:8600"), - grpcConfig.WithPath("/micro"), - ) - - // create new config - conf, _ := config.NewConfig() - - // load the source into config - if err := conf.Load(source); err != nil { - log.Fatal(err) - } - - configs := &Micro{} - if err := conf.Scan(configs); err != nil { - log.Fatal(err) - } - - log.Infof("Read config: %s", string(conf.Bytes())) - - // watch the config for changes - watcher, err := conf.Watch() - if err != nil { - log.Fatal(err) - } - - log.Infof("Watching for changes ...") - - for { - v, err := watcher.Next() - if err != nil { - log.Fatal(err) - } - - log.Infof("Watching for changes: %v", string(v.Bytes())) - } -} diff --git a/examples/config/grpc/srv/conf/extra.yaml b/examples/config/grpc/srv/conf/extra.yaml deleted file mode 100644 index 86134c24..00000000 --- a/examples/config/grpc/srv/conf/extra.yaml +++ /dev/null @@ -1,4 +0,0 @@ -other: - name: Extra - version: 1.0.0 - message: Ugh this sucks diff --git a/examples/config/grpc/srv/conf/micro.yaml b/examples/config/grpc/srv/conf/micro.yaml deleted file mode 100644 index 91271315..00000000 --- a/examples/config/grpc/srv/conf/micro.yaml +++ /dev/null @@ -1,4 +0,0 @@ -micro: - name: Micro - version: 1.0.0 - message: hello diff --git a/examples/config/grpc/srv/conf/other.yaml b/examples/config/grpc/srv/conf/other.yaml deleted file mode 100644 index c6af6a8a..00000000 --- a/examples/config/grpc/srv/conf/other.yaml +++ /dev/null @@ -1,4 +0,0 @@ -other: - name: badBoy - version: 1.0.0 - hi: Ah \ No newline at end of file diff --git a/examples/config/grpc/srv/main.go b/examples/config/grpc/srv/main.go deleted file mode 100644 index 52d2888a..00000000 --- a/examples/config/grpc/srv/main.go +++ /dev/null @@ -1,138 +0,0 @@ -package main - -import ( - "context" - "crypto/md5" - "fmt" - "net" - "strings" - "sync" - "time" - - yaml "github.com/asim/go-micro/plugins/config/encoder/yaml/v4" - proto "github.com/asim/go-micro/plugins/config/source/grpc/v4/proto" - "go-micro.dev/v4/config" - "go-micro.dev/v4/config/reader" - "go-micro.dev/v4/config/reader/json" - "go-micro.dev/v4/config/source/file" - log "go-micro.dev/v4/logger" - grpc "google.golang.org/grpc" -) - -var ( - mux sync.RWMutex - configMaps = make(map[string]*proto.ChangeSet) - apps = []string{"micro", "extra"} - cfg config.Config -) - -type Service struct{} - -func main() { - // create config with yaml encoder - enc := yaml.NewEncoder() - cfg, _ = config.NewConfig(config.WithReader(json.NewReader( - reader.WithEncoder(enc), - ))) - - // load config files - err := loadConfigFile() - if err != nil { - log.Fatal(err) - } - - // new service - service := grpc.NewServer() - proto.RegisterSourceServer(service, new(Service)) - ts, err := net.Listen("tcp", ":8600") - if err != nil { - log.Fatal(err) - } - - log.Infof("configServer started") - err = service.Serve(ts) - if err != nil { - log.Fatal(err) - } -} - -func (s Service) Read(ctx context.Context, req *proto.ReadRequest) (rsp *proto.ReadResponse, err error) { - appName := parsePath(req.Path) - switch appName { - case "micro", "extra": - rsp = &proto.ReadResponse{ - ChangeSet: getConfig(appName), - } - return - default: - err = fmt.Errorf("[Read] the first path is invalid") - return - } -} - -func (s Service) Watch(req *proto.WatchRequest, server proto.Source_WatchServer) (err error) { - appName := parsePath(req.Path) - rsp := &proto.WatchResponse{ - ChangeSet: getConfig(appName), - } - if err = server.Send(rsp); err != nil { - log.Infof("[Watch] watch files error,%s", err) - return err - } - - return -} - -func loadConfigFile() (err error) { - for _, app := range apps { - if err := cfg.Load(file.NewSource( - file.WithPath("./conf/" + app + ".yaml"), - )); err != nil { - log.Fatalf("[loadConfigFile] load files error,%s", err) - return err - } - } - - // watch changes - watcher, err := cfg.Watch() - if err != nil { - log.Fatalf("[loadConfigFile] start watching files error,%s", err) - return err - } - - go func() { - for { - v, err := watcher.Next() - if err != nil { - log.Fatalf("[loadConfigFile] watch files error,%s", err) - return - } - - log.Infof("[loadConfigFile] file change, %s", string(v.Bytes())) - } - }() - - return -} - -func getConfig(appName string) *proto.ChangeSet { - bytes := cfg.Get(appName).Bytes() - - log.Infof("[getConfig] appName,%s", string(bytes)) - return &proto.ChangeSet{ - Data: bytes, - Checksum: fmt.Sprintf("%x", md5.Sum(bytes)), - Format: "yml", - Source: "file", - Timestamp: time.Now().Unix()} -} - -func parsePath(path string) (appName string) { - paths := strings.Split(path, "/") - - if paths[0] == "" && len(paths) > 1 { - return paths[1] - } - - return paths[0] -} diff --git a/examples/config/modify/README.md b/examples/config/modify/README.md deleted file mode 100644 index b3254553..00000000 --- a/examples/config/modify/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Modify Config - -This is an example of modifying config in a file. - -Note: We currently only support setting values in memory, not passing down to the source. - -## Usage - -- example.conf is a toml file format -- modify.go - loads, modifies and writes back the file - -``` -go run modify.go -``` diff --git a/examples/config/modify/example.conf b/examples/config/modify/example.conf deleted file mode 100644 index bc12c990..00000000 --- a/examples/config/modify/example.conf +++ /dev/null @@ -1,47 +0,0 @@ -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - country = "中国" # This should be parsed as UTF-8 - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] - -# Products - - [[products]] - name = "Hammer" - sku = 738594937 - - [[products]] - name = "Nail" - sku = 284758393 - color = "gray" diff --git a/examples/config/modify/modify.go b/examples/config/modify/modify.go deleted file mode 100644 index b1c68340..00000000 --- a/examples/config/modify/modify.go +++ /dev/null @@ -1,60 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "go-micro.dev/v4/config" - "github.com/asim/go-micro/plugins/config/encoder/toml/v4" - "go-micro.dev/v4/config/source" - "go-micro.dev/v4/config/source/file" -) - -func main() { - // new toml encoder - t := toml.NewEncoder() - - // create a new config - c, err := config.NewConfig( - config.WithSource( - // create a new file source - file.NewSource( - // path of file - file.WithPath("./example.conf"), - // specify the toml encoder - source.WithEncoder(t), - ), - ), - ) - if err != nil { - fmt.Println(err) - return - } - - // load the config - if err := c.Load(); err != nil { - fmt.Println(err) - return - } - - // set a value - c.Set("foo", "bar") - - // now the hacks begin - vals := c.Map() - - // encode - v, err := t.Encode(vals) - if err != nil { - fmt.Println(err) - return - } - - // write the file - if err := os.WriteFile("./example.conf", v, 0644); err != nil { - fmt.Println(err) - return - } - - fmt.Println("wrote update to example.conf") -} diff --git a/examples/config/yaml/README.md b/examples/config/yaml/README.md deleted file mode 100644 index 2e20a29a..00000000 --- a/examples/config/yaml/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Yaml Config - -This is an example of reading yaml config in a file. - -## Usage - -```bash -go run main.go -``` diff --git a/examples/config/yaml/config.yaml b/examples/config/yaml/config.yaml deleted file mode 100644 index 890515bf..00000000 --- a/examples/config/yaml/config.yaml +++ /dev/null @@ -1,7 +0,0 @@ -hosts: - database: - address: 10.0.0.1 - port: 3306 - cache: - address: 10.0.0.2 - port: 6379 diff --git a/examples/config/yaml/main.go b/examples/config/yaml/main.go deleted file mode 100644 index 685fce8a..00000000 --- a/examples/config/yaml/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - - yaml "github.com/asim/go-micro/plugins/config/encoder/yaml/v4" - "go-micro.dev/v4/config" - "go-micro.dev/v4/config/reader" - "go-micro.dev/v4/config/reader/json" - "go-micro.dev/v4/config/source/file" -) - -func main() { - // new yaml encoder - enc := yaml.NewEncoder() - - // new config - c, _ := config.NewConfig( - config.WithReader( - json.NewReader( // json reader for internal config merge - reader.WithEncoder(enc), - ), - ), - ) - - // load the config from a file source - if err := c.Load(file.NewSource( - file.WithPath("./config.yaml"), - )); err != nil { - fmt.Println(err) - return - } - - fmt.Println("data", c.Map()) - - // define our own host type - type Host struct { - Address string `json:"address"` - Port int `json:"port"` - } - - var host Host - - // read a database host - if err := c.Get("hosts", "database").Scan(&host); err != nil { - fmt.Println(err) - return - } - - fmt.Println(host.Address, host.Port) -} diff --git a/examples/event/README.md b/examples/event/README.md deleted file mode 100644 index 11de044e..00000000 --- a/examples/event/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Event - -This is an example of using the micro API as an event gateway with the event handler - -A http request is formatted as an [event](https://github.com/micro/go-api/blob/master/proto/api.proto#L28L39) and published on the go-micro message broker. - -## Contents - -- srv - A service which subscribes to events - -## Usage - -Run the micro api with the event handler set and with a namespace which used as part of the topic name - -``` -micro api --handler=event --namespace=go.micro.evt -``` - -Run the service - -``` -go run srv/main.go -``` - -### Event format - -On the receiving end the message will be formatted like so: - -``` -// A HTTP event as RPC -message Event { - // e.g login - string name = 1; - // uuid - string id = 2; - // unix timestamp of event - int64 timestamp = 3; - // event headers - map header = 4; - // the event data - string data = 5; -} -``` - -### Publish Event - -Publishing an event is as simple as making a http post request - -``` -curl -d '{"name": "john"}' http://localhost:8080/user/login -``` - -This request will be published to the topic `go.micro.evt.user` with event name `login` - -### Receiving Event - -A subscriber should be registered with the service for topic `go.micro.evt.user` - -The subscriber should take the proto.Event type. See srv/main.go for the code. - -The event received will look like the following - -``` -{ - name: "user.login", - id: "go.micro.evt.user-user.login-693116e7-f20c-11e7-96c7-f40f242f6897", - timestamp:1515152077, - header: {...}, - data: {"name": "john"} -} -``` diff --git a/examples/event/srv/main.go b/examples/event/srv/main.go deleted file mode 100644 index 771d793d..00000000 --- a/examples/event/srv/main.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "context" - - "go-micro.dev/v4" - proto "go-micro.dev/v4/api/proto" - "go-micro.dev/v4/util/log" -) - -// All methods of Event will be executed when a message is received -type Event struct{} - -// Method can be of any name -func (e *Event) Process(ctx context.Context, event *proto.Event) error { - log.Logf("Received event %+v\n", event) - // do something with event - return nil -} - -func main() { - service := micro.NewService( - micro.Name("user"), - ) - service.Init() - - // register subscriber - micro.RegisterSubscriber("go.micro.evt.user", service.Server(), new(Event)) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/event/srv/proto/pubsub.micro.go b/examples/event/srv/proto/pubsub.micro.go deleted file mode 100644 index 7f6c6a53..00000000 --- a/examples/event/srv/proto/pubsub.micro.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/event/srv/proto/pubsub.proto - -/* -Package pubsub is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/event/srv/proto/pubsub.proto - -It has these top-level messages: - Event -*/ -package pubsub - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package diff --git a/examples/event/srv/proto/pubsub.pb.go b/examples/event/srv/proto/pubsub.pb.go deleted file mode 100644 index 9b5d30ff..00000000 --- a/examples/event/srv/proto/pubsub.pb.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/event/srv/proto/pubsub.proto - -/* -Package pubsub is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/event/srv/proto/pubsub.proto - -It has these top-level messages: - Event -*/ -package pubsub - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Example message -type Event struct { - // unique id - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - // unix timestamp - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - // message - Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Event) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Event) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *Event) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func init() { - proto.RegisterType((*Event)(nil), "Event") -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/event/srv/proto/pubsub.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 143 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4b, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcd, 0x4c, 0x2e, 0xca, 0xd7, 0x4f, 0xad, 0x48, - 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2f, 0x2e, 0x2a, 0xd3, - 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x28, 0x4d, 0x2a, 0x2e, 0x4d, 0xd2, 0x03, 0x73, 0x94, - 0xfc, 0xb9, 0x58, 0x5d, 0x41, 0xf2, 0x42, 0x7c, 0x5c, 0x4c, 0x99, 0x29, 0x12, 0x8c, 0x0a, 0x8c, - 0x1a, 0x9c, 0x41, 0x4c, 0x99, 0x29, 0x42, 0x32, 0x5c, 0x9c, 0x25, 0x99, 0xb9, 0xa9, 0xc5, 0x25, - 0x89, 0xb9, 0x05, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x08, 0x01, 0x21, 0x09, 0x2e, 0xf6, - 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x66, 0xb0, 0x16, 0x18, 0x37, 0x89, 0x0d, 0x6c, - 0xae, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x89, 0xbc, 0xdb, 0x74, 0x91, 0x00, 0x00, 0x00, -} diff --git a/examples/event/srv/proto/pubsub.proto b/examples/event/srv/proto/pubsub.proto deleted file mode 100644 index cc534a27..00000000 --- a/examples/event/srv/proto/pubsub.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -// Example message -message Event { - // unique id - string id = 1; - // unix timestamp - int64 timestamp = 2; - // message - string message = 3; -} diff --git a/examples/filter/README.md b/examples/filter/README.md deleted file mode 100644 index 58f2265c..00000000 --- a/examples/filter/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Filter - -Filter demonstrates how to filter requests in the client - -## Usage - -``` -// Run the service example -go run ../service/main.go -``` - -``` -// Run the client -go run main.go -``` diff --git a/examples/filter/main.go b/examples/filter/main.go deleted file mode 100644 index d550eed7..00000000 --- a/examples/filter/main.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "context" - "fmt" - - "github.com/asim/go-micro/examples/v4/filter/version" - proto "github.com/asim/go-micro/examples/v4/service/proto" - "go-micro.dev/v4" -) - -func main() { - service := micro.NewService() - service.Init() - - greeter := proto.NewGreeterService("greeter", service.Client()) - - rsp, err := greeter.Hello( - // provide a context - context.TODO(), - // provide the request - &proto.Request{Name: "John"}, - // set the filter - version.Filter("latest"), - ) - if err != nil { - fmt.Println(err) - return - } - - fmt.Println(rsp.Greeting) -} diff --git a/examples/filter/version/version.go b/examples/filter/version/version.go deleted file mode 100644 index cbf436b8..00000000 --- a/examples/filter/version/version.go +++ /dev/null @@ -1,25 +0,0 @@ -// Package version provides a way of calling a version of a service -package version - -import ( - "go-micro.dev/v4/client" - "go-micro.dev/v4/selector" - "go-micro.dev/v4/registry" -) - -// Filter will filter the version of the service -func Filter(v string) client.CallOption { - filter := func(services []*registry.Service) []*registry.Service { - var filtered []*registry.Service - - for _, service := range services { - if service.Version == v { - filtered = append(filtered, service) - } - } - - return filtered - } - - return client.WithSelectOption(selector.WithFilter(filter)) -} diff --git a/examples/flags/README.md b/examples/flags/README.md deleted file mode 100644 index 66fb34d0..00000000 --- a/examples/flags/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Flags - -This is an example of using command line flags - -## Run the example - -```shell -go run main.go --string_flag="a string" --int_flag=10 --bool_flag=true -``` - -And that's all there is to it. diff --git a/examples/flags/main.go b/examples/flags/main.go deleted file mode 100644 index 3a81a650..00000000 --- a/examples/flags/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "go-micro.dev/v4" - "github.com/urfave/cli/v2" -) - -func main() { - service := micro.NewService( - // Add runtime flags - // We could do this below too - micro.Flags( - &cli.StringFlag{ - Name: "string_flag", - Usage: "This is a string flag", - }, - &cli.IntFlag{ - Name: "int_flag", - Usage: "This is an int flag", - }, - &cli.BoolFlag{ - Name: "bool_flag", - Usage: "This is a bool flag", - }, - ), - ) - - // Init will parse the command line flags. Any flags set will - // override the above settings. Options defined here will - // override anything set on the command line. - service.Init( - // Add runtime action - // We could actually do this above - micro.Action(func(c *cli.Context) error { - fmt.Printf("The string flag is: %s\n", c.String("string_flag")) - fmt.Printf("The int flag is: %d\n", c.Int("int_flag")) - fmt.Printf("The bool flag is: %t\n", c.Bool("bool_flag")) - // let's just exit because - os.Exit(0) - return nil - }), - ) - - // Run the server - if err := service.Run(); err != nil { - fmt.Println(err) - } -} diff --git a/examples/function/README.md b/examples/function/README.md deleted file mode 100644 index 4891d9c2..00000000 --- a/examples/function/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Function - -This is an example of creating a micro function. A function is a one time executing service. - -## Contents - -- main.go - is the main definition of the function -- proto - contains the protobuf definition of the API - -## Run function - -```shell -while true; do - github.com/asim/go-micro/examples/v4/function -done -``` - -## Call function - -```shell -micro call greeter Greeter.Hello '{"name": "john"}' -``` diff --git a/examples/function/main.go b/examples/function/main.go deleted file mode 100644 index 53bb338a..00000000 --- a/examples/function/main.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "context" - - proto "github.com/asim/go-micro/examples/v4/function/proto" - "go-micro.dev/v4" -) - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, req *proto.HelloRequest, rsp *proto.HelloResponse) error { - rsp.Greeting = "Hello " + req.Name - return nil -} - -func main() { - fnc := micro.NewFunction( - micro.Name("greeter"), - ) - - fnc.Init() - - fnc.Handle(new(Greeter)) - - fnc.Run() -} diff --git a/examples/function/proto/greeter.micro.go b/examples/function/proto/greeter.micro.go deleted file mode 100644 index e7de7aff..00000000 --- a/examples/function/proto/greeter.micro.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/function/proto/greeter.proto - -/* -Package greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/function/proto/greeter.proto - -It has these top-level messages: - HelloRequest - HelloResponse -*/ -package greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Greeter service - -type GreeterService interface { - Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error) -} - -type greeterService struct { - c client.Client - serviceName string -} - -func NewGreeterService(serviceName string, c client.Client) GreeterService { - if c == nil { - c = client.NewClient() - } - if len(serviceName) == 0 { - serviceName = "greeter" - } - return &greeterService{ - c: c, - serviceName: serviceName, - } -} - -func (c *greeterService) Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error) { - req := c.c.NewRequest(c.serviceName, "Greeter.Hello", in) - out := new(HelloResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterHandler interface { - Hello(context.Context, *HelloRequest, *HelloResponse) error -} - -func RegisterGreeterHandler(s server.Server, hdlr GreeterHandler, opts ...server.HandlerOption) { - type greeter interface { - Hello(ctx context.Context, in *HelloRequest, out *HelloResponse) error - } - type Greeter struct { - greeter - } - h := &greeterHandler{hdlr} - s.Handle(s.NewHandler(&Greeter{h}, opts...)) -} - -type greeterHandler struct { - GreeterHandler -} - -func (h *greeterHandler) Hello(ctx context.Context, in *HelloRequest, out *HelloResponse) error { - return h.GreeterHandler.Hello(ctx, in, out) -} diff --git a/examples/function/proto/greeter.pb.go b/examples/function/proto/greeter.pb.go deleted file mode 100644 index 4aba7483..00000000 --- a/examples/function/proto/greeter.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/function/proto/greeter.proto - -/* -Package greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/function/proto/greeter.proto - -It has these top-level messages: - HelloRequest - HelloResponse -*/ -package greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -type HelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *HelloRequest) Reset() { *m = HelloRequest{} } -func (m *HelloRequest) String() string { return proto.CompactTextString(m) } -func (*HelloRequest) ProtoMessage() {} -func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *HelloRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type HelloResponse struct { - Greeting string `protobuf:"bytes,2,opt,name=greeting" json:"greeting,omitempty"` -} - -func (m *HelloResponse) Reset() { *m = HelloResponse{} } -func (m *HelloResponse) String() string { return proto.CompactTextString(m) } -func (*HelloResponse) ProtoMessage() {} -func (*HelloResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *HelloResponse) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -func init() { - proto.RegisterType((*HelloRequest)(nil), "HelloRequest") - proto.RegisterType((*HelloResponse)(nil), "HelloResponse") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Greeter service - -type GreeterClient interface { - Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) -} - -type greeterClient struct { - cc *grpc.ClientConn -} - -func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { - return &greeterClient{cc} -} - -func (c *greeterClient) Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) { - out := new(HelloResponse) - err := grpc.Invoke(ctx, "/Greeter/Hello", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterServer interface { - Hello(context.Context, *HelloRequest) (*HelloResponse, error) -} - -func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { - s.RegisterService(&_Greeter_serviceDesc, srv) -} - -func _Greeter_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GreeterServer).Hello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Greeter/Hello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GreeterServer).Hello(ctx, req.(*HelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Greeter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Greeter", - HandlerType: (*GreeterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Hello", - Handler: _Greeter_Hello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/asim/go-micro/examples/v4/function/proto/greeter.proto", -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/function/proto/greeter.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 167 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8e, 0xcb, 0x0a, 0xc2, 0x30, - 0x10, 0x45, 0xad, 0xf8, 0x1c, 0xac, 0x8b, 0xac, 0x4a, 0x57, 0x92, 0x55, 0x41, 0x48, 0xc0, 0x82, - 0xbf, 0xa0, 0xeb, 0xfe, 0x41, 0x5b, 0xc6, 0x1a, 0x68, 0x32, 0x35, 0x0f, 0xf0, 0xf3, 0x85, 0x51, - 0x44, 0x77, 0x73, 0xe1, 0xce, 0x39, 0x17, 0xce, 0x83, 0x89, 0xf7, 0xd4, 0xa9, 0x9e, 0xac, 0xb6, - 0xa6, 0xf7, 0xa4, 0xf1, 0xd9, 0xda, 0x69, 0xc4, 0xa0, 0x6f, 0xc9, 0xf5, 0xd1, 0x90, 0xd3, 0x93, - 0xa7, 0x48, 0x7a, 0xf0, 0x88, 0x11, 0xbd, 0xe2, 0x24, 0x25, 0xec, 0xae, 0x38, 0x8e, 0xd4, 0xe0, - 0x23, 0x61, 0x88, 0x42, 0xc0, 0xc2, 0xb5, 0x16, 0x8b, 0xec, 0x90, 0x55, 0xdb, 0x86, 0x6f, 0x79, - 0x84, 0xfc, 0xd3, 0x09, 0x13, 0xb9, 0x80, 0xa2, 0x84, 0x0d, 0x53, 0x8c, 0x1b, 0x8a, 0x39, 0x17, - 0xbf, 0xf9, 0x54, 0xc3, 0xfa, 0xf2, 0x36, 0x88, 0x0a, 0x96, 0xfc, 0x27, 0x72, 0xf5, 0xeb, 0x28, - 0xf7, 0xea, 0x0f, 0x27, 0x67, 0xdd, 0x8a, 0xc7, 0xd4, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, - 0x67, 0xb8, 0xdf, 0xc6, 0x00, 0x00, 0x00, -} diff --git a/examples/function/proto/greeter.proto b/examples/function/proto/greeter.proto deleted file mode 100644 index 4ff347af..00000000 --- a/examples/function/proto/greeter.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -service Greeter { - rpc Hello(HelloRequest) returns (HelloResponse) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloResponse { - string greeting = 2; -} diff --git a/examples/gateway/README.md b/examples/gateway/README.md deleted file mode 100644 index b744a4bd..00000000 --- a/examples/gateway/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# GRPC Gateway - -This directory contains a grpc gateway generated using [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway). - -Services written with [asim/go-micro/service/grpc](https://github.com/asim/go-micro/service/grpc) are fully compatible with the grpc-gateway and any other -grpc services. - -Go to [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) for details on how to generate gateways. We -have generated the gateway from the same proto as the greeter server but with additional options for the gateway. - -## Usage - -Run the go.micro.srv.greeter service - -``` -go run ../greeter/srv/main.go --server_address=localhost:9090 -``` - -Run the gateway - -``` -go run main.go -``` - -Curl your request at the gateway (localhost:8080) - -``` -curl -H "content-type: application/json" -d '{"name": "john"}' http://localhost:8080/greeter/hello -``` diff --git a/examples/gateway/main.go b/examples/gateway/main.go deleted file mode 100644 index 5695719b..00000000 --- a/examples/gateway/main.go +++ /dev/null @@ -1,44 +0,0 @@ -package main - -import ( - "flag" - "net/http" - - "context" - "github.com/golang/glog" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "google.golang.org/grpc" - - hello "github.com/asim/go-micro/examples/v4/gateway/proto/hello" -) - -var ( - // the go.micro.srv.greeter address - endpoint = flag.String("endpoint", "localhost:9090", "go.micro.srv.greeter address") -) - -func run() error { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - mux := runtime.NewServeMux() - opts := []grpc.DialOption{grpc.WithInsecure()} - - err := hello.RegisterSayHandlerFromEndpoint(ctx, mux, *endpoint, opts) - if err != nil { - return err - } - - return http.ListenAndServe(":8080", mux) -} - -func main() { - flag.Parse() - - defer glog.Flush() - - if err := run(); err != nil { - glog.Fatal(err) - } -} diff --git a/examples/gateway/proto/hello/hello.pb.go b/examples/gateway/proto/hello/hello.pb.go deleted file mode 100644 index ae944de2..00000000 --- a/examples/gateway/proto/hello/hello.pb.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: hello.proto - -/* -Package greeter is a generated protocol buffer package. - -It is generated from these files: - hello.proto - -It has these top-level messages: - Request - Response -*/ -package greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Response) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func init() { - proto.RegisterType((*Request)(nil), "greeter.Request") - proto.RegisterType((*Response)(nil), "greeter.Response") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Say service - -type SayClient interface { - Hello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) -} - -type sayClient struct { - cc *grpc.ClientConn -} - -func NewSayClient(cc *grpc.ClientConn) SayClient { - return &sayClient{cc} -} - -func (c *sayClient) Hello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := grpc.Invoke(ctx, "/greeter.Say/Hello", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Say service - -type SayServer interface { - Hello(context.Context, *Request) (*Response, error) -} - -func RegisterSayServer(s *grpc.Server, srv SayServer) { - s.RegisterService(&_Say_serviceDesc, srv) -} - -func _Say_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SayServer).Hello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/greeter.Say/Hello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SayServer).Hello(ctx, req.(*Request)) - } - return interceptor(ctx, in, info, handler) -} - -var _Say_serviceDesc = grpc.ServiceDesc{ - ServiceName: "greeter.Say", - HandlerType: (*SayServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Hello", - Handler: _Say_Hello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "hello.proto", -} - -func init() { proto.RegisterFile("hello.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 176 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x48, 0xcd, 0xc9, - 0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4f, 0x2f, 0x4a, 0x4d, 0x2d, 0x49, 0x2d, - 0x92, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, - 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x28, 0x53, 0x92, 0xe5, 0x62, 0x0f, 0x4a, - 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, 0x54, - 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x95, 0x64, 0xb8, 0x38, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, - 0x8a, 0x53, 0x85, 0x04, 0xb8, 0x98, 0x73, 0x8b, 0xd3, 0xa1, 0xd2, 0x20, 0xa6, 0x91, 0x1f, 0x17, - 0x73, 0x70, 0x62, 0xa5, 0x90, 0x3b, 0x17, 0xab, 0x07, 0xc8, 0x66, 0x21, 0x01, 0x3d, 0xa8, 0xa5, - 0x7a, 0x50, 0x33, 0xa5, 0x04, 0x91, 0x44, 0x20, 0xc6, 0x28, 0x49, 0x36, 0x5d, 0x7e, 0x32, 0x99, - 0x49, 0x58, 0x89, 0x4f, 0x1f, 0x2a, 0xa5, 0x0f, 0x76, 0xb6, 0x15, 0xa3, 0x56, 0x12, 0x1b, 0xd8, - 0x4d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x1b, 0x54, 0xae, 0xc9, 0x00, 0x00, 0x00, -} diff --git a/examples/gateway/proto/hello/hello.pb.gw.go b/examples/gateway/proto/hello/hello.pb.gw.go deleted file mode 100644 index a49280bb..00000000 --- a/examples/gateway/proto/hello/hello.pb.gw.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: hello.proto - -/* -Package greeter is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package greeter - -import ( - "io" - "net/http" - - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray - -func request_Say_Hello_0(ctx context.Context, marshaler runtime.Marshaler, client SayClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Request - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Hello(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -// RegisterSayHandlerFromEndpoint is same as RegisterSayHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterSayHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterSayHandler(ctx, mux, conn) -} - -// RegisterSayHandler registers the http handlers for service Say to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterSayHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - client := NewSayClient(conn) - - mux.Handle("POST", pattern_Say_Hello_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - if cn, ok := w.(http.CloseNotifier); ok { - go func(done <-chan struct{}, closed <-chan bool) { - select { - case <-done: - case <-closed: - cancel() - } - }(ctx.Done(), cn.CloseNotify()) - } - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Say_Hello_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Say_Hello_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Say_Hello_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"greeter", "hello"}, "")) -) - -var ( - forward_Say_Hello_0 = runtime.ForwardResponseMessage -) diff --git a/examples/gateway/proto/hello/hello.proto b/examples/gateway/proto/hello/hello.proto deleted file mode 100644 index 372bfa42..00000000 --- a/examples/gateway/proto/hello/hello.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package greeter; - -import "google/api/annotations.proto"; - -service Say { - rpc Hello(Request) returns (Response) { - option (google.api.http) = { - post: "/greeter/hello" - body: "*" - }; - } -} - -message Request { - string name = 1; -} - -message Response { - string msg = 1; -} diff --git a/examples/getip/README.md b/examples/getip/README.md deleted file mode 100644 index c8a51f99..00000000 --- a/examples/getip/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Get IP - -The GetIP example demonstrates how to get local and remote ips from metadata. - diff --git a/examples/getip/main.go b/examples/getip/main.go deleted file mode 100644 index f0cf7ba5..00000000 --- a/examples/getip/main.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "context" - "fmt" - - proto "github.com/asim/go-micro/examples/v4/service/proto" - "go-micro.dev/v4" - "go-micro.dev/v4/metadata" -) - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, req *proto.Request, rsp *proto.Response) error { - md, _ := metadata.FromContext(ctx) - - // local ip of service - fmt.Println("local ip is", md["Local"]) - - // remote ip of caller - fmt.Println("remote ip is", md["Remote"]) - - rsp.Greeting = "Hello " + req.Name - return nil -} - -func main() { - service := micro.NewService( - micro.Name("greeter"), - ) - - service.Init() - - proto.RegisterGreeterHandler(service.Server(), new(Greeter)) - - if err := service.Run(); err != nil { - fmt.Println(err) - } -} diff --git a/examples/getip/proto/greeter.micro.go b/examples/getip/proto/greeter.micro.go deleted file mode 100644 index 047e14f1..00000000 --- a/examples/getip/proto/greeter.micro.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -/* -Package greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -It has these top-level messages: - HelloRequest - HelloResponse -*/ -package greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Greeter service - -type GreeterService interface { - Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error) -} - -type greeterService struct { - c client.Client - serviceName string -} - -func NewGreeterService(serviceName string, c client.Client) GreeterService { - if c == nil { - c = client.NewClient() - } - if len(serviceName) == 0 { - serviceName = "greeter" - } - return &greeterService{ - c: c, - serviceName: serviceName, - } -} - -func (c *greeterService) Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error) { - req := c.c.NewRequest(c.serviceName, "Greeter.Hello", in) - out := new(HelloResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterHandler interface { - Hello(context.Context, *HelloRequest, *HelloResponse) error -} - -func RegisterGreeterHandler(s server.Server, hdlr GreeterHandler, opts ...server.HandlerOption) { - type greeter interface { - Hello(ctx context.Context, in *HelloRequest, out *HelloResponse) error - } - type Greeter struct { - greeter - } - h := &greeterHandler{hdlr} - s.Handle(s.NewHandler(&Greeter{h}, opts...)) -} - -type greeterHandler struct { - GreeterHandler -} - -func (h *greeterHandler) Hello(ctx context.Context, in *HelloRequest, out *HelloResponse) error { - return h.GreeterHandler.Hello(ctx, in, out) -} diff --git a/examples/getip/proto/greeter.pb.go b/examples/getip/proto/greeter.pb.go deleted file mode 100644 index 22427b1a..00000000 --- a/examples/getip/proto/greeter.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -/* -Package greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -It has these top-level messages: - HelloRequest - HelloResponse -*/ -package greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -type HelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *HelloRequest) Reset() { *m = HelloRequest{} } -func (m *HelloRequest) String() string { return proto.CompactTextString(m) } -func (*HelloRequest) ProtoMessage() {} -func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *HelloRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type HelloResponse struct { - Greeting string `protobuf:"bytes,2,opt,name=greeting" json:"greeting,omitempty"` -} - -func (m *HelloResponse) Reset() { *m = HelloResponse{} } -func (m *HelloResponse) String() string { return proto.CompactTextString(m) } -func (*HelloResponse) ProtoMessage() {} -func (*HelloResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *HelloResponse) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -func init() { - proto.RegisterType((*HelloRequest)(nil), "HelloRequest") - proto.RegisterType((*HelloResponse)(nil), "HelloResponse") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Greeter service - -type GreeterClient interface { - Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) -} - -type greeterClient struct { - cc *grpc.ClientConn -} - -func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { - return &greeterClient{cc} -} - -func (c *greeterClient) Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) { - out := new(HelloResponse) - err := grpc.Invoke(ctx, "/Greeter/Hello", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterServer interface { - Hello(context.Context, *HelloRequest) (*HelloResponse, error) -} - -func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { - s.RegisterService(&_Greeter_serviceDesc, srv) -} - -func _Greeter_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GreeterServer).Hello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Greeter/Hello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GreeterServer).Hello(ctx, req.(*HelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Greeter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Greeter", - HandlerType: (*GreeterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Hello", - Handler: _Greeter_Hello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/asim/go-micro/examples/v4/service/proto/greeter.proto", -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/service/proto/greeter.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8e, 0xcd, 0x0a, 0xc2, 0x30, - 0x10, 0x84, 0xad, 0xf8, 0xbb, 0x58, 0x0f, 0x39, 0x95, 0x9e, 0x24, 0xa7, 0x82, 0x90, 0x80, 0xc5, - 0x67, 0xd0, 0x73, 0xdf, 0xa0, 0x2d, 0x43, 0x0d, 0x34, 0x4d, 0x4d, 0x52, 0xf1, 0xf1, 0x85, 0x55, - 0x44, 0x6f, 0x3b, 0x30, 0xfb, 0x7d, 0x43, 0xe7, 0xce, 0xc4, 0xdb, 0xd4, 0xa8, 0xd6, 0x59, 0x6d, - 0x4d, 0xeb, 0x9d, 0xc6, 0xb3, 0xb6, 0x63, 0x8f, 0xa0, 0x03, 0xfc, 0xc3, 0xb4, 0xd0, 0xa3, 0x77, - 0xd1, 0xe9, 0xce, 0x03, 0x11, 0x5e, 0x71, 0x92, 0x92, 0x76, 0x57, 0xf4, 0xbd, 0xab, 0x70, 0x9f, - 0x10, 0xa2, 0x10, 0xb4, 0x18, 0x6a, 0x8b, 0x2c, 0x39, 0x24, 0xc5, 0xb6, 0xe2, 0x5b, 0x1e, 0x29, - 0xfd, 0x74, 0xc2, 0xe8, 0x86, 0x00, 0x91, 0xd3, 0x86, 0x29, 0x66, 0xe8, 0xb2, 0x39, 0x17, 0xbf, - 0xf9, 0x54, 0xd2, 0xfa, 0xf2, 0x36, 0x88, 0x82, 0x96, 0xfc, 0x27, 0x52, 0xf5, 0xeb, 0xc8, 0xf7, - 0xea, 0x0f, 0x27, 0x67, 0xcd, 0x8a, 0xc7, 0x94, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xa3, - 0x46, 0x4c, 0xc5, 0x00, 0x00, 0x00, -} diff --git a/examples/getip/proto/greeter.proto b/examples/getip/proto/greeter.proto deleted file mode 100644 index 4ff347af..00000000 --- a/examples/getip/proto/greeter.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -service Greeter { - rpc Hello(HelloRequest) returns (HelloResponse) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloResponse { - string greeting = 2; -} diff --git a/examples/go.mod b/examples/go.mod deleted file mode 100644 index 5aee9521..00000000 --- a/examples/go.mod +++ /dev/null @@ -1,86 +0,0 @@ -module github.com/asim/go-micro/examples/v4 - -go 1.17 - -replace ( - github.com/asim/go-micro/plugins/client/grpc/v4 => ../plugins/client/grpc - github.com/asim/go-micro/plugins/client/http/v4 => ../plugins/client/http - github.com/asim/go-micro/plugins/config/encoder/toml/v4 => ../plugins/config/encoder/toml - github.com/asim/go-micro/plugins/config/encoder/yaml/v4 => ../plugins/config/encoder/yaml - github.com/asim/go-micro/plugins/config/source/grpc/v4 => ../plugins/config/source/grpc - github.com/asim/go-micro/plugins/server/grpc/v4 => ../plugins/server/grpc - github.com/asim/go-micro/plugins/server/http/v4 => ../plugins/server/http - github.com/asim/go-micro/plugins/transport/grpc/v4 => ../plugins/transport/grpc - github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v4 => ../plugins/wrapper/select/roundrobin - github.com/asim/go-micro/plugins/wrapper/select/shard/v4 => ../plugins/wrapper/select/shard - go-micro.dev/v4 => ../../go-micro -) - -require ( - github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211019191242-9edc569e68bb - github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/config/source/grpc/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/server/grpc/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v4 v4.0.0-00010101000000-000000000000 - github.com/asim/go-micro/plugins/wrapper/select/shard/v4 v4.0.0-00010101000000-000000000000 - github.com/gin-gonic/gin v1.7.4 - github.com/golang/glog v1.0.0 - github.com/golang/protobuf v1.5.2 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/pborman/uuid v1.2.1 - github.com/urfave/cli/v2 v2.3.0 - go-micro.dev/v4 v4.3.0 - golang.org/x/net v0.0.0-20211020060615-d418f374d309 - google.golang.org/genproto v0.0.0-20211021150943-2b146023228c - google.golang.org/grpc v1.42.0 - google.golang.org/protobuf v1.27.1 -) - -require ( - github.com/BurntSushi/toml v0.3.1 // indirect - github.com/Microsoft/go-winio v0.5.0 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect - github.com/bitly/go-simplejson v0.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/emirpasic/gods v1.12.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-git/gcfg v1.5.0 // indirect - github.com/go-git/go-billy/v5 v5.3.1 // indirect - github.com/go-git/go-git/v5 v5.4.2 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect - github.com/google/uuid v1.2.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/json-iterator/go v1.1.9 // indirect - github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect - github.com/leodido/go-urn v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect - github.com/miekg/dns v1.1.43 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/nxadm/tail v1.4.8 // indirect - github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/russross/blackfriday/v2 v2.0.1 // indirect - github.com/sergi/go-diff v1.1.0 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/ugorji/go/codec v1.1.7 // indirect - github.com/xanzy/ssh-agent v0.3.0 // indirect - golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect - golang.org/x/text v0.3.6 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/examples/go.sum b/examples/go.sum deleted file mode 100644 index 53694a8c..00000000 --- a/examples/go.sum +++ /dev/null @@ -1,934 +0,0 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= -github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akamai/AkamaiOPEN-edgegrid-golang v1.1.0/go.mod h1:kX6YddBkXqqywAe8c9LyvgTCyFuZCTMF4cRPQhc3Fy8= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.976/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= -github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpu/goacmedns v0.1.1/go.mod h1:MuaouqEhPAHxsbqjgnck5zeghuwBP1dLnPoobeGqugQ= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deepmap/oapi-codegen v1.3.11/go.mod h1:suMvK7+rKlx3+tpa8ByptmvoXbAV70wERKTOGH3hLp0= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnsimple/dnsimple-go v0.63.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/exoscale/egoscale v0.46.0/go.mod h1:mpEXBpROAa/2i5GC0r33rfxG+TxSEka11g1PIXt9+zc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsouza/go-dockerclient v1.7.3/go.mod h1:8xfZB8o9SptLNJ13VoV5pMiRbZGWkU/Omu5VOu/KC9Y= -github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s+pcEVXFuAjw= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= -github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-acme/lego/v4 v4.4.0/go.mod h1:l3+tFUFZb590dWcqhWZegynUthtaHJbG2fevUpoOOE0= -github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.4/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= -github.com/gophercloud/gophercloud v0.16.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= -github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/infobloxopen/infoblox-go-client v1.1.1/go.mod h1:BXiw7S2b9qJoM8MS40vfgCNB2NLHGusk1DtO16BD9zI= -github.com/jarcoal/httpmock v1.0.6/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= -github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/linode/linodego v0.25.3/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= -github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs= -github.com/liquidweb/go-lwApi v0.0.5/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs= -github.com/liquidweb/liquidweb-cli v0.6.9/go.mod h1:cE1uvQ+x24NGUL75D0QagOFCG8Wdvmwu8aL9TLmA/eQ= -github.com/liquidweb/liquidweb-go v1.6.3/go.mod h1:SuXXp+thr28LnjEw18AYtWwIbWMHSUiajPQs8T9c/Rc= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= -github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/sys/mount v0.2.0/go.mod h1:aAivFE2LB3W4bACsUXChRHQ0qKWsetY4Y9V7sxOougM= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nrdcg/auroradns v1.0.1/go.mod h1:y4pc0i9QXYlFCWrhWrUSIETnZgrf4KuwjDIWmmXo3JI= -github.com/nrdcg/desec v0.5.0/go.mod h1:2ejvMazkav1VdDbv2HeQO7w+Ta1CGHqzQr27ZBYTuEQ= -github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= -github.com/nrdcg/goinwx v0.8.1/go.mod h1:tILVc10gieBp/5PMvbcYeXM6pVQ+c9jxDZnpaR1UW7c= -github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= -github.com/nrdcg/porkbun v0.1.1/go.mod h1:JWl/WKnguWos4mjfp4YizvvToigk9qpQwrodOk+CPoA= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= -github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= -github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= -github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sacloud/libsacloud v1.36.2/go.mod h1:P7YAOVmnIn3DKHqCZcUKYUXmSwGBm3yS7IBEjKVSrjg= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/gunit v1.0.4/go.mod h1:EH5qMBab2UclzXUcpR8b93eHsIlp9u+pDQIRp5DZNzQ= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g= -github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= -github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA= -github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg= -github.com/vultr/govultr/v2 v2.0.0/go.mod h1:2PsEeg+gs3p/Fo5Pw8F9mv+DUBEOlrNZ8GmCTGmhOhs= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.m3o.com v0.1.0/go.mod h1:p8FdLqZH3R9a0y04qiMNT+clw69d3SxyQPFzCNbDRtk= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI= -golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210216224549-f992740a1bac/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201113234701-d7a72108b828/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e h1:m7aQHHqd0q89mRwhwS9Bx2rjyl/hsFAeta+uGrHsQaU= -google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e/go.mod h1:gID3PKrg7pWKntu9Ss6zTLJ0ttC0X9IHgREOCZwbCVU= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ns1/ns1-go.v2 v2.4.4/go.mod h1:GMnKY+ZuoJ+lVLL+78uSTjwTz2jMazq6AfGKQOYhsPk= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/examples/graceful/README.md b/examples/graceful/README.md deleted file mode 100644 index 9974cc7a..00000000 --- a/examples/graceful/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Graceful - -Graceful demonstrates graceful shutdown of a service using the server.Wait option - -The server deregisters the service and waits for handlers to finish executing before exiting. - diff --git a/examples/graceful/main.go b/examples/graceful/main.go deleted file mode 100644 index 1e8b40c5..00000000 --- a/examples/graceful/main.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "fmt" - - "go-micro.dev/v4" - "go-micro.dev/v4/server" -) - -func main() { - service := micro.NewService() - - service.Server().Init( - server.Wait(nil), - ) - - if err := service.Run(); err != nil { - fmt.Println(err) - } -} diff --git a/examples/greeter/README.md b/examples/greeter/README.md deleted file mode 100644 index 1bbbf7a7..00000000 --- a/examples/greeter/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Greeter - -An example Greeter application - -## Contents - -- **srv** - an RPC greeter service -- **cli** - an RPC client that calls the service once - -## Run Service - -Start go.micro.srv.greeter -```shell -go run srv/main.go -``` - -## Run Client - -Call go.micro.srv.greeter via client -```shell -go run cli/main.go -``` - -Examples of client usage via other languages can be found in the client directory. diff --git a/examples/greeter/cli/README.md b/examples/greeter/cli/README.md deleted file mode 100644 index d6f3ff00..00000000 --- a/examples/greeter/cli/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Greeter Client - -This directory contains examples of greeter clients - -## Contents - -- main.go - standard go-micro client call -- api - call via micro api using http post and protobuf -- ruby - call natively and via the sidecar using ruby -- python - call natively and via the sidecar using python -- sidecar - call via micro sidecar using http post and protobuf diff --git a/examples/greeter/cli/main.go b/examples/greeter/cli/main.go deleted file mode 100644 index 0e79c764..00000000 --- a/examples/greeter/cli/main.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "context" - "fmt" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" -) - -func main() { - // create a new service - service := micro.NewService() - - // parse command line flags - service.Init() - - // Use the generated client stub - cl := hello.NewSayService("go.micro.srv.greeter", service.Client()) - - // Make request - rsp, err := cl.Hello(context.Background(), &hello.Request{ - Name: "John", - }) - if err != nil { - fmt.Println(err) - return - } - - fmt.Println(rsp.Msg) -} diff --git a/examples/greeter/cli/python/rpc_client.py b/examples/greeter/cli/python/rpc_client.py deleted file mode 100644 index f94a5fb7..00000000 --- a/examples/greeter/cli/python/rpc_client.py +++ /dev/null @@ -1,22 +0,0 @@ -import requests -import json - - -def main(): - url = "http://localhost:4000" - headers = {'content-type': 'application/json'} - - # Example echo method - payload = { - "method": "Say.Hello", - "params": [{"name": "John"}], - "jsonrpc": "2.0", - "id": 0, - } - response = requests.post( - url, data=json.dumps(payload), headers=headers).json() - - print response["result"] - -if __name__ == "__main__": - main() diff --git a/examples/greeter/cli/python/sidecar_client.py b/examples/greeter/cli/python/sidecar_client.py deleted file mode 100644 index 4d907614..00000000 --- a/examples/greeter/cli/python/sidecar_client.py +++ /dev/null @@ -1,21 +0,0 @@ -import requests -import json - - -def main(): - url = "http://localhost:8081/rpc" - headers = {'content-type': 'application/json'} - - # Example echo method - payload = { - "service": "go.micro.srv.greeter", - "method": "Say.Hello", - "request": {"name": "John"}, - } - response = requests.post( - url, data=json.dumps(payload), headers=headers).json() - - print response - -if __name__ == "__main__": - main() diff --git a/examples/greeter/cli/ruby/Gemfile b/examples/greeter/cli/ruby/Gemfile deleted file mode 100644 index fb5c8a74..00000000 --- a/examples/greeter/cli/ruby/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' -gem 'json-rpc-objects' -gem 'json-rpc-objects-json' diff --git a/examples/greeter/cli/ruby/rpc_client.rb b/examples/greeter/cli/ruby/rpc_client.rb deleted file mode 100644 index a536b2d1..00000000 --- a/examples/greeter/cli/ruby/rpc_client.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'net/http' -require 'json-rpc-objects/request' -require 'json-rpc-objects/response' - -# RPC Client example in ruby -# -# This speaks directly to the service go.micro.srv.greeter - -# set the host to the running go.micro.srv.greeter service -uri = URI("http://localhost:8080") -method = "Say.Hello" -request = {:name => "John"} - -# create request -req = JsonRpcObjects::Request::create(method, [request], :id => 1) - -# do request -http = Net::HTTP.new(uri.host, uri.port) -request = Net::HTTP::Post.new(uri.request_uri) -request.content_type = 'application/json' -request.body = req.to_json - -# parse response -puts JsonRpcObjects::Response::parse(http.request(request).body).result["msg"] diff --git a/examples/greeter/cli/ruby/sidecar_client.rb b/examples/greeter/cli/ruby/sidecar_client.rb deleted file mode 100644 index bf25e523..00000000 --- a/examples/greeter/cli/ruby/sidecar_client.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'net/http' -require 'json' - -# Sidecar Client example in ruby -# -# This speaks to the service go.micro.srv.greeter -# via the sidecar application HTTP interface - -uri = URI("http://localhost:8081/rpc") - -req = { - "service" => "ruby.micro.srv.greeter", - "method" => "Say.Hello", - "request" => {"name" => "John"} -} - -# do request -http = Net::HTTP.new(uri.host, uri.port) -request = Net::HTTP::Post.new(uri.request_uri) -request.content_type = 'application/json' -request.body = req.to_json - -puts JSON.parse(http.request(request).body) diff --git a/examples/greeter/cli/sidecar/sidecar.go b/examples/greeter/cli/sidecar/sidecar.go deleted file mode 100644 index 9782b9bc..00000000 --- a/examples/greeter/cli/sidecar/sidecar.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io" - "net/http" - - "github.com/golang/protobuf/proto" - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" -) - -func main() { - req, err := proto.Marshal(&hello.Request{Name: "John"}) - if err != nil { - fmt.Println(err) - return - } - - r, err := http.Post("http://localhost:8081/greeter/say/hello", "application/protobuf", bytes.NewReader(req)) - if err != nil { - fmt.Println(err) - return - } - defer r.Body.Close() - - b, err := io.ReadAll(r.Body) - if err != nil { - fmt.Println(err) - return - } - rsp := &hello.Response{} - if err := proto.Unmarshal(b, rsp); err != nil { - fmt.Println(err) - return - } - fmt.Println(rsp.Msg) -} diff --git a/examples/greeter/srv/Dockerfile b/examples/greeter/srv/Dockerfile deleted file mode 100644 index 167d347c..00000000 --- a/examples/greeter/srv/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM alpine:3.2 -ADD greeter-srv /greeter-srv -ENTRYPOINT [ "/greeter-srv" ] diff --git a/examples/greeter/srv/main.go b/examples/greeter/srv/main.go deleted file mode 100644 index 1bcfe1f1..00000000 --- a/examples/greeter/srv/main.go +++ /dev/null @@ -1,44 +0,0 @@ -// Package main -package main - -import ( - "context" - "time" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/util/log" - "google.golang.org/grpc" -) - -type Say struct{} - -func (s *Say) Hello(ctx context.Context, req *hello.Request, rsp *hello.Response) error { - log.Log("Received Say.Hello request") - rsp.Msg = "Hello " + req.Name - return nil -} - -func main() { - go func() { - for { - grpc.DialContext(context.TODO(), "127.0.0.1:9091") - time.Sleep(time.Second) - } - }() - - service := micro.NewService( - micro.Name("go.micro.srv.greeter"), - ) - - // optionally setup command line usage - service.Init() - - // Register Handlers - hello.RegisterSayHandler(service.Server(), new(Say)) - - // Run server - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/greeter/srv/proto/hello/hello.pb.go b/examples/greeter/srv/proto/hello/hello.pb.go deleted file mode 100644 index 56245395..00000000 --- a/examples/greeter/srv/proto/hello/hello.pb.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: asim/go-micro/examples/greeter/srv/proto/hello/hello.proto - -package go_micro_srv_greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// 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 - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_f9c4d46e1c0507ba, []int{0} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_f9c4d46e1c0507ba, []int{1} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func init() { - proto.RegisterType((*Request)(nil), "go.micro.srv.greeter.Request") - proto.RegisterType((*Response)(nil), "go.micro.srv.greeter.Response") -} - -func init() { - proto.RegisterFile("asim/go-micro/examples/greeter/srv/proto/hello/hello.proto", fileDescriptor_f9c4d46e1c0507ba) -} - -var fileDescriptor_f9c4d46e1c0507ba = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xca, 0xcd, 0x4c, 0x2e, - 0xca, 0xd7, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x4f, 0x2f, 0x4a, 0x4d, 0x2d, - 0x49, 0x2d, 0xd2, 0x2f, 0x2e, 0x2a, 0xd3, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0xcf, 0x48, 0xcd, - 0xc9, 0x81, 0x92, 0x7a, 0x60, 0x11, 0x21, 0x91, 0xf4, 0x7c, 0x3d, 0xb0, 0x36, 0xbd, 0xe2, 0xa2, - 0x32, 0x3d, 0xa8, 0x0e, 0x25, 0x59, 0x2e, 0xf6, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, - 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, - 0x49, 0x86, 0x8b, 0x23, 0x28, 0xb5, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0x48, 0x80, 0x8b, 0x39, - 0xb7, 0x38, 0x1d, 0x2a, 0x0d, 0x62, 0x1a, 0xf9, 0x73, 0x31, 0x07, 0x27, 0x56, 0x0a, 0x79, 0x70, - 0xb1, 0x7a, 0x80, 0x2c, 0x12, 0x92, 0xd5, 0xc3, 0x66, 0x87, 0x1e, 0xd4, 0x02, 0x29, 0x39, 0x5c, - 0xd2, 0x10, 0x0b, 0x94, 0x18, 0x92, 0xd8, 0xc0, 0x4e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x0c, 0xa9, 0xad, 0x53, 0xe0, 0x00, 0x00, 0x00, -} diff --git a/examples/greeter/srv/proto/hello/hello.pb.micro.go b/examples/greeter/srv/proto/hello/hello.pb.micro.go deleted file mode 100644 index d9561927..00000000 --- a/examples/greeter/srv/proto/hello/hello.pb.micro.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: asim/go-micro/examples/greeter/srv/proto/hello/hello.proto - -package go_micro_srv_greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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 - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Say service - -type SayService interface { - Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) -} - -type sayService struct { - c client.Client - name string -} - -func NewSayService(name string, c client.Client) SayService { - return &sayService{ - c: c, - name: name, - } -} - -func (c *sayService) Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { - req := c.c.NewRequest(c.name, "Say.Hello", in) - out := new(Response) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Say service - -type SayHandler interface { - Hello(context.Context, *Request, *Response) error -} - -func RegisterSayHandler(s server.Server, hdlr SayHandler, opts ...server.HandlerOption) error { - type say interface { - Hello(ctx context.Context, in *Request, out *Response) error - } - type Say struct { - say - } - h := &sayHandler{hdlr} - return s.Handle(s.NewHandler(&Say{h}, opts...)) -} - -type sayHandler struct { - SayHandler -} - -func (h *sayHandler) Hello(ctx context.Context, in *Request, out *Response) error { - return h.SayHandler.Hello(ctx, in, out) -} diff --git a/examples/greeter/srv/proto/hello/hello.proto b/examples/greeter/srv/proto/hello/hello.proto deleted file mode 100644 index a7c28a44..00000000 --- a/examples/greeter/srv/proto/hello/hello.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package go.micro.srv.greeter; - -service Say { - rpc Hello(Request) returns (Response) {} -} - -message Request { - string name = 1; -} - -message Response { - string msg = 1; -} diff --git a/examples/heartbeat/README.md b/examples/heartbeat/README.md deleted file mode 100644 index 282f117d..00000000 --- a/examples/heartbeat/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Heartbeat - -A demonstration of using heartbeating with service discovery. - -## Rationale - -Services register with service discovery on startup and deregister on shutdown. Sometimes these services may unexpectedly die or -be killed forcefully or face transient network issues. In these cases stale nodes will be left in service discovery. It would be -ideal if services were automatically removed. - -## Solution - -Micro supports the option of a register TTL and register interval for this exact reason. TTL specifies how long a registration should -exist in discovery after which it expires and is removed. Interval is the time at which a service should re-register to preserve -it's registration in service discovery. - -These are options made available in go-micro and as flags in the micro toolkit - -## Toolkit - -Run any component of the toolkit with the flags like so - -``` -micro --register_ttl=30 --register_interval=15 api -``` - -This example shows that we're setting a ttl of 30 seconds with a re-register interval of 15 seconds. - -## Go Micro - -When declaring a micro service you can pass in the options as time.Duration - -``` -service := micro.NewService( - micro.Name("com.example.srv.foo"), - micro.RegisterTTL(time.Second*30), - micro.RegisterInterval(time.Second*15), -) -``` diff --git a/examples/heartbeat/main.go b/examples/heartbeat/main.go deleted file mode 100644 index f0c8b5e0..00000000 --- a/examples/heartbeat/main.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "time" - - "go-micro.dev/v4" - "go-micro.dev/v4/util/log" -) - -func main() { - service := micro.NewService( - micro.Name("com.example.srv.foo"), - micro.RegisterTTL(time.Second*30), - micro.RegisterInterval(time.Second*15), - ) - service.Init() - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/helloworld/README.md b/examples/helloworld/README.md deleted file mode 100644 index a18f51d2..00000000 --- a/examples/helloworld/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Hello World - -This is hello world using micro - -## Contents - -- main.go - is the main definition of the service, handler and client -- proto - contains the protobuf definition of the API - -## Dependencies - -Install the following - -- [micro](https://github.com/asim/go-micro/tree/master/cmd/micro) -- [protoc-gen-micro](https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro) - -## Run Service - -```shell -micro run . --name helloworld -``` - -## Query Service - -``` -micro call helloworld Greeter.Hello '{"name": "John"}' -``` - -## List Services - -```shell -micro services -``` \ No newline at end of file diff --git a/examples/helloworld/main.go b/examples/helloworld/main.go deleted file mode 100644 index 83e65df5..00000000 --- a/examples/helloworld/main.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "context" - "log" - - pb "github.com/asim/go-micro/examples/v4/helloworld/proto" - "go-micro.dev/v4" -) - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, req *pb.Request, rsp *pb.Response) error { - rsp.Greeting = "Hello " + req.Name - return nil -} - -func main() { - service := micro.NewService( - micro.Name("helloworld"), - ) - - service.Init() - - pb.RegisterGreeterHandler(service.Server(), new(Greeter)) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/helloworld/proto/greeter.pb.go b/examples/helloworld/proto/greeter.pb.go deleted file mode 100644 index 206955a8..00000000 --- a/examples/helloworld/proto/greeter.pb.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/helloworld/proto/greeter.proto - -package greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// 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 - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_f59dc6c921369088, []int{0} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Greeting string `protobuf:"bytes,2,opt,name=greeting,proto3" json:"greeting,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_f59dc6c921369088, []int{1} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -func init() { - proto.RegisterType((*Request)(nil), "Request") - proto.RegisterType((*Response)(nil), "Response") -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/helloworld/proto/greeter.proto", fileDescriptor_f59dc6c921369088) -} - -var fileDescriptor_f59dc6c921369088 = []byte{ - // 164 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8d, 0x4d, 0x0a, 0xc2, 0x30, - 0x10, 0x46, 0xad, 0xa8, 0x6d, 0x67, 0x99, 0x55, 0x29, 0x28, 0xd2, 0x85, 0xe8, 0x26, 0x01, 0xdd, - 0x78, 0x03, 0x5d, 0xf7, 0x06, 0x6d, 0x1d, 0xd2, 0x40, 0x92, 0x89, 0x49, 0x8a, 0x1e, 0x5f, 0x8c, - 0x3f, 0xbb, 0x79, 0x30, 0xdf, 0x7b, 0x70, 0x96, 0x2a, 0x8e, 0x53, 0xcf, 0x07, 0x32, 0xc2, 0xa8, - 0xc1, 0x93, 0xc0, 0x67, 0x67, 0x9c, 0xc6, 0x20, 0x46, 0xd4, 0x9a, 0x1e, 0xe4, 0xf5, 0x4d, 0x38, - 0x4f, 0x91, 0x84, 0xf4, 0x88, 0x11, 0x3d, 0x4f, 0xd4, 0xac, 0x21, 0x6f, 0xf1, 0x3e, 0x61, 0x88, - 0x8c, 0xc1, 0xc2, 0x76, 0x06, 0xab, 0x6c, 0x9b, 0xed, 0xcb, 0x36, 0xdd, 0xcd, 0x0e, 0x8a, 0x16, - 0x83, 0x23, 0x1b, 0x90, 0xd5, 0x50, 0xa4, 0xad, 0xb2, 0xb2, 0x9a, 0xa7, 0x9f, 0x3f, 0x1f, 0x0f, - 0x90, 0x5f, 0x3e, 0x5e, 0xb6, 0x81, 0xe5, 0xf5, 0xdd, 0x64, 0x05, 0xff, 0x9a, 0xeb, 0x92, 0xff, - 0x24, 0xcd, 0xac, 0x5f, 0xa5, 0xf0, 0xe9, 0x15, 0x00, 0x00, 0xff, 0xff, 0x54, 0xa4, 0xf7, 0x61, - 0xb4, 0x00, 0x00, 0x00, -} diff --git a/examples/helloworld/proto/greeter.pb.micro.go b/examples/helloworld/proto/greeter.pb.micro.go deleted file mode 100644 index 5404e6e0..00000000 --- a/examples/helloworld/proto/greeter.pb.micro.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/helloworld/proto/greeter.proto - -package greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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 - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Greeter service - -type GreeterService interface { - Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) -} - -type greeterService struct { - c client.Client - name string -} - -func NewGreeterService(name string, c client.Client) GreeterService { - return &greeterService{ - c: c, - name: name, - } -} - -func (c *greeterService) Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { - req := c.c.NewRequest(c.name, "Greeter.Hello", in) - out := new(Response) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterHandler interface { - Hello(context.Context, *Request, *Response) error -} - -func RegisterGreeterHandler(s server.Server, hdlr GreeterHandler, opts ...server.HandlerOption) error { - type greeter interface { - Hello(ctx context.Context, in *Request, out *Response) error - } - type Greeter struct { - greeter - } - h := &greeterHandler{hdlr} - return s.Handle(s.NewHandler(&Greeter{h}, opts...)) -} - -type greeterHandler struct { - GreeterHandler -} - -func (h *greeterHandler) Hello(ctx context.Context, in *Request, out *Response) error { - return h.GreeterHandler.Hello(ctx, in, out) -} diff --git a/examples/helloworld/proto/greeter.proto b/examples/helloworld/proto/greeter.proto deleted file mode 100644 index 7d4bf88f..00000000 --- a/examples/helloworld/proto/greeter.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -service Greeter { - rpc Hello(Request) returns (Response) {} -} - -message Request { - string name = 1; -} - -message Response { - string greeting = 2; -} diff --git a/examples/http/README.md b/examples/http/README.md deleted file mode 100644 index df1afb3d..00000000 --- a/examples/http/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# http server and http client demo - -An example http application - -## Contents - -- **srv** - a http server as server of go-mirco service -- **cli** - a http client that call http server -- **rpcli** - a http client that call rpc server - - -## Run Service -Start http server -```shell -go run srv/main.go -``` - -## Client - -Call http client -```shell -go run cli/main.go - -``` - - -## Run rpc Service -Start greeter service -```shell -go run ../greeter/srv/main.go -``` - -## Client -http client call rpc service -```shell -go run rpccli/main.go -``` diff --git a/examples/http/cli/main.go b/examples/http/cli/main.go deleted file mode 100644 index e5dfb6ec..00000000 --- a/examples/http/cli/main.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "context" - "log" - - httpClient "github.com/asim/go-micro/plugins/client/http/v4" - "go-micro.dev/v4/client" - "go-micro.dev/v4/registry" - "go-micro.dev/v4/selector" -) - -func main() { - CallHttpServer() -} - -func CallHttpServer() { - r := registry.NewRegistry() - s := selector.NewSelector(selector.Registry(r)) - // new client - c := httpClient.NewClient(client.Selector(s)) - // create request/response - request := c.NewRequest("demo-http", "/demo", "", client.WithContentType("application/json")) - - response := new(map[string]interface{}) - // call service - err := c.Call(context.Background(), request, response) - log.Printf("err:%v response:%#v\n", err, response) - -} diff --git a/examples/http/rpccli/main.go b/examples/http/rpccli/main.go deleted file mode 100644 index e5cc6016..00000000 --- a/examples/http/rpccli/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "context" - "log" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/client" - "go-micro.dev/v4/registry" -) - -func main() { - CallGrpcByHttp() -} - -func CallGrpcByHttp() { - // create a new service - service := micro.NewService( - micro.Registry(registry.NewRegistry()), - ) - // parse command line flags - service.Init() - c := service.Client() - - req := &hello.Request{Name: "call grpc server by http client"} - // create request/response - request := client.NewRequest("go.micro.srv.greeter", "Say.Hello", req) - - response := new(hello.Response) - // call service - err := c.Call(context.Background(), request, response) - log.Printf("err:%v response:%#v\n", err, response) -} diff --git a/examples/http/srv/main.go b/examples/http/srv/main.go deleted file mode 100644 index aade3ac1..00000000 --- a/examples/http/srv/main.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "log" - - httpServer "github.com/asim/go-micro/plugins/server/http/v4" - "go-micro.dev/v4" - - "go-micro.dev/v4/registry" - "go-micro.dev/v4/server" - "github.com/gin-gonic/gin" -) - -const ( - SERVER_NAME = "demo-http" // server name -) - -func main() { - - srv := httpServer.NewServer( - server.Name(SERVER_NAME), - server.Address(":8080"), - ) - - gin.SetMode(gin.ReleaseMode) - router := gin.New() - router.Use(gin.Recovery()) - - // register router - demo := newDemo() - demo.InitRouter(router) - - hd := srv.NewHandler(router) - if err := srv.Handle(hd); err != nil { - log.Fatalln(err) - } - - service := micro.NewService( - micro.Server(srv), - micro.Registry(registry.NewRegistry()), - ) - service.Init() - service.Run() -} - -//demo -type demo struct{} - -func newDemo() *demo { - return &demo{} -} - -func (a *demo) InitRouter(router *gin.Engine) { - router.POST("/demo", a.demo) -} - -func (a *demo) demo(c *gin.Context) { - c.JSON(200, gin.H{"msg": "call go-micro v3 http server success"}) -} diff --git a/examples/metadata/README.md b/examples/metadata/README.md deleted file mode 100644 index 7de81edc..00000000 --- a/examples/metadata/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Metadata - -This is an example of sending metadata/headers. - -HTTP headers sent to the micro api will be converted to metadata and forwarded on. - -## Contents - -- **srv** - an RPC service which extracts metadata -- **cli** - an RPC client that calls the service once - -## Run Service - -Start go.micro.srv.greeter -```shell -go run srv/main.go -``` - -## Client - -Call go.micro.srv.greeter via client -```shell -go run cli/main.go -``` - diff --git a/examples/metadata/cli/README.md b/examples/metadata/cli/README.md deleted file mode 100644 index e19db14a..00000000 --- a/examples/metadata/cli/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Metadata Client - -This directory contains the client example for setting metadata and sending to a service - -## Contents - -- main.go - standard go-micro client call - diff --git a/examples/metadata/cli/main.go b/examples/metadata/cli/main.go deleted file mode 100644 index 36134130..00000000 --- a/examples/metadata/cli/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "fmt" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/metadata" - - "context" -) - -func main() { - service := micro.NewService() - service.Init() - - cl := hello.NewSayService("go.micro.srv.greeter", service.Client()) - - // Set arbitrary headers in context - ctx := metadata.NewContext(context.Background(), map[string]string{ - "User": "john", - "ID": "1", - }) - - rsp, err := cl.Hello(ctx, &hello.Request{ - Name: "John", - }) - if err != nil { - fmt.Println(err) - return - } - - fmt.Println(rsp.Msg) -} diff --git a/examples/metadata/srv/main.go b/examples/metadata/srv/main.go deleted file mode 100644 index a515a7c3..00000000 --- a/examples/metadata/srv/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/metadata" - - "context" -) - -type Say struct{} - -func (s *Say) Hello(ctx context.Context, req *hello.Request, rsp *hello.Response) error { - md, ok := metadata.FromContext(ctx) - if !ok { - rsp.Msg = "No metadata received" - return nil - } - log.Printf("Received metadata %v\n", md) - rsp.Msg = fmt.Sprintf("Hello %s thanks for this %v", req.Name, md) - return nil -} - -func main() { - service := micro.NewService( - micro.Name("go.micro.srv.greeter"), - micro.RegisterTTL(time.Second*30), - micro.RegisterInterval(time.Second*10), - ) - - service.Init() - - hello.RegisterSayHandler(service.Server(), new(Say)) - - // Run server - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/mocking/README.md b/examples/mocking/README.md deleted file mode 100644 index 67c2363c..00000000 --- a/examples/mocking/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Mocking - -Thie example demonstrates how to mock the helloworld service - -The generated protos create a `Service` interface used by the client. This can simply be mocked. - -```go -type GreeterService interface { - Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) -} -``` - -Where the `GreeterService` is used we can instead pass in the mock which returns the expected response rather than calling a service. - -## Mock Client - -```go -type mockGreeterService struct { -} - -func (m *mockGreeterService) Hello(ctx context.Context, req *proto.Request, opts ...client.CallOption) (*proto.Response, error) { - return &proto.Response{ - Greeting: "Hello " + req.Name, - }, nil -} - -func NewGreeterService() proto.GreeterService { - return new(mockGreeterService) -} -``` - -## Use Mock - -In the test environment we will use the mock client - -```go -func main() { - var c proto.GreeterService - - service := micro.NewService( - micro.Flags(&cli.StringFlag{ - Name: "environment", - Value: "testing", - }), - ) - - service.Init( - micro.Action(func(ctx *cli.Context) error { - env := ctx.String("environment") - // use the mock when in testing environment - if env == "testing" { - c = mock.NewGreeterService() - } else { - c = proto.NewGreeterService("helloworld", service.Client()) - } - return nil - }), - ) - - // call hello service - rsp, err := c.Hello(context.TODO(), &proto.Request{ - Name: "John", - }) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(rsp.Greeting) -} -``` diff --git a/examples/mocking/main.go b/examples/mocking/main.go deleted file mode 100644 index e96d68ad..00000000 --- a/examples/mocking/main.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "context" - "fmt" - - proto "github.com/asim/go-micro/examples/v4/helloworld/proto" - "github.com/asim/go-micro/examples/v4/mocking/mock" - "go-micro.dev/v4" - "github.com/urfave/cli/v2" -) - -func main() { - var c proto.GreeterService - - service := micro.NewService( - micro.Flags(&cli.StringFlag{ - Name: "environment", - Value: "testing", - }), - ) - - service.Init( - micro.Action(func(ctx *cli.Context) error { - env := ctx.String("environment") - // use the mock when in testing environment - if env == "testing" { - c = mock.NewGreeterService() - } else { - c = proto.NewGreeterService("helloworld", service.Client()) - } - return nil - }), - ) - - // call hello service - rsp, err := c.Hello(context.TODO(), &proto.Request{ - Name: "John", - }) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(rsp.Greeting) -} diff --git a/examples/mocking/mock/mock.go b/examples/mocking/mock/mock.go deleted file mode 100644 index 3435ef7e..00000000 --- a/examples/mocking/mock/mock.go +++ /dev/null @@ -1,21 +0,0 @@ -package mock - -import ( - "context" - - proto "github.com/asim/go-micro/examples/v4/helloworld/proto" - "go-micro.dev/v4/client" -) - -type mockGreeterService struct { -} - -func (m *mockGreeterService) Hello(ctx context.Context, req *proto.Request, opts ...client.CallOption) (*proto.Response, error) { - return &proto.Response{ - Greeting: "Hello " + req.Name, - }, nil -} - -func NewGreeterService() proto.GreeterService { - return new(mockGreeterService) -} diff --git a/examples/noproto/README.md b/examples/noproto/README.md deleted file mode 100644 index 5b88fca8..00000000 --- a/examples/noproto/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# noproto - -This example demonstrates how to use micro without protobuf. - -Use micro with standard go types and use the json codec for marshalling. Services have multiple codecs and use the `Content-Type` -header to determine which to use. The client sends `Content-Type: application/json`. Because we can marshal standard Go types to -json there is no code generation or use of protobuf required. - -## Contents - -- main.go - is a micro greeter service -- client - is a micro json client - -## Run the example - -Run the service - -```shell -go run main.go -``` - -Run the client - -```shell -go run client/main.go -``` diff --git a/examples/noproto/client/main.go b/examples/noproto/client/main.go deleted file mode 100644 index dc963b2c..00000000 --- a/examples/noproto/client/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "context" - "fmt" - - "go-micro.dev/v4" - "go-micro.dev/v4/client" -) - -func main() { - service := micro.NewService() - service.Init() - c := service.Client() - - request := c.NewRequest("greeter", "Greeter.Hello", "john", client.WithContentType("application/json")) - var response string - - if err := c.Call(context.TODO(), request, &response); err != nil { - fmt.Println(err) - return - } - fmt.Println(response) -} diff --git a/examples/noproto/main.go b/examples/noproto/main.go deleted file mode 100644 index bd95456e..00000000 --- a/examples/noproto/main.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "context" - - "go-micro.dev/v4" -) - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, name *string, msg *string) error { - *msg = "Hello " + *name - return nil -} - -func main() { - // create new service - service := micro.NewService( - micro.Name("greeter"), - ) - - // initialise command line - service.Init() - - // set the handler - micro.RegisterHandler(service.Server(), new(Greeter)) - - // run service - service.Run() -} diff --git a/examples/options/README.md b/examples/options/README.md deleted file mode 100644 index 7a764279..00000000 --- a/examples/options/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Options - -Go-micro makes the use of [functional options](https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis). It's a design -pattern that allows the addition of new options without changing the method signature. - -Each package has an [Option](https://godoc.org/github.com/asim/go-micro#Option) type - -``` -type Option func(*Options) -``` - -Options such as the [Name](https://godoc.org/github.com/asim/go-micro#Name) function exist to set a service name - -The implementation is as follows - -``` -func Name(n string) Option { - return func(o *Options) { - o.Server.Init(server.Name(n)) - } -} -``` - -## Usage - -Here's an example at the top level - -``` -import "go-micro.dev/v4" - - -service := micro.NewService( - micro.Name("my.service"), -) -``` diff --git a/examples/pubsub/README.md b/examples/pubsub/README.md deleted file mode 100644 index 7f8fd4cf..00000000 --- a/examples/pubsub/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# PubSub - -This is an example of pubsub via the client/server interfaces. - -PubSub at the client/server level works much like RPC but for async comms. It uses the same encoding but -rather than using the transport interface it uses the broker for messaging. This includes the ability -to encode metadata into context which is passed through with messages. - -## Contents - -- srv - contains the service -- cli - contains the client - diff --git a/examples/pubsub/cli/main.go b/examples/pubsub/cli/main.go deleted file mode 100644 index 67fab648..00000000 --- a/examples/pubsub/cli/main.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "fmt" - "time" - - "context" - proto "github.com/asim/go-micro/examples/v4/pubsub/srv/proto" - "go-micro.dev/v4" - "go-micro.dev/v4/util/log" - "github.com/pborman/uuid" -) - -// send events using the publisher -func sendEv(topic string, p micro.Publisher) { - t := time.NewTicker(time.Second) - - for _ = range t.C { - // create new event - ev := &proto.Event{ - Id: uuid.NewUUID().String(), - Timestamp: time.Now().Unix(), - Message: fmt.Sprintf("Messaging you all day on %s", topic), - } - - log.Logf("publishing %+v\n", ev) - - // publish an event - if err := p.Publish(context.Background(), ev); err != nil { - log.Logf("error publishing: %v", err) - } - } -} - -func main() { - // create a service - service := micro.NewService( - micro.Name("go.micro.cli.pubsub"), - ) - // parse command line - service.Init() - - // create publisher - pub1 := micro.NewPublisher("example.topic.pubsub.1", service.Client()) - pub2 := micro.NewPublisher("example.topic.pubsub.2", service.Client()) - - // pub to topic 1 - go sendEv("example.topic.pubsub.1", pub1) - // pub to topic 2 - go sendEv("example.topic.pubsub.2", pub2) - - // block forever - select {} -} diff --git a/examples/pubsub/srv/main.go b/examples/pubsub/srv/main.go deleted file mode 100644 index b1277dfb..00000000 --- a/examples/pubsub/srv/main.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - proto "github.com/asim/go-micro/examples/v4/pubsub/srv/proto" - "go-micro.dev/v4" - "go-micro.dev/v4/metadata" - "go-micro.dev/v4/server" - "go-micro.dev/v4/util/log" - - "context" -) - -// All methods of Sub will be executed when -// a message is received -type Sub struct{} - -// Method can be of any name -func (s *Sub) Process(ctx context.Context, event *proto.Event) error { - md, _ := metadata.FromContext(ctx) - log.Logf("[pubsub.1] Received event %+v with metadata %+v\n", event, md) - // do something with event - return nil -} - -// Alternatively a function can be used -func subEv(ctx context.Context, event *proto.Event) error { - md, _ := metadata.FromContext(ctx) - log.Logf("[pubsub.2] Received event %+v with metadata %+v\n", event, md) - // do something with event - return nil -} - -func main() { - // create a service - service := micro.NewService( - micro.Name("go.micro.srv.pubsub"), - ) - // parse command line - service.Init() - - // register subscriber - micro.RegisterSubscriber("example.topic.pubsub.1", service.Server(), new(Sub)) - - // register subscriber with queue, each message is delivered to a unique subscriber - micro.RegisterSubscriber("example.topic.pubsub.2", service.Server(), subEv, server.SubscriberQueue("queue.pubsub")) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/pubsub/srv/proto/pubsub.micro.go b/examples/pubsub/srv/proto/pubsub.micro.go deleted file mode 100644 index 518c1828..00000000 --- a/examples/pubsub/srv/proto/pubsub.micro.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/pubsub/srv/proto/pubsub.proto - -/* -Package pubsub is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/pubsub/srv/proto/pubsub.proto - -It has these top-level messages: - Event -*/ -package pubsub - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package diff --git a/examples/pubsub/srv/proto/pubsub.pb.go b/examples/pubsub/srv/proto/pubsub.pb.go deleted file mode 100644 index a4171406..00000000 --- a/examples/pubsub/srv/proto/pubsub.pb.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/pubsub/srv/proto/pubsub.proto - -/* -Package pubsub is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/pubsub/srv/proto/pubsub.proto - -It has these top-level messages: - Event -*/ -package pubsub - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Example message -type Event struct { - // unique id - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - // unix timestamp - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - // message - Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Event) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Event) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *Event) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func init() { - proto.RegisterType((*Event)(nil), "Event") -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/pubsub/srv/proto/pubsub.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 141 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4f, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcd, 0x4c, 0x2e, 0xca, 0xd7, 0x4f, 0xad, 0x48, - 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x2f, 0x28, 0x4d, 0x2a, 0x2e, 0x4d, 0xd2, 0x2f, 0x2e, 0x2a, - 0xd3, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x87, 0x0a, 0xe8, 0x81, 0x39, 0x4a, 0xfe, 0x5c, 0xac, 0xae, - 0x65, 0xa9, 0x79, 0x25, 0x42, 0x7c, 0x5c, 0x4c, 0x99, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, - 0x41, 0x4c, 0x99, 0x29, 0x42, 0x32, 0x5c, 0x9c, 0x25, 0x99, 0xb9, 0xa9, 0xc5, 0x25, 0x89, 0xb9, - 0x05, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x08, 0x01, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, - 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x66, 0xb0, 0x16, 0x18, 0x37, 0x89, 0x0d, 0x6c, 0xae, 0x31, - 0x20, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x55, 0x67, 0x13, 0x92, 0x00, 0x00, 0x00, -} diff --git a/examples/pubsub/srv/proto/pubsub.proto b/examples/pubsub/srv/proto/pubsub.proto deleted file mode 100644 index cc534a27..00000000 --- a/examples/pubsub/srv/proto/pubsub.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -// Example message -message Event { - // unique id - string id = 1; - // unix timestamp - int64 timestamp = 2; - // message - string message = 3; -} diff --git a/examples/redirect/README.md b/examples/redirect/README.md deleted file mode 100644 index e93c499d..00000000 --- a/examples/redirect/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Redirect - -This demonstrates how to http redirect using an API service - -## Usage - -Run the micro API - -``` -micro --registry=mdns api -``` - -Run the redirect API - -``` -go run main.go --registry=mdns -``` - -Make request -``` -curl -v http://localhost:8080/redirect/url -``` - -Should return - -``` -HTTP/1.1 301 Moved Permanently -Location: https://google.com -``` diff --git a/examples/redirect/main.go b/examples/redirect/main.go deleted file mode 100644 index 774187dc..00000000 --- a/examples/redirect/main.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "log" - - "context" - "go-micro.dev/v4" - api "go-micro.dev/v4/api/proto" -) - -type Redirect struct{} - -func (r *Redirect) Url(ctx context.Context, req *api.Request, rsp *api.Response) error { - rsp.StatusCode = int32(301) - rsp.Header = map[string]*api.Pair{ - "Location": &api.Pair{ - Key: "Location", - Values: []string{"https://google.com"}, - }, - } - return nil -} - -func main() { - service := micro.NewService( - micro.Name("go.micro.api.redirect"), - ) - - // parse command line flags - service.Init() - - service.Server().Handle( - service.Server().NewHandler(new(Redirect)), - ) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/roundrobin/README.md b/examples/roundrobin/README.md deleted file mode 100644 index dd6b2616..00000000 --- a/examples/roundrobin/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Round Robin - -An example of using a round robin client wrapper with the greeter application. - -## Contents - -- api.go - a modified version of the greeter api to include roundrobin - -### Micro - -``` -go get github.com/micro/micro -``` - -## Run - -### Greeter Service - -Run multiple copies of the greeter - -``` -cd ../greeter -go run srv/main.go -``` - -### Greeter API - -``` -go run api.go -``` - -### Micro API - -``` -micro api -``` - -### Call API - -```shell -curl http://localhost:8080/greeter/say/hello?name=John -``` - diff --git a/examples/roundrobin/api.go b/examples/roundrobin/api.go deleted file mode 100644 index 9b4df97a..00000000 --- a/examples/roundrobin/api.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -import ( - "encoding/json" - "log" - "strings" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/errors" - roundrobin "github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v4" - api "go-micro.dev/v4/api/proto" - - "context" -) - -type Say struct { - Client hello.SayService -} - -func (s *Say) Hello(ctx context.Context, req *api.Request, rsp *api.Response) error { - log.Print("Received Say.Hello API request") - - name, ok := req.Get["name"] - if !ok || len(name.Values) == 0 { - return errors.BadRequest("go.micro.api.greeter", "Name cannot be blank") - } - - response, err := s.Client.Hello(ctx, &hello.Request{ - Name: strings.Join(name.Values, " "), - }) - if err != nil { - return err - } - - rsp.StatusCode = 200 - b, _ := json.Marshal(map[string]string{ - "message": response.Msg, - }) - rsp.Body = string(b) - - return nil -} - -func main() { - wrapper := roundrobin.NewClientWrapper() - - service := micro.NewService( - micro.Name("go.micro.api.greeter"), - micro.WrapClient(wrapper), - ) - - // parse command line flags - service.Init() - - service.Server().Handle( - service.Server().NewHandler( - &Say{Client: hello.NewSayService("go.micro.srv.greeter", service.Client())}, - ), - ) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/secure/README.md b/examples/secure/README.md deleted file mode 100644 index c8634871..00000000 --- a/examples/secure/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Secure - -This example demonstrates how to use tls self signed certs with a micro service. - -The micro transport has a secure option which will generate a cert on startup. Clients will use -insecure skip verify by default. - -## Contents - -- srv - greeter server with secure transport that generates a tls self signed cert -- cli - greeter client with secure transport that uses insecure skip verify - -## Micro Toolkit - -The cli example can be used with the micro toolkit for a secure client - -Create a tls.go file - -``` -package main - -import ( - "go-micro.dev/v4/client" - "go-micro.dev/v4/transport" -) - -func init() { - client.DefaultClient.Init( - client.Transport( - transport.NewTransport(transport.Secure(true)), - ), - ) -} -``` - -Build the toolkit with the tls.go file - -``` -cd github.com/micro/micro -go build -o micro main.go tls.go -``` diff --git a/examples/secure/cli/main.go b/examples/secure/cli/main.go deleted file mode 100644 index cb1117d0..00000000 --- a/examples/secure/cli/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "fmt" - - "go-micro.dev/v4/client" - "go-micro.dev/v4/transport" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - - "context" -) - -func init() { - client.DefaultClient.Init( - client.Transport( - transport.NewHTTPTransport(transport.Secure(true)), - ), - ) -} - -func main() { - cl := hello.NewSayService("go.micro.srv.greeter", client.DefaultClient) - - rsp, err := cl.Hello(context.TODO(), &hello.Request{ - Name: "John", - }) - if err != nil { - fmt.Println(err) - return - } - - fmt.Println(rsp.Msg) -} diff --git a/examples/secure/srv/main.go b/examples/secure/srv/main.go deleted file mode 100644 index 81e923d4..00000000 --- a/examples/secure/srv/main.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "log" - "time" - - "context" - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/transport" -) - -type Say struct{} - -func (s *Say) Hello(ctx context.Context, req *hello.Request, rsp *hello.Response) error { - rsp.Msg = "Hello " + req.Name - return nil -} - -func main() { - service := micro.NewService( - micro.Name("go.micro.srv.greeter"), - micro.RegisterTTL(time.Second*30), - micro.RegisterInterval(time.Second*10), - // setup a new transport with secure option - micro.Transport( - // create new transport - transport.NewHTTPTransport( - // set to automatically secure - transport.Secure(true), - ), - ), - ) - - service.Init() - - hello.RegisterSayHandler(service.Server(), new(Say)) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/secure/srv/proto/hello/hello.micro.go b/examples/secure/srv/proto/hello/hello.micro.go deleted file mode 100644 index d4ef86dc..00000000 --- a/examples/secure/srv/proto/hello/hello.micro.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto - -/* -Package go_micro_srv_greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto - -It has these top-level messages: - Request - Response -*/ -package go_micro_srv_greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Say service - -type SayService interface { - Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) -} - -type sayService struct { - c client.Client - serviceName string -} - -func NewSayService(serviceName string, c client.Client) SayService { - if c == nil { - c = client.NewClient() - } - if len(serviceName) == 0 { - serviceName = "go.micro.srv.greeter" - } - return &sayService{ - c: c, - serviceName: serviceName, - } -} - -func (c *sayService) Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { - req := c.c.NewRequest(c.serviceName, "Say.Hello", in) - out := new(Response) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Say service - -type SayHandler interface { - Hello(context.Context, *Request, *Response) error -} - -func RegisterSayHandler(s server.Server, hdlr SayHandler, opts ...server.HandlerOption) { - type say interface { - Hello(ctx context.Context, in *Request, out *Response) error - } - type Say struct { - say - } - h := &sayHandler{hdlr} - s.Handle(s.NewHandler(&Say{h}, opts...)) -} - -type sayHandler struct { - SayHandler -} - -func (h *sayHandler) Hello(ctx context.Context, in *Request, out *Response) error { - return h.SayHandler.Hello(ctx, in, out) -} diff --git a/examples/secure/srv/proto/hello/hello.pb.go b/examples/secure/srv/proto/hello/hello.pb.go deleted file mode 100644 index fe668953..00000000 --- a/examples/secure/srv/proto/hello/hello.pb.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto - -/* -Package go_micro_srv_greeter is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto - -It has these top-level messages: - Request - Response -*/ -package go_micro_srv_greeter - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Response) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func init() { - proto.RegisterType((*Request)(nil), "go.micro.srv.greeter.Request") - proto.RegisterType((*Response)(nil), "go.micro.srv.greeter.Response") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Say service - -type SayClient interface { - Hello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) -} - -type sayClient struct { - cc *grpc.ClientConn -} - -func NewSayClient(cc *grpc.ClientConn) SayClient { - return &sayClient{cc} -} - -func (c *sayClient) Hello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := grpc.Invoke(ctx, "/go.micro.srv.greeter.Say/Hello", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Say service - -type SayServer interface { - Hello(context.Context, *Request) (*Response, error) -} - -func RegisterSayServer(s *grpc.Server, srv SayServer) { - s.RegisterService(&_Say_serviceDesc, srv) -} - -func _Say_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SayServer).Hello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.srv.greeter.Say/Hello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SayServer).Hello(ctx, req.(*Request)) - } - return interceptor(ctx, in, info, handler) -} - -var _Say_serviceDesc = grpc.ServiceDesc{ - ServiceName: "go.micro.srv.greeter.Say", - HandlerType: (*SayServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Hello", - Handler: _Say_Hello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto", -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/secure/srv/proto/hello/hello.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 182 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xce, 0x4f, 0xcb, 0x82, 0x40, - 0x10, 0x06, 0xf0, 0x57, 0x7c, 0xff, 0x35, 0xa7, 0x58, 0x3a, 0x44, 0x64, 0x84, 0xa7, 0x4e, 0xb3, - 0x50, 0xd7, 0x3e, 0x80, 0xb7, 0xc0, 0x3e, 0x81, 0xca, 0xb0, 0x0a, 0xae, 0x6b, 0x33, 0xab, 0xd4, - 0xb7, 0x0f, 0x37, 0x8f, 0x75, 0x19, 0x1e, 0xe6, 0x61, 0xf8, 0x0d, 0x9c, 0x4d, 0xe3, 0xeb, 0xa1, - 0xc4, 0xca, 0x59, 0x6d, 0x9b, 0x8a, 0x9d, 0xa6, 0x7b, 0x61, 0xfb, 0x96, 0x44, 0x0b, 0x55, 0x03, - 0x93, 0x16, 0x1e, 0x75, 0xcf, 0xce, 0x3b, 0x5d, 0x53, 0xdb, 0xce, 0x13, 0xc3, 0x46, 0xad, 0x8c, - 0xc3, 0x70, 0x85, 0xc2, 0x23, 0x1a, 0x26, 0xf2, 0xc4, 0x69, 0x02, 0x7f, 0x39, 0xdd, 0x06, 0x12, - 0xaf, 0x14, 0x7c, 0x77, 0x85, 0xa5, 0x75, 0xb4, 0x8f, 0x0e, 0x8b, 0x3c, 0xe4, 0x74, 0x0b, 0xff, - 0x39, 0x49, 0xef, 0x3a, 0x21, 0xb5, 0x84, 0xd8, 0x8a, 0x99, 0xeb, 0x29, 0x1e, 0x2f, 0x10, 0x5f, - 0x8b, 0x87, 0xca, 0xe0, 0x27, 0x9b, 0x20, 0x95, 0xe0, 0x3b, 0x03, 0x67, 0x60, 0xb3, 0xfb, 0x54, - 0xbf, 0x80, 0xf4, 0xab, 0xfc, 0x0d, 0xaf, 0x9e, 0x9e, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0xd8, - 0xd1, 0xf2, 0xea, 0x00, 0x00, 0x00, -} diff --git a/examples/secure/srv/proto/hello/hello.proto b/examples/secure/srv/proto/hello/hello.proto deleted file mode 100644 index a7c28a44..00000000 --- a/examples/secure/srv/proto/hello/hello.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package go.micro.srv.greeter; - -service Say { - rpc Hello(Request) returns (Response) {} -} - -message Request { - string name = 1; -} - -message Response { - string msg = 1; -} diff --git a/examples/server/Dockerfile b/examples/server/Dockerfile deleted file mode 100644 index c24b628a..00000000 --- a/examples/server/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -# Build binary with the following command -# CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./main.go -FROM alpine:3.2 -ADD server / -ENTRYPOINT [ "/server" ] diff --git a/examples/server/README.md b/examples/server/README.md deleted file mode 100644 index 2b2aca1f..00000000 --- a/examples/server/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Service - -An example Go service running with go-micro - -## Contents - -- main.go - initialises and runs the the server -- handler - is an example RPC request handler for the Server -- proto - contains the protobuf defintion for the Server API -- subscriber - is a handler for subscribing via the Server -- wrapper - demonstrates use of a server HandlerWrapper -- codegen - shows how to use codegenerated registration to reduce boilerplate - -## Usage - -Run Service -``` -$ go run server/main.go -I0525 18:06:14.471489 83304 server.go:117] Starting server go.micro.srv.example id go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6 -I0525 18:06:14.474960 83304 rpc_server.go:126] Listening on [::]:62216 -I0525 18:06:14.474997 83304 server.go:99] Registering node: go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6 -``` - -Test Service -``` -$ go run client/main.go -go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6: Hello John -``` diff --git a/examples/server/codegen/codegen.go b/examples/server/codegen/codegen.go deleted file mode 100644 index fabc368f..00000000 --- a/examples/server/codegen/codegen.go +++ /dev/null @@ -1,83 +0,0 @@ -package main - -import ( - "log" - - "context" - "github.com/asim/go-micro/examples/v4/server/subscriber" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/server" - - example "github.com/asim/go-micro/examples/v4/server/proto/example" -) - -type Example struct{} - -func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error { - log.Print("Received Example.Call request") - rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name - return nil -} - -func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error { - log.Printf("Received Example.Stream request with count: %d", req.Count) - - for i := 0; i < int(req.Count); i++ { - log.Printf("Responding: %d", i) - if err := stream.Send(&example.StreamingResponse{ - Count: int64(i), - }); err != nil { - return err - } - } - - return nil -} - -func (e *Example) PingPong(ctx context.Context, stream example.Example_PingPongStream) error { - for { - req, err := stream.Recv() - if err != nil { - return err - } - log.Printf("Got ping %v", req.Stroke) - if err := stream.Send(&example.Pong{Stroke: req.Stroke}); err != nil { - return err - } - } -} - -func main() { - // optionally setup command line usage - cmd.Init() - - // Initialise Server - server.Init( - server.Name("go.micro.srv.example"), - ) - - // Register Subscribers - server.Subscribe( - server.NewSubscriber( - "topic.go.micro.srv.example", - new(subscriber.Example), - ), - ) - - server.Subscribe( - server.NewSubscriber( - "topic.go.micro.srv.example", - subscriber.Handler, - ), - ) - - // Register Handler - example.RegisterExampleHandler( - server.DefaultServer, new(Example), - ) - - // Run server - if err := server.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/server/handler/example.go b/examples/server/handler/example.go deleted file mode 100644 index 69d75cc9..00000000 --- a/examples/server/handler/example.go +++ /dev/null @@ -1,58 +0,0 @@ -package handler - -import ( - "log" - - example "github.com/asim/go-micro/examples/v4/server/proto/example" - "go-micro.dev/v4/metadata" - "go-micro.dev/v4/server" - - "context" -) - -type Example struct{} - -func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error { - md, _ := metadata.FromContext(ctx) - log.Printf("Received Example.Call request with metadata: %v", md) - rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name - return nil -} - -func (e *Example) Stream(ctx context.Context, stream server.Stream) error { - log.Print("Executing streaming handler") - req := &example.StreamingRequest{} - - // We just want to receive 1 request and then process here - if err := stream.Recv(req); err != nil { - log.Printf("Error receiving streaming request: %v", err) - return err - } - - log.Printf("Received Example.Stream request with count: %d", req.Count) - - for i := 0; i < int(req.Count); i++ { - log.Printf("Responding: %d", i) - - if err := stream.Send(&example.StreamingResponse{ - Count: int64(i), - }); err != nil { - return err - } - } - - return nil -} - -func (e *Example) PingPong(ctx context.Context, stream server.Stream) error { - for { - req := &example.Ping{} - if err := stream.Recv(req); err != nil { - return err - } - log.Printf("Got ping %v", req.Stroke) - if err := stream.Send(&example.Pong{Stroke: req.Stroke}); err != nil { - return err - } - } -} diff --git a/examples/server/main.go b/examples/server/main.go deleted file mode 100644 index 41f70d2d..00000000 --- a/examples/server/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "log" - - "github.com/asim/go-micro/examples/v4/server/handler" - "github.com/asim/go-micro/examples/v4/server/subscriber" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/server" -) - -func main() { - // optionally setup command line usage - cmd.Init() - - // Initialise Server - server.Init( - server.Name("go.micro.srv.example"), - ) - - // Register Handlers - server.Handle( - server.NewHandler( - new(handler.Example), - ), - ) - - // Register Subscribers - if err := server.Subscribe( - server.NewSubscriber( - "topic.example", - new(subscriber.Example), - ), - ); err != nil { - log.Fatal(err) - } - - if err := server.Subscribe( - server.NewSubscriber( - "topic.example", - subscriber.Handler, - ), - ); err != nil { - log.Fatal(err) - } - - // Run server - if err := server.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/server/proto/example/example.micro.go b/examples/server/proto/example/example.micro.go deleted file mode 100644 index d850cef0..00000000 --- a/examples/server/proto/example/example.micro.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/server/proto/example/example.proto - -/* -Package go_micro_srv_example is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/server/proto/example/example.proto - -It has these top-level messages: - Message - Request - Response - StreamingRequest - StreamingResponse - Ping - Pong -*/ -package go_micro_srv_example - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Example service - -type ExampleService interface { - Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) - Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamService, error) - PingPong(ctx context.Context, opts ...client.CallOption) (Example_PingPongService, error) -} - -type exampleService struct { - c client.Client - serviceName string -} - -func NewExampleService(serviceName string, c client.Client) ExampleService { - if c == nil { - c = client.NewClient() - } - if len(serviceName) == 0 { - serviceName = "go.micro.srv.example" - } - return &exampleService{ - c: c, - serviceName: serviceName, - } -} - -func (c *exampleService) Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { - req := c.c.NewRequest(c.serviceName, "Example.Call", in) - out := new(Response) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *exampleService) Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamService, error) { - req := c.c.NewRequest(c.serviceName, "Example.Stream", &StreamingRequest{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - if err := stream.Send(in); err != nil { - return nil, err - } - return &exampleStreamService{stream}, nil -} - -type Example_StreamService interface { - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Recv() (*StreamingResponse, error) -} - -type exampleStreamService struct { - stream client.Stream -} - -func (x *exampleStreamService) Close() error { - return x.stream.Close() -} - -func (x *exampleStreamService) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *exampleStreamService) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *exampleStreamService) Recv() (*StreamingResponse, error) { - m := new(StreamingResponse) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -func (c *exampleService) PingPong(ctx context.Context, opts ...client.CallOption) (Example_PingPongService, error) { - req := c.c.NewRequest(c.serviceName, "Example.PingPong", &Ping{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - return &examplePingPongService{stream}, nil -} - -type Example_PingPongService interface { - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Ping) error - Recv() (*Pong, error) -} - -type examplePingPongService struct { - stream client.Stream -} - -func (x *examplePingPongService) Close() error { - return x.stream.Close() -} - -func (x *examplePingPongService) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *examplePingPongService) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *examplePingPongService) Send(m *Ping) error { - return x.stream.Send(m) -} - -func (x *examplePingPongService) Recv() (*Pong, error) { - m := new(Pong) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -// Server API for Example service - -type ExampleHandler interface { - Call(context.Context, *Request, *Response) error - Stream(context.Context, *StreamingRequest, Example_StreamStream) error - PingPong(context.Context, Example_PingPongStream) error -} - -func RegisterExampleHandler(s server.Server, hdlr ExampleHandler, opts ...server.HandlerOption) { - type example interface { - Call(ctx context.Context, in *Request, out *Response) error - Stream(ctx context.Context, stream server.Stream) error - PingPong(ctx context.Context, stream server.Stream) error - } - type Example struct { - example - } - h := &exampleHandler{hdlr} - s.Handle(s.NewHandler(&Example{h}, opts...)) -} - -type exampleHandler struct { - ExampleHandler -} - -func (h *exampleHandler) Call(ctx context.Context, in *Request, out *Response) error { - return h.ExampleHandler.Call(ctx, in, out) -} - -func (h *exampleHandler) Stream(ctx context.Context, stream server.Stream) error { - m := new(StreamingRequest) - if err := stream.Recv(m); err != nil { - return err - } - return h.ExampleHandler.Stream(ctx, m, &exampleStreamStream{stream}) -} - -type Example_StreamStream interface { - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*StreamingResponse) error -} - -type exampleStreamStream struct { - stream server.Stream -} - -func (x *exampleStreamStream) Close() error { - return x.stream.Close() -} - -func (x *exampleStreamStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *exampleStreamStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *exampleStreamStream) Send(m *StreamingResponse) error { - return x.stream.Send(m) -} - -func (h *exampleHandler) PingPong(ctx context.Context, stream server.Stream) error { - return h.ExampleHandler.PingPong(ctx, &examplePingPongStream{stream}) -} - -type Example_PingPongStream interface { - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Pong) error - Recv() (*Ping, error) -} - -type examplePingPongStream struct { - stream server.Stream -} - -func (x *examplePingPongStream) Close() error { - return x.stream.Close() -} - -func (x *examplePingPongStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *examplePingPongStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *examplePingPongStream) Send(m *Pong) error { - return x.stream.Send(m) -} - -func (x *examplePingPongStream) Recv() (*Ping, error) { - m := new(Ping) - if err := x.stream.Recv(m); err != nil { - return nil, err - } - return m, nil -} diff --git a/examples/server/proto/example/example.pb.go b/examples/server/proto/example/example.pb.go deleted file mode 100644 index 1e4103b8..00000000 --- a/examples/server/proto/example/example.pb.go +++ /dev/null @@ -1,386 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/server/proto/example/example.proto - -/* -Package go_micro_srv_example is a generated protocol buffer package. - -It is generated from these files: - github.com/asim/go-micro/examples/v4/server/proto/example/example.proto - -It has these top-level messages: - Message - Request - Response - StreamingRequest - StreamingResponse - Ping - Pong -*/ -package go_micro_srv_example - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// 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.ProtoPackageIsVersion2 // please upgrade the proto package - -type Message struct { - Say string `protobuf:"bytes,1,opt,name=say" json:"say,omitempty"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Message) GetSay() string { - if m != nil { - return m.Say - } - return "" -} - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *Response) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -type StreamingRequest struct { - Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` -} - -func (m *StreamingRequest) Reset() { *m = StreamingRequest{} } -func (m *StreamingRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingRequest) ProtoMessage() {} -func (*StreamingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *StreamingRequest) GetCount() int64 { - if m != nil { - return m.Count - } - return 0 -} - -type StreamingResponse struct { - Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` -} - -func (m *StreamingResponse) Reset() { *m = StreamingResponse{} } -func (m *StreamingResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingResponse) ProtoMessage() {} -func (*StreamingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *StreamingResponse) GetCount() int64 { - if m != nil { - return m.Count - } - return 0 -} - -type Ping struct { - Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"` -} - -func (m *Ping) Reset() { *m = Ping{} } -func (m *Ping) String() string { return proto.CompactTextString(m) } -func (*Ping) ProtoMessage() {} -func (*Ping) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *Ping) GetStroke() int64 { - if m != nil { - return m.Stroke - } - return 0 -} - -type Pong struct { - Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"` -} - -func (m *Pong) Reset() { *m = Pong{} } -func (m *Pong) String() string { return proto.CompactTextString(m) } -func (*Pong) ProtoMessage() {} -func (*Pong) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *Pong) GetStroke() int64 { - if m != nil { - return m.Stroke - } - return 0 -} - -func init() { - proto.RegisterType((*Message)(nil), "go.micro.srv.example.Message") - proto.RegisterType((*Request)(nil), "go.micro.srv.example.Request") - proto.RegisterType((*Response)(nil), "go.micro.srv.example.Response") - proto.RegisterType((*StreamingRequest)(nil), "go.micro.srv.example.StreamingRequest") - proto.RegisterType((*StreamingResponse)(nil), "go.micro.srv.example.StreamingResponse") - proto.RegisterType((*Ping)(nil), "go.micro.srv.example.Ping") - proto.RegisterType((*Pong)(nil), "go.micro.srv.example.Pong") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Example service - -type ExampleClient interface { - Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) - Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error) - PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error) -} - -type exampleClient struct { - cc *grpc.ClientConn -} - -func NewExampleClient(cc *grpc.ClientConn) ExampleClient { - return &exampleClient{cc} -} - -func (c *exampleClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := grpc.Invoke(ctx, "/go.micro.srv.example.Example/Call", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[0], c.cc, "/go.micro.srv.example.Example/Stream", opts...) - if err != nil { - return nil, err - } - x := &exampleStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Example_StreamClient interface { - Recv() (*StreamingResponse, error) - grpc.ClientStream -} - -type exampleStreamClient struct { - grpc.ClientStream -} - -func (x *exampleStreamClient) Recv() (*StreamingResponse, error) { - m := new(StreamingResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *exampleClient) PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[1], c.cc, "/go.micro.srv.example.Example/PingPong", opts...) - if err != nil { - return nil, err - } - x := &examplePingPongClient{stream} - return x, nil -} - -type Example_PingPongClient interface { - Send(*Ping) error - Recv() (*Pong, error) - grpc.ClientStream -} - -type examplePingPongClient struct { - grpc.ClientStream -} - -func (x *examplePingPongClient) Send(m *Ping) error { - return x.ClientStream.SendMsg(m) -} - -func (x *examplePingPongClient) Recv() (*Pong, error) { - m := new(Pong) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for Example service - -type ExampleServer interface { - Call(context.Context, *Request) (*Response, error) - Stream(*StreamingRequest, Example_StreamServer) error - PingPong(Example_PingPongServer) error -} - -func RegisterExampleServer(s *grpc.Server, srv ExampleServer) { - s.RegisterService(&_Example_serviceDesc, srv) -} - -func _Example_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExampleServer).Call(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.srv.example.Example/Call", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExampleServer).Call(ctx, req.(*Request)) - } - return interceptor(ctx, in, info, handler) -} - -func _Example_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StreamingRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ExampleServer).Stream(m, &exampleStreamServer{stream}) -} - -type Example_StreamServer interface { - Send(*StreamingResponse) error - grpc.ServerStream -} - -type exampleStreamServer struct { - grpc.ServerStream -} - -func (x *exampleStreamServer) Send(m *StreamingResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Example_PingPong_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ExampleServer).PingPong(&examplePingPongServer{stream}) -} - -type Example_PingPongServer interface { - Send(*Pong) error - Recv() (*Ping, error) - grpc.ServerStream -} - -type examplePingPongServer struct { - grpc.ServerStream -} - -func (x *examplePingPongServer) Send(m *Pong) error { - return x.ServerStream.SendMsg(m) -} - -func (x *examplePingPongServer) Recv() (*Ping, error) { - m := new(Ping) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Example_serviceDesc = grpc.ServiceDesc{ - ServiceName: "go.micro.srv.example.Example", - HandlerType: (*ExampleServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Call", - Handler: _Example_Call_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Stream", - Handler: _Example_Stream_Handler, - ServerStreams: true, - }, - { - StreamName: "PingPong", - Handler: _Example_PingPong_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/asim/go-micro/examples/v4/server/proto/example/example.proto", -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/server/proto/example/example.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4b, 0x2b, 0x31, - 0x10, 0xc6, 0x1b, 0xda, 0xd7, 0xf6, 0xcd, 0xa9, 0x86, 0x22, 0xb2, 0xda, 0x22, 0x39, 0x68, 0xbd, - 0x64, 0x8b, 0x5e, 0xbd, 0x89, 0xe8, 0x45, 0x90, 0xf5, 0xec, 0x21, 0x2d, 0x43, 0x5c, 0x6c, 0x92, - 0x9a, 0x49, 0x8b, 0xfe, 0xed, 0x5e, 0x64, 0xb3, 0x59, 0x11, 0xd9, 0xc5, 0x53, 0x66, 0xe6, 0xf7, - 0x7d, 0xc3, 0xcc, 0x10, 0xb8, 0xd6, 0x65, 0x78, 0xd9, 0xad, 0xe4, 0xda, 0x99, 0xdc, 0x94, 0x6b, - 0xef, 0x72, 0x7c, 0x57, 0x66, 0xbb, 0x41, 0xca, 0x09, 0xfd, 0x1e, 0x7d, 0xbe, 0xf5, 0x2e, 0x7c, - 0x57, 0x9b, 0x57, 0xc6, 0x2a, 0x9f, 0x6a, 0x27, 0xa3, 0x4b, 0x92, 0xdf, 0xcb, 0xc4, 0xc4, 0x31, - 0x8c, 0x1e, 0x90, 0x48, 0x69, 0xe4, 0x13, 0xe8, 0x93, 0xfa, 0x38, 0x62, 0xa7, 0x6c, 0xf1, 0xbf, - 0xa8, 0x42, 0x31, 0x83, 0x51, 0x81, 0x6f, 0x3b, 0xa4, 0xc0, 0x39, 0x0c, 0xac, 0x32, 0x98, 0x68, - 0x8c, 0xc5, 0x09, 0x8c, 0x0b, 0xa4, 0xad, 0xb3, 0x14, 0xcd, 0x86, 0x74, 0x63, 0x36, 0xa4, 0xc5, - 0x02, 0x26, 0x4f, 0xc1, 0xa3, 0x32, 0xa5, 0xd5, 0x4d, 0x97, 0x29, 0xfc, 0x5b, 0xbb, 0x9d, 0x0d, - 0x51, 0xd7, 0x2f, 0xea, 0x44, 0x5c, 0xc0, 0xc1, 0x0f, 0x65, 0x6a, 0xd8, 0x2e, 0x9d, 0xc3, 0xe0, - 0xb1, 0xb4, 0x9a, 0x1f, 0xc2, 0x90, 0x82, 0x77, 0xaf, 0x98, 0x70, 0xca, 0x22, 0x77, 0xdd, 0xfc, - 0xf2, 0x93, 0xc1, 0xe8, 0xb6, 0x5e, 0x9d, 0xdf, 0xc1, 0xe0, 0x46, 0x6d, 0x36, 0x7c, 0x26, 0xdb, - 0x2e, 0x23, 0xd3, 0xcc, 0xd9, 0xbc, 0x0b, 0xd7, 0x83, 0x8a, 0x1e, 0x7f, 0x86, 0x61, 0x3d, 0x3f, - 0x3f, 0x6b, 0xd7, 0xfe, 0xbe, 0x43, 0x76, 0xfe, 0xa7, 0xae, 0x69, 0xbe, 0x64, 0xfc, 0x1e, 0xc6, - 0xd5, 0xce, 0x71, 0xaf, 0xac, 0xdd, 0x58, 0xf1, 0xac, 0x8b, 0x39, 0xab, 0x45, 0x6f, 0xc1, 0x96, - 0x6c, 0x35, 0x8c, 0x3f, 0xe1, 0xea, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x6d, 0x30, 0x6b, 0x49, - 0x02, 0x00, 0x00, -} diff --git a/examples/server/proto/example/example.proto b/examples/server/proto/example/example.proto deleted file mode 100644 index 48c687e4..00000000 --- a/examples/server/proto/example/example.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; - -package go.micro.srv.example; - -service Example { - rpc Call(Request) returns (Response) {} - rpc Stream(StreamingRequest) returns (stream StreamingResponse) {} - rpc PingPong(stream Ping) returns (stream Pong) {} -} - -message Message { - string say = 1; -} - -message Request { - string name = 1; -} - -message Response { - string msg = 1; -} - -message StreamingRequest { - int64 count = 1; -} - -message StreamingResponse { - int64 count = 1; -} - -message Ping { - int64 stroke = 1; -} - -message Pong { - int64 stroke = 1; -} diff --git a/examples/server/subscriber/subscriber.go b/examples/server/subscriber/subscriber.go deleted file mode 100644 index bf7648ef..00000000 --- a/examples/server/subscriber/subscriber.go +++ /dev/null @@ -1,20 +0,0 @@ -package subscriber - -import ( - "log" - - "context" - example "github.com/asim/go-micro/examples/v4/server/proto/example" -) - -type Example struct{} - -func (e *Example) Handle(ctx context.Context, msg *example.Message) error { - log.Print("Handler Received message: ", msg.Say) - return nil -} - -func Handler(ctx context.Context, msg *example.Message) error { - log.Print("Function Received message: ", msg.Say) - return nil -} diff --git a/examples/server/wrapper/main.go b/examples/server/wrapper/main.go deleted file mode 100644 index 0dbe4cd2..00000000 --- a/examples/server/wrapper/main.go +++ /dev/null @@ -1,79 +0,0 @@ -package main - -import ( - "log" - - "context" - "github.com/asim/go-micro/examples/v4/server/handler" - "github.com/asim/go-micro/examples/v4/server/subscriber" - "go-micro.dev/v4/cmd" - "go-micro.dev/v4/server" -) - -func logWrapper(fn server.HandlerFunc) server.HandlerFunc { - return func(ctx context.Context, req server.Request, rsp interface{}) error { - log.Printf("[Log Wrapper] Before serving request method: %v", req.Endpoint()) - err := fn(ctx, req, rsp) - log.Printf("[Log Wrapper] After serving request") - return err - } -} - -func logSubWrapper(fn server.SubscriberFunc) server.SubscriberFunc { - return func(ctx context.Context, req server.Message) error { - log.Printf("[Log Sub Wrapper] Before serving publication topic: %v", req.Topic()) - err := fn(ctx, req) - log.Printf("[Log Sub Wrapper] After serving publication") - return err - } -} - -func main() { - // optionally setup command line usage - cmd.Init() - - md := server.DefaultOptions().Metadata - md["datacenter"] = "local" - - server.DefaultServer = server.NewServer( - server.WrapHandler(logWrapper), - server.WrapSubscriber(logSubWrapper), - server.Metadata(md), - ) - - // Initialise Server - server.Init( - server.Name("go.micro.srv.example"), - ) - - // Register Handlers - server.Handle( - server.NewHandler( - new(handler.Example), - ), - ) - - // Register Subscribers - if err := server.Subscribe( - server.NewSubscriber( - "topic.go.micro.srv.example", - new(subscriber.Example), - ), - ); err != nil { - log.Fatal(err) - } - - if err := server.Subscribe( - server.NewSubscriber( - "topic.go.micro.srv.example", - subscriber.Handler, - ), - ); err != nil { - log.Fatal(err) - } - - // Run server - if err := server.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/service/README.md b/examples/service/README.md deleted file mode 100644 index e75044d8..00000000 --- a/examples/service/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Service - -This is an example of creating a micro service. - -## Contents - -- main.go - is the main definition of the service, handler and client -- proto - contains the protobuf definition of the API - -## Run the example - -Run the service - -```shell -go run main.go -``` - -Run the client - -```shell -go run main.go --run_client -``` - -And that's all there is to it. diff --git a/examples/service/main.go b/examples/service/main.go deleted file mode 100644 index ec557074..00000000 --- a/examples/service/main.go +++ /dev/null @@ -1,88 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "context" - - proto "github.com/asim/go-micro/examples/v4/service/proto" - "go-micro.dev/v4" - "github.com/urfave/cli/v2" -) - -/* - -Example usage of top level service initialisation - -*/ - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, req *proto.Request, rsp *proto.Response) error { - rsp.Greeting = "Hello " + req.Name - return nil -} - -// Setup and the client -func runClient(service micro.Service) { - // Create new greeter client - greeter := proto.NewGreeterService("greeter", service.Client()) - - // Call the greeter - rsp, err := greeter.Hello(context.TODO(), &proto.Request{Name: "John"}) - if err != nil { - fmt.Println(err) - return - } - - // Print response - fmt.Println(rsp.Greeting) -} - -func main() { - // Create a new service. Optionally include some options here. - service := micro.NewService( - micro.Name("greeter"), - micro.Version("latest"), - micro.Metadata(map[string]string{ - "type": "helloworld", - }), - - // Setup some flags. Specify --run_client to run the client - - // Add runtime flags - // We could do this below too - micro.Flags(&cli.BoolFlag{ - Name: "run_client", - Usage: "Launch the client", - }), - ) - - // Init will parse the command line flags. Any flags set will - // override the above settings. Options defined here will - // override anything set on the command line. - service.Init( - // Add runtime action - // We could actually do this above - micro.Action(func(c *cli.Context) error { - if c.Bool("run_client") { - runClient(service) - os.Exit(0) - } - return nil - }), - ) - - // By default we'll run the server unless the flags catch us - - // Setup the server - - // Register handler - proto.RegisterGreeterHandler(service.Server(), new(Greeter)) - - // Run the server - if err := service.Run(); err != nil { - fmt.Println(err) - } -} diff --git a/examples/service/proto/greeter.pb.go b/examples/service/proto/greeter.pb.go deleted file mode 100644 index 0a76f0ab..00000000 --- a/examples/service/proto/greeter.pb.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -package greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// 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 - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_f752d72c38fc9ff3, []int{0} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Response struct { - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_f752d72c38fc9ff3, []int{1} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -func init() { - proto.RegisterType((*Request)(nil), "Request") - proto.RegisterType((*Response)(nil), "Response") -} - -func init() { - proto.RegisterFile("github.com/asim/go-micro/examples/v4/service/proto/greeter.proto", fileDescriptor_f752d72c38fc9ff3) -} - -var fileDescriptor_f752d72c38fc9ff3 = []byte{ - // 159 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8d, 0x41, 0x0a, 0xc2, 0x30, - 0x14, 0x44, 0x2d, 0xa8, 0x6d, 0xff, 0x32, 0x2b, 0x29, 0x28, 0xd2, 0x85, 0xe8, 0x26, 0x01, 0xc5, - 0x33, 0xe8, 0xba, 0x37, 0x68, 0xcb, 0x50, 0x03, 0x4d, 0x7e, 0x4c, 0x52, 0xf1, 0xf8, 0x42, 0xac, - 0xee, 0xe6, 0xc1, 0xcc, 0x1b, 0xba, 0x0e, 0x3a, 0x3e, 0xa6, 0x4e, 0xf6, 0x6c, 0x94, 0xd1, 0xbd, - 0x67, 0x85, 0x77, 0x6b, 0xdc, 0x88, 0xa0, 0x02, 0xfc, 0x4b, 0xf7, 0x50, 0xce, 0x73, 0x64, 0x35, - 0x78, 0x20, 0xc2, 0xcb, 0x44, 0xf5, 0x96, 0xf2, 0x06, 0xcf, 0x09, 0x21, 0x0a, 0x41, 0x4b, 0xdb, - 0x1a, 0x6c, 0xb2, 0x7d, 0x76, 0x2c, 0x9b, 0x94, 0xeb, 0x03, 0x15, 0x0d, 0x82, 0x63, 0x1b, 0x20, - 0x2a, 0x2a, 0xd2, 0x56, 0xdb, 0x61, 0xee, 0xfc, 0xf9, 0x7c, 0xa2, 0xfc, 0xf6, 0xf5, 0x8a, 0x1d, - 0xad, 0xee, 0x18, 0x47, 0x16, 0x85, 0x9c, 0xcd, 0x55, 0x29, 0x7f, 0x92, 0x7a, 0xd1, 0xad, 0xd3, - 0xf1, 0xe5, 0x13, 0x00, 0x00, 0xff, 0xff, 0x92, 0xab, 0x44, 0xf7, 0xb1, 0x00, 0x00, 0x00, -} diff --git a/examples/service/proto/greeter.pb.micro.go b/examples/service/proto/greeter.pb.micro.go deleted file mode 100644 index d8e7cd2b..00000000 --- a/examples/service/proto/greeter.pb.micro.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: github.com/asim/go-micro/examples/v4/service/proto/greeter.proto - -package greeter - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// 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 - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ client.Option -var _ server.Option - -// Client API for Greeter service - -type GreeterService interface { - Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) -} - -type greeterService struct { - c client.Client - name string -} - -func NewGreeterService(name string, c client.Client) GreeterService { - if c == nil { - c = client.NewClient() - } - if len(name) == 0 { - name = "greeter" - } - return &greeterService{ - c: c, - name: name, - } -} - -func (c *greeterService) Hello(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { - req := c.c.NewRequest(c.name, "Greeter.Hello", in) - out := new(Response) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterHandler interface { - Hello(context.Context, *Request, *Response) error -} - -func RegisterGreeterHandler(s server.Server, hdlr GreeterHandler, opts ...server.HandlerOption) error { - type greeter interface { - Hello(ctx context.Context, in *Request, out *Response) error - } - type Greeter struct { - greeter - } - h := &greeterHandler{hdlr} - return s.Handle(s.NewHandler(&Greeter{h}, opts...)) -} - -type greeterHandler struct { - GreeterHandler -} - -func (h *greeterHandler) Hello(ctx context.Context, in *Request, out *Response) error { - return h.GreeterHandler.Hello(ctx, in, out) -} diff --git a/examples/service/proto/greeter.proto b/examples/service/proto/greeter.proto deleted file mode 100644 index 845bcc53..00000000 --- a/examples/service/proto/greeter.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -service Greeter { - rpc Hello(Request) returns (Response) {} -} - -message Request { - string name = 1; -} - -message Response { - string greeting = 1; -} diff --git a/examples/sharding/README.md b/examples/sharding/README.md deleted file mode 100644 index e45c3a86..00000000 --- a/examples/sharding/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Sharding - -A sharding example using the greeter application and a X-From-User header as the sharding key - -## Contents - -- api.go - a modified version of the greeter api to include sharding - -## Run - -### Greeter Service - -Run multiple copies of the greeter - -``` -cd ../greeter -go run srv/main.go -``` - -### Greeter API - -``` -go run api.go -``` - -### Micro API - -``` -micro api -``` - -### Call API - -Call the API with X-From-User header. Change the user to see the effects of sharding. - -```shell -curl -H "X-From-User: john" http://localhost:8080/greeter/say/hello?name=John -``` - diff --git a/examples/sharding/api.go b/examples/sharding/api.go deleted file mode 100644 index 037f3e1a..00000000 --- a/examples/sharding/api.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "encoding/json" - "log" - "strings" - - hello "github.com/asim/go-micro/examples/v4/greeter/srv/proto/hello" - "go-micro.dev/v4" - "go-micro.dev/v4/errors" - shard "github.com/asim/go-micro/plugins/wrapper/select/shard/v4" - api "go-micro.dev/v4/api/proto" - - "context" -) - -type Say struct { - Client hello.SayService -} - -func (s *Say) Hello(ctx context.Context, req *api.Request, rsp *api.Response) error { - log.Print("Received Say.Hello API request") - - name, ok := req.Get["name"] - if !ok || len(name.Values) == 0 { - return errors.BadRequest("go.micro.api.greeter", "Name cannot be blank") - } - - response, err := s.Client.Hello(ctx, &hello.Request{ - Name: strings.Join(name.Values, " "), - }) - if err != nil { - return err - } - - rsp.StatusCode = 200 - b, _ := json.Marshal(map[string]string{ - "message": response.Msg, - }) - rsp.Body = string(b) - - return nil -} - -func main() { - wrapper := shard.NewClientWrapper("X-From-User") - - service := micro.NewService( - micro.Name("go.micro.api.greeter"), - micro.WrapClient(wrapper), - ) - - // parse command line flags - service.Init() - - service.Server().Handle(service.Server().NewHandler(&Say{ - Client: hello.NewSayService("go.micro.srv.greeter", service.Client()), - })) - - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/shutdown/README.md b/examples/shutdown/README.md deleted file mode 100644 index 508061fd..00000000 --- a/examples/shutdown/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Shutdown - -This demonstrates graceful shutdown of a service via context cancellation after 5 seconds - -A micro.Service waits on context.Done() or an OS kill signal diff --git a/examples/shutdown/main.go b/examples/shutdown/main.go deleted file mode 100644 index 15c71cc9..00000000 --- a/examples/shutdown/main.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "log" - "time" - - "context" - "go-micro.dev/v4" -) - -func main() { - // cancellation context - ctx, cancel := context.WithCancel(context.Background()) - - // shutdown after 5 seconds - go func() { - <-time.After(time.Second * 5) - log.Println("Shutdown example: shutting down service") - cancel() - }() - - // create service - service := micro.NewService( - // with our cancellation context - micro.Context(ctx), - ) - - // init service - service.Init() - - // run service - service.Run() -} diff --git a/examples/stream/grpc/README.md b/examples/stream/grpc/README.md deleted file mode 100644 index 2b2c442b..00000000 --- a/examples/stream/grpc/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Description - -This example is translate [go grpc example](https://grpc.io/docs/languages/go/basics/) into go-micro. -You can also find the orignal codes in [github.com/grpc/grpc-go](https://github.com/grpc/grpc-go/tree/master/examples/route_guide). - -# Run the sample code - -## Protobuf - -```shell -protoc --go_out=proto --micro_out=proto proto/route_guide.proto -``` - -## Server - -```shell -cd stream/gprc/server -go run . -``` - -## Client - -```shell -cd stream/client -go run main.go -``` diff --git a/examples/stream/grpc/client/main.go b/examples/stream/grpc/client/main.go deleted file mode 100644 index 005d0dc4..00000000 --- a/examples/stream/grpc/client/main.go +++ /dev/null @@ -1,161 +0,0 @@ -package main - -import ( - "context" - "io" - "math/rand" - "time" - - pb "github.com/asim/go-micro/examples/v4/stream/grpc/proto" - "github.com/asim/go-micro/plugins/client/grpc/v4" - "go-micro.dev/v4" - "go-micro.dev/v4/logger" -) - -func main() { - srv := micro.NewService( - micro.Client(grpc.NewClient()), - micro.Name("stream-client"), - ) - srv.Init() - client := pb.NewRouteGuideService("stream-server", srv.Client()) - - for { - // Looking for a valid feature - printFeature(client, &pb.Point{Latitude: 409146138, Longitude: -746188906}) - // Feature missing. - printFeature(client, &pb.Point{Latitude: 0, Longitude: 0}) - // Looking for features between 40, -75 and 42, -73. - printFeatures(client, &pb.Rectangle{ - Lo: &pb.Point{Latitude: 400000000, Longitude: -750000000}, - Hi: &pb.Point{Latitude: 420000000, Longitude: -730000000}, - }) - - // RecordRoute - runRecordRoute(client) - - // RouteChat - runRouteChat(client) - - time.Sleep(time.Second) - } -} - -// printFeature gets the feature for the given point. -func printFeature(client pb.RouteGuideService, point *pb.Point) { - logger.Info("Getting feature for point (%d, %d)", point.Latitude, point.Longitude) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - feature, err := client.GetFeature(ctx, point) - if err != nil { - logger.Fatal(err) - } - logger.Info(feature) -} - -// printFeatures lists all the features within the given bounding Rectangle. -func printFeatures(client pb.RouteGuideService, rect *pb.Rectangle) { - logger.Infof("Looking for features within %v", rect) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - stream, err := client.ListFeatures(ctx, rect) - if err != nil { - logger.Fatal(err) - } - // IMPORTANT: do not forgot to close stream - defer stream.Close() - for { - feature, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - logger.Fatal(err) - } - logger.Infof("Feature: name: %q, point:(%v, %v)", feature.GetName(), - feature.GetLocation().GetLatitude(), feature.GetLocation().GetLongitude()) - } -} - -// runRecordRoute sends a sequence of points to server and expects to get a RouteSummary from server. -func runRecordRoute(client pb.RouteGuideService) { - // Create a random number of random points - r := rand.New(rand.NewSource(time.Now().UnixNano())) - pointCount := int(r.Int31n(100)) + 2 // Traverse at least two points - var points []*pb.Point - for i := 0; i < pointCount; i++ { - points = append(points, randomPoint(r)) - } - logger.Infof("Traversing %d points.", len(points)) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - stream, err := client.RecordRoute(ctx) - if err != nil { - logger.Fatal(err) - } - // IMPORTANT: do not forgot to close stream - defer stream.Close() - for _, point := range points { - if err := stream.Send(point); err != nil { - logger.Fatal(err) - } - } - if err := stream.CloseSend(); err != nil { - logger.Fatal(err) - } - summary := pb.RouteSummary{} - if err := stream.RecvMsg(&summary); err != nil { - logger.Fatal(err) - } - logger.Infof("Route summary: %v", &summary) -} - -// runRouteChat receives a sequence of route notes, while sending notes for various locations. -func runRouteChat(client pb.RouteGuideService) { - notes := []*pb.RouteNote{ - {Location: &pb.Point{Latitude: 0, Longitude: 1}, Message: "First message"}, - {Location: &pb.Point{Latitude: 0, Longitude: 2}, Message: "Second message"}, - {Location: &pb.Point{Latitude: 0, Longitude: 3}, Message: "Third message"}, - {Location: &pb.Point{Latitude: 0, Longitude: 1}, Message: "Fourth message"}, - {Location: &pb.Point{Latitude: 0, Longitude: 2}, Message: "Fifth message"}, - {Location: &pb.Point{Latitude: 0, Longitude: 3}, Message: "Sixth message"}, - } - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - stream, err := client.RouteChat(ctx) - if err != nil { - logger.Fatal(err) - } - // IMPORTANT: do not forgot to close stream - defer stream.Close() - waitc := make(chan struct{}) - go func() { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - close(waitc) - break - } - if err != nil { - logger.Fatal(err) - } - logger.Infof("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) - } - }() - for _, note := range notes { - if err := stream.Send(note); err != nil { - logger.Fatal(err) - } - } - if err := stream.CloseSend(); err != nil { - logger.Fatal(err) - } - <-waitc -} - -func randomPoint(r *rand.Rand) *pb.Point { - lat := (r.Int31n(180) - 90) * 1e7 - long := (r.Int31n(360) - 180) * 1e7 - return &pb.Point{Latitude: lat, Longitude: long} -} diff --git a/examples/stream/grpc/proto/route_guide.pb.go b/examples/stream/grpc/proto/route_guide.pb.go deleted file mode 100644 index d3e7125d..00000000 --- a/examples/stream/grpc/proto/route_guide.pb.go +++ /dev/null @@ -1,514 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.15.6 -// source: proto/route_guide.proto - -package proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Points are represented as latitude-longitude pairs in the E7 representation -// (degrees multiplied by 10**7 and rounded to the nearest integer). -// Latitudes should be in the range +/- 90 degrees and longitude should be in -// the range +/- 180 degrees (inclusive). -type Point struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Latitude int32 `protobuf:"varint,1,opt,name=latitude,proto3" json:"latitude,omitempty"` - Longitude int32 `protobuf:"varint,2,opt,name=longitude,proto3" json:"longitude,omitempty"` -} - -func (x *Point) Reset() { - *x = Point{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_route_guide_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Point) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Point) ProtoMessage() {} - -func (x *Point) ProtoReflect() protoreflect.Message { - mi := &file_proto_route_guide_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Point.ProtoReflect.Descriptor instead. -func (*Point) Descriptor() ([]byte, []int) { - return file_proto_route_guide_proto_rawDescGZIP(), []int{0} -} - -func (x *Point) GetLatitude() int32 { - if x != nil { - return x.Latitude - } - return 0 -} - -func (x *Point) GetLongitude() int32 { - if x != nil { - return x.Longitude - } - return 0 -} - -// A latitude-longitude rectangle, represented as two diagonally opposite -// points "lo" and "hi". -type Rectangle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // One corner of the rectangle. - Lo *Point `protobuf:"bytes,1,opt,name=lo,proto3" json:"lo,omitempty"` - // The other corner of the rectangle. - Hi *Point `protobuf:"bytes,2,opt,name=hi,proto3" json:"hi,omitempty"` -} - -func (x *Rectangle) Reset() { - *x = Rectangle{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_route_guide_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rectangle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rectangle) ProtoMessage() {} - -func (x *Rectangle) ProtoReflect() protoreflect.Message { - mi := &file_proto_route_guide_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rectangle.ProtoReflect.Descriptor instead. -func (*Rectangle) Descriptor() ([]byte, []int) { - return file_proto_route_guide_proto_rawDescGZIP(), []int{1} -} - -func (x *Rectangle) GetLo() *Point { - if x != nil { - return x.Lo - } - return nil -} - -func (x *Rectangle) GetHi() *Point { - if x != nil { - return x.Hi - } - return nil -} - -// A feature names something at a given point. -// -// If a feature could not be named, the name is empty. -type Feature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the feature. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The point where the feature is detected. - Location *Point `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` -} - -func (x *Feature) Reset() { - *x = Feature{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_route_guide_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Feature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Feature) ProtoMessage() {} - -func (x *Feature) ProtoReflect() protoreflect.Message { - mi := &file_proto_route_guide_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Feature.ProtoReflect.Descriptor instead. -func (*Feature) Descriptor() ([]byte, []int) { - return file_proto_route_guide_proto_rawDescGZIP(), []int{2} -} - -func (x *Feature) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Feature) GetLocation() *Point { - if x != nil { - return x.Location - } - return nil -} - -// A RouteNote is a message sent while at a given point. -type RouteNote struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The location from which the message is sent. - Location *Point `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` - // The message to be sent. - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *RouteNote) Reset() { - *x = RouteNote{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_route_guide_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RouteNote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RouteNote) ProtoMessage() {} - -func (x *RouteNote) ProtoReflect() protoreflect.Message { - mi := &file_proto_route_guide_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RouteNote.ProtoReflect.Descriptor instead. -func (*RouteNote) Descriptor() ([]byte, []int) { - return file_proto_route_guide_proto_rawDescGZIP(), []int{3} -} - -func (x *RouteNote) GetLocation() *Point { - if x != nil { - return x.Location - } - return nil -} - -func (x *RouteNote) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// A RouteSummary is received in response to a RecordRoute rpc. -// -// It contains the number of individual points received, the number of -// detected features, and the total distance covered as the cumulative sum of -// the distance between each point. -type RouteSummary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The number of points received. - PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` - // The number of known features passed while traversing the route. - FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount,proto3" json:"feature_count,omitempty"` - // The distance covered in metres. - Distance int32 `protobuf:"varint,3,opt,name=distance,proto3" json:"distance,omitempty"` - // The duration of the traversal in seconds. - ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"` -} - -func (x *RouteSummary) Reset() { - *x = RouteSummary{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_route_guide_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RouteSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RouteSummary) ProtoMessage() {} - -func (x *RouteSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_route_guide_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RouteSummary.ProtoReflect.Descriptor instead. -func (*RouteSummary) Descriptor() ([]byte, []int) { - return file_proto_route_guide_proto_rawDescGZIP(), []int{4} -} - -func (x *RouteSummary) GetPointCount() int32 { - if x != nil { - return x.PointCount - } - return 0 -} - -func (x *RouteSummary) GetFeatureCount() int32 { - if x != nil { - return x.FeatureCount - } - return 0 -} - -func (x *RouteSummary) GetDistance() int32 { - if x != nil { - return x.Distance - } - return 0 -} - -func (x *RouteSummary) GetElapsedTime() int32 { - if x != nil { - return x.ElapsedTime - } - return 0 -} - -var File_proto_route_guide_proto protoreflect.FileDescriptor - -var file_proto_route_guide_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x67, 0x75, - 0x69, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x41, 0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x74, - 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x74, - 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, - 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, - 0x75, 0x64, 0x65, 0x22, 0x47, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 0x6c, 0x65, - 0x12, 0x1c, 0x0a, 0x02, 0x6c, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x02, 0x6c, 0x6f, 0x12, 0x1c, - 0x0a, 0x02, 0x68, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x02, 0x68, 0x69, 0x22, 0x47, 0x0a, 0x07, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x08, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x09, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x4e, 0x6f, - 0x74, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x69, - 0x6e, 0x74, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6c, 0x61, - 0x70, 0x73, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0b, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x32, 0xdd, 0x01, 0x0a, - 0x0a, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x47, 0x75, 0x69, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0c, 0x4c, 0x69, 0x73, - 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x1a, 0x0e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, - 0x34, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x0c, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x13, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x22, 0x00, 0x28, 0x01, 0x12, 0x35, 0x0a, 0x09, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x68, - 0x61, 0x74, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x4e, 0x6f, 0x74, 0x65, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x75, - 0x74, 0x65, 0x4e, 0x6f, 0x74, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0a, 0x5a, 0x08, - 0x2e, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_route_guide_proto_rawDescOnce sync.Once - file_proto_route_guide_proto_rawDescData = file_proto_route_guide_proto_rawDesc -) - -func file_proto_route_guide_proto_rawDescGZIP() []byte { - file_proto_route_guide_proto_rawDescOnce.Do(func() { - file_proto_route_guide_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_route_guide_proto_rawDescData) - }) - return file_proto_route_guide_proto_rawDescData -} - -var file_proto_route_guide_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_proto_route_guide_proto_goTypes = []interface{}{ - (*Point)(nil), // 0: proto.Point - (*Rectangle)(nil), // 1: proto.Rectangle - (*Feature)(nil), // 2: proto.Feature - (*RouteNote)(nil), // 3: proto.RouteNote - (*RouteSummary)(nil), // 4: proto.RouteSummary -} -var file_proto_route_guide_proto_depIdxs = []int32{ - 0, // 0: proto.Rectangle.lo:type_name -> proto.Point - 0, // 1: proto.Rectangle.hi:type_name -> proto.Point - 0, // 2: proto.Feature.location:type_name -> proto.Point - 0, // 3: proto.RouteNote.location:type_name -> proto.Point - 0, // 4: proto.RouteGuide.GetFeature:input_type -> proto.Point - 1, // 5: proto.RouteGuide.ListFeatures:input_type -> proto.Rectangle - 0, // 6: proto.RouteGuide.RecordRoute:input_type -> proto.Point - 3, // 7: proto.RouteGuide.RouteChat:input_type -> proto.RouteNote - 2, // 8: proto.RouteGuide.GetFeature:output_type -> proto.Feature - 2, // 9: proto.RouteGuide.ListFeatures:output_type -> proto.Feature - 4, // 10: proto.RouteGuide.RecordRoute:output_type -> proto.RouteSummary - 3, // 11: proto.RouteGuide.RouteChat:output_type -> proto.RouteNote - 8, // [8:12] is the sub-list for method output_type - 4, // [4:8] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_proto_route_guide_proto_init() } -func file_proto_route_guide_proto_init() { - if File_proto_route_guide_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_route_guide_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Point); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_route_guide_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rectangle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_route_guide_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Feature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_route_guide_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RouteNote); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_route_guide_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RouteSummary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_route_guide_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_route_guide_proto_goTypes, - DependencyIndexes: file_proto_route_guide_proto_depIdxs, - MessageInfos: file_proto_route_guide_proto_msgTypes, - }.Build() - File_proto_route_guide_proto = out.File - file_proto_route_guide_proto_rawDesc = nil - file_proto_route_guide_proto_goTypes = nil - file_proto_route_guide_proto_depIdxs = nil -} diff --git a/examples/stream/grpc/proto/route_guide.pb.micro.go b/examples/stream/grpc/proto/route_guide.pb.micro.go deleted file mode 100644 index cbdba4ee..00000000 --- a/examples/stream/grpc/proto/route_guide.pb.micro.go +++ /dev/null @@ -1,420 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/route_guide.proto - -package proto - -import ( - fmt "fmt" - proto "google.golang.org/protobuf/proto" - math "math" -) - -import ( - context "context" - api "go-micro.dev/v4/api" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for RouteGuide service - -func NewRouteGuideEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for RouteGuide service - -type RouteGuideService interface { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - GetFeature(ctx context.Context, in *Point, opts ...client.CallOption) (*Feature, error) - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - ListFeatures(ctx context.Context, in *Rectangle, opts ...client.CallOption) (RouteGuide_ListFeaturesService, error) - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - RecordRoute(ctx context.Context, opts ...client.CallOption) (RouteGuide_RecordRouteService, error) - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - RouteChat(ctx context.Context, opts ...client.CallOption) (RouteGuide_RouteChatService, error) -} - -type routeGuideService struct { - c client.Client - name string -} - -func NewRouteGuideService(name string, c client.Client) RouteGuideService { - return &routeGuideService{ - c: c, - name: name, - } -} - -func (c *routeGuideService) GetFeature(ctx context.Context, in *Point, opts ...client.CallOption) (*Feature, error) { - req := c.c.NewRequest(c.name, "RouteGuide.GetFeature", in) - out := new(Feature) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routeGuideService) ListFeatures(ctx context.Context, in *Rectangle, opts ...client.CallOption) (RouteGuide_ListFeaturesService, error) { - req := c.c.NewRequest(c.name, "RouteGuide.ListFeatures", &Rectangle{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - if err := stream.Send(in); err != nil { - return nil, err - } - if err := stream.CloseSend(); err != nil { - return nil, err - } - return &routeGuideServiceListFeatures{stream}, nil -} - -type RouteGuide_ListFeaturesService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - CloseSend() error - Close() error - Recv() (*Feature, error) -} - -type routeGuideServiceListFeatures struct { - stream client.Stream -} - -func (x *routeGuideServiceListFeatures) CloseSend() error { - return x.stream.CloseSend() -} - -func (x *routeGuideServiceListFeatures) Close() error { - return x.stream.Close() -} - -func (x *routeGuideServiceListFeatures) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideServiceListFeatures) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideServiceListFeatures) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideServiceListFeatures) Recv() (*Feature, error) { - m := new(Feature) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -func (c *routeGuideService) RecordRoute(ctx context.Context, opts ...client.CallOption) (RouteGuide_RecordRouteService, error) { - req := c.c.NewRequest(c.name, "RouteGuide.RecordRoute", &Point{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - return &routeGuideServiceRecordRoute{stream}, nil -} - -type RouteGuide_RecordRouteService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - CloseSend() error - Close() error - Send(*Point) error -} - -type routeGuideServiceRecordRoute struct { - stream client.Stream -} - -func (x *routeGuideServiceRecordRoute) CloseSend() error { - return x.stream.CloseSend() -} - -func (x *routeGuideServiceRecordRoute) Close() error { - return x.stream.Close() -} - -func (x *routeGuideServiceRecordRoute) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideServiceRecordRoute) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideServiceRecordRoute) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideServiceRecordRoute) Send(m *Point) error { - return x.stream.Send(m) -} - -func (c *routeGuideService) RouteChat(ctx context.Context, opts ...client.CallOption) (RouteGuide_RouteChatService, error) { - req := c.c.NewRequest(c.name, "RouteGuide.RouteChat", &RouteNote{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - return &routeGuideServiceRouteChat{stream}, nil -} - -type RouteGuide_RouteChatService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - CloseSend() error - Close() error - Send(*RouteNote) error - Recv() (*RouteNote, error) -} - -type routeGuideServiceRouteChat struct { - stream client.Stream -} - -func (x *routeGuideServiceRouteChat) CloseSend() error { - return x.stream.CloseSend() -} - -func (x *routeGuideServiceRouteChat) Close() error { - return x.stream.Close() -} - -func (x *routeGuideServiceRouteChat) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideServiceRouteChat) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideServiceRouteChat) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideServiceRouteChat) Send(m *RouteNote) error { - return x.stream.Send(m) -} - -func (x *routeGuideServiceRouteChat) Recv() (*RouteNote, error) { - m := new(RouteNote) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -// Server API for RouteGuide service - -type RouteGuideHandler interface { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - GetFeature(context.Context, *Point, *Feature) error - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - ListFeatures(context.Context, *Rectangle, RouteGuide_ListFeaturesStream) error - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - RecordRoute(context.Context, RouteGuide_RecordRouteStream) error - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - RouteChat(context.Context, RouteGuide_RouteChatStream) error -} - -func RegisterRouteGuideHandler(s server.Server, hdlr RouteGuideHandler, opts ...server.HandlerOption) error { - type routeGuide interface { - GetFeature(ctx context.Context, in *Point, out *Feature) error - ListFeatures(ctx context.Context, stream server.Stream) error - RecordRoute(ctx context.Context, stream server.Stream) error - RouteChat(ctx context.Context, stream server.Stream) error - } - type RouteGuide struct { - routeGuide - } - h := &routeGuideHandler{hdlr} - return s.Handle(s.NewHandler(&RouteGuide{h}, opts...)) -} - -type routeGuideHandler struct { - RouteGuideHandler -} - -func (h *routeGuideHandler) GetFeature(ctx context.Context, in *Point, out *Feature) error { - return h.RouteGuideHandler.GetFeature(ctx, in, out) -} - -func (h *routeGuideHandler) ListFeatures(ctx context.Context, stream server.Stream) error { - m := new(Rectangle) - if err := stream.Recv(m); err != nil { - return err - } - return h.RouteGuideHandler.ListFeatures(ctx, m, &routeGuideListFeaturesStream{stream}) -} - -type RouteGuide_ListFeaturesStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Feature) error -} - -type routeGuideListFeaturesStream struct { - stream server.Stream -} - -func (x *routeGuideListFeaturesStream) Close() error { - return x.stream.Close() -} - -func (x *routeGuideListFeaturesStream) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideListFeaturesStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideListFeaturesStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideListFeaturesStream) Send(m *Feature) error { - return x.stream.Send(m) -} - -func (h *routeGuideHandler) RecordRoute(ctx context.Context, stream server.Stream) error { - return h.RouteGuideHandler.RecordRoute(ctx, &routeGuideRecordRouteStream{stream}) -} - -type RouteGuide_RecordRouteStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Recv() (*Point, error) -} - -type routeGuideRecordRouteStream struct { - stream server.Stream -} - -func (x *routeGuideRecordRouteStream) Close() error { - return x.stream.Close() -} - -func (x *routeGuideRecordRouteStream) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideRecordRouteStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideRecordRouteStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideRecordRouteStream) Recv() (*Point, error) { - m := new(Point) - if err := x.stream.Recv(m); err != nil { - return nil, err - } - return m, nil -} - -func (h *routeGuideHandler) RouteChat(ctx context.Context, stream server.Stream) error { - return h.RouteGuideHandler.RouteChat(ctx, &routeGuideRouteChatStream{stream}) -} - -type RouteGuide_RouteChatStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*RouteNote) error - Recv() (*RouteNote, error) -} - -type routeGuideRouteChatStream struct { - stream server.Stream -} - -func (x *routeGuideRouteChatStream) Close() error { - return x.stream.Close() -} - -func (x *routeGuideRouteChatStream) Context() context.Context { - return x.stream.Context() -} - -func (x *routeGuideRouteChatStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *routeGuideRouteChatStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *routeGuideRouteChatStream) Send(m *RouteNote) error { - return x.stream.Send(m) -} - -func (x *routeGuideRouteChatStream) Recv() (*RouteNote, error) { - m := new(RouteNote) - if err := x.stream.Recv(m); err != nil { - return nil, err - } - return m, nil -} diff --git a/examples/stream/grpc/proto/route_guide.proto b/examples/stream/grpc/proto/route_guide.proto deleted file mode 100644 index 7ca28420..00000000 --- a/examples/stream/grpc/proto/route_guide.proto +++ /dev/null @@ -1,94 +0,0 @@ -syntax = "proto3"; - -option go_package = "../proto"; - -package proto; - -// Interface exported by the server. -service RouteGuide { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - rpc GetFeature(Point) returns (Feature) {} - - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - rpc ListFeatures(Rectangle) returns (stream Feature) {} - - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - rpc RecordRoute(stream Point) returns (RouteSummary) {} - - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} -} - -// Points are represented as latitude-longitude pairs in the E7 representation -// (degrees multiplied by 10**7 and rounded to the nearest integer). -// Latitudes should be in the range +/- 90 degrees and longitude should be in -// the range +/- 180 degrees (inclusive). -message Point { - int32 latitude = 1; - int32 longitude = 2; -} - -// A latitude-longitude rectangle, represented as two diagonally opposite -// points "lo" and "hi". -message Rectangle { - // One corner of the rectangle. - Point lo = 1; - - // The other corner of the rectangle. - Point hi = 2; -} - -// A feature names something at a given point. -// -// If a feature could not be named, the name is empty. -message Feature { - // The name of the feature. - string name = 1; - - // The point where the feature is detected. - Point location = 2; -} - -// A RouteNote is a message sent while at a given point. -message RouteNote { - // The location from which the message is sent. - Point location = 1; - - // The message to be sent. - string message = 2; -} - -// A RouteSummary is received in response to a RecordRoute rpc. -// -// It contains the number of individual points received, the number of -// detected features, and the total distance covered as the cumulative sum of -// the distance between each point. -message RouteSummary { - // The number of points received. - int32 point_count = 1; - - // The number of known features passed while traversing the route. - int32 feature_count = 2; - - // The distance covered in metres. - int32 distance = 3; - - // The duration of the traversal in seconds. - int32 elapsed_time = 4; -} \ No newline at end of file diff --git a/examples/stream/grpc/server/data.go b/examples/stream/grpc/server/data.go deleted file mode 100644 index d1cc27a3..00000000 --- a/examples/stream/grpc/server/data.go +++ /dev/null @@ -1,661 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "math" - - pb "github.com/asim/go-micro/examples/v4/stream/grpc/proto" -) - -var features []*pb.Feature - -func init() { - if err := json.Unmarshal(testingData, &features); err != nil { - panic(err) - } -} - -func inRange(point *pb.Point, rect *pb.Rectangle) bool { - left := math.Min(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) - right := math.Max(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) - top := math.Max(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) - bottom := math.Min(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) - - if float64(point.Longitude) >= left && - float64(point.Longitude) <= right && - float64(point.Latitude) >= bottom && - float64(point.Latitude) <= top { - return true - } - return false -} - -func calcDistance(p1 *pb.Point, p2 *pb.Point) int32 { - const CordFactor float64 = 1e7 - const R = float64(6371000) // earth radius in metres - lat1 := toRadians(float64(p1.Latitude) / CordFactor) - lat2 := toRadians(float64(p2.Latitude) / CordFactor) - lng1 := toRadians(float64(p1.Longitude) / CordFactor) - lng2 := toRadians(float64(p2.Longitude) / CordFactor) - dlat := lat2 - lat1 - dlng := lng2 - lng1 - - a := math.Sin(dlat/2)*math.Sin(dlat/2) + - math.Cos(lat1)*math.Cos(lat2)* - math.Sin(dlng/2)*math.Sin(dlng/2) - c := 2 * math.Atan2(math.Sqrt(a), math.Sqrt(1-a)) - - distance := R * c - return int32(distance) -} - -func toRadians(num float64) float64 { - return num * math.Pi / float64(180) -} - -func serialize(point *pb.Point) string { - return fmt.Sprintf("%d %d", point.Latitude, point.Longitude) -} - -var testingData = []byte(`[{ - "location": { - "latitude": 407838351, - "longitude": -746143763 - }, - "name": "Patriots Path, Mendham, NJ 07945, USA" -}, { - "location": { - "latitude": 408122808, - "longitude": -743999179 - }, - "name": "101 New Jersey 10, Whippany, NJ 07981, USA" -}, { - "location": { - "latitude": 413628156, - "longitude": -749015468 - }, - "name": "U.S. 6, Shohola, PA 18458, USA" -}, { - "location": { - "latitude": 419999544, - "longitude": -740371136 - }, - "name": "5 Conners Road, Kingston, NY 12401, USA" -}, { - "location": { - "latitude": 414008389, - "longitude": -743951297 - }, - "name": "Mid Hudson Psychiatric Center, New Hampton, NY 10958, USA" -}, { - "location": { - "latitude": 419611318, - "longitude": -746524769 - }, - "name": "287 Flugertown Road, Livingston Manor, NY 12758, USA" -}, { - "location": { - "latitude": 406109563, - "longitude": -742186778 - }, - "name": "4001 Tremley Point Road, Linden, NJ 07036, USA" -}, { - "location": { - "latitude": 416802456, - "longitude": -742370183 - }, - "name": "352 South Mountain Road, Wallkill, NY 12589, USA" -}, { - "location": { - "latitude": 412950425, - "longitude": -741077389 - }, - "name": "Bailey Turn Road, Harriman, NY 10926, USA" -}, { - "location": { - "latitude": 412144655, - "longitude": -743949739 - }, - "name": "193-199 Wawayanda Road, Hewitt, NJ 07421, USA" -}, { - "location": { - "latitude": 415736605, - "longitude": -742847522 - }, - "name": "406-496 Ward Avenue, Pine Bush, NY 12566, USA" -}, { - "location": { - "latitude": 413843930, - "longitude": -740501726 - }, - "name": "162 Merrill Road, Highland Mills, NY 10930, USA" -}, { - "location": { - "latitude": 410873075, - "longitude": -744459023 - }, - "name": "Clinton Road, West Milford, NJ 07480, USA" -}, { - "location": { - "latitude": 412346009, - "longitude": -744026814 - }, - "name": "16 Old Brook Lane, Warwick, NY 10990, USA" -}, { - "location": { - "latitude": 402948455, - "longitude": -747903913 - }, - "name": "3 Drake Lane, Pennington, NJ 08534, USA" -}, { - "location": { - "latitude": 406337092, - "longitude": -740122226 - }, - "name": "6324 8th Avenue, Brooklyn, NY 11220, USA" -}, { - "location": { - "latitude": 406421967, - "longitude": -747727624 - }, - "name": "1 Merck Access Road, Whitehouse Station, NJ 08889, USA" -}, { - "location": { - "latitude": 416318082, - "longitude": -749677716 - }, - "name": "78-98 Schalck Road, Narrowsburg, NY 12764, USA" -}, { - "location": { - "latitude": 415301720, - "longitude": -748416257 - }, - "name": "282 Lakeview Drive Road, Highland Lake, NY 12743, USA" -}, { - "location": { - "latitude": 402647019, - "longitude": -747071791 - }, - "name": "330 Evelyn Avenue, Hamilton Township, NJ 08619, USA" -}, { - "location": { - "latitude": 412567807, - "longitude": -741058078 - }, - "name": "New York State Reference Route 987E, Southfields, NY 10975, USA" -}, { - "location": { - "latitude": 416855156, - "longitude": -744420597 - }, - "name": "103-271 Tempaloni Road, Ellenville, NY 12428, USA" -}, { - "location": { - "latitude": 404663628, - "longitude": -744820157 - }, - "name": "1300 Airport Road, North Brunswick Township, NJ 08902, USA" -}, { - "location": { - "latitude": 407113723, - "longitude": -749746483 - }, - "name": "" -}, { - "location": { - "latitude": 402133926, - "longitude": -743613249 - }, - "name": "" -}, { - "location": { - "latitude": 400273442, - "longitude": -741220915 - }, - "name": "" -}, { - "location": { - "latitude": 411236786, - "longitude": -744070769 - }, - "name": "" -}, { - "location": { - "latitude": 411633782, - "longitude": -746784970 - }, - "name": "211-225 Plains Road, Augusta, NJ 07822, USA" -}, { - "location": { - "latitude": 415830701, - "longitude": -742952812 - }, - "name": "" -}, { - "location": { - "latitude": 413447164, - "longitude": -748712898 - }, - "name": "165 Pedersen Ridge Road, Milford, PA 18337, USA" -}, { - "location": { - "latitude": 405047245, - "longitude": -749800722 - }, - "name": "100-122 Locktown Road, Frenchtown, NJ 08825, USA" -}, { - "location": { - "latitude": 418858923, - "longitude": -746156790 - }, - "name": "" -}, { - "location": { - "latitude": 417951888, - "longitude": -748484944 - }, - "name": "650-652 Willi Hill Road, Swan Lake, NY 12783, USA" -}, { - "location": { - "latitude": 407033786, - "longitude": -743977337 - }, - "name": "26 East 3rd Street, New Providence, NJ 07974, USA" -}, { - "location": { - "latitude": 417548014, - "longitude": -740075041 - }, - "name": "" -}, { - "location": { - "latitude": 410395868, - "longitude": -744972325 - }, - "name": "" -}, { - "location": { - "latitude": 404615353, - "longitude": -745129803 - }, - "name": "" -}, { - "location": { - "latitude": 406589790, - "longitude": -743560121 - }, - "name": "611 Lawrence Avenue, Westfield, NJ 07090, USA" -}, { - "location": { - "latitude": 414653148, - "longitude": -740477477 - }, - "name": "18 Lannis Avenue, New Windsor, NY 12553, USA" -}, { - "location": { - "latitude": 405957808, - "longitude": -743255336 - }, - "name": "82-104 Amherst Avenue, Colonia, NJ 07067, USA" -}, { - "location": { - "latitude": 411733589, - "longitude": -741648093 - }, - "name": "170 Seven Lakes Drive, Sloatsburg, NY 10974, USA" -}, { - "location": { - "latitude": 412676291, - "longitude": -742606606 - }, - "name": "1270 Lakes Road, Monroe, NY 10950, USA" -}, { - "location": { - "latitude": 409224445, - "longitude": -748286738 - }, - "name": "509-535 Alphano Road, Great Meadows, NJ 07838, USA" -}, { - "location": { - "latitude": 406523420, - "longitude": -742135517 - }, - "name": "652 Garden Street, Elizabeth, NJ 07202, USA" -}, { - "location": { - "latitude": 401827388, - "longitude": -740294537 - }, - "name": "349 Sea Spray Court, Neptune City, NJ 07753, USA" -}, { - "location": { - "latitude": 410564152, - "longitude": -743685054 - }, - "name": "13-17 Stanley Street, West Milford, NJ 07480, USA" -}, { - "location": { - "latitude": 408472324, - "longitude": -740726046 - }, - "name": "47 Industrial Avenue, Teterboro, NJ 07608, USA" -}, { - "location": { - "latitude": 412452168, - "longitude": -740214052 - }, - "name": "5 White Oak Lane, Stony Point, NY 10980, USA" -}, { - "location": { - "latitude": 409146138, - "longitude": -746188906 - }, - "name": "Berkshire Valley Management Area Trail, Jefferson, NJ, USA" -}, { - "location": { - "latitude": 404701380, - "longitude": -744781745 - }, - "name": "1007 Jersey Avenue, New Brunswick, NJ 08901, USA" -}, { - "location": { - "latitude": 409642566, - "longitude": -746017679 - }, - "name": "6 East Emerald Isle Drive, Lake Hopatcong, NJ 07849, USA" -}, { - "location": { - "latitude": 408031728, - "longitude": -748645385 - }, - "name": "1358-1474 New Jersey 57, Port Murray, NJ 07865, USA" -}, { - "location": { - "latitude": 413700272, - "longitude": -742135189 - }, - "name": "367 Prospect Road, Chester, NY 10918, USA" -}, { - "location": { - "latitude": 404310607, - "longitude": -740282632 - }, - "name": "10 Simon Lake Drive, Atlantic Highlands, NJ 07716, USA" -}, { - "location": { - "latitude": 409319800, - "longitude": -746201391 - }, - "name": "11 Ward Street, Mount Arlington, NJ 07856, USA" -}, { - "location": { - "latitude": 406685311, - "longitude": -742108603 - }, - "name": "300-398 Jefferson Avenue, Elizabeth, NJ 07201, USA" -}, { - "location": { - "latitude": 419018117, - "longitude": -749142781 - }, - "name": "43 Dreher Road, Roscoe, NY 12776, USA" -}, { - "location": { - "latitude": 412856162, - "longitude": -745148837 - }, - "name": "Swan Street, Pine Island, NY 10969, USA" -}, { - "location": { - "latitude": 416560744, - "longitude": -746721964 - }, - "name": "66 Pleasantview Avenue, Monticello, NY 12701, USA" -}, { - "location": { - "latitude": 405314270, - "longitude": -749836354 - }, - "name": "" -}, { - "location": { - "latitude": 414219548, - "longitude": -743327440 - }, - "name": "" -}, { - "location": { - "latitude": 415534177, - "longitude": -742900616 - }, - "name": "565 Winding Hills Road, Montgomery, NY 12549, USA" -}, { - "location": { - "latitude": 406898530, - "longitude": -749127080 - }, - "name": "231 Rocky Run Road, Glen Gardner, NJ 08826, USA" -}, { - "location": { - "latitude": 407586880, - "longitude": -741670168 - }, - "name": "100 Mount Pleasant Avenue, Newark, NJ 07104, USA" -}, { - "location": { - "latitude": 400106455, - "longitude": -742870190 - }, - "name": "517-521 Huntington Drive, Manchester Township, NJ 08759, USA" -}, { - "location": { - "latitude": 400066188, - "longitude": -746793294 - }, - "name": "" -}, { - "location": { - "latitude": 418803880, - "longitude": -744102673 - }, - "name": "40 Mountain Road, Napanoch, NY 12458, USA" -}, { - "location": { - "latitude": 414204288, - "longitude": -747895140 - }, - "name": "" -}, { - "location": { - "latitude": 414777405, - "longitude": -740615601 - }, - "name": "" -}, { - "location": { - "latitude": 415464475, - "longitude": -747175374 - }, - "name": "48 North Road, Forestburgh, NY 12777, USA" -}, { - "location": { - "latitude": 404062378, - "longitude": -746376177 - }, - "name": "" -}, { - "location": { - "latitude": 405688272, - "longitude": -749285130 - }, - "name": "" -}, { - "location": { - "latitude": 400342070, - "longitude": -748788996 - }, - "name": "" -}, { - "location": { - "latitude": 401809022, - "longitude": -744157964 - }, - "name": "" -}, { - "location": { - "latitude": 404226644, - "longitude": -740517141 - }, - "name": "9 Thompson Avenue, Leonardo, NJ 07737, USA" -}, { - "location": { - "latitude": 410322033, - "longitude": -747871659 - }, - "name": "" -}, { - "location": { - "latitude": 407100674, - "longitude": -747742727 - }, - "name": "" -}, { - "location": { - "latitude": 418811433, - "longitude": -741718005 - }, - "name": "213 Bush Road, Stone Ridge, NY 12484, USA" -}, { - "location": { - "latitude": 415034302, - "longitude": -743850945 - }, - "name": "" -}, { - "location": { - "latitude": 411349992, - "longitude": -743694161 - }, - "name": "" -}, { - "location": { - "latitude": 404839914, - "longitude": -744759616 - }, - "name": "1-17 Bergen Court, New Brunswick, NJ 08901, USA" -}, { - "location": { - "latitude": 414638017, - "longitude": -745957854 - }, - "name": "35 Oakland Valley Road, Cuddebackville, NY 12729, USA" -}, { - "location": { - "latitude": 412127800, - "longitude": -740173578 - }, - "name": "" -}, { - "location": { - "latitude": 401263460, - "longitude": -747964303 - }, - "name": "" -}, { - "location": { - "latitude": 412843391, - "longitude": -749086026 - }, - "name": "" -}, { - "location": { - "latitude": 418512773, - "longitude": -743067823 - }, - "name": "" -}, { - "location": { - "latitude": 404318328, - "longitude": -740835638 - }, - "name": "42-102 Main Street, Belford, NJ 07718, USA" -}, { - "location": { - "latitude": 419020746, - "longitude": -741172328 - }, - "name": "" -}, { - "location": { - "latitude": 404080723, - "longitude": -746119569 - }, - "name": "" -}, { - "location": { - "latitude": 401012643, - "longitude": -744035134 - }, - "name": "" -}, { - "location": { - "latitude": 404306372, - "longitude": -741079661 - }, - "name": "" -}, { - "location": { - "latitude": 403966326, - "longitude": -748519297 - }, - "name": "" -}, { - "location": { - "latitude": 405002031, - "longitude": -748407866 - }, - "name": "" -}, { - "location": { - "latitude": 409532885, - "longitude": -742200683 - }, - "name": "" -}, { - "location": { - "latitude": 416851321, - "longitude": -742674555 - }, - "name": "" -}, { - "location": { - "latitude": 406411633, - "longitude": -741722051 - }, - "name": "3387 Richmond Terrace, Staten Island, NY 10303, USA" -}, { - "location": { - "latitude": 413069058, - "longitude": -744597778 - }, - "name": "261 Van Sickle Road, Goshen, NY 10924, USA" -}, { - "location": { - "latitude": 418465462, - "longitude": -746859398 - }, - "name": "" -}, { - "location": { - "latitude": 411733222, - "longitude": -744228360 - }, - "name": "" -}, { - "location": { - "latitude": 410248224, - "longitude": -747127767 - }, - "name": "3 Hasta Way, Newton, NJ 07860, USA" -}]`) diff --git a/examples/stream/grpc/server/main.go b/examples/stream/grpc/server/main.go deleted file mode 100644 index e4e8d4c4..00000000 --- a/examples/stream/grpc/server/main.go +++ /dev/null @@ -1,114 +0,0 @@ -package main - -import ( - "context" - "io" - "sync" - "time" - - pb "github.com/asim/go-micro/examples/v4/stream/grpc/proto" - "github.com/asim/go-micro/plugins/server/grpc/v4" - "go-micro.dev/v4" - "go-micro.dev/v4/logger" - "google.golang.org/protobuf/proto" -) - -type server struct { - mu sync.Mutex - routeNotes map[string][]*pb.RouteNote -} - -func main() { - srv := micro.NewService( - micro.Server(grpc.NewServer()), - micro.Name("stream-server"), - ) - srv.Init() - pb.RegisterRouteGuideHandler(srv.Server(), &server{routeNotes: make(map[string][]*pb.RouteNote)}) - if err := srv.Run(); err != nil { - logger.Fatal(err) - } -} - -func (s *server) GetFeature(ctx context.Context, in *pb.Point, out *pb.Feature) error { - for _, f := range features { - if proto.Equal(f.Location, in) { - out.Location = f.Location - out.Name = f.Name - return nil - } - } - out.Location = in - return nil -} - -func (s *server) ListFeatures(ctx context.Context, in *pb.Rectangle, stream pb.RouteGuide_ListFeaturesStream) error { - for _, feature := range features { - if inRange(feature.Location, in) { - if err := stream.Send(feature); err != nil { - return err - } - } - } - return nil -} - -func (s *server) RecordRoute(ctx context.Context, stream pb.RouteGuide_RecordRouteStream) error { - var pointCount, featureCount, distance int32 - var lastPoint *pb.Point - startTime := time.Now() - for { - point, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - pointCount++ - for _, feature := range features { - if proto.Equal(feature.Location, point) { - featureCount++ - } - } - if lastPoint != nil { - distance += calcDistance(lastPoint, point) - } - lastPoint = point - } - return stream.SendMsg(&pb.RouteSummary{ - PointCount: pointCount, - FeatureCount: featureCount, - Distance: distance, - ElapsedTime: int32(time.Since(startTime).Seconds()), - }) -} - -func (s *server) RouteChat(ctx context.Context, stream pb.RouteGuide_RouteChatStream) error { - for { - in, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - key := serialize(in.Location) - - s.mu.Lock() - s.routeNotes[key] = append(s.routeNotes[key], in) - // Note: this copy prevents blocking other clients while serving this one. - // We don't need to do a deep copy, because elements in the slice are - // insert-only and never modified. - rn := make([]*pb.RouteNote, len(s.routeNotes[key])) - copy(rn, s.routeNotes[key]) - s.mu.Unlock() - - for _, note := range rn { - if err := stream.Send(note); err != nil { - return err - } - } - } - return nil -} diff --git a/examples/stream/rpc/README.md b/examples/stream/rpc/README.md deleted file mode 100644 index 429c15c4..00000000 --- a/examples/stream/rpc/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Stream - -This is an example of a streaming service and two clients, a streaming rpc client and a client using websockets. - -## Contents - -- server - is the service -- client - is the rpc client -- web - is the websocket client - -## Run the example - -Run the service - -```shell -go run server/main.go -``` - -Run the client - -```shell -go run client/main.go -``` - -Run the micro web reverse proxy for the websocket client - -``` shell -micro web -``` - -Run the websocket client - -```shell -cd web # must be in the web directory to serve static files. -go run main.go -``` - -Visit http://localhost:8082/stream and send a request! - -And that's all there is to it. diff --git a/examples/stream/rpc/client/main.go b/examples/stream/rpc/client/main.go deleted file mode 100644 index 812a3966..00000000 --- a/examples/stream/rpc/client/main.go +++ /dev/null @@ -1,100 +0,0 @@ -package main - -import ( - "fmt" - "io" - "time" - - "context" - - proto "github.com/asim/go-micro/examples/v4/stream/rpc/server/proto" - "go-micro.dev/v4" -) - -func bidirectional(cl proto.StreamerService) { - // create streaming client - stream, err := cl.Stream(context.Background()) - if err != nil { - fmt.Println("err:", err) - return - } - - // bidirectional stream - // send and receive messages for a 10 count - for j := 0; j < 10; j++ { - if err := stream.Send(&proto.Request{Count: int64(j)}); err != nil { - fmt.Println("err:", err) - return - } - rsp, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - fmt.Println("recv err", err) - break - } - fmt.Printf("Sent msg %v got msg %v\n", j, rsp.Count) - } - - // close the stream - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func serverStream(cl proto.StreamerService) { - // send request to stream count of 10 - stream, err := cl.ServerStream(context.Background(), &proto.Request{Count: int64(10)}) - if err != nil { - fmt.Println("err:", err) - return - } - - var i int - - // server side stream - // receive messages for a 10 count - for { - rsp, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - fmt.Println("recv err", err) - break - } - i++ - fmt.Printf("got msg %v\n", rsp.Count) - } - - if i < 10 { - fmt.Println("only got", i) - return - } - - // close the stream - if err := stream.Close(); err != nil { - fmt.Println("stream close err:", err) - } -} - -func main() { - service := micro.NewService() - service.Init() - - // create client - cl := proto.NewStreamerService("go.micro.srv.stream", service.Client()) - - for { - fmt.Println("Stream") - // bidirectional stream - bidirectional(cl) - - fmt.Println("ServerStream") - // server side stream - serverStream(cl) - - time.Sleep(time.Second) - } -} diff --git a/examples/stream/rpc/server/main.go b/examples/stream/rpc/server/main.go deleted file mode 100644 index ee46cf58..00000000 --- a/examples/stream/rpc/server/main.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "context" - "fmt" - "io" - "log" - - proto "github.com/asim/go-micro/examples/v4/stream/rpc/server/proto" - "go-micro.dev/v4" -) - -type Streamer struct{} - -// Server side stream -func (e *Streamer) ServerStream(ctx context.Context, req *proto.Request, stream proto.Streamer_ServerStreamStream) error { - fmt.Printf("ServerStream Got msg %v\n", req.Count) - for i := 0; i < int(req.Count); i++ { - fmt.Println("sent", i) - if err := stream.Send(&proto.Response{Count: int64(i)}); err != nil { - return err - } - } - return nil -} - -// Bidirectional stream -func (e *Streamer) Stream(ctx context.Context, stream proto.Streamer_StreamStream) error { - fmt.Println("Stream") - for { - req, err := stream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - fmt.Printf("Got msg %v\n", req.Count) - if err := stream.Send(&proto.Response{Count: req.Count}); err != nil { - return err - } - } -} - -func main() { - // new service - service := micro.NewService( - micro.Name("go.micro.srv.stream"), - ) - - // Init command line - service.Init() - - // Register Handler - proto.RegisterStreamerHandler(service.Server(), new(Streamer)) - - // Run service - if err := service.Run(); err != nil { - log.Fatal(err) - } -} diff --git a/examples/stream/rpc/server/proto/stream.pb.go b/examples/stream/rpc/server/proto/stream.pb.go deleted file mode 100644 index d277dfa1..00000000 --- a/examples/stream/rpc/server/proto/stream.pb.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.15.6 -// source: proto/stream.proto - -package stream - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Request struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *Request) Reset() { - *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_stream_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_proto_stream_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Request.ProtoReflect.Descriptor instead. -func (*Request) Descriptor() ([]byte, []int) { - return file_proto_stream_proto_rawDescGZIP(), []int{0} -} - -func (x *Request) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -type Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *Response) Reset() { - *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_stream_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_proto_stream_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Response.ProtoReflect.Descriptor instead. -func (*Response) Descriptor() ([]byte, []int) { - return file_proto_stream_proto_rawDescGZIP(), []int{1} -} - -func (x *Response) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -var File_proto_stream_proto protoreflect.FileDescriptor - -var file_proto_stream_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1f, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x58, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x08, 0x2e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x08, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, - 0x01, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_stream_proto_rawDescOnce sync.Once - file_proto_stream_proto_rawDescData = file_proto_stream_proto_rawDesc -) - -func file_proto_stream_proto_rawDescGZIP() []byte { - file_proto_stream_proto_rawDescOnce.Do(func() { - file_proto_stream_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_stream_proto_rawDescData) - }) - return file_proto_stream_proto_rawDescData -} - -var file_proto_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_proto_stream_proto_goTypes = []interface{}{ - (*Request)(nil), // 0: Request - (*Response)(nil), // 1: Response -} -var file_proto_stream_proto_depIdxs = []int32{ - 0, // 0: Streamer.Stream:input_type -> Request - 0, // 1: Streamer.ServerStream:input_type -> Request - 1, // 2: Streamer.Stream:output_type -> Response - 1, // 3: Streamer.ServerStream:output_type -> Response - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_proto_stream_proto_init() } -func file_proto_stream_proto_init() { - if File_proto_stream_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_stream_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_stream_proto_goTypes, - DependencyIndexes: file_proto_stream_proto_depIdxs, - MessageInfos: file_proto_stream_proto_msgTypes, - }.Build() - File_proto_stream_proto = out.File - file_proto_stream_proto_rawDesc = nil - file_proto_stream_proto_goTypes = nil - file_proto_stream_proto_depIdxs = nil -} diff --git a/examples/stream/rpc/server/proto/stream.pb.micro.go b/examples/stream/rpc/server/proto/stream.pb.micro.go deleted file mode 100644 index 485ae2f5..00000000 --- a/examples/stream/rpc/server/proto/stream.pb.micro.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/stream.proto - -package stream - -import ( - fmt "fmt" - proto "google.golang.org/protobuf/proto" - math "math" -) - -import ( - context "context" - api "go-micro.dev/v4/api" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Streamer service - -func NewStreamerEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Streamer service - -type StreamerService interface { - Stream(ctx context.Context, opts ...client.CallOption) (Streamer_StreamService, error) - ServerStream(ctx context.Context, in *Request, opts ...client.CallOption) (Streamer_ServerStreamService, error) -} - -type streamerService struct { - c client.Client - name string -} - -func NewStreamerService(name string, c client.Client) StreamerService { - return &streamerService{ - c: c, - name: name, - } -} - -func (c *streamerService) Stream(ctx context.Context, opts ...client.CallOption) (Streamer_StreamService, error) { - req := c.c.NewRequest(c.name, "Streamer.Stream", &Request{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - return &streamerServiceStream{stream}, nil -} - -type Streamer_StreamService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - CloseSend() error - Close() error - Send(*Request) error - Recv() (*Response, error) -} - -type streamerServiceStream struct { - stream client.Stream -} - -func (x *streamerServiceStream) CloseSend() error { - return x.stream.CloseSend() -} - -func (x *streamerServiceStream) Close() error { - return x.stream.Close() -} - -func (x *streamerServiceStream) Context() context.Context { - return x.stream.Context() -} - -func (x *streamerServiceStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *streamerServiceStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *streamerServiceStream) Send(m *Request) error { - return x.stream.Send(m) -} - -func (x *streamerServiceStream) Recv() (*Response, error) { - m := new(Response) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -func (c *streamerService) ServerStream(ctx context.Context, in *Request, opts ...client.CallOption) (Streamer_ServerStreamService, error) { - req := c.c.NewRequest(c.name, "Streamer.ServerStream", &Request{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - if err := stream.Send(in); err != nil { - return nil, err - } - return &streamerServiceServerStream{stream}, nil -} - -type Streamer_ServerStreamService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - CloseSend() error - Close() error - Recv() (*Response, error) -} - -type streamerServiceServerStream struct { - stream client.Stream -} - -func (x *streamerServiceServerStream) CloseSend() error { - return x.stream.CloseSend() -} - -func (x *streamerServiceServerStream) Close() error { - return x.stream.Close() -} - -func (x *streamerServiceServerStream) Context() context.Context { - return x.stream.Context() -} - -func (x *streamerServiceServerStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *streamerServiceServerStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *streamerServiceServerStream) Recv() (*Response, error) { - m := new(Response) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -// Server API for Streamer service - -type StreamerHandler interface { - Stream(context.Context, Streamer_StreamStream) error - ServerStream(context.Context, *Request, Streamer_ServerStreamStream) error -} - -func RegisterStreamerHandler(s server.Server, hdlr StreamerHandler, opts ...server.HandlerOption) error { - type streamer interface { - Stream(ctx context.Context, stream server.Stream) error - ServerStream(ctx context.Context, stream server.Stream) error - } - type Streamer struct { - streamer - } - h := &streamerHandler{hdlr} - return s.Handle(s.NewHandler(&Streamer{h}, opts...)) -} - -type streamerHandler struct { - StreamerHandler -} - -func (h *streamerHandler) Stream(ctx context.Context, stream server.Stream) error { - return h.StreamerHandler.Stream(ctx, &streamerStreamStream{stream}) -} - -type Streamer_StreamStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Response) error - Recv() (*Request, error) -} - -type streamerStreamStream struct { - stream server.Stream -} - -func (x *streamerStreamStream) Close() error { - return x.stream.Close() -} - -func (x *streamerStreamStream) Context() context.Context { - return x.stream.Context() -} - -func (x *streamerStreamStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *streamerStreamStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *streamerStreamStream) Send(m *Response) error { - return x.stream.Send(m) -} - -func (x *streamerStreamStream) Recv() (*Request, error) { - m := new(Request) - if err := x.stream.Recv(m); err != nil { - return nil, err - } - return m, nil -} - -func (h *streamerHandler) ServerStream(ctx context.Context, stream server.Stream) error { - m := new(Request) - if err := stream.Recv(m); err != nil { - return err - } - return h.StreamerHandler.ServerStream(ctx, m, &streamerServerStreamStream{stream}) -} - -type Streamer_ServerStreamStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*Response) error -} - -type streamerServerStreamStream struct { - stream server.Stream -} - -func (x *streamerServerStreamStream) Close() error { - return x.stream.Close() -} - -func (x *streamerServerStreamStream) Context() context.Context { - return x.stream.Context() -} - -func (x *streamerServerStreamStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *streamerServerStreamStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *streamerServerStreamStream) Send(m *Response) error { - return x.stream.Send(m) -} diff --git a/examples/stream/rpc/server/proto/stream.proto b/examples/stream/rpc/server/proto/stream.proto deleted file mode 100644 index 2e1cf08f..00000000 --- a/examples/stream/rpc/server/proto/stream.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -option go_package = "./proto;stream"; - -service Streamer { - rpc Stream(stream Request) returns (stream Response) {} - rpc ServerStream(Request) returns (stream Response) {} -} - -message Request { - int64 count = 1; -} - -message Response { - int64 count = 1; -} diff --git a/examples/waitgroup/README.md b/examples/waitgroup/README.md deleted file mode 100644 index 57f53646..00000000 --- a/examples/waitgroup/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Waitgroup - -This demonstrates how to use sync.WaitGroup with a service. - diff --git a/examples/waitgroup/main.go b/examples/waitgroup/main.go deleted file mode 100644 index 9f18551b..00000000 --- a/examples/waitgroup/main.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "sync" - - "context" - "go-micro.dev/v4" - "go-micro.dev/v4/server" -) - -// waitgroup is a handler wrapper which adds a handler to a sync.WaitGroup -func waitgroup(wg *sync.WaitGroup) server.HandlerWrapper { - return func(h server.HandlerFunc) server.HandlerFunc { - return func(ctx context.Context, req server.Request, rsp interface{}) error { - wg.Add(1) - defer wg.Done() - return h(ctx, req, rsp) - } - } -} - -func main() { - var wg sync.WaitGroup - - service := micro.NewService( - // wrap handlers with waitgroup wrapper - micro.WrapHandler(waitgroup(&wg)), - // waits for the waitgroup once stopped - micro.AfterStop(func() error { - // wait for handlers to finish - wg.Wait() - return nil - }), - ) - - if err := service.Run(); err != nil { - fmt.Println(err) - } -} diff --git a/examples/wrapper/README.md b/examples/wrapper/README.md deleted file mode 100644 index 09d10817..00000000 --- a/examples/wrapper/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Wrapper - -This is an example of how to use wrappers, a form of middleware - -- main.go - the service with a log handler wrapper -- cli/main.go - the client with a log client wrapper diff --git a/examples/wrapper/cli/main.go b/examples/wrapper/cli/main.go deleted file mode 100644 index cbdb516b..00000000 --- a/examples/wrapper/cli/main.go +++ /dev/null @@ -1,46 +0,0 @@ -package main - -import ( - "fmt" - - "context" - proto "github.com/asim/go-micro/examples/v4/service/proto" - "go-micro.dev/v4" - "go-micro.dev/v4/client" -) - -// log wrapper logs every time a request is made -type logWrapper struct { - client.Client -} - -func (l *logWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { - fmt.Printf("[wrapper] client request service: %s method: %s\n", req.Service(), req.Endpoint()) - return l.Client.Call(ctx, req, rsp) -} - -// Implements client.Wrapper as logWrapper -func logWrap(c client.Client) client.Client { - return &logWrapper{c} -} - -func main() { - service := micro.NewService( - micro.Name("greeter.client"), - // wrap the client - micro.WrapClient(logWrap), - ) - - service.Init() - - greeter := proto.NewGreeterService("greeter", service.Client()) - - rsp, err := greeter.Hello(context.TODO(), &proto.Request{Name: "John"}) - if err != nil { - fmt.Println(err) - return - } - - fmt.Println(rsp.Greeting) - -} diff --git a/examples/wrapper/main.go b/examples/wrapper/main.go deleted file mode 100644 index 199f4484..00000000 --- a/examples/wrapper/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "context" - proto "github.com/asim/go-micro/examples/v4/service/proto" - "go-micro.dev/v4" - "go-micro.dev/v4/server" -) - -type Greeter struct{} - -func (g *Greeter) Hello(ctx context.Context, req *proto.Request, rsp *proto.Response) error { - rsp.Greeting = "Hello " + req.Name - return nil -} - -// logWrapper is a handler wrapper -func logWrapper(fn server.HandlerFunc) server.HandlerFunc { - return func(ctx context.Context, req server.Request, rsp interface{}) error { - log.Printf("[wrapper] server request: %v", req.Endpoint()) - err := fn(ctx, req, rsp) - return err - } -} - -func main() { - service := micro.NewService( - micro.Name("greeter"), - // wrap the handler - micro.WrapHandler(logWrapper), - ) - - service.Init() - - proto.RegisterGreeterHandler(service.Server(), new(Greeter)) - - if err := service.Run(); err != nil { - fmt.Println(err) - } -}