mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
examples at v3
This commit is contained in:
@ -27,7 +27,7 @@ This is a repository for go-micro examples. Feel free to contribute.
|
||||
- [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
|
||||
- [grpc](grpc) - Examples of how to use [go-micro/service/grpc](https://github.com/micro/go-micro/service/grpc)
|
||||
- [grpc](grpc) - Examples of how to use [go-micro/service/grpc](https://github.com/asim/go-micro/service/grpc)
|
||||
- [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
|
||||
|
@ -1,57 +0,0 @@
|
||||
# API
|
||||
|
||||
This repo contains examples for using the micro api.
|
||||
|
||||
## Overview
|
||||
|
||||
The [micro api](https://github.com/micro/micro/tree/master/api) is an API gateway which serves HTTP and routes dynamically based on service discovery.
|
||||
|
||||
The micro api by default serves the namespace go.micro.api. Our service names include this plus a unique name e.g go.micro.api.example.
|
||||
You can change the namespace via the flag `--namespace=`.
|
||||
|
||||
The micro api has a number of different handlers which lets you define what kind of API services you want. See examples below. The handler
|
||||
can be set via the flag `--handler=`. The default handler is "rpc".
|
||||
|
||||
## Contents
|
||||
|
||||
- api - an rpc handler that provides the entire http headers and request
|
||||
- proxy - use the api as a http reverse proxy
|
||||
- rpc - make an rpc request to a go-micro app
|
||||
- meta - specify which handler to use via configuration in code
|
||||
|
||||
## Request Mapping
|
||||
|
||||
### API/RPC
|
||||
|
||||
Micro maps http paths to rpc services. The mapping table can be seen below.
|
||||
|
||||
The default namespace for the api is **go.micro.api** but you can set your own namespace via `--namespace`.
|
||||
|
||||
URLs are mapped as follows:
|
||||
|
||||
Path | Service | Method
|
||||
---- | ---- | ----
|
||||
/foo/bar | go.micro.api.foo | Foo.Bar
|
||||
/foo/bar/baz | go.micro.api.foo | Bar.Baz
|
||||
/foo/bar/baz/cat | go.micro.api.foo.bar | Baz.Cat
|
||||
|
||||
Versioned API URLs can easily be mapped to service names:
|
||||
|
||||
Path | Service | Method
|
||||
---- | ---- | ----
|
||||
/foo/bar | go.micro.api.foo | Foo.Bar
|
||||
/v1/foo/bar | go.micro.api.v1.foo | Foo.Bar
|
||||
/v1/foo/bar/baz | go.micro.api.v1.foo | Bar.Baz
|
||||
/v2/foo/bar | go.micro.api.v2.foo | Foo.Bar
|
||||
/v2/foo/bar/baz | go.micro.api.v2.foo | Bar.Baz
|
||||
|
||||
### Proxy Mapping
|
||||
|
||||
Starting the API with `--handler=http` will reverse proxy requests to backend services within the served API namespace (default: go.micro.api).
|
||||
|
||||
Example
|
||||
|
||||
Path | Service | Service Path
|
||||
--- | --- | ---
|
||||
/greeter | go.micro.api.greeter | /greeter
|
||||
/greeter/:name | go.micro.api.greeter | /greeter/:name
|
@ -1,58 +0,0 @@
|
||||
# API
|
||||
|
||||
This example makes use of the "api" handler.
|
||||
|
||||
The api expects you use the [api.Request/Response](https://github.com/micro/go-api/blob/master/proto/api.proto) protos.
|
||||
|
||||
The micro api request handler gives you full control over the http request and response while still leveraging RPC and
|
||||
any transport plugins that use other protocols beyond http in your stack such as grpc, nats, kafka.
|
||||
|
||||
## Usage
|
||||
|
||||
Run the micro API
|
||||
|
||||
```
|
||||
micro api --handler=api
|
||||
```
|
||||
|
||||
Run this example
|
||||
|
||||
```
|
||||
go run api.go
|
||||
```
|
||||
|
||||
|
||||
## Calling the service
|
||||
|
||||
Make a GET request to /example/call which will call go.micro.api.example Example.Call
|
||||
|
||||
```
|
||||
curl "http://localhost:8080/example/call?name=john"
|
||||
```
|
||||
|
||||
Make a POST request to /example/foo/bar which will call go.micro.api.example Foo.Bar
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/example/foo/bar
|
||||
```
|
||||
|
||||
## Set Namespace
|
||||
|
||||
Run the micro API with custom namespace
|
||||
|
||||
```
|
||||
micro api --handler=api --namespace=com.foobar.api
|
||||
```
|
||||
|
||||
or
|
||||
```
|
||||
MICRO_API_NAMESPACE=com.foobar.api micro api --handler=api
|
||||
```
|
||||
|
||||
Set service name with the namespace
|
||||
|
||||
```
|
||||
service := micro.NewService(
|
||||
micro.Name("com.foobar.api.example"),
|
||||
)
|
||||
```
|
@ -1,91 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/api/api/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
api "github.com/asim/go-micro/v3/api/proto"
|
||||
"github.com/asim/go-micro/v3/errors"
|
||||
)
|
||||
|
||||
type Example struct{}
|
||||
|
||||
type Foo struct{}
|
||||
|
||||
// Example.Call is a method which will be served by http request /example/call
|
||||
// In the event we see /[service]/[method] the [service] is used as part of the method
|
||||
// E.g /example/call goes to go.micro.api.example Example.Call
|
||||
func (e *Example) Call(ctx context.Context, req *api.Request, rsp *api.Response) error {
|
||||
log.Print("Received Example.Call request")
|
||||
|
||||
// parse values from the get request
|
||||
name, ok := req.Get["name"]
|
||||
|
||||
if !ok || len(name.Values) == 0 {
|
||||
return errors.BadRequest("go.micro.api.example", "no content")
|
||||
}
|
||||
|
||||
// set response status
|
||||
rsp.StatusCode = 200
|
||||
|
||||
// respond with some json
|
||||
b, _ := json.Marshal(map[string]string{
|
||||
"message": "got your request " + strings.Join(name.Values, " "),
|
||||
})
|
||||
|
||||
// set json body
|
||||
rsp.Body = string(b)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Foo.Bar is a method which will be served by http request /example/foo/bar
|
||||
// Because Foo is not the same as the service name it is mapped beyond /example/
|
||||
func (f *Foo) Bar(ctx context.Context, req *api.Request, rsp *api.Response) error {
|
||||
log.Print("Received Foo.Bar request")
|
||||
|
||||
// check method
|
||||
if req.Method != "POST" {
|
||||
return errors.BadRequest("go.micro.api.example", "require post")
|
||||
}
|
||||
|
||||
// let's make sure we get json
|
||||
ct, ok := req.Header["Content-Type"]
|
||||
if !ok || len(ct.Values) == 0 {
|
||||
return errors.BadRequest("go.micro.api.example", "need content-type")
|
||||
}
|
||||
|
||||
if ct.Values[0] != "application/json" {
|
||||
return errors.BadRequest("go.micro.api.example", "expect application/json")
|
||||
}
|
||||
|
||||
// parse body
|
||||
var body map[string]interface{}
|
||||
json.Unmarshal([]byte(req.Body), &body)
|
||||
|
||||
// do something with parsed body
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.example"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
// register example handler
|
||||
proto.RegisterExampleHandler(service.Server(), new(Example))
|
||||
|
||||
// register foo handler
|
||||
proto.RegisterFooHandler(service.Server(), new(Foo))
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
proto1 "github.com/asim/go-micro/v3/api/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Example service
|
||||
|
||||
type ExampleService interface {
|
||||
Call(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
|
||||
}
|
||||
|
||||
type exampleService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewExampleService(name string, c client.Client) ExampleService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(name) == 0 {
|
||||
name = "example"
|
||||
}
|
||||
return &exampleService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *exampleService) Call(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
|
||||
req := c.c.NewRequest(c.name, "Example.Call", in)
|
||||
out := new(proto1.Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Example service
|
||||
|
||||
type ExampleHandler interface {
|
||||
Call(context.Context, *proto1.Request, *proto1.Response) error
|
||||
}
|
||||
|
||||
func RegisterExampleHandler(s server.Server, hdlr ExampleHandler, opts ...server.HandlerOption) error {
|
||||
type example interface {
|
||||
Call(ctx context.Context, in *proto1.Request, out *proto1.Response) error
|
||||
}
|
||||
type Example struct {
|
||||
example
|
||||
}
|
||||
h := &exampleHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Example{h}, opts...))
|
||||
}
|
||||
|
||||
type exampleHandler struct {
|
||||
ExampleHandler
|
||||
}
|
||||
|
||||
func (h *exampleHandler) Call(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
|
||||
return h.ExampleHandler.Call(ctx, in, out)
|
||||
}
|
||||
|
||||
// Client API for Foo service
|
||||
|
||||
type FooService interface {
|
||||
Bar(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
|
||||
}
|
||||
|
||||
type fooService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewFooService(name string, c client.Client) FooService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(name) == 0 {
|
||||
name = "foo"
|
||||
}
|
||||
return &fooService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *fooService) Bar(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
|
||||
req := c.c.NewRequest(c.name, "Foo.Bar", in)
|
||||
out := new(proto1.Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Foo service
|
||||
|
||||
type FooHandler interface {
|
||||
Bar(context.Context, *proto1.Request, *proto1.Response) error
|
||||
}
|
||||
|
||||
func RegisterFooHandler(s server.Server, hdlr FooHandler, opts ...server.HandlerOption) error {
|
||||
type foo interface {
|
||||
Bar(ctx context.Context, in *proto1.Request, out *proto1.Response) error
|
||||
}
|
||||
type Foo struct {
|
||||
foo
|
||||
}
|
||||
h := &fooHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Foo{h}, opts...))
|
||||
}
|
||||
|
||||
type fooHandler struct {
|
||||
FooHandler
|
||||
}
|
||||
|
||||
func (h *fooHandler) Bar(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
|
||||
return h.FooHandler.Bar(ctx, in, out)
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: proto/api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/asim/go-micro/v3/api/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
|
||||
|
||||
func init() { proto.RegisterFile("proto/api.proto", fileDescriptor_ecf0878b123623e2) }
|
||||
|
||||
var fileDescriptor_ecf0878b123623e2 = []byte{
|
||||
// 135 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0x03, 0xb3, 0xa4, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93,
|
||||
0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x73, 0x33, 0x93, 0x8b, 0xf2, 0xf5, 0xd3, 0xf3, 0x75, 0x21, 0x8c,
|
||||
0xc4, 0x82, 0x4c, 0x7d, 0x34, 0xe5, 0x46, 0x66, 0x5c, 0xec, 0xae, 0x15, 0x89, 0xb9, 0x05, 0x39,
|
||||
0xa9, 0x42, 0xda, 0x5c, 0x2c, 0xce, 0x89, 0x39, 0x39, 0x42, 0xfc, 0x7a, 0xe9, 0xf9, 0x7a, 0x20,
|
||||
0x15, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x52, 0x02, 0x08, 0x81, 0xe2, 0x82, 0xfc, 0xbc,
|
||||
0xe2, 0x54, 0x25, 0x06, 0x23, 0x43, 0x2e, 0x66, 0xb7, 0xfc, 0x7c, 0x21, 0x2d, 0x2e, 0x66, 0xa7,
|
||||
0xc4, 0x22, 0xa2, 0xb4, 0x24, 0xb1, 0x81, 0x6d, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf4,
|
||||
0x92, 0x9f, 0xad, 0xb3, 0x00, 0x00, 0x00,
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "github.com/asim/go-micro/v3/api/proto/api.proto";
|
||||
|
||||
service Example {
|
||||
rpc Call(go.api.Request) returns(go.api.Response) {};
|
||||
}
|
||||
|
||||
service Foo {
|
||||
rpc Bar(go.api.Request) returns(go.api.Response) {};
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
# Meta API
|
||||
|
||||
This example makes use of the micro API metadata handler.
|
||||
|
||||
This will allow us to write standard go-micro services and set the handler/endpoint via service discovery metadata.
|
||||
|
||||
## Usage
|
||||
|
||||
Run the micro API
|
||||
|
||||
```
|
||||
micro api
|
||||
```
|
||||
|
||||
Run this example. Note endpoint metadata when registering the handler
|
||||
|
||||
```
|
||||
go run meta.go
|
||||
```
|
||||
|
||||
Make a POST request to /example which will call go.micro.api.example Example.Call
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{"name": "john"}' "http://localhost:8080/example"
|
||||
```
|
||||
|
||||
Make a POST request to /foo/bar which will call go.micro.api.example Foo.Bar
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/foo/bar
|
||||
```
|
@ -1,78 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/api/rpc/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/api"
|
||||
rapi "github.com/asim/go-micro/v3/api/handler/api"
|
||||
"github.com/asim/go-micro/v3/api/handler/rpc"
|
||||
"github.com/asim/go-micro/v3/errors"
|
||||
|
||||
"context"
|
||||
)
|
||||
|
||||
type Example struct{}
|
||||
|
||||
type Foo struct{}
|
||||
|
||||
// Example.Call is a method which will be served by http request /example/call
|
||||
// In the event we see /[service]/[method] the [service] is used as part of the method
|
||||
// E.g /example/call goes to go.micro.api.example Example.Call
|
||||
func (e *Example) Call(ctx context.Context, req *proto.CallRequest, rsp *proto.CallResponse) error {
|
||||
log.Print("Received Example.Call request")
|
||||
|
||||
if len(req.Name) == 0 {
|
||||
return errors.BadRequest("go.micro.api.example", "no content")
|
||||
}
|
||||
|
||||
rsp.Message = "got your request " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Foo.Bar is a method which will be served by http request /example/foo/bar
|
||||
// Because Foo is not the same as the service name it is mapped beyond /example/
|
||||
func (f *Foo) Bar(ctx context.Context, req *proto.EmptyRequest, rsp *proto.EmptyResponse) error {
|
||||
log.Print("Received Foo.Bar request")
|
||||
|
||||
// noop
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.example"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
// register example handler
|
||||
proto.RegisterExampleHandler(service.Server(), new(Example), api.WithEndpoint(&api.Endpoint{
|
||||
// The RPC method
|
||||
Name: "Example.Call",
|
||||
// The HTTP paths. This can be a POSIX regex
|
||||
Path: []string{"/example"},
|
||||
// The HTTP Methods for this endpoint
|
||||
Method: []string{"POST"},
|
||||
// The API handler to use
|
||||
Handler: rpc.Handler,
|
||||
}))
|
||||
|
||||
// register foo handler
|
||||
proto.RegisterFooHandler(service.Server(), new(Foo), api.WithEndpoint(&api.Endpoint{
|
||||
// The RPC method
|
||||
Name: "Foo.Bar",
|
||||
// The HTTP paths. This can be a POSIX regex
|
||||
Path: []string{"/foo/bar"},
|
||||
// The HTTP Methods for this endpoint
|
||||
Method: []string{"POST"},
|
||||
// The API handler to use
|
||||
Handler: rapi.Handler,
|
||||
}))
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/api/meta/proto/api.proto
|
||||
|
||||
/*
|
||||
Package api is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/api/meta/proto/api.proto
|
||||
|
||||
It has these top-level messages:
|
||||
CallRequest
|
||||
CallResponse
|
||||
EmptyRequest
|
||||
EmptyResponse
|
||||
*/
|
||||
package api
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 *CallRequest, opts ...client.CallOption) (*CallResponse, 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 = "example"
|
||||
}
|
||||
return &exampleService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *exampleService) Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Example.Call", in)
|
||||
out := new(CallResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Example service
|
||||
|
||||
type ExampleHandler interface {
|
||||
Call(context.Context, *CallRequest, *CallResponse) error
|
||||
}
|
||||
|
||||
func RegisterExampleHandler(s server.Server, hdlr ExampleHandler, opts ...server.HandlerOption) {
|
||||
type example interface {
|
||||
Call(ctx context.Context, in *CallRequest, out *CallResponse) 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 *CallRequest, out *CallResponse) error {
|
||||
return h.ExampleHandler.Call(ctx, in, out)
|
||||
}
|
||||
|
||||
// Client API for Foo service
|
||||
|
||||
type FooService interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, opts ...client.CallOption) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
type fooService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewFooService(serviceName string, c client.Client) FooService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "foo"
|
||||
}
|
||||
return &fooService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *fooService) Bar(ctx context.Context, in *EmptyRequest, opts ...client.CallOption) (*EmptyResponse, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Foo.Bar", in)
|
||||
out := new(EmptyResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Foo service
|
||||
|
||||
type FooHandler interface {
|
||||
Bar(context.Context, *EmptyRequest, *EmptyResponse) error
|
||||
}
|
||||
|
||||
func RegisterFooHandler(s server.Server, hdlr FooHandler, opts ...server.HandlerOption) {
|
||||
type foo interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, out *EmptyResponse) error
|
||||
}
|
||||
type Foo struct {
|
||||
foo
|
||||
}
|
||||
h := &fooHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Foo{h}, opts...))
|
||||
}
|
||||
|
||||
type fooHandler struct {
|
||||
FooHandler
|
||||
}
|
||||
|
||||
func (h *fooHandler) Bar(ctx context.Context, in *EmptyRequest, out *EmptyResponse) error {
|
||||
return h.FooHandler.Bar(ctx, in, out)
|
||||
}
|
@ -1,246 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/api/meta/proto/api.proto
|
||||
|
||||
/*
|
||||
Package api is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/api/meta/proto/api.proto
|
||||
|
||||
It has these top-level messages:
|
||||
CallRequest
|
||||
CallResponse
|
||||
EmptyRequest
|
||||
EmptyResponse
|
||||
*/
|
||||
package api
|
||||
|
||||
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 CallRequest struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CallRequest) Reset() { *m = CallRequest{} }
|
||||
func (m *CallRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CallRequest) ProtoMessage() {}
|
||||
func (*CallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *CallRequest) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CallResponse struct {
|
||||
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CallResponse) Reset() { *m = CallResponse{} }
|
||||
func (m *CallResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CallResponse) ProtoMessage() {}
|
||||
func (*CallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *CallResponse) GetMessage() string {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type EmptyRequest struct {
|
||||
}
|
||||
|
||||
func (m *EmptyRequest) Reset() { *m = EmptyRequest{} }
|
||||
func (m *EmptyRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*EmptyRequest) ProtoMessage() {}
|
||||
func (*EmptyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
type EmptyResponse struct {
|
||||
}
|
||||
|
||||
func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
|
||||
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*EmptyResponse) ProtoMessage() {}
|
||||
func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*CallRequest)(nil), "CallRequest")
|
||||
proto.RegisterType((*CallResponse)(nil), "CallResponse")
|
||||
proto.RegisterType((*EmptyRequest)(nil), "EmptyRequest")
|
||||
proto.RegisterType((*EmptyResponse)(nil), "EmptyResponse")
|
||||
}
|
||||
|
||||
// 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 *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
|
||||
}
|
||||
|
||||
type exampleClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewExampleClient(cc *grpc.ClientConn) ExampleClient {
|
||||
return &exampleClient{cc}
|
||||
}
|
||||
|
||||
func (c *exampleClient) Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error) {
|
||||
out := new(CallResponse)
|
||||
err := grpc.Invoke(ctx, "/Example/Call", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Example service
|
||||
|
||||
type ExampleServer interface {
|
||||
Call(context.Context, *CallRequest) (*CallResponse, 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(CallRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExampleServer).Call(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/Example/Call",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExampleServer).Call(ctx, req.(*CallRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Example_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "Example",
|
||||
HandlerType: (*ExampleServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Call",
|
||||
Handler: _Example_Call_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/api/meta/proto/api.proto",
|
||||
}
|
||||
|
||||
// Client API for Foo service
|
||||
|
||||
type FooClient interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
type fooClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewFooClient(cc *grpc.ClientConn) FooClient {
|
||||
return &fooClient{cc}
|
||||
}
|
||||
|
||||
func (c *fooClient) Bar(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error) {
|
||||
out := new(EmptyResponse)
|
||||
err := grpc.Invoke(ctx, "/Foo/Bar", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Foo service
|
||||
|
||||
type FooServer interface {
|
||||
Bar(context.Context, *EmptyRequest) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
func RegisterFooServer(s *grpc.Server, srv FooServer) {
|
||||
s.RegisterService(&_Foo_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Foo_Bar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmptyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FooServer).Bar(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/Foo/Bar",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FooServer).Bar(ctx, req.(*EmptyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Foo_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "Foo",
|
||||
HandlerType: (*FooServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Bar",
|
||||
Handler: _Foo_Bar_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/api/meta/proto/api.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("github.com/micro/go-micro/examples/api/meta/proto/api.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 203 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0xd1, 0x6a, 0x83, 0x30,
|
||||
0x14, 0x86, 0x75, 0xca, 0x64, 0x67, 0xea, 0x20, 0x57, 0xe2, 0xd5, 0x16, 0xd8, 0xf0, 0x66, 0xc9,
|
||||
0x70, 0x6f, 0xd0, 0x62, 0x1f, 0xc0, 0x37, 0x88, 0x72, 0xb0, 0x82, 0x31, 0xa9, 0x89, 0xd0, 0xbe,
|
||||
0x7d, 0x31, 0x5a, 0xb0, 0x77, 0xff, 0x07, 0x7f, 0xbe, 0x3f, 0x07, 0xca, 0xae, 0xb7, 0xe7, 0xb9,
|
||||
0x61, 0xad, 0x92, 0x5c, 0xf6, 0xed, 0xa4, 0x38, 0x5e, 0x85, 0xd4, 0x03, 0x1a, 0x2e, 0x74, 0xcf,
|
||||
0x25, 0x5a, 0xc1, 0xf5, 0xa4, 0xac, 0x5a, 0x90, 0xb9, 0x44, 0xbf, 0xe0, 0xfd, 0x28, 0x86, 0xa1,
|
||||
0xc6, 0xcb, 0x8c, 0xc6, 0x12, 0x02, 0xe1, 0x28, 0x24, 0x66, 0xfe, 0xa7, 0x5f, 0xbc, 0xd5, 0x2e,
|
||||
0xd3, 0x02, 0xe2, 0xb5, 0x62, 0xb4, 0x1a, 0x0d, 0x92, 0x0c, 0x22, 0x89, 0xc6, 0x88, 0x0e, 0xb3,
|
||||
0x17, 0x57, 0x7b, 0x20, 0x4d, 0x21, 0xae, 0xa4, 0xb6, 0xb7, 0xcd, 0x46, 0x3f, 0x20, 0xd9, 0x78,
|
||||
0x7d, 0x5a, 0xfe, 0x41, 0x54, 0xad, 0x5f, 0x22, 0xdf, 0x10, 0x2e, 0x56, 0x12, 0xb3, 0xdd, 0x7e,
|
||||
0x9e, 0xb0, 0xfd, 0x14, 0xf5, 0xca, 0x5f, 0x08, 0x4e, 0x4a, 0x91, 0x1f, 0x08, 0x0e, 0x62, 0x22,
|
||||
0x09, 0xdb, 0xfb, 0xf3, 0x94, 0x3d, 0xe9, 0xa9, 0xd7, 0xbc, 0xba, 0xab, 0xfe, 0xef, 0x01, 0x00,
|
||||
0x00, 0xff, 0xff, 0x14, 0x42, 0xb8, 0x1d, 0x0b, 0x01, 0x00, 0x00,
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
service Example {
|
||||
rpc Call(CallRequest) returns(CallResponse) {};
|
||||
}
|
||||
|
||||
service Foo {
|
||||
rpc Bar(EmptyRequest) returns(EmptyResponse) {};
|
||||
}
|
||||
|
||||
message CallRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CallResponse {
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message EmptyRequest {
|
||||
}
|
||||
|
||||
message EmptyResponse {
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
# Proxy API
|
||||
|
||||
This is an example of using the micro api as a http proxy.
|
||||
|
||||
Using the api as a http proxy gives you complete control over what languages or libraries to use
|
||||
at the API layer. In this case we're using go-web to easily register http services.
|
||||
|
||||
## Usage
|
||||
|
||||
Run micro api with http proxy handler
|
||||
|
||||
```
|
||||
micro api --handler=http
|
||||
```
|
||||
|
||||
Run this proxy service
|
||||
|
||||
```
|
||||
go run proxy.go
|
||||
```
|
||||
|
||||
Make a GET request to /example/call which will call go.micro.api.example Example.Call
|
||||
|
||||
```
|
||||
curl "http://localhost:8080/example/call?name=john"
|
||||
```
|
||||
|
||||
Make a POST request to /example/foo/bar which will call go.micro.api.example Foo.Bar
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/example/foo/bar
|
||||
```
|
@ -1,84 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/asim/go-micro/v3/errors"
|
||||
"github.com/asim/go-micro/v3/web"
|
||||
)
|
||||
|
||||
// exampleCall will handle /example/call
|
||||
func exampleCall(w http.ResponseWriter, r *http.Request) {
|
||||
r.ParseForm()
|
||||
// get name
|
||||
name := r.Form.Get("name")
|
||||
|
||||
if len(name) == 0 {
|
||||
http.Error(
|
||||
w,
|
||||
errors.BadRequest("go.micro.api.example", "no content").Error(),
|
||||
400,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// marshal response
|
||||
b, _ := json.Marshal(map[string]interface{}{
|
||||
"message": "got your message " + name,
|
||||
})
|
||||
|
||||
// write response
|
||||
w.Write(b)
|
||||
}
|
||||
|
||||
// exampleFooBar will handle /example/foo/bar
|
||||
func exampleFooBar(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != "POST" {
|
||||
http.Error(
|
||||
w,
|
||||
errors.BadRequest("go.micro.api.example", "require post").Error(),
|
||||
400,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if len(r.Header.Get("Content-Type")) == 0 {
|
||||
http.Error(
|
||||
w,
|
||||
errors.BadRequest("go.micro.api.example", "need content-type").Error(),
|
||||
400,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if r.Header.Get("Content-Type") != "application/json" {
|
||||
http.Error(
|
||||
w,
|
||||
errors.BadRequest("go.micro.api.example", "expect application/json").Error(),
|
||||
400,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// do something
|
||||
}
|
||||
|
||||
func main() {
|
||||
// we're using go-web for convenience since it registers with discovery
|
||||
service := web.NewService(
|
||||
web.Name("go.micro.api.example"),
|
||||
)
|
||||
|
||||
service.HandleFunc("/example/call", exampleCall)
|
||||
service.HandleFunc("/example/foo/bar", exampleFooBar)
|
||||
|
||||
if err := service.Init(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
# RPC API
|
||||
|
||||
This example makes use of the micro API with the RPC handler.
|
||||
|
||||
The api in this mode lets you serve http while routing to standard go-micro services via RPC.
|
||||
|
||||
The micro api with rpc handler only supports POST method and expects content-type of application/json or application/protobuf.
|
||||
|
||||
## Usage
|
||||
|
||||
Run the micro API with the rpc handler
|
||||
|
||||
```
|
||||
micro api --handler=rpc
|
||||
```
|
||||
|
||||
Run this example
|
||||
|
||||
```
|
||||
go run rpc.go
|
||||
```
|
||||
|
||||
Make a POST request to /example/call which will call go.micro.api.example Example.Call
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{"name": "john"}' "http://localhost:8080/example/call"
|
||||
```
|
||||
|
||||
Make a POST request to /example/foo/bar which will call go.micro.api.example Foo.Bar
|
||||
|
||||
```
|
||||
curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/example/foo/bar
|
||||
```
|
@ -1,160 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/api/rpc/proto/api.proto
|
||||
|
||||
/*
|
||||
Package api is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/api/rpc/proto/api.proto
|
||||
|
||||
It has these top-level messages:
|
||||
CallRequest
|
||||
CallResponse
|
||||
EmptyRequest
|
||||
EmptyResponse
|
||||
*/
|
||||
package api
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 *CallRequest, opts ...client.CallOption) (*CallResponse, 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 = "example"
|
||||
}
|
||||
return &exampleService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *exampleService) Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Example.Call", in)
|
||||
out := new(CallResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Example service
|
||||
|
||||
type ExampleHandler interface {
|
||||
Call(context.Context, *CallRequest, *CallResponse) error
|
||||
}
|
||||
|
||||
func RegisterExampleHandler(s server.Server, hdlr ExampleHandler, opts ...server.HandlerOption) {
|
||||
type example interface {
|
||||
Call(ctx context.Context, in *CallRequest, out *CallResponse) 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 *CallRequest, out *CallResponse) error {
|
||||
return h.ExampleHandler.Call(ctx, in, out)
|
||||
}
|
||||
|
||||
// Client API for Foo service
|
||||
|
||||
type FooService interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, opts ...client.CallOption) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
type fooService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewFooService(serviceName string, c client.Client) FooService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "foo"
|
||||
}
|
||||
return &fooService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *fooService) Bar(ctx context.Context, in *EmptyRequest, opts ...client.CallOption) (*EmptyResponse, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Foo.Bar", in)
|
||||
out := new(EmptyResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Foo service
|
||||
|
||||
type FooHandler interface {
|
||||
Bar(context.Context, *EmptyRequest, *EmptyResponse) error
|
||||
}
|
||||
|
||||
func RegisterFooHandler(s server.Server, hdlr FooHandler, opts ...server.HandlerOption) {
|
||||
type foo interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, out *EmptyResponse) error
|
||||
}
|
||||
type Foo struct {
|
||||
foo
|
||||
}
|
||||
h := &fooHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Foo{h}, opts...))
|
||||
}
|
||||
|
||||
type fooHandler struct {
|
||||
FooHandler
|
||||
}
|
||||
|
||||
func (h *fooHandler) Bar(ctx context.Context, in *EmptyRequest, out *EmptyResponse) error {
|
||||
return h.FooHandler.Bar(ctx, in, out)
|
||||
}
|
@ -1,246 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/api/rpc/proto/api.proto
|
||||
|
||||
/*
|
||||
Package api is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/api/rpc/proto/api.proto
|
||||
|
||||
It has these top-level messages:
|
||||
CallRequest
|
||||
CallResponse
|
||||
EmptyRequest
|
||||
EmptyResponse
|
||||
*/
|
||||
package api
|
||||
|
||||
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 CallRequest struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CallRequest) Reset() { *m = CallRequest{} }
|
||||
func (m *CallRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CallRequest) ProtoMessage() {}
|
||||
func (*CallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *CallRequest) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CallResponse struct {
|
||||
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CallResponse) Reset() { *m = CallResponse{} }
|
||||
func (m *CallResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CallResponse) ProtoMessage() {}
|
||||
func (*CallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *CallResponse) GetMessage() string {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type EmptyRequest struct {
|
||||
}
|
||||
|
||||
func (m *EmptyRequest) Reset() { *m = EmptyRequest{} }
|
||||
func (m *EmptyRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*EmptyRequest) ProtoMessage() {}
|
||||
func (*EmptyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
type EmptyResponse struct {
|
||||
}
|
||||
|
||||
func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
|
||||
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*EmptyResponse) ProtoMessage() {}
|
||||
func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*CallRequest)(nil), "CallRequest")
|
||||
proto.RegisterType((*CallResponse)(nil), "CallResponse")
|
||||
proto.RegisterType((*EmptyRequest)(nil), "EmptyRequest")
|
||||
proto.RegisterType((*EmptyResponse)(nil), "EmptyResponse")
|
||||
}
|
||||
|
||||
// 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 *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
|
||||
}
|
||||
|
||||
type exampleClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewExampleClient(cc *grpc.ClientConn) ExampleClient {
|
||||
return &exampleClient{cc}
|
||||
}
|
||||
|
||||
func (c *exampleClient) Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error) {
|
||||
out := new(CallResponse)
|
||||
err := grpc.Invoke(ctx, "/Example/Call", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Example service
|
||||
|
||||
type ExampleServer interface {
|
||||
Call(context.Context, *CallRequest) (*CallResponse, 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(CallRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExampleServer).Call(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/Example/Call",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExampleServer).Call(ctx, req.(*CallRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Example_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "Example",
|
||||
HandlerType: (*ExampleServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Call",
|
||||
Handler: _Example_Call_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/api/rpc/proto/api.proto",
|
||||
}
|
||||
|
||||
// Client API for Foo service
|
||||
|
||||
type FooClient interface {
|
||||
Bar(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
type fooClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewFooClient(cc *grpc.ClientConn) FooClient {
|
||||
return &fooClient{cc}
|
||||
}
|
||||
|
||||
func (c *fooClient) Bar(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error) {
|
||||
out := new(EmptyResponse)
|
||||
err := grpc.Invoke(ctx, "/Foo/Bar", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Foo service
|
||||
|
||||
type FooServer interface {
|
||||
Bar(context.Context, *EmptyRequest) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
func RegisterFooServer(s *grpc.Server, srv FooServer) {
|
||||
s.RegisterService(&_Foo_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Foo_Bar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmptyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FooServer).Bar(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/Foo/Bar",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FooServer).Bar(ctx, req.(*EmptyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Foo_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "Foo",
|
||||
HandlerType: (*FooServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Bar",
|
||||
Handler: _Foo_Bar_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/api/rpc/proto/api.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("github.com/micro/go-micro/examples/api/rpc/proto/api.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 203 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x51, 0x6a, 0x84, 0x30,
|
||||
0x14, 0x45, 0xb5, 0x4a, 0xa5, 0xaf, 0x6a, 0x21, 0x5f, 0xe2, 0x57, 0x1b, 0x68, 0xf1, 0xa7, 0x49,
|
||||
0x6b, 0x77, 0xd0, 0x62, 0x17, 0xe0, 0x0e, 0xa2, 0x3c, 0xac, 0x60, 0x4c, 0x9a, 0x44, 0x98, 0xd9,
|
||||
0xfd, 0x60, 0x74, 0xc0, 0xf9, 0xbb, 0x07, 0x6e, 0xce, 0xcd, 0x83, 0xcf, 0x61, 0x74, 0x7f, 0x4b,
|
||||
0xc7, 0x7a, 0x25, 0xb9, 0x1c, 0x7b, 0xa3, 0x38, 0x9e, 0x84, 0xd4, 0x13, 0x5a, 0x2e, 0xf4, 0xc8,
|
||||
0x8d, 0xee, 0xb9, 0x36, 0xca, 0xa9, 0x95, 0x98, 0x4f, 0xf4, 0x05, 0x1e, 0x7f, 0xc4, 0x34, 0xb5,
|
||||
0xf8, 0xbf, 0xa0, 0x75, 0x84, 0x40, 0x3c, 0x0b, 0x89, 0x45, 0xf8, 0x1c, 0x56, 0x0f, 0xad, 0xcf,
|
||||
0xb4, 0x82, 0x74, 0xab, 0x58, 0xad, 0x66, 0x8b, 0xa4, 0x80, 0x44, 0xa2, 0xb5, 0x62, 0xc0, 0xe2,
|
||||
0xce, 0xd7, 0xae, 0x48, 0x73, 0x48, 0x1b, 0xa9, 0xdd, 0x79, 0xb7, 0xd1, 0x27, 0xc8, 0x76, 0xde,
|
||||
0x9e, 0xd6, 0x1f, 0x90, 0x34, 0xdb, 0x8f, 0xc8, 0x2b, 0xc4, 0xab, 0x95, 0xa4, 0xec, 0xb0, 0x5f,
|
||||
0x66, 0xec, 0x38, 0x45, 0x83, 0xfa, 0x1d, 0xa2, 0x5f, 0xa5, 0xc8, 0x1b, 0x44, 0xdf, 0xc2, 0x90,
|
||||
0x8c, 0x1d, 0xfd, 0x65, 0xce, 0x6e, 0xf4, 0x34, 0xe8, 0xee, 0xfd, 0x55, 0x5f, 0x97, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0x81, 0x2d, 0x74, 0x3d, 0x0a, 0x01, 0x00, 0x00,
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
service Example {
|
||||
rpc Call(CallRequest) returns(CallResponse) {};
|
||||
}
|
||||
|
||||
service Foo {
|
||||
rpc Bar(EmptyRequest) returns(EmptyResponse) {};
|
||||
}
|
||||
|
||||
message CallRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CallResponse {
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message EmptyRequest {
|
||||
}
|
||||
|
||||
message EmptyResponse {
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/api/rpc/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/errors"
|
||||
|
||||
"context"
|
||||
)
|
||||
|
||||
type Example struct{}
|
||||
|
||||
type Foo struct{}
|
||||
|
||||
// Example.Call is a method which will be served by http request /example/call
|
||||
// In the event we see /[service]/[method] the [service] is used as part of the method
|
||||
// E.g /example/call goes to go.micro.api.example Example.Call
|
||||
func (e *Example) Call(ctx context.Context, req *proto.CallRequest, rsp *proto.CallResponse) error {
|
||||
log.Print("Received Example.Call request")
|
||||
|
||||
if len(req.Name) == 0 {
|
||||
return errors.BadRequest("go.micro.api.example", "no content")
|
||||
}
|
||||
|
||||
rsp.Message = "got your request " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Foo.Bar is a method which will be served by http request /example/foo/bar
|
||||
// Because Foo is not the same as the service name it is mapped beyond /example/
|
||||
func (f *Foo) Bar(ctx context.Context, req *proto.EmptyRequest, rsp *proto.EmptyResponse) error {
|
||||
log.Print("Received Foo.Bar request")
|
||||
|
||||
// noop
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.example"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
// register example handler
|
||||
proto.RegisterExampleHandler(service.Server(), new(Example))
|
||||
|
||||
// register foo handler
|
||||
proto.RegisterFooHandler(service.Server(), new(Foo))
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
.PHONY: proto data build
|
||||
|
||||
proto:
|
||||
for d in api srv; do \
|
||||
for f in $$d/**/proto/*.proto; do \
|
||||
protoc --proto_path=${GOPATH}/src:. --micro_out=. --go_out=. $$f; \
|
||||
echo compiled: $$f; \
|
||||
done \
|
||||
done
|
||||
|
||||
lint:
|
||||
./bin/lint.sh
|
||||
|
||||
build:
|
||||
./bin/build.sh
|
||||
|
||||
data:
|
||||
go-bindata -o data/bindata.go -pkg data data/*.json
|
||||
|
||||
run:
|
||||
docker-compose build
|
||||
docker-compose up
|
@ -1,107 +0,0 @@
|
||||
# Booking.com Example
|
||||
|
||||
This is [@harlow](https://github.com/harlow)'s [go-micro-services](https://github.com/harlow/go-micro-services) example converted to use Micro.
|
||||
|
||||
His README (with required changes):
|
||||
|
||||
The API Endpoint accepts HTTP requests at `localhost:8080` and then spawns a number of RPC requests to the backend services.
|
||||
|
||||
_Note:_ Data for each of the services is stored in JSON flat files under the `/data/` directory. In reality each of the services could choose their own specialty datastore. The Geo service for example could use PostGis or any other database specializing in geospacial queries.
|
||||
|
||||
### Setup
|
||||
|
||||
Docker is required for running the services https://docs.docker.com/engine/installation.
|
||||
|
||||
Protobuf v3 are required:
|
||||
|
||||
$ brew install protobuf
|
||||
|
||||
Install the protoc-gen libraries and other dependencies:
|
||||
|
||||
$ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
|
||||
$ go get -u github.com/micro/protoc-gen-micro
|
||||
$ go get -u github.com/micro/go-micro
|
||||
$ go get -u github.com/hailocab/go-geoindex
|
||||
|
||||
Clone the repository:
|
||||
|
||||
$ git clone git@github.com:micro/micro.git
|
||||
|
||||
Change to examples dir
|
||||
|
||||
$ cd micro/go-micro/examples/booking
|
||||
|
||||
### Protobufs
|
||||
|
||||
If changes are made to the Protocol Buffer files use the Makefile to regenerate:
|
||||
|
||||
$ make proto
|
||||
|
||||
### Run
|
||||
|
||||
To make the demo as straigforward as possible; [Docker Compose](https://docs.docker.com/compose/) is used to run all the services at once (In a production environment each of the services would be run (and scaled) independently).
|
||||
|
||||
$ make build
|
||||
$ make run
|
||||
|
||||
Curl the endpoint with an invalid auth token:
|
||||
|
||||
$ curl -H 'Content-Type: application/json' \
|
||||
-H "Authorization: Bearer INVALID_TOKEN" \
|
||||
-d '{"inDate": "2015-04-09"}' \
|
||||
http://localhost:8080/hotel/rates
|
||||
|
||||
{"id":"api.hotel.rates","code":401,"detail":"Unauthorized","status":"Unauthorized"}
|
||||
|
||||
Curl the endpoint without checkin or checkout dates:
|
||||
|
||||
$ curl -H 'Content-Type: application/json' \
|
||||
-H "Authorization: Bearer VALID_TOKEN" \
|
||||
-d '{"inDate": "2015-04-09"}' \
|
||||
http://localhost:8080/hotel/rates
|
||||
|
||||
{"id":"api.hotel.rates","code":400,"detail":"Please specify inDate/outDate params","status":"Bad Request"}
|
||||
|
||||
Curl the API endpoint with a valid auth token:
|
||||
|
||||
$ curl -H 'Content-Type: application/json' \
|
||||
-H "Authorization: Bearer VALID_TOKEN" \
|
||||
-d '{"inDate": "2015-04-09", "outDate": "2015-04-10"}' \
|
||||
http://localhost:8080/hotel/rates
|
||||
|
||||
The JSON response:
|
||||
|
||||
```json
|
||||
{
|
||||
"hotels": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Clift Hotel",
|
||||
"phoneNumber": "(415) 775-4700",
|
||||
"description": "A 6-minute walk from Union Square and 4 minutes from a Muni Metro station, this luxury hotel designed by Philippe Starck features an artsy furniture collection in the lobby, including work by Salvador Dali.",
|
||||
"address": {
|
||||
"streetNumber": "495",
|
||||
"streetName": "Geary St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94102"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ratePlans": [
|
||||
{
|
||||
"hotelId": 1,
|
||||
"code": "RACK",
|
||||
"inDate": "2015-04-09",
|
||||
"outDate": "2015-04-10",
|
||||
"roomType": {
|
||||
"bookableRate": 109,
|
||||
"totalRate": 109,
|
||||
"totalRateInclusive": 123.17,
|
||||
"code": "KNG"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
@ -1,4 +0,0 @@
|
||||
FROM alpine:3.2
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/hotel" ]
|
@ -1,192 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
_ "expvar"
|
||||
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/net/trace"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/go-micro/examples/booking/api/hotel/proto"
|
||||
"github.com/micro/go-micro/examples/booking/srv/auth/proto"
|
||||
"github.com/micro/go-micro/examples/booking/srv/geo/proto"
|
||||
"github.com/micro/go-micro/examples/booking/srv/profile/proto"
|
||||
"github.com/micro/go-micro/examples/booking/srv/rate/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
merr "github.com/asim/go-micro/v3/errors"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
BASIC_SCHEMA string = "Basic "
|
||||
BEARER_SCHEMA string = "Bearer "
|
||||
)
|
||||
|
||||
type profileResults struct {
|
||||
hotels []*profile.Hotel
|
||||
err error
|
||||
}
|
||||
|
||||
type rateResults struct {
|
||||
ratePlans []*rate.RatePlan
|
||||
err error
|
||||
}
|
||||
|
||||
type Hotel struct {
|
||||
Client client.Client
|
||||
}
|
||||
|
||||
func (s *Hotel) Rates(ctx context.Context, req *hotel.Request, rsp *hotel.Response) error {
|
||||
// tracing
|
||||
tr := trace.New("api.v1", "Hotel.Rates")
|
||||
defer tr.Finish()
|
||||
|
||||
// context
|
||||
ctx = trace.NewContext(ctx, tr)
|
||||
|
||||
md, ok := metadata.FromContext(ctx)
|
||||
if !ok {
|
||||
md = metadata.Metadata{}
|
||||
}
|
||||
|
||||
// add a unique request id to context
|
||||
traceID := uuid.New()
|
||||
// make copy
|
||||
tmd := metadata.Metadata{}
|
||||
for k, v := range md {
|
||||
tmd[k] = v
|
||||
}
|
||||
|
||||
tmd["traceID"] = traceID.String()
|
||||
tmd["fromName"] = "api.v1"
|
||||
ctx = metadata.NewContext(ctx, tmd)
|
||||
|
||||
// token from request headers
|
||||
token, err := getToken(md)
|
||||
if err != nil {
|
||||
return merr.Forbidden("api.hotel.rates", err.Error())
|
||||
}
|
||||
|
||||
// verify token w/ auth service
|
||||
authClient := auth.NewAuthService("go.micro.srv.auth", s.Client)
|
||||
if _, err = authClient.VerifyToken(ctx, &auth.Request{AuthToken: token}); err != nil {
|
||||
return merr.Unauthorized("api.hotel.rates", "Unauthorized")
|
||||
}
|
||||
|
||||
// checkin and checkout date query params
|
||||
inDate, outDate := req.InDate, req.OutDate
|
||||
if inDate == "" || outDate == "" {
|
||||
return merr.BadRequest("api.hotel.rates", "Please specify inDate/outDate params")
|
||||
}
|
||||
|
||||
// finds nearby hotels
|
||||
// TODO(hw): use lat/lon from request params
|
||||
geoClient := geo.NewGeoService("go.micro.srv.geo", s.Client)
|
||||
nearby, err := geoClient.Nearby(ctx, &geo.Request{
|
||||
Lat: 51.502973,
|
||||
Lon: -0.114723,
|
||||
})
|
||||
if err != nil {
|
||||
return merr.InternalServerError("api.hotel.rates", err.Error())
|
||||
}
|
||||
|
||||
// make requests for profiles and rates
|
||||
profileCh := getHotelProfiles(s.Client, ctx, nearby.HotelIds)
|
||||
rateCh := getRatePlans(s.Client, ctx, nearby.HotelIds, inDate, outDate)
|
||||
|
||||
// wait on profiles reply
|
||||
profileReply := <-profileCh
|
||||
if err := profileReply.err; err != nil {
|
||||
return merr.InternalServerError("api.hotel.rates", err.Error())
|
||||
}
|
||||
|
||||
// wait on rates reply
|
||||
rateReply := <-rateCh
|
||||
if err := rateReply.err; err != nil {
|
||||
return merr.InternalServerError("api.hotel.rates", err.Error())
|
||||
}
|
||||
|
||||
rsp.Hotels = profileReply.hotels
|
||||
rsp.RatePlans = rateReply.ratePlans
|
||||
return nil
|
||||
}
|
||||
|
||||
func getToken(md metadata.Metadata) (string, error) {
|
||||
// Grab the raw Authorization header
|
||||
authHeader := md["Authorization"]
|
||||
if authHeader == "" {
|
||||
return "", errors.New("Authorization header required")
|
||||
}
|
||||
|
||||
// Confirm the request is sending Basic Authentication credentials.
|
||||
if !strings.HasPrefix(authHeader, BASIC_SCHEMA) && !strings.HasPrefix(authHeader, BEARER_SCHEMA) {
|
||||
return "", errors.New("Authorization requires Basic/Bearer scheme")
|
||||
}
|
||||
|
||||
// Get the token from the request header
|
||||
// The first six characters are skipped - e.g. "Basic ".
|
||||
if strings.HasPrefix(authHeader, BASIC_SCHEMA) {
|
||||
str, err := base64.StdEncoding.DecodeString(authHeader[len(BASIC_SCHEMA):])
|
||||
if err != nil {
|
||||
return "", errors.New("Base64 encoding issue")
|
||||
}
|
||||
creds := strings.Split(string(str), ":")
|
||||
return creds[0], nil
|
||||
}
|
||||
|
||||
return authHeader[len(BEARER_SCHEMA):], nil
|
||||
}
|
||||
|
||||
func getRatePlans(c client.Client, ctx context.Context, hotelIDs []string, inDate string, outDate string) chan rateResults {
|
||||
rateClient := rate.NewRateService("go.micro.srv.rate", c)
|
||||
ch := make(chan rateResults, 1)
|
||||
|
||||
go func() {
|
||||
res, err := rateClient.GetRates(ctx, &rate.Request{
|
||||
HotelIds: hotelIDs,
|
||||
InDate: inDate,
|
||||
OutDate: outDate,
|
||||
})
|
||||
ch <- rateResults{res.RatePlans, err}
|
||||
}()
|
||||
|
||||
return ch
|
||||
}
|
||||
|
||||
func getHotelProfiles(c client.Client, ctx context.Context, hotelIDs []string) chan profileResults {
|
||||
profileClient := profile.NewProfileService("go.micro.srv.profile", c)
|
||||
ch := make(chan profileResults, 1)
|
||||
|
||||
go func() {
|
||||
res, err := profileClient.GetProfiles(ctx, &profile.Request{
|
||||
HotelIds: hotelIDs,
|
||||
Locale: "en",
|
||||
})
|
||||
ch <- profileResults{res.Hotels, err}
|
||||
}()
|
||||
|
||||
return ch
|
||||
}
|
||||
|
||||
func main() {
|
||||
// trace library patched for demo purposes.
|
||||
// https://github.com/golang/net/blob/master/trace/trace.go#L94
|
||||
trace.AuthRequest = func(req *http.Request) (any, sensitive bool) {
|
||||
return true, true
|
||||
}
|
||||
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.hotel"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
hotel.RegisterHotelHandler(service.Server(), &Hotel{service.Client()})
|
||||
service.Run()
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto
|
||||
|
||||
/*
|
||||
Package hotel is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Response
|
||||
*/
|
||||
package hotel
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/micro/go-micro/examples/booking/srv/profile/proto"
|
||||
import _ "github.com/micro/go-micro/examples/booking/srv/rate/proto"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Hotel service
|
||||
|
||||
type HotelService interface {
|
||||
Rates(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type hotelService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewHotelService(serviceName string, c client.Client) HotelService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "hotel"
|
||||
}
|
||||
return &hotelService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *hotelService) Rates(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Hotel.Rates", in)
|
||||
out := new(Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Hotel service
|
||||
|
||||
type HotelHandler interface {
|
||||
Rates(context.Context, *Request, *Response) error
|
||||
}
|
||||
|
||||
func RegisterHotelHandler(s server.Server, hdlr HotelHandler, opts ...server.HandlerOption) {
|
||||
type hotel interface {
|
||||
Rates(ctx context.Context, in *Request, out *Response) error
|
||||
}
|
||||
type Hotel struct {
|
||||
hotel
|
||||
}
|
||||
h := &hotelHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Hotel{h}, opts...))
|
||||
}
|
||||
|
||||
type hotelHandler struct {
|
||||
HotelHandler
|
||||
}
|
||||
|
||||
func (h *hotelHandler) Rates(ctx context.Context, in *Request, out *Response) error {
|
||||
return h.HotelHandler.Rates(ctx, in, out)
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto
|
||||
|
||||
/*
|
||||
Package hotel is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Response
|
||||
*/
|
||||
package hotel
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import profile "github.com/micro/go-micro/examples/booking/srv/profile/proto"
|
||||
import rate "github.com/micro/go-micro/examples/booking/srv/rate/proto"
|
||||
|
||||
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 {
|
||||
InDate string `protobuf:"bytes,1,opt,name=inDate" json:"inDate,omitempty"`
|
||||
OutDate string `protobuf:"bytes,2,opt,name=outDate" json:"outDate,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) GetInDate() string {
|
||||
if m != nil {
|
||||
return m.InDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Request) GetOutDate() string {
|
||||
if m != nil {
|
||||
return m.OutDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Hotels []*profile.Hotel `protobuf:"bytes,1,rep,name=hotels" json:"hotels,omitempty"`
|
||||
RatePlans []*rate.RatePlan `protobuf:"bytes,2,rep,name=ratePlans" json:"ratePlans,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) GetHotels() []*profile.Hotel {
|
||||
if m != nil {
|
||||
return m.Hotels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Response) GetRatePlans() []*rate.RatePlan {
|
||||
if m != nil {
|
||||
return m.RatePlans
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "hotel.Request")
|
||||
proto.RegisterType((*Response)(nil), "hotel.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 Hotel service
|
||||
|
||||
type HotelClient interface {
|
||||
Rates(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type hotelClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewHotelClient(cc *grpc.ClientConn) HotelClient {
|
||||
return &hotelClient{cc}
|
||||
}
|
||||
|
||||
func (c *hotelClient) Rates(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := grpc.Invoke(ctx, "/hotel.Hotel/Rates", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Hotel service
|
||||
|
||||
type HotelServer interface {
|
||||
Rates(context.Context, *Request) (*Response, error)
|
||||
}
|
||||
|
||||
func RegisterHotelServer(s *grpc.Server, srv HotelServer) {
|
||||
s.RegisterService(&_Hotel_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Hotel_Rates_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.(HotelServer).Rates(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/hotel.Hotel/Rates",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HotelServer).Rates(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Hotel_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "hotel.Hotel",
|
||||
HandlerType: (*HotelServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Rates",
|
||||
Handler: _Hotel_Rates_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/booking/api/hotel/proto/hotel.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 246 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x50, 0xc1, 0x4a, 0xc3, 0x40,
|
||||
0x10, 0x35, 0x95, 0xa4, 0x76, 0x84, 0x0a, 0x7b, 0x90, 0x90, 0x53, 0xc9, 0x41, 0x8a, 0x48, 0x16,
|
||||
0xda, 0x63, 0xf1, 0x20, 0x78, 0xf0, 0x28, 0xfb, 0x05, 0x6e, 0xca, 0xd8, 0x2c, 0x26, 0x99, 0x98,
|
||||
0xdd, 0x88, 0x9f, 0x2f, 0x3b, 0xbb, 0xd1, 0xa3, 0xbd, 0xbd, 0x37, 0x6f, 0xde, 0xdb, 0x37, 0x0b,
|
||||
0x8f, 0x27, 0xe3, 0x9a, 0xa9, 0xae, 0x8e, 0xd4, 0xc9, 0xce, 0x1c, 0x47, 0x92, 0xf8, 0xad, 0xbb,
|
||||
0xa1, 0x45, 0x2b, 0x6b, 0xa2, 0x0f, 0xd3, 0x9f, 0xa4, 0x1e, 0x8c, 0x6c, 0xc8, 0x61, 0x2b, 0x87,
|
||||
0x91, 0x1c, 0x05, 0x5c, 0x31, 0x16, 0x29, 0x93, 0xe2, 0xe9, 0xff, 0x14, 0x3b, 0x7e, 0x79, 0xff,
|
||||
0xbb, 0x69, 0x31, 0xe6, 0x44, 0x16, 0x92, 0x8a, 0xc3, 0x79, 0x11, 0xa3, 0x76, 0xb3, 0xdf, 0xc3,
|
||||
0x60, 0x2e, 0x0f, 0xb0, 0x54, 0xf8, 0x39, 0xa1, 0x75, 0xe2, 0x16, 0x32, 0xd3, 0x3f, 0x6b, 0x87,
|
||||
0x79, 0xb2, 0x49, 0xb6, 0x2b, 0x15, 0x99, 0xc8, 0x61, 0x49, 0x93, 0x63, 0x61, 0xc1, 0xc2, 0x4c,
|
||||
0xcb, 0x37, 0xb8, 0x52, 0x68, 0x07, 0xea, 0x2d, 0x8a, 0x3b, 0xc8, 0xf8, 0x22, 0x9b, 0x27, 0x9b,
|
||||
0xcb, 0xed, 0xf5, 0x6e, 0x5d, 0xcd, 0x2d, 0x5f, 0xfc, 0x58, 0x45, 0x55, 0x3c, 0xc0, 0xca, 0x3f,
|
||||
0xff, 0xda, 0xea, 0xde, 0xe6, 0x8b, 0xb8, 0xca, 0x85, 0x54, 0x1c, 0xab, 0xbf, 0x85, 0xdd, 0x1e,
|
||||
0x52, 0xb6, 0x8b, 0x7b, 0x48, 0xbd, 0x6e, 0xc5, 0xba, 0x0a, 0xbf, 0x18, 0x5b, 0x17, 0x37, 0xbf,
|
||||
0x3c, 0x14, 0x29, 0x2f, 0xea, 0x8c, 0x4f, 0xdb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x11, 0xa3,
|
||||
0x5e, 0xbd, 0xa2, 0x01, 0x00, 0x00,
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hotel;
|
||||
|
||||
import "github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto";
|
||||
import "github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto";
|
||||
|
||||
service Hotel {
|
||||
rpc Rates(Request) returns (Response) {};
|
||||
}
|
||||
|
||||
message Request {
|
||||
string inDate = 1;
|
||||
string outDate = 2;
|
||||
}
|
||||
|
||||
message Response {
|
||||
repeated profile.Hotel hotels = 1;
|
||||
repeated rate.RatePlan ratePlans = 2;
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
dir=`pwd`
|
||||
|
||||
build() {
|
||||
for d in $(ls ./$1); do
|
||||
echo "building $1/$d"
|
||||
pushd $dir/$1/$d >/dev/null
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w'
|
||||
popd >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
build api
|
||||
build srv
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
dir=`pwd`
|
||||
|
||||
check() {
|
||||
for d in $(ls ./$1); do
|
||||
echo "verifying $1/$d"
|
||||
pushd $dir/$1/$d >/dev/null
|
||||
go fmt
|
||||
golint
|
||||
popd >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
check api
|
||||
check srv
|
@ -1,306 +0,0 @@
|
||||
// Code generated by go-bindata.
|
||||
// sources:
|
||||
// data/customers.json
|
||||
// data/locations.json
|
||||
// data/profiles.json
|
||||
// data/rates.json
|
||||
// DO NOT EDIT!
|
||||
|
||||
package data
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = io.Copy(&buf, gz)
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
}
|
||||
|
||||
type bindataFileInfo struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindataFileInfo) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindataFileInfo) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindataFileInfo) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindataFileInfo) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindataFileInfo) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _dataCustomersJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8a\xe6\x52\x00\x82\x6a\x30\x09\x02\x4a\x99\x29\x4a\x56\x0a\x86\x3a\x08\x81\xc4\xd2\x92\x8c\x90\xfc\xec\xd4\x3c\xa0\xb8\x52\x98\xa3\x8f\xa7\x4b\x7c\x88\xbf\xb7\xab\x9f\x12\x58\x49\x2d\x57\x2c\x17\x20\x00\x00\xff\xff\x2b\x28\xf3\x0d\x44\x00\x00\x00")
|
||||
|
||||
func dataCustomersJsonBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_dataCustomersJson,
|
||||
"data/customers.json",
|
||||
)
|
||||
}
|
||||
|
||||
func dataCustomersJson() (*asset, error) {
|
||||
bytes, err := dataCustomersJsonBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "data/customers.json", size: 68, mode: os.FileMode(420), modTime: time.Unix(1445724030, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _dataLocationsJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8a\xe6\x52\x00\x82\x6a\x30\x09\x02\x4a\x19\xf9\x25\xa9\x39\x9e\x29\x4a\x56\x0a\x4a\x86\x4a\x3a\x08\xf1\x9c\xc4\x12\xa0\x98\xa9\xa1\x9e\xa9\x81\x91\xa5\xb9\x31\xb2\x4c\x7e\x1e\x50\x46\xd7\x40\xcf\xd0\xd0\xc4\xdc\xc8\x18\x2c\x51\xab\x83\xc7\x5c\x23\x1a\x99\x6b\x4c\x23\x73\x4d\x68\x64\xae\x29\x8d\xcc\x35\xa3\xc0\x5c\xae\x58\x2e\x40\x00\x00\x00\xff\xff\xab\x3a\x0e\xb4\x13\x02\x00\x00")
|
||||
|
||||
func dataLocationsJsonBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_dataLocationsJson,
|
||||
"data/locations.json",
|
||||
)
|
||||
}
|
||||
|
||||
func dataLocationsJson() (*asset, error) {
|
||||
bytes, err := dataLocationsJsonBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "data/locations.json", size: 531, mode: os.FileMode(420), modTime: time.Unix(1456591447, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _dataProfilesJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd4\x56\xdd\x6e\x2b\x35\x10\xbe\xef\x53\x8c\x72\x05\x52\xb6\x4a\xb2\xbb\x6d\xc2\x5d\xd2\x43\x7b\x90\x08\xaa\x4e\x02\x08\x10\x17\xb3\xf6\x24\x6b\xea\xb5\x83\xed\x3d\x39\x11\x3a\x12\xaf\xc1\xeb\xf1\x24\x8c\x37\x29\x49\xdb\xfc\x94\x5c\x95\x5c\x54\xdd\xf5\xec\x78\x3c\xdf\xe7\x6f\xbe\x5f\x2e\x80\x7f\x7f\x34\x7f\xe3\xaf\xa5\x64\xeb\x2b\x68\x75\x5b\xed\xed\x2b\x83\x15\xc5\x97\x37\x5a\xcd\x02\xbc\xb7\x81\xf4\xee\xf2\xa2\xb4\x86\xbe\xab\xab\x82\x5c\x8c\xfa\x22\xeb\xe6\x5f\xc2\xf5\x75\x9e\x64\xd7\x9d\xce\x6e\xa0\x24\x2f\x9c\x5a\x04\x65\x4d\x0c\x1c\xc2\x55\x52\x29\x53\x07\x82\x25\xea\x07\x98\x39\x5b\xc1\xf7\x86\x57\x61\xf2\x7b\x8d\x8e\x00\x8d\x84\x0c\xd6\x31\x7e\xbd\x8e\x30\xae\x8d\x82\x31\x05\x67\xc1\x07\x8c\xc9\xda\x10\x4a\xe5\x41\xd7\x9f\x6a\xb7\x82\x32\xd6\x07\xbc\x97\x9a\x1b\x92\x50\xac\xe0\xbe\x54\x5a\x2d\x16\x04\x93\x80\x4e\xf0\x46\x84\xa1\x76\x9c\x11\x0d\xa0\x0b\x7e\x05\xb3\xda\x19\x15\xdf\x81\xb0\x5a\x93\x88\x59\x41\x19\xce\x4b\xa0\x6d\x51\xac\xda\xfc\x24\x74\x2d\x95\x99\xc3\xd2\xba\x87\x98\x76\x82\xfa\x23\x4a\xeb\xe0\x1d\x6a\x75\xb9\x7b\x50\x94\x92\xd3\x7b\x3e\xe4\xb6\xb1\xcd\x82\x0f\x8e\x28\x6c\x7b\x95\x0d\xf2\x9d\xef\x76\x43\x36\x2d\xbf\x23\xe4\x23\x4d\xc2\xf3\x28\xa1\xc2\x2a\xae\x4f\xf8\x08\xb7\x0e\x8d\x50\x5e\xd8\x97\xa9\x30\xac\x81\x1b\xbe\xf8\xde\xd6\x26\xb8\x26\x05\x77\x3c\x70\x9f\x26\x31\xd8\x3f\x8f\x5b\x58\x4e\xa2\x6f\xac\x6c\xf2\x0c\xb2\x6e\xa7\xd7\xfa\x37\xe2\x73\xf3\xdf\xe7\xf6\x7e\x0a\xf5\xf6\x51\xe8\x47\x38\x54\xf1\x21\x1a\x5d\x27\x79\x7a\x94\x46\xdf\x72\xa7\x19\xa8\x88\x25\x14\xda\x8a\x0d\x91\x22\x74\x3f\x91\x2b\x10\x46\x35\x19\x84\x1b\x32\x81\x1c\xcc\x18\xaf\xb8\x34\x64\xdc\x37\xbc\xe1\x86\x1b\xf9\xc8\x1b\x7e\x46\xe8\xf6\x8e\x13\xf3\x3c\xb0\xbb\xfd\xee\x71\xb0\x53\x27\xdf\x14\xd4\xe9\x6b\xa1\x4e\xf7\x41\xdd\xe8\x04\xfc\x4c\x21\xe0\x49\x98\xf3\x2c\x4d\xfa\x79\x9e\x1f\x55\x8b\xf4\x25\x28\x11\xc9\x7b\xbb\x24\xad\xf9\x50\xb1\x95\x20\xb0\xd0\x94\x08\x64\x94\xf9\x4e\xa3\xe3\xc3\xcb\x46\x47\x46\xc3\x0f\x53\x70\xa8\xf4\x33\xd5\x28\xd5\x62\x03\xfd\xe0\xa9\xd2\x3c\x51\x22\x61\xab\x42\x19\x8a\xe1\xf3\x32\x09\x24\x4a\xd6\x05\x39\x6f\xe4\x40\x85\x72\x23\x23\xc1\xd6\xa2\x24\x7f\x1e\x3d\xf2\x13\x52\x90\xf3\x36\xff\x4b\x76\x64\x87\xd9\xf1\x83\xe2\xa4\x74\x92\x1e\xbd\xeb\x7e\x92\x1e\x1f\x26\xd3\x88\xe5\x92\x2b\x77\x0c\x9e\x09\x1b\x48\x1b\x6c\x46\xb8\x82\x91\x53\x72\x4e\xf0\x51\xd1\xd2\xc7\x3b\x9e\xae\xa5\xc2\x6f\x69\x74\xab\x4c\xec\x1e\x6a\x78\xa7\xb8\xf1\x4a\x84\x86\x36\x08\xd9\x7e\xda\xdd\x92\x63\x65\x1e\xd5\x4a\xc7\xa1\x70\x1e\xe4\xfd\xe3\x88\x8f\x95\xf7\x0d\x07\xdf\x10\xea\xf9\x6b\x51\xcf\xf7\xa1\x7e\x5f\x5a\x32\xea\xd3\xab\x3d\xc4\x55\xd2\x4d\xfb\x47\xc5\xdf\x0a\x8c\xe5\x6f\x66\xf5\x94\x95\x9c\x9c\xb6\xfc\x68\x88\x6f\x6a\x61\x5d\x69\xad\x6c\x47\x4d\xef\xbc\xc4\x11\x0f\xaa\x82\x6b\xfc\x45\x65\x03\x8f\x8b\x78\xd1\x09\x4a\xe4\xcb\xcf\xed\xe0\xcd\x2a\x34\x2b\x70\x71\xd2\x54\xb5\x57\xcc\x19\xe3\x1b\xae\x58\x2e\xc1\x81\x20\x4d\x85\x53\x41\xb1\x5a\x78\x76\x0d\xd4\x54\xd6\x1d\xe4\x1d\x7f\x09\xdf\x84\xbf\xff\xfc\xcb\x1f\x66\x15\xef\xcd\x5b\x2a\x01\x77\x8e\x4d\x0a\x0c\x2b\xe2\x07\x06\x79\x1c\x37\x82\xf7\xc8\x42\x67\xf8\x5c\x81\xbd\x48\x71\x1e\xe7\xae\x3a\x27\xa6\xd0\xd7\x52\xbe\x2d\xc7\x31\x68\x5d\xbc\x92\x73\x57\xfb\x38\x37\x2d\xa3\xf1\xbb\x84\x0f\x34\x67\x60\xff\x9b\xfd\xe8\xf5\xb3\x24\xeb\x1c\x15\x9e\x6d\x6a\xc6\x88\xea\x0a\xa6\x3c\x8f\xdc\xda\x47\x64\xbd\x24\xc2\xc9\xee\x31\xeb\x67\xc0\xde\xd9\x3f\xac\xf8\x63\x5c\xc4\x80\x35\x63\x27\xb6\x66\x89\xb2\x33\x18\xa3\x7b\xe0\xf9\x25\x1f\xc5\x87\x5f\x3d\xa9\xb5\x0d\x37\x6c\x33\xd9\xbe\x18\x85\xcc\x67\xf9\x1b\x0a\x76\x34\x3c\x72\x9e\xb8\x9c\x3b\x74\x92\x0c\x3b\x9b\xb1\xe5\x6f\x0c\x6d\x6c\x4f\x1b\xee\x51\x8c\xe2\x98\x7c\x14\xac\x86\xb0\x4d\x01\xbb\x9b\x3c\x9e\x21\xd6\xc3\x08\x38\x13\x7d\xd2\x99\x6e\xa7\x77\x62\x9e\xb1\xdb\x79\x53\x1c\x7b\x46\xb1\x8b\x5f\x2f\xfe\x09\x00\x00\xff\xff\xf8\xbe\x11\x38\x1c\x0d\x00\x00")
|
||||
|
||||
func dataProfilesJsonBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_dataProfilesJson,
|
||||
"data/profiles.json",
|
||||
)
|
||||
}
|
||||
|
||||
func dataProfilesJson() (*asset, error) {
|
||||
bytes, err := dataProfilesJsonBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "data/profiles.json", size: 3356, mode: os.FileMode(420), modTime: time.Unix(1456591428, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _dataRatesJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8a\xe6\x52\x00\x82\x6a\x30\x09\x02\x4a\x19\xf9\x25\xa9\x39\x9e\x29\x4a\x56\x0a\x4a\x86\x4a\x3a\x08\xf1\xe4\xfc\x94\x54\x90\x60\x90\xa3\xb3\x37\xb2\x78\x66\x9e\x4b\x62\x09\x58\xc6\xc8\xc0\xd0\x54\xd7\xc0\x44\xd7\xc0\x12\x59\x3e\xbf\xb4\x04\x5d\x81\xa1\x01\xb2\x82\xa2\xfc\xfc\xdc\x90\xca\x02\x90\x0a\x84\x33\x80\xe2\x49\xf9\xf9\xd9\x89\x49\x39\xa9\x41\x10\xdd\x86\x06\x96\x7a\x06\x06\x3a\xc8\x2a\x60\x4e\xf2\xf6\x73\x57\x42\x91\x48\x49\x2d\x4e\x2e\xca\x2c\x28\xc9\xcc\xcf\x03\xcb\x67\xe6\xa5\x2b\x14\x67\x56\xa5\xa6\x28\x24\xa5\xa6\xa0\x2a\x2d\xc9\x2f\x49\xcc\xc1\x6d\x05\x5c\xda\x33\x2f\x39\xa7\xb4\x38\xb3\x0c\xac\xce\xc8\x58\xcf\xd0\x1c\xae\xac\x96\x0b\x42\xc6\x72\x01\x02\x00\x00\xff\xff\xe0\xd7\xdf\xfa\x4d\x01\x00\x00")
|
||||
|
||||
func dataRatesJsonBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_dataRatesJson,
|
||||
"data/rates.json",
|
||||
)
|
||||
}
|
||||
|
||||
func dataRatesJson() (*asset, error) {
|
||||
bytes, err := dataRatesJsonBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "data/rates.json", size: 333, mode: os.FileMode(420), modTime: time.Unix(1456591432, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
a, err := Asset(name)
|
||||
if err != nil {
|
||||
panic("asset: Asset(" + name + "): " + err.Error())
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
for name := range _bindata {
|
||||
names = append(names, name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"data/customers.json": dataCustomersJson,
|
||||
"data/locations.json": dataLocationsJson,
|
||||
"data/profiles.json": dataProfilesJson,
|
||||
"data/rates.json": dataRatesJson,
|
||||
}
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
// following hierarchy:
|
||||
// data/
|
||||
// foo.txt
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
if node.Func != nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
rv := make([]string, 0, len(node.Children))
|
||||
for childName := range node.Children {
|
||||
rv = append(rv, childName)
|
||||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"data": &bintree{nil, map[string]*bintree{
|
||||
"customers.json": &bintree{dataCustomersJson, map[string]*bintree{}},
|
||||
"locations.json": &bintree{dataLocationsJson, map[string]*bintree{}},
|
||||
"profiles.json": &bintree{dataProfilesJson, map[string]*bintree{}},
|
||||
"rates.json": &bintree{dataRatesJson, map[string]*bintree{}},
|
||||
}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
if err != nil {
|
||||
return RestoreAsset(dir, name)
|
||||
}
|
||||
// Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, filepath.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"authToken": "VALID_TOKEN"
|
||||
}
|
||||
]
|
@ -1,32 +0,0 @@
|
||||
[
|
||||
{
|
||||
"hotelId": "1",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
},
|
||||
{
|
||||
"hotelId": "2",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
},
|
||||
{
|
||||
"hotelId": "3",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
},
|
||||
{
|
||||
"hotelId": "4",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
},
|
||||
{
|
||||
"hotelId": "5",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
},
|
||||
{
|
||||
"hotelId": "6",
|
||||
"lat": 51.502973,
|
||||
"lon": -0.114723
|
||||
}
|
||||
]
|
@ -1,87 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Clift Hotel",
|
||||
"phoneNumber": "(415) 775-4700",
|
||||
"description": "A 6-minute walk from Union Square and 4 minutes from a Muni Metro station, this luxury hotel designed by Philippe Starck features an artsy furniture collection in the lobby, including work by Salvador Dali.",
|
||||
"address": {
|
||||
"streetNumber": "495",
|
||||
"streetName": "Geary St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94102"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"name": "W San Francisco",
|
||||
"phoneNumber": "(415) 777-5300",
|
||||
"description": "Less than a block from the Yerba Buena Center for the Arts, this trendy hotel is a 12-minute walk from Union Square.",
|
||||
"address": {
|
||||
"streetNumber": "181",
|
||||
"streetName": "3rd St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94103"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"name": "Hotel Zetta",
|
||||
"phoneNumber": "(415) 543-8555",
|
||||
"description": "A 3-minute walk from the Powell Street cable-car turnaround and BART rail station, this hip hotel 9 minutes from Union Square combines high-tech lodging with artsy touches.",
|
||||
"address": {
|
||||
"streetNumber": "55",
|
||||
"streetName": "5th St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94103"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"name": "Hotel Vitale",
|
||||
"phoneNumber": "(415) 278-3700",
|
||||
"description": "This waterfront hotel with Bay Bridge views is 3 blocks from the Financial District and a 4-minute walk from the Ferry Building.",
|
||||
"address": {
|
||||
"streetNumber": "8",
|
||||
"streetName": "Mission St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94105"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"name": "Phoenix Hotel",
|
||||
"phoneNumber": "(415) 776-1380",
|
||||
"description": "Located in the Tenderloin neighborhood, a 10-minute walk from a BART rail station, this retro motor lodge has hosted many rock musicians and other celebrities since the 1950s. It’s a 4-minute walk from the historic Great American Music Hall nightclub.",
|
||||
"address": {
|
||||
"streetNumber": "601",
|
||||
"streetName": "Eddy St",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94109"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "6",
|
||||
"name": "The St. Regis San Francisco",
|
||||
"phoneNumber": "(415) 284-4000",
|
||||
"description": "St. Regis Museum Tower is a 42-story, 484 ft skyscraper in the South of Market district of San Francisco, California, adjacent to Yerba Buena Gardens, Moscone Center, PacBell Building and the San Francisco Museum of Modern Art.",
|
||||
"address": {
|
||||
"streetNumber": "125",
|
||||
"streetName": "3rd",
|
||||
"city": "San Francisco",
|
||||
"state": "CA",
|
||||
"country": "United States",
|
||||
"postalCode": "94109"
|
||||
}
|
||||
}
|
||||
]
|
@ -1,15 +0,0 @@
|
||||
[
|
||||
{
|
||||
"hotelId": "1",
|
||||
"code": "RACK",
|
||||
"inDate": "2015-04-09",
|
||||
"outDate": "2015-04-10",
|
||||
"roomType": {
|
||||
"bookableRate": 109.00,
|
||||
"code": "KNG",
|
||||
"description": "King sized bed",
|
||||
"totalRate": 109.00,
|
||||
"totalRateInclusive": 123.17
|
||||
}
|
||||
}
|
||||
]
|
@ -1,45 +0,0 @@
|
||||
consul:
|
||||
command: -server -bootstrap -rejoin
|
||||
image: progrium/consul:latest
|
||||
ports:
|
||||
- "8300:8300"
|
||||
- "8400:8400"
|
||||
- "8500:8500"
|
||||
- "8600:53/udp"
|
||||
micro:
|
||||
command: --registry_address=consul:8500 api --handler=rpc
|
||||
image: microhq/micro:latest
|
||||
links:
|
||||
- consul
|
||||
- api
|
||||
ports:
|
||||
- "8080:8080"
|
||||
api:
|
||||
build: ./api/hotel
|
||||
command: --registry_address=consul:8500
|
||||
links:
|
||||
- consul
|
||||
- auth
|
||||
- geo
|
||||
- profile
|
||||
- rate
|
||||
auth:
|
||||
build: ./srv/auth
|
||||
command: --registry_address=consul:8500
|
||||
links:
|
||||
- consul
|
||||
geo:
|
||||
build: ./srv/geo
|
||||
command: --registry_address=consul:8500
|
||||
links:
|
||||
- consul
|
||||
profile:
|
||||
build: ./srv/profile
|
||||
command: --registry_address=consul:8500
|
||||
links:
|
||||
- consul
|
||||
rate:
|
||||
build: ./srv/rate
|
||||
command: --registry_address=consul:8500
|
||||
links:
|
||||
- consul
|
@ -1,4 +0,0 @@
|
||||
FROM alpine:3.2
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/auth" ]
|
@ -1,70 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
|
||||
"github.com/micro/go-micro/examples/booking/data"
|
||||
"github.com/micro/go-micro/examples/booking/srv/auth/proto"
|
||||
|
||||
"context"
|
||||
"golang.org/x/net/trace"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
||||
type Auth struct {
|
||||
customers map[string]*auth.Customer
|
||||
}
|
||||
|
||||
// VerifyToken returns a customer from authentication token.
|
||||
func (s *Auth) VerifyToken(ctx context.Context, req *auth.Request, rsp *auth.Result) error {
|
||||
md, _ := metadata.FromContext(ctx)
|
||||
traceID := md["traceID"]
|
||||
|
||||
if tr, ok := trace.FromContext(ctx); ok {
|
||||
tr.LazyPrintf("traceID %s", traceID)
|
||||
}
|
||||
|
||||
customer := s.customers[req.AuthToken]
|
||||
if customer == nil {
|
||||
return errors.New("Invalid Token")
|
||||
}
|
||||
|
||||
rsp.Customer = customer
|
||||
return nil
|
||||
}
|
||||
|
||||
// loadCustomers loads customers from a JSON file.
|
||||
func loadCustomerData(path string) map[string]*auth.Customer {
|
||||
file := data.MustAsset(path)
|
||||
customers := []*auth.Customer{}
|
||||
|
||||
// unmarshal JSON
|
||||
if err := json.Unmarshal(file, &customers); err != nil {
|
||||
log.Fatalf("Failed to unmarshal json: %v", err)
|
||||
}
|
||||
|
||||
// create customer lookup map
|
||||
cache := make(map[string]*auth.Customer)
|
||||
for _, c := range customers {
|
||||
cache[c.AuthToken] = c
|
||||
}
|
||||
return cache
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.srv.auth"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
auth.RegisterAuthHandler(service.Server(), &Auth{
|
||||
customers: loadCustomerData("data/customers.json"),
|
||||
})
|
||||
|
||||
service.Run()
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto
|
||||
|
||||
/*
|
||||
Package auth is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
Customer
|
||||
*/
|
||||
package auth
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Auth service
|
||||
|
||||
type AuthService interface {
|
||||
VerifyToken(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type authService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewAuthService(serviceName string, c client.Client) AuthService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "auth"
|
||||
}
|
||||
return &authService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *authService) VerifyToken(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Auth.VerifyToken", in)
|
||||
out := new(Result)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Auth service
|
||||
|
||||
type AuthHandler interface {
|
||||
VerifyToken(context.Context, *Request, *Result) error
|
||||
}
|
||||
|
||||
func RegisterAuthHandler(s server.Server, hdlr AuthHandler, opts ...server.HandlerOption) {
|
||||
type auth interface {
|
||||
VerifyToken(ctx context.Context, in *Request, out *Result) error
|
||||
}
|
||||
type Auth struct {
|
||||
auth
|
||||
}
|
||||
h := &authHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Auth{h}, opts...))
|
||||
}
|
||||
|
||||
type authHandler struct {
|
||||
AuthHandler
|
||||
}
|
||||
|
||||
func (h *authHandler) VerifyToken(ctx context.Context, in *Request, out *Result) error {
|
||||
return h.AuthHandler.VerifyToken(ctx, in, out)
|
||||
}
|
@ -1,191 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto
|
||||
|
||||
/*
|
||||
Package auth is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
Customer
|
||||
*/
|
||||
package auth
|
||||
|
||||
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 {
|
||||
AuthToken string `protobuf:"bytes,1,opt,name=authToken" json:"authToken,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) GetAuthToken() string {
|
||||
if m != nil {
|
||||
return m.AuthToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
Customer *Customer `protobuf:"bytes,1,opt,name=customer" json:"customer,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Result) Reset() { *m = Result{} }
|
||||
func (m *Result) String() string { return proto.CompactTextString(m) }
|
||||
func (*Result) ProtoMessage() {}
|
||||
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Result) GetCustomer() *Customer {
|
||||
if m != nil {
|
||||
return m.Customer
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
|
||||
AuthToken string `protobuf:"bytes,2,opt,name=authToken" json:"authToken,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Customer) Reset() { *m = Customer{} }
|
||||
func (m *Customer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Customer) ProtoMessage() {}
|
||||
func (*Customer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *Customer) GetId() int32 {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Customer) GetAuthToken() string {
|
||||
if m != nil {
|
||||
return m.AuthToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "auth.Request")
|
||||
proto.RegisterType((*Result)(nil), "auth.Result")
|
||||
proto.RegisterType((*Customer)(nil), "auth.Customer")
|
||||
}
|
||||
|
||||
// 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 Auth service
|
||||
|
||||
type AuthClient interface {
|
||||
VerifyToken(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type authClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewAuthClient(cc *grpc.ClientConn) AuthClient {
|
||||
return &authClient{cc}
|
||||
}
|
||||
|
||||
func (c *authClient) VerifyToken(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
|
||||
out := new(Result)
|
||||
err := grpc.Invoke(ctx, "/auth.Auth/VerifyToken", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Auth service
|
||||
|
||||
type AuthServer interface {
|
||||
VerifyToken(context.Context, *Request) (*Result, error)
|
||||
}
|
||||
|
||||
func RegisterAuthServer(s *grpc.Server, srv AuthServer) {
|
||||
s.RegisterService(&_Auth_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Auth_VerifyToken_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.(AuthServer).VerifyToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/auth.Auth/VerifyToken",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServer).VerifyToken(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Auth_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "auth.Auth",
|
||||
HandlerType: (*AuthServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "VerifyToken",
|
||||
Handler: _Auth_VerifyToken_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/booking/srv/auth/proto/auth.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 213 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 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, 0xca, 0xcf, 0xcf, 0xce, 0xcc, 0x4b, 0xd7, 0x2f, 0x2e,
|
||||
0x2a, 0xd3, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x07, 0x33, 0xf5, 0xc0,
|
||||
0x4c, 0x21, 0x16, 0x10, 0x5b, 0x49, 0x9d, 0x8b, 0x3d, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44,
|
||||
0x48, 0x86, 0x8b, 0x13, 0x24, 0x14, 0x92, 0x9f, 0x9d, 0x9a, 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1,
|
||||
0x19, 0x84, 0x10, 0x50, 0x32, 0xe1, 0x62, 0x0b, 0x4a, 0x2d, 0x2e, 0xcd, 0x29, 0x11, 0xd2, 0xe2,
|
||||
0xe2, 0x48, 0x2e, 0x2d, 0x2e, 0xc9, 0xcf, 0x4d, 0x2d, 0x02, 0x2b, 0xe3, 0x36, 0xe2, 0xd3, 0x03,
|
||||
0x9b, 0xeb, 0x0c, 0x15, 0x0d, 0x82, 0xcb, 0x2b, 0x59, 0x70, 0x71, 0xc0, 0x44, 0x85, 0xf8, 0xb8,
|
||||
0x98, 0x32, 0x53, 0xc0, 0x3a, 0x58, 0x83, 0x98, 0x32, 0x53, 0x50, 0xed, 0x63, 0x42, 0xb3, 0xcf,
|
||||
0xc8, 0x84, 0x8b, 0xc5, 0xb1, 0xb4, 0x24, 0x43, 0x48, 0x87, 0x8b, 0x3b, 0x2c, 0xb5, 0x28, 0x33,
|
||||
0xad, 0x12, 0x2c, 0x2c, 0xc4, 0x0b, 0xb1, 0x0a, 0xea, 0x66, 0x29, 0x1e, 0x18, 0x17, 0xe4, 0x32,
|
||||
0x25, 0x86, 0x24, 0x36, 0xb0, 0xdf, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x57, 0xa9,
|
||||
0xd9, 0x1a, 0x01, 0x00, 0x00,
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package auth;
|
||||
|
||||
service Auth {
|
||||
rpc VerifyToken(Request) returns (Result) {}
|
||||
}
|
||||
|
||||
message Request {
|
||||
string authToken = 1;
|
||||
}
|
||||
|
||||
message Result {
|
||||
Customer customer = 1;
|
||||
}
|
||||
|
||||
message Customer {
|
||||
int32 id = 1;
|
||||
string authToken = 2;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
FROM alpine:3.2
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/geo" ]
|
@ -1,95 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
|
||||
"github.com/hailocab/go-geoindex"
|
||||
"github.com/micro/go-micro/examples/booking/data"
|
||||
"github.com/micro/go-micro/examples/booking/srv/geo/proto"
|
||||
|
||||
"context"
|
||||
"golang.org/x/net/trace"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
maxSearchRadius = 10
|
||||
maxSearchResults = 5
|
||||
)
|
||||
|
||||
type point struct {
|
||||
Pid string `json:"hotelId"`
|
||||
Plat float64 `json:"lat"`
|
||||
Plon float64 `json:"lon"`
|
||||
}
|
||||
|
||||
// Implement Point interface
|
||||
func (p *point) Lat() float64 { return p.Plat }
|
||||
func (p *point) Lon() float64 { return p.Plon }
|
||||
func (p *point) Id() string { return p.Pid }
|
||||
|
||||
type Geo struct {
|
||||
index *geoindex.ClusteringIndex
|
||||
}
|
||||
|
||||
// Nearby returns all hotels within a given distance.
|
||||
func (s *Geo) Nearby(ctx context.Context, req *geo.Request, rsp *geo.Result) error {
|
||||
md, _ := metadata.FromContext(ctx)
|
||||
traceID := md["traceID"]
|
||||
|
||||
if tr, ok := trace.FromContext(ctx); ok {
|
||||
tr.LazyPrintf("traceID %s", traceID)
|
||||
}
|
||||
|
||||
// create center point for query
|
||||
center := &geoindex.GeoPoint{
|
||||
Pid: "",
|
||||
Plat: float64(req.Lat),
|
||||
Plon: float64(req.Lon),
|
||||
}
|
||||
|
||||
// find points around center point
|
||||
points := s.index.KNearest(center, maxSearchResults, geoindex.Km(maxSearchRadius), func(p geoindex.Point) bool {
|
||||
return true
|
||||
})
|
||||
|
||||
for _, p := range points {
|
||||
rsp.HotelIds = append(rsp.HotelIds, p.Id())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// newGeoIndex returns a geo index with points loaded
|
||||
func newGeoIndex(path string) *geoindex.ClusteringIndex {
|
||||
file := data.MustAsset(path)
|
||||
|
||||
// unmarshal json points
|
||||
var points []*point
|
||||
if err := json.Unmarshal(file, &points); err != nil {
|
||||
log.Fatalf("Failed to load hotels: %v", err)
|
||||
}
|
||||
|
||||
// add points to index
|
||||
index := geoindex.NewClusteringIndex()
|
||||
for _, point := range points {
|
||||
index.Add(point)
|
||||
}
|
||||
return index
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.srv.geo"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
geo.RegisterGeoHandler(service.Server(), &Geo{
|
||||
index: newGeoIndex("data/locations.json"),
|
||||
})
|
||||
|
||||
service.Run()
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto
|
||||
|
||||
/*
|
||||
Package geo is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
*/
|
||||
package geo
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Geo service
|
||||
|
||||
type GeoService interface {
|
||||
// Finds the hotels contained nearby the current lat/lon.
|
||||
Nearby(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type geoService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewGeoService(serviceName string, c client.Client) GeoService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "geo"
|
||||
}
|
||||
return &geoService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *geoService) Nearby(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Geo.Nearby", in)
|
||||
out := new(Result)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Geo service
|
||||
|
||||
type GeoHandler interface {
|
||||
// Finds the hotels contained nearby the current lat/lon.
|
||||
Nearby(context.Context, *Request, *Result) error
|
||||
}
|
||||
|
||||
func RegisterGeoHandler(s server.Server, hdlr GeoHandler, opts ...server.HandlerOption) {
|
||||
type geo interface {
|
||||
Nearby(ctx context.Context, in *Request, out *Result) error
|
||||
}
|
||||
type Geo struct {
|
||||
geo
|
||||
}
|
||||
h := &geoHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Geo{h}, opts...))
|
||||
}
|
||||
|
||||
type geoHandler struct {
|
||||
GeoHandler
|
||||
}
|
||||
|
||||
func (h *geoHandler) Nearby(ctx context.Context, in *Request, out *Result) error {
|
||||
return h.GeoHandler.Nearby(ctx, in, out)
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto
|
||||
|
||||
/*
|
||||
Package geo is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
*/
|
||||
package geo
|
||||
|
||||
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
|
||||
|
||||
// The latitude and longitude of the current location.
|
||||
type Request struct {
|
||||
Lat float32 `protobuf:"fixed32,1,opt,name=lat" json:"lat,omitempty"`
|
||||
Lon float32 `protobuf:"fixed32,2,opt,name=lon" json:"lon,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) GetLat() float32 {
|
||||
if m != nil {
|
||||
return m.Lat
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Request) GetLon() float32 {
|
||||
if m != nil {
|
||||
return m.Lon
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
HotelIds []string `protobuf:"bytes,1,rep,name=hotelIds" json:"hotelIds,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Result) Reset() { *m = Result{} }
|
||||
func (m *Result) String() string { return proto.CompactTextString(m) }
|
||||
func (*Result) ProtoMessage() {}
|
||||
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Result) GetHotelIds() []string {
|
||||
if m != nil {
|
||||
return m.HotelIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "geo.Request")
|
||||
proto.RegisterType((*Result)(nil), "geo.Result")
|
||||
}
|
||||
|
||||
// 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 Geo service
|
||||
|
||||
type GeoClient interface {
|
||||
// Finds the hotels contained nearby the current lat/lon.
|
||||
Nearby(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type geoClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewGeoClient(cc *grpc.ClientConn) GeoClient {
|
||||
return &geoClient{cc}
|
||||
}
|
||||
|
||||
func (c *geoClient) Nearby(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
|
||||
out := new(Result)
|
||||
err := grpc.Invoke(ctx, "/geo.Geo/Nearby", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Geo service
|
||||
|
||||
type GeoServer interface {
|
||||
// Finds the hotels contained nearby the current lat/lon.
|
||||
Nearby(context.Context, *Request) (*Result, error)
|
||||
}
|
||||
|
||||
func RegisterGeoServer(s *grpc.Server, srv GeoServer) {
|
||||
s.RegisterService(&_Geo_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Geo_Nearby_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.(GeoServer).Nearby(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/geo.Geo/Nearby",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GeoServer).Nearby(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Geo_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "geo.Geo",
|
||||
HandlerType: (*GeoServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Nearby",
|
||||
Handler: _Geo_Nearby_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/booking/srv/geo/proto/geo.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 184 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8e, 0xb1, 0xae, 0x82, 0x30,
|
||||
0x14, 0x86, 0x03, 0x4d, 0xb8, 0xf7, 0x9e, 0xeb, 0x60, 0x3a, 0x11, 0x26, 0x82, 0x0e, 0xc4, 0x44,
|
||||
0x9a, 0xe8, 0xe4, 0x13, 0x18, 0x17, 0x87, 0xbe, 0x01, 0xc5, 0x93, 0x42, 0x2c, 0x1c, 0x6c, 0x8b,
|
||||
0xd1, 0xb7, 0x37, 0x25, 0xc4, 0xed, 0xfb, 0xbf, 0xe1, 0x7c, 0x07, 0x4e, 0xba, 0xf3, 0xed, 0xa4,
|
||||
0xaa, 0x86, 0x7a, 0xd1, 0x77, 0x8d, 0x25, 0x81, 0xaf, 0xba, 0x1f, 0x0d, 0x3a, 0xa1, 0x88, 0xee,
|
||||
0xdd, 0xa0, 0x85, 0xb3, 0x4f, 0xa1, 0x91, 0xc4, 0x68, 0xc9, 0x53, 0xa0, 0x6a, 0x26, 0xce, 0x34,
|
||||
0x52, 0xb1, 0x87, 0x1f, 0x89, 0x8f, 0x09, 0x9d, 0xe7, 0x6b, 0x60, 0xa6, 0xf6, 0x69, 0x94, 0x47,
|
||||
0x65, 0x2c, 0x03, 0xce, 0x86, 0x86, 0x34, 0x5e, 0x0c, 0x0d, 0xc5, 0x16, 0x12, 0x89, 0x6e, 0x32,
|
||||
0x9e, 0x67, 0xf0, 0xdb, 0x92, 0x47, 0x73, 0xb9, 0xb9, 0x34, 0xca, 0x59, 0xf9, 0x27, 0xbf, 0xfb,
|
||||
0xb0, 0x03, 0x76, 0x46, 0xe2, 0x1b, 0x48, 0xae, 0x58, 0x5b, 0xf5, 0xe6, 0xab, 0x2a, 0x64, 0x97,
|
||||
0x50, 0xf6, 0xbf, 0xac, 0x70, 0x47, 0x25, 0xf3, 0x33, 0xc7, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x39, 0xe5, 0x14, 0x38, 0xc9, 0x00, 0x00, 0x00,
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package geo;
|
||||
|
||||
service Geo {
|
||||
// Finds the hotels contained nearby the current lat/lon.
|
||||
rpc Nearby(Request) returns (Result);
|
||||
}
|
||||
|
||||
// The latitude and longitude of the current location.
|
||||
message Request {
|
||||
float lat = 1;
|
||||
float lon = 2;
|
||||
}
|
||||
|
||||
message Result {
|
||||
repeated string hotelIds = 1;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
FROM alpine:3.2
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/profile" ]
|
@ -1,64 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
|
||||
"github.com/micro/go-micro/examples/booking/data"
|
||||
"github.com/micro/go-micro/examples/booking/srv/profile/proto"
|
||||
|
||||
"context"
|
||||
"golang.org/x/net/trace"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
||||
type Profile struct {
|
||||
hotels map[string]*profile.Hotel
|
||||
}
|
||||
|
||||
// GetProfiles returns hotel profiles for requested IDs
|
||||
func (s *Profile) GetProfiles(ctx context.Context, req *profile.Request, rsp *profile.Result) error {
|
||||
md, _ := metadata.FromContext(ctx)
|
||||
traceID := md["traceID"]
|
||||
if tr, ok := trace.FromContext(ctx); ok {
|
||||
tr.LazyPrintf("traceID %s", traceID)
|
||||
}
|
||||
|
||||
for _, i := range req.HotelIds {
|
||||
rsp.Hotels = append(rsp.Hotels, s.hotels[i])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// loadProfiles loads hotel profiles from a JSON file.
|
||||
func loadProfiles(path string) map[string]*profile.Hotel {
|
||||
file := data.MustAsset(path)
|
||||
|
||||
// unmarshal json profiles
|
||||
hotels := []*profile.Hotel{}
|
||||
if err := json.Unmarshal(file, &hotels); err != nil {
|
||||
log.Fatalf("Failed to load json: %v", err)
|
||||
}
|
||||
|
||||
profiles := make(map[string]*profile.Hotel)
|
||||
for _, hotel := range hotels {
|
||||
profiles[hotel.Id] = hotel
|
||||
}
|
||||
return profiles
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.srv.profile"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
profile.RegisterProfileHandler(service.Server(), &Profile{
|
||||
hotels: loadProfiles("data/profiles.json"),
|
||||
})
|
||||
|
||||
service.Run()
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto
|
||||
|
||||
/*
|
||||
Package profile is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
Hotel
|
||||
Address
|
||||
Image
|
||||
*/
|
||||
package profile
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Profile service
|
||||
|
||||
type ProfileService interface {
|
||||
GetProfiles(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type profileService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewProfileService(serviceName string, c client.Client) ProfileService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "profile"
|
||||
}
|
||||
return &profileService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *profileService) GetProfiles(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Profile.GetProfiles", in)
|
||||
out := new(Result)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Profile service
|
||||
|
||||
type ProfileHandler interface {
|
||||
GetProfiles(context.Context, *Request, *Result) error
|
||||
}
|
||||
|
||||
func RegisterProfileHandler(s server.Server, hdlr ProfileHandler, opts ...server.HandlerOption) {
|
||||
type profile interface {
|
||||
GetProfiles(ctx context.Context, in *Request, out *Result) error
|
||||
}
|
||||
type Profile struct {
|
||||
profile
|
||||
}
|
||||
h := &profileHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Profile{h}, opts...))
|
||||
}
|
||||
|
||||
type profileHandler struct {
|
||||
ProfileHandler
|
||||
}
|
||||
|
||||
func (h *profileHandler) GetProfiles(ctx context.Context, in *Request, out *Result) error {
|
||||
return h.ProfileHandler.GetProfiles(ctx, in, out)
|
||||
}
|
@ -1,326 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto
|
||||
|
||||
/*
|
||||
Package profile is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
Hotel
|
||||
Address
|
||||
Image
|
||||
*/
|
||||
package profile
|
||||
|
||||
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 {
|
||||
HotelIds []string `protobuf:"bytes,1,rep,name=hotelIds" json:"hotelIds,omitempty"`
|
||||
Locale string `protobuf:"bytes,2,opt,name=locale" json:"locale,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) GetHotelIds() []string {
|
||||
if m != nil {
|
||||
return m.HotelIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Request) GetLocale() string {
|
||||
if m != nil {
|
||||
return m.Locale
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
Hotels []*Hotel `protobuf:"bytes,1,rep,name=hotels" json:"hotels,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Result) Reset() { *m = Result{} }
|
||||
func (m *Result) String() string { return proto.CompactTextString(m) }
|
||||
func (*Result) ProtoMessage() {}
|
||||
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Result) GetHotels() []*Hotel {
|
||||
if m != nil {
|
||||
return m.Hotels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Hotel struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
|
||||
PhoneNumber string `protobuf:"bytes,3,opt,name=phoneNumber" json:"phoneNumber,omitempty"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
|
||||
Address *Address `protobuf:"bytes,5,opt,name=address" json:"address,omitempty"`
|
||||
Images []*Image `protobuf:"bytes,6,rep,name=images" json:"images,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Hotel) Reset() { *m = Hotel{} }
|
||||
func (m *Hotel) String() string { return proto.CompactTextString(m) }
|
||||
func (*Hotel) ProtoMessage() {}
|
||||
func (*Hotel) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *Hotel) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Hotel) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Hotel) GetPhoneNumber() string {
|
||||
if m != nil {
|
||||
return m.PhoneNumber
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Hotel) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Hotel) GetAddress() *Address {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Hotel) GetImages() []*Image {
|
||||
if m != nil {
|
||||
return m.Images
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Address struct {
|
||||
StreetNumber string `protobuf:"bytes,1,opt,name=streetNumber" json:"streetNumber,omitempty"`
|
||||
StreetName string `protobuf:"bytes,2,opt,name=streetName" json:"streetName,omitempty"`
|
||||
City string `protobuf:"bytes,3,opt,name=city" json:"city,omitempty"`
|
||||
State string `protobuf:"bytes,4,opt,name=state" json:"state,omitempty"`
|
||||
Country string `protobuf:"bytes,5,opt,name=country" json:"country,omitempty"`
|
||||
PostalCode string `protobuf:"bytes,6,opt,name=postalCode" json:"postalCode,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Address) Reset() { *m = Address{} }
|
||||
func (m *Address) String() string { return proto.CompactTextString(m) }
|
||||
func (*Address) ProtoMessage() {}
|
||||
func (*Address) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func (m *Address) GetStreetNumber() string {
|
||||
if m != nil {
|
||||
return m.StreetNumber
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Address) GetStreetName() string {
|
||||
if m != nil {
|
||||
return m.StreetName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Address) GetCity() string {
|
||||
if m != nil {
|
||||
return m.City
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Address) GetState() string {
|
||||
if m != nil {
|
||||
return m.State
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Address) GetCountry() string {
|
||||
if m != nil {
|
||||
return m.Country
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Address) GetPostalCode() string {
|
||||
if m != nil {
|
||||
return m.PostalCode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
|
||||
Default bool `protobuf:"varint,2,opt,name=default" json:"default,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Image) Reset() { *m = Image{} }
|
||||
func (m *Image) String() string { return proto.CompactTextString(m) }
|
||||
func (*Image) ProtoMessage() {}
|
||||
func (*Image) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
|
||||
|
||||
func (m *Image) GetUrl() string {
|
||||
if m != nil {
|
||||
return m.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Image) GetDefault() bool {
|
||||
if m != nil {
|
||||
return m.Default
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "profile.Request")
|
||||
proto.RegisterType((*Result)(nil), "profile.Result")
|
||||
proto.RegisterType((*Hotel)(nil), "profile.Hotel")
|
||||
proto.RegisterType((*Address)(nil), "profile.Address")
|
||||
proto.RegisterType((*Image)(nil), "profile.Image")
|
||||
}
|
||||
|
||||
// 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 Profile service
|
||||
|
||||
type ProfileClient interface {
|
||||
GetProfiles(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type profileClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewProfileClient(cc *grpc.ClientConn) ProfileClient {
|
||||
return &profileClient{cc}
|
||||
}
|
||||
|
||||
func (c *profileClient) GetProfiles(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
|
||||
out := new(Result)
|
||||
err := grpc.Invoke(ctx, "/profile.Profile/GetProfiles", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Profile service
|
||||
|
||||
type ProfileServer interface {
|
||||
GetProfiles(context.Context, *Request) (*Result, error)
|
||||
}
|
||||
|
||||
func RegisterProfileServer(s *grpc.Server, srv ProfileServer) {
|
||||
s.RegisterService(&_Profile_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Profile_GetProfiles_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.(ProfileServer).GetProfiles(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/profile.Profile/GetProfiles",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProfileServer).GetProfiles(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Profile_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "profile.Profile",
|
||||
HandlerType: (*ProfileServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetProfiles",
|
||||
Handler: _Profile_GetProfiles_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/booking/srv/profile/proto/profile.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 397 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xc1, 0x6e, 0xd4, 0x30,
|
||||
0x10, 0x86, 0x95, 0xdd, 0x6e, 0xd2, 0x9d, 0x45, 0xa5, 0x1a, 0x21, 0x64, 0xf5, 0x80, 0x56, 0x39,
|
||||
0xa0, 0x15, 0x87, 0x4d, 0xb5, 0x3d, 0x22, 0x0e, 0x15, 0x07, 0xe8, 0x05, 0x21, 0xbf, 0x81, 0x13,
|
||||
0x4f, 0x77, 0x2d, 0x9c, 0x38, 0xd8, 0x0e, 0xa2, 0x8f, 0xc5, 0x33, 0xf0, 0x62, 0xc8, 0x8e, 0xd3,
|
||||
0x0d, 0x3d, 0x79, 0xfe, 0x6f, 0xc6, 0x9e, 0xf9, 0xad, 0x81, 0xfb, 0xa3, 0xf2, 0xa7, 0xa1, 0xde,
|
||||
0x37, 0xa6, 0xad, 0x5a, 0xd5, 0x58, 0x53, 0xd1, 0x6f, 0xd1, 0xf6, 0x9a, 0x5c, 0x55, 0x1b, 0xf3,
|
||||
0x43, 0x75, 0xc7, 0xca, 0xd9, 0x5f, 0x55, 0x6f, 0xcd, 0xa3, 0xd2, 0x14, 0x4e, 0x6f, 0x26, 0xb5,
|
||||
0x8f, 0x0a, 0x8b, 0x24, 0xcb, 0x4f, 0x50, 0x70, 0xfa, 0x39, 0x90, 0xf3, 0x78, 0x03, 0x97, 0x27,
|
||||
0xe3, 0x49, 0x3f, 0x48, 0xc7, 0xb2, 0xed, 0x72, 0xb7, 0xe6, 0xcf, 0x1a, 0xdf, 0x42, 0xae, 0x4d,
|
||||
0x23, 0x34, 0xb1, 0xc5, 0x36, 0xdb, 0xad, 0x79, 0x52, 0xe5, 0x2d, 0xe4, 0x9c, 0xdc, 0xa0, 0x3d,
|
||||
0xbe, 0x87, 0x3c, 0x56, 0x8f, 0x77, 0x37, 0x87, 0xab, 0xfd, 0xd4, 0xf1, 0x6b, 0xc0, 0x3c, 0x65,
|
||||
0xcb, 0xbf, 0x19, 0xac, 0x22, 0xc1, 0x2b, 0x58, 0x28, 0xc9, 0xb2, 0xf8, 0xde, 0x42, 0x49, 0x44,
|
||||
0xb8, 0xe8, 0x44, 0x3b, 0x75, 0x88, 0x31, 0x6e, 0x61, 0xd3, 0x9f, 0x4c, 0x47, 0xdf, 0x86, 0xb6,
|
||||
0x26, 0xcb, 0x96, 0x31, 0x35, 0x47, 0xa1, 0x42, 0x92, 0x6b, 0xac, 0xea, 0xbd, 0x32, 0x1d, 0xbb,
|
||||
0x18, 0x2b, 0x66, 0x08, 0x3f, 0x40, 0x21, 0xa4, 0xb4, 0xe4, 0x1c, 0x5b, 0x6d, 0xb3, 0xdd, 0xe6,
|
||||
0x70, 0xfd, 0x3c, 0xda, 0xfd, 0xc8, 0xf9, 0x54, 0x10, 0x5c, 0xa8, 0x56, 0x1c, 0xc9, 0xb1, 0xfc,
|
||||
0x85, 0x8b, 0x87, 0x80, 0x79, 0xca, 0x96, 0x7f, 0x32, 0x28, 0xd2, 0x65, 0x2c, 0xe1, 0x95, 0xf3,
|
||||
0x96, 0xc8, 0xa7, 0x21, 0x47, 0x47, 0xff, 0x31, 0x7c, 0x07, 0x90, 0xf4, 0xd9, 0xe1, 0x8c, 0x04,
|
||||
0xef, 0x8d, 0xf2, 0x4f, 0xc9, 0x60, 0x8c, 0xf1, 0x0d, 0xac, 0x9c, 0x17, 0x9e, 0x92, 0xa7, 0x51,
|
||||
0x20, 0x83, 0xa2, 0x31, 0x43, 0xe7, 0xed, 0x53, 0x74, 0xb3, 0xe6, 0x93, 0x0c, 0x3d, 0x7a, 0xe3,
|
||||
0xbc, 0xd0, 0x9f, 0x8d, 0x24, 0x96, 0x8f, 0x3d, 0xce, 0xa4, 0xbc, 0x83, 0x55, 0x34, 0x81, 0xd7,
|
||||
0xb0, 0x1c, 0xac, 0x4e, 0x73, 0x86, 0x30, 0x3c, 0x2a, 0xe9, 0x51, 0x0c, 0xda, 0xc7, 0xd9, 0x2e,
|
||||
0xf9, 0x24, 0x0f, 0x1f, 0xa1, 0xf8, 0x3e, 0xfe, 0x00, 0xde, 0xc2, 0xe6, 0x0b, 0xf9, 0xa4, 0x1c,
|
||||
0x9e, 0x7f, 0x31, 0x2d, 0xd0, 0xcd, 0xeb, 0x19, 0x09, 0x3b, 0x51, 0xe7, 0x71, 0xd9, 0xee, 0xfe,
|
||||
0x05, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x00, 0x45, 0x96, 0xb1, 0x02, 0x00, 0x00,
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package profile;
|
||||
|
||||
service Profile {
|
||||
rpc GetProfiles(Request) returns (Result);
|
||||
}
|
||||
|
||||
message Request {
|
||||
repeated string hotelIds = 1;
|
||||
string locale = 2;
|
||||
}
|
||||
|
||||
message Result {
|
||||
repeated Hotel hotels = 1;
|
||||
}
|
||||
|
||||
message Hotel {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string phoneNumber = 3;
|
||||
string description = 4;
|
||||
Address address = 5;
|
||||
repeated Image images = 6;
|
||||
}
|
||||
|
||||
message Address {
|
||||
string streetNumber = 1;
|
||||
string streetName = 2;
|
||||
string city = 3;
|
||||
string state = 4;
|
||||
string country = 5;
|
||||
string postalCode = 6;
|
||||
}
|
||||
|
||||
message Image {
|
||||
string url = 1;
|
||||
bool default = 2;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
FROM alpine:3.2
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/rate" ]
|
@ -1,82 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
|
||||
"github.com/micro/go-micro/examples/booking/data"
|
||||
"github.com/micro/go-micro/examples/booking/srv/rate/proto"
|
||||
|
||||
"context"
|
||||
"golang.org/x/net/trace"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
||||
type stay struct {
|
||||
HotelID string
|
||||
InDate string
|
||||
OutDate string
|
||||
}
|
||||
|
||||
type Rate struct {
|
||||
rateTable map[stay]*rate.RatePlan
|
||||
}
|
||||
|
||||
// GetRates gets rates for hotels for specific date range.
|
||||
func (s *Rate) GetRates(ctx context.Context, req *rate.Request, rsp *rate.Result) error {
|
||||
md, _ := metadata.FromContext(ctx)
|
||||
traceID := md["traceID"]
|
||||
|
||||
if tr, ok := trace.FromContext(ctx); ok {
|
||||
tr.LazyPrintf("traceID %s", traceID)
|
||||
}
|
||||
|
||||
for _, hotelID := range req.HotelIds {
|
||||
stay := stay{
|
||||
HotelID: hotelID,
|
||||
InDate: req.InDate,
|
||||
OutDate: req.OutDate,
|
||||
}
|
||||
if s.rateTable[stay] != nil {
|
||||
rsp.RatePlans = append(rsp.RatePlans, s.rateTable[stay])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// loadRates loads rate codes from JSON file.
|
||||
func loadRateTable(path string) map[stay]*rate.RatePlan {
|
||||
file := data.MustAsset("data/rates.json")
|
||||
|
||||
rates := []*rate.RatePlan{}
|
||||
if err := json.Unmarshal(file, &rates); err != nil {
|
||||
log.Fatalf("Failed to load json: %v", err)
|
||||
}
|
||||
|
||||
rateTable := make(map[stay]*rate.RatePlan)
|
||||
for _, ratePlan := range rates {
|
||||
stay := stay{
|
||||
HotelID: ratePlan.HotelId,
|
||||
InDate: ratePlan.InDate,
|
||||
OutDate: ratePlan.OutDate,
|
||||
}
|
||||
rateTable[stay] = ratePlan
|
||||
}
|
||||
return rateTable
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.srv.rate"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
rate.RegisterRateHandler(service.Server(), &Rate{
|
||||
rateTable: loadRateTable("data/rates.json"),
|
||||
})
|
||||
|
||||
service.Run()
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto
|
||||
|
||||
/*
|
||||
Package rate is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
RatePlan
|
||||
RoomType
|
||||
*/
|
||||
package rate
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Rate service
|
||||
|
||||
type RateService interface {
|
||||
// GetRates returns rate codes for hotels for a given date range
|
||||
GetRates(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type rateService struct {
|
||||
c client.Client
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func NewRateService(serviceName string, c client.Client) RateService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(serviceName) == 0 {
|
||||
serviceName = "rate"
|
||||
}
|
||||
return &rateService{
|
||||
c: c,
|
||||
serviceName: serviceName,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *rateService) GetRates(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error) {
|
||||
req := c.c.NewRequest(c.serviceName, "Rate.GetRates", in)
|
||||
out := new(Result)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Rate service
|
||||
|
||||
type RateHandler interface {
|
||||
// GetRates returns rate codes for hotels for a given date range
|
||||
GetRates(context.Context, *Request, *Result) error
|
||||
}
|
||||
|
||||
func RegisterRateHandler(s server.Server, hdlr RateHandler, opts ...server.HandlerOption) {
|
||||
type rate interface {
|
||||
GetRates(ctx context.Context, in *Request, out *Result) error
|
||||
}
|
||||
type Rate struct {
|
||||
rate
|
||||
}
|
||||
h := &rateHandler{hdlr}
|
||||
s.Handle(s.NewHandler(&Rate{h}, opts...))
|
||||
}
|
||||
|
||||
type rateHandler struct {
|
||||
RateHandler
|
||||
}
|
||||
|
||||
func (h *rateHandler) GetRates(ctx context.Context, in *Request, out *Result) error {
|
||||
return h.RateHandler.GetRates(ctx, in, out)
|
||||
}
|
@ -1,299 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto
|
||||
|
||||
/*
|
||||
Package rate is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Request
|
||||
Result
|
||||
RatePlan
|
||||
RoomType
|
||||
*/
|
||||
package rate
|
||||
|
||||
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 {
|
||||
HotelIds []string `protobuf:"bytes,1,rep,name=hotelIds" json:"hotelIds,omitempty"`
|
||||
InDate string `protobuf:"bytes,2,opt,name=inDate" json:"inDate,omitempty"`
|
||||
OutDate string `protobuf:"bytes,3,opt,name=outDate" json:"outDate,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) GetHotelIds() []string {
|
||||
if m != nil {
|
||||
return m.HotelIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Request) GetInDate() string {
|
||||
if m != nil {
|
||||
return m.InDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Request) GetOutDate() string {
|
||||
if m != nil {
|
||||
return m.OutDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
RatePlans []*RatePlan `protobuf:"bytes,1,rep,name=ratePlans" json:"ratePlans,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Result) Reset() { *m = Result{} }
|
||||
func (m *Result) String() string { return proto.CompactTextString(m) }
|
||||
func (*Result) ProtoMessage() {}
|
||||
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Result) GetRatePlans() []*RatePlan {
|
||||
if m != nil {
|
||||
return m.RatePlans
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RatePlan struct {
|
||||
HotelId string `protobuf:"bytes,1,opt,name=hotelId" json:"hotelId,omitempty"`
|
||||
Code string `protobuf:"bytes,2,opt,name=code" json:"code,omitempty"`
|
||||
InDate string `protobuf:"bytes,3,opt,name=inDate" json:"inDate,omitempty"`
|
||||
OutDate string `protobuf:"bytes,4,opt,name=outDate" json:"outDate,omitempty"`
|
||||
RoomType *RoomType `protobuf:"bytes,5,opt,name=roomType" json:"roomType,omitempty"`
|
||||
}
|
||||
|
||||
func (m *RatePlan) Reset() { *m = RatePlan{} }
|
||||
func (m *RatePlan) String() string { return proto.CompactTextString(m) }
|
||||
func (*RatePlan) ProtoMessage() {}
|
||||
func (*RatePlan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *RatePlan) GetHotelId() string {
|
||||
if m != nil {
|
||||
return m.HotelId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RatePlan) GetCode() string {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RatePlan) GetInDate() string {
|
||||
if m != nil {
|
||||
return m.InDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RatePlan) GetOutDate() string {
|
||||
if m != nil {
|
||||
return m.OutDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RatePlan) GetRoomType() *RoomType {
|
||||
if m != nil {
|
||||
return m.RoomType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RoomType struct {
|
||||
BookableRate float64 `protobuf:"fixed64,1,opt,name=bookableRate" json:"bookableRate,omitempty"`
|
||||
TotalRate float64 `protobuf:"fixed64,2,opt,name=totalRate" json:"totalRate,omitempty"`
|
||||
TotalRateInclusive float64 `protobuf:"fixed64,3,opt,name=totalRateInclusive" json:"totalRateInclusive,omitempty"`
|
||||
Code string `protobuf:"bytes,4,opt,name=code" json:"code,omitempty"`
|
||||
Currency string `protobuf:"bytes,5,opt,name=currency" json:"currency,omitempty"`
|
||||
RoomDescription string `protobuf:"bytes,6,opt,name=roomDescription" json:"roomDescription,omitempty"`
|
||||
}
|
||||
|
||||
func (m *RoomType) Reset() { *m = RoomType{} }
|
||||
func (m *RoomType) String() string { return proto.CompactTextString(m) }
|
||||
func (*RoomType) ProtoMessage() {}
|
||||
func (*RoomType) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func (m *RoomType) GetBookableRate() float64 {
|
||||
if m != nil {
|
||||
return m.BookableRate
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *RoomType) GetTotalRate() float64 {
|
||||
if m != nil {
|
||||
return m.TotalRate
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *RoomType) GetTotalRateInclusive() float64 {
|
||||
if m != nil {
|
||||
return m.TotalRateInclusive
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *RoomType) GetCode() string {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RoomType) GetCurrency() string {
|
||||
if m != nil {
|
||||
return m.Currency
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *RoomType) GetRoomDescription() string {
|
||||
if m != nil {
|
||||
return m.RoomDescription
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "rate.Request")
|
||||
proto.RegisterType((*Result)(nil), "rate.Result")
|
||||
proto.RegisterType((*RatePlan)(nil), "rate.RatePlan")
|
||||
proto.RegisterType((*RoomType)(nil), "rate.RoomType")
|
||||
}
|
||||
|
||||
// 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 Rate service
|
||||
|
||||
type RateClient interface {
|
||||
// GetRates returns rate codes for hotels for a given date range
|
||||
GetRates(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error)
|
||||
}
|
||||
|
||||
type rateClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewRateClient(cc *grpc.ClientConn) RateClient {
|
||||
return &rateClient{cc}
|
||||
}
|
||||
|
||||
func (c *rateClient) GetRates(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
|
||||
out := new(Result)
|
||||
err := grpc.Invoke(ctx, "/rate.Rate/GetRates", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Rate service
|
||||
|
||||
type RateServer interface {
|
||||
// GetRates returns rate codes for hotels for a given date range
|
||||
GetRates(context.Context, *Request) (*Result, error)
|
||||
}
|
||||
|
||||
func RegisterRateServer(s *grpc.Server, srv RateServer) {
|
||||
s.RegisterService(&_Rate_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Rate_GetRates_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.(RateServer).GetRates(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/rate.Rate/GetRates",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RateServer).GetRates(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Rate_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "rate.Rate",
|
||||
HandlerType: (*RateServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetRates",
|
||||
Handler: _Rate_GetRates_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/booking/srv/rate/proto/rate.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 351 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4f, 0x4b, 0xfb, 0x30,
|
||||
0x18, 0xc7, 0xc9, 0x6f, 0xfd, 0x75, 0xed, 0xe3, 0x54, 0x78, 0x0e, 0x52, 0x86, 0x87, 0xd1, 0x8b,
|
||||
0x43, 0xa4, 0x85, 0x09, 0x5e, 0xbc, 0x0e, 0x64, 0x37, 0x09, 0x82, 0xe7, 0xb6, 0x0b, 0x5b, 0x31,
|
||||
0x6d, 0x6a, 0x92, 0x0e, 0xf7, 0x46, 0x7c, 0x69, 0xbe, 0x1e, 0x49, 0x9a, 0x76, 0x9b, 0xe8, 0xed,
|
||||
0xfb, 0x27, 0x3c, 0xfd, 0xe4, 0x69, 0xe0, 0x71, 0x53, 0xea, 0x6d, 0x9b, 0x27, 0x85, 0xa8, 0xd2,
|
||||
0xaa, 0x2c, 0xa4, 0x48, 0xd9, 0x47, 0x56, 0x35, 0x9c, 0xa9, 0x34, 0x17, 0xe2, 0xad, 0xac, 0x37,
|
||||
0xa9, 0x92, 0xbb, 0x54, 0x66, 0x9a, 0xa5, 0x8d, 0x14, 0x5a, 0x58, 0x99, 0x58, 0x89, 0x9e, 0xd1,
|
||||
0xf1, 0x2b, 0x8c, 0x29, 0x7b, 0x6f, 0x99, 0xd2, 0x38, 0x85, 0x60, 0x2b, 0x34, 0xe3, 0xab, 0xb5,
|
||||
0x8a, 0xc8, 0x6c, 0x34, 0x0f, 0xe9, 0xe0, 0xf1, 0x0a, 0xfc, 0xb2, 0x5e, 0x66, 0x9a, 0x45, 0xff,
|
||||
0x66, 0x64, 0x1e, 0x52, 0xe7, 0x30, 0x82, 0xb1, 0x68, 0xb5, 0x2d, 0x46, 0xb6, 0xe8, 0x6d, 0xfc,
|
||||
0x00, 0x3e, 0x65, 0xaa, 0xe5, 0x1a, 0xef, 0x20, 0x34, 0x9f, 0x7a, 0xe6, 0x59, 0xdd, 0x0d, 0x3e,
|
||||
0x5b, 0x5c, 0x24, 0x16, 0x84, 0xba, 0x98, 0x1e, 0x0e, 0xc4, 0x9f, 0x04, 0x82, 0x3e, 0x37, 0xe3,
|
||||
0x1d, 0x42, 0x44, 0xba, 0xf1, 0xce, 0x22, 0x82, 0x57, 0x88, 0x75, 0x8f, 0x63, 0xf5, 0x11, 0xe4,
|
||||
0xe8, 0x2f, 0x48, 0xef, 0x04, 0x12, 0x6f, 0x21, 0x90, 0x42, 0x54, 0x2f, 0xfb, 0x86, 0x45, 0xff,
|
||||
0x67, 0xe4, 0x88, 0xcc, 0xa5, 0x74, 0xe8, 0xe3, 0x2f, 0x03, 0xe6, 0x0c, 0xc6, 0x30, 0x31, 0x1b,
|
||||
0xce, 0x72, 0xce, 0x0c, 0xac, 0xa5, 0x23, 0xf4, 0x24, 0xc3, 0x6b, 0x08, 0xb5, 0xd0, 0x19, 0xa7,
|
||||
0xfd, 0xda, 0x08, 0x3d, 0x04, 0x98, 0x00, 0x0e, 0x66, 0x55, 0x17, 0xbc, 0x55, 0xe5, 0xae, 0x03,
|
||||
0x27, 0xf4, 0x97, 0x66, 0xb8, 0xb0, 0x77, 0x74, 0xe1, 0x29, 0x04, 0x45, 0x2b, 0x25, 0xab, 0x8b,
|
||||
0xbd, 0xc5, 0x0f, 0xe9, 0xe0, 0x71, 0x0e, 0x97, 0x06, 0x7d, 0xc9, 0x54, 0x21, 0xcb, 0x46, 0x97,
|
||||
0xa2, 0x8e, 0x7c, 0x7b, 0xe4, 0x67, 0xbc, 0x48, 0xc1, 0xb3, 0x44, 0x37, 0x10, 0x3c, 0x31, 0x6d,
|
||||
0xa4, 0xc2, 0x73, 0xb7, 0x86, 0xee, 0x69, 0x4c, 0x27, 0xbd, 0x35, 0x3f, 0x34, 0xf7, 0xed, 0x03,
|
||||
0xba, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xef, 0x8a, 0xc6, 0x91, 0x7f, 0x02, 0x00, 0x00,
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package rate;
|
||||
|
||||
service Rate {
|
||||
// GetRates returns rate codes for hotels for a given date range
|
||||
rpc GetRates(Request) returns (Result);
|
||||
}
|
||||
|
||||
message Request {
|
||||
repeated string hotelIds = 1;
|
||||
string inDate = 2;
|
||||
string outDate = 3;
|
||||
}
|
||||
|
||||
message Result {
|
||||
repeated RatePlan ratePlans = 1;
|
||||
}
|
||||
|
||||
message RatePlan {
|
||||
string hotelId = 1;
|
||||
string code = 2;
|
||||
string inDate = 3;
|
||||
string outDate = 4;
|
||||
RoomType roomType = 5;
|
||||
}
|
||||
|
||||
message RoomType {
|
||||
double bookableRate = 1;
|
||||
double totalRate = 2;
|
||||
double totalRateInclusive = 3;
|
||||
string code = 4;
|
||||
string currency = 5;
|
||||
string roomDescription = 6;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# Broker
|
||||
|
||||
The [broker](https://godoc.org/github.com/micro/go-micro/broker#Broker) is an interface for PubSub.
|
||||
The [broker](https://godoc.org/github.com/asim/go-micro/broker#Broker) is an interface for PubSub.
|
||||
|
||||
## Contents
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
// To enable rabbitmq plugin uncomment
|
||||
//_ "github.com/micro/go-plugins/broker/rabbitmq"
|
||||
)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
// To enable rabbitmq plugin uncomment
|
||||
//_ "github.com/micro/go-plugins/broker/rabbitmq"
|
||||
)
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"context"
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -7,12 +7,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/client/selector"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/selector"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -8,11 +8,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/client/selector"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/selector"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
)
|
||||
|
||||
// Built in random hashed node selector
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"context"
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"context"
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
"github.com/asim/go-micro/v3"
|
||||
)
|
||||
|
||||
|
@ -6,10 +6,10 @@ import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/client/selector"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/selector"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
)
|
||||
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"time"
|
||||
|
||||
"context"
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
example "github.com/asim/go-micro/examples/v3/server/proto/example"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/config/cmd"
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
)
|
||||
|
@ -1,19 +0,0 @@
|
||||
# Command
|
||||
|
||||
This is an example of a bot command as a microservice
|
||||
|
||||
## Contents
|
||||
|
||||
- main.go - is the main definition of the service and handler
|
||||
|
||||
## Run the example
|
||||
|
||||
Run the service
|
||||
|
||||
```shell
|
||||
go run main.go
|
||||
```
|
||||
|
||||
## Call the service
|
||||
|
||||
Run the [bot](https://micro.mu/docs/bot.html) and send message `command`
|
@ -1,42 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"context"
|
||||
"github.com/asim/go-micro/v3"
|
||||
|
||||
proto "github.com/asim/go-micro/v3/agent/proto"
|
||||
)
|
||||
|
||||
type Command struct{}
|
||||
|
||||
// Help returns the command usage
|
||||
func (c *Command) Help(ctx context.Context, req *proto.HelpRequest, rsp *proto.HelpResponse) error {
|
||||
rsp.Usage = "command"
|
||||
rsp.Description = "This is an example bot command as a micro service"
|
||||
return nil
|
||||
}
|
||||
|
||||
// Exec executes the command
|
||||
func (c *Command) Exec(ctx context.Context, req *proto.ExecRequest, rsp *proto.ExecResponse) error {
|
||||
rsp.Result = []byte(strings.Join(req.Args, " "))
|
||||
// rsp.Error could be set to return an error instead
|
||||
// the function error would only be used for service level issues
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.bot.command"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
proto.RegisterCommandHandler(service.Server(), new(Command))
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/util/log"
|
||||
grpcConfig "github.com/micro/go-plugins/config/source/grpc/v2"
|
||||
grpcConfig "github.com/asim/go-micro/plugins/config/source/grpc/v3"
|
||||
)
|
||||
|
||||
type Micro struct {
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/source/file"
|
||||
"github.com/asim/go-micro/v3/util/log"
|
||||
proto "github.com/micro/go-plugins/config/source/grpc/v2/proto"
|
||||
proto "github.com/asim/go-micro/plugins/config/source/grpc/v3/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/encoder/toml"
|
||||
"github.com/asim/go-micro/plugins/config/encoder/toml/v3"
|
||||
"github.com/asim/go-micro/v3/config/source"
|
||||
"github.com/asim/go-micro/v3/config/source/file"
|
||||
)
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/event/srv/proto/pubsub.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/event/srv/proto/pubsub.proto
|
||||
|
||||
/*
|
||||
Package pubsub is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/event/srv/proto/pubsub.proto
|
||||
github.com/asim/go-micro/examples/v3/event/srv/proto/pubsub.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Event
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/event/srv/proto/pubsub.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/event/srv/proto/pubsub.proto
|
||||
|
||||
/*
|
||||
Package pubsub is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/event/srv/proto/pubsub.proto
|
||||
github.com/asim/go-micro/examples/v3/event/srv/proto/pubsub.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Event
|
||||
@ -68,7 +68,7 @@ func init() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/event/srv/proto/pubsub.proto", fileDescriptor0)
|
||||
proto.RegisterFile("github.com/asim/go-micro/examples/v3/event/srv/proto/pubsub.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/micro/go-micro/examples/filter/version"
|
||||
proto "github.com/micro/go-micro/examples/service/proto"
|
||||
"github.com/asim/go-micro/examples/v3/filter/version"
|
||||
proto "github.com/asim/go-micro/examples/v3/service/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@ package version
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/client/selector"
|
||||
"github.com/asim/go-micro/v3/selector"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
)
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
# Form
|
||||
|
||||
This rudimentary example demonstrates how to access a form and multipart form when writing API services
|
||||
|
||||
## Contents
|
||||
|
||||
- web - is the web front end with the form
|
||||
- api - is the api service
|
||||
|
||||
## Usage
|
||||
|
||||
Run the micro api
|
||||
|
||||
```
|
||||
micro api --handler=api
|
||||
```
|
||||
|
||||
Run the micro web
|
||||
|
||||
```
|
||||
micro web
|
||||
```
|
||||
|
||||
Run the api service
|
||||
|
||||
```
|
||||
go run api/main.go
|
||||
```
|
||||
|
||||
Run the web service
|
||||
|
||||
```
|
||||
go run web/main.go
|
||||
```
|
||||
|
||||
Browse to localhost:8082/form
|
@ -1,54 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"mime"
|
||||
"mime/multipart"
|
||||
"strings"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/form/api/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
api "github.com/asim/go-micro/v3/api/proto"
|
||||
"github.com/asim/go-micro/v3/util/log"
|
||||
)
|
||||
|
||||
type Form struct{}
|
||||
|
||||
func (f *Form) Submit(ctx context.Context, req *api.Request, rsp *api.Response) error {
|
||||
rsp.Body = fmt.Sprintf("got your values %+v", req.Post)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *Form) Multipart(ctx context.Context, req *api.Request, rsp *api.Response) error {
|
||||
ct := strings.Join(req.Header["Content-Type"].Values, ",")
|
||||
mt, p, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !strings.HasPrefix(mt, "multipart/") {
|
||||
return fmt.Errorf("%v does not contain multipart", mt)
|
||||
}
|
||||
r := multipart.NewReader(bytes.NewReader([]byte(req.Body)), p["boundary"])
|
||||
form, err := r.ReadForm(32 << 20)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rsp.Body = fmt.Sprintf("got your values %+v", form)
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.form"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
proto.RegisterFormHandler(service.Server(), new(Form))
|
||||
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
proto1 "github.com/asim/go-micro/v3/api/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/asim/go-micro/v3/client"
|
||||
server "github.com/asim/go-micro/v3/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 Form service
|
||||
|
||||
type FormService interface {
|
||||
// regular form
|
||||
Submit(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
|
||||
// multipart form
|
||||
Multipart(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
|
||||
}
|
||||
|
||||
type formService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewFormService(name string, c client.Client) FormService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(name) == 0 {
|
||||
name = "form"
|
||||
}
|
||||
return &formService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *formService) Submit(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
|
||||
req := c.c.NewRequest(c.name, "Form.Submit", in)
|
||||
out := new(proto1.Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *formService) Multipart(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
|
||||
req := c.c.NewRequest(c.name, "Form.Multipart", in)
|
||||
out := new(proto1.Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Form service
|
||||
|
||||
type FormHandler interface {
|
||||
// regular form
|
||||
Submit(context.Context, *proto1.Request, *proto1.Response) error
|
||||
// multipart form
|
||||
Multipart(context.Context, *proto1.Request, *proto1.Response) error
|
||||
}
|
||||
|
||||
func RegisterFormHandler(s server.Server, hdlr FormHandler, opts ...server.HandlerOption) error {
|
||||
type form interface {
|
||||
Submit(ctx context.Context, in *proto1.Request, out *proto1.Response) error
|
||||
Multipart(ctx context.Context, in *proto1.Request, out *proto1.Response) error
|
||||
}
|
||||
type Form struct {
|
||||
form
|
||||
}
|
||||
h := &formHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Form{h}, opts...))
|
||||
}
|
||||
|
||||
type formHandler struct {
|
||||
FormHandler
|
||||
}
|
||||
|
||||
func (h *formHandler) Submit(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
|
||||
return h.FormHandler.Submit(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *formHandler) Multipart(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
|
||||
return h.FormHandler.Multipart(ctx, in, out)
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: proto/api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/asim/go-micro/v3/api/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
|
||||
|
||||
func init() { proto.RegisterFile("proto/api.proto", fileDescriptor_ecf0878b123623e2) }
|
||||
|
||||
var fileDescriptor_ecf0878b123623e2 = []byte{
|
||||
// 132 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0x03, 0xb3, 0xa4, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93,
|
||||
0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x73, 0x33, 0x93, 0x8b, 0xf2, 0xf5, 0xd3, 0xf3, 0x75, 0x21, 0x8c,
|
||||
0xc4, 0x82, 0x4c, 0x7d, 0x34, 0xe5, 0x46, 0xe9, 0x5c, 0x2c, 0x6e, 0xf9, 0x45, 0xb9, 0x42, 0xba,
|
||||
0x5c, 0x6c, 0xc1, 0xa5, 0x49, 0xb9, 0x99, 0x25, 0x42, 0xfc, 0x7a, 0xe9, 0xf9, 0x7a, 0x20, 0x05,
|
||||
0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x52, 0x02, 0x08, 0x81, 0xe2, 0x82, 0xfc, 0xbc, 0xe2,
|
||||
0x54, 0x25, 0x06, 0x21, 0x03, 0x2e, 0x4e, 0xdf, 0xd2, 0x9c, 0x92, 0xcc, 0x82, 0xc4, 0x22, 0xe2,
|
||||
0x74, 0x24, 0xb1, 0x81, 0xed, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x4f, 0x39, 0x8c,
|
||||
0xb1, 0x00, 0x00, 0x00,
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "github.com/asim/go-micro/v3/api/proto/api.proto";
|
||||
|
||||
service Form {
|
||||
// regular form
|
||||
rpc Submit(go.api.Request) returns (go.api.Response) {};
|
||||
// multipart form
|
||||
rpc Multipart(go.api.Request) returns (go.api.Response) {};
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/asim/go-micro/v3/web"
|
||||
)
|
||||
|
||||
func index(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, `<html>
|
||||
<body>
|
||||
<h1>This is a regular form</h1>
|
||||
<form action="http://localhost:8080/form/submit" method="POST">
|
||||
<input type="text" id="thing" name="thing" />
|
||||
<button>submit</button>
|
||||
</form>
|
||||
<h1>This is a multipart form</h1>
|
||||
<form action="http://localhost:8080/form/multipart" method="POST" enctype="multipart/form-data">
|
||||
<input type="text" id="thing" name="thing" />
|
||||
<button>submit</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
}
|
||||
|
||||
func main() {
|
||||
service := web.NewService(
|
||||
web.Name("go.micro.web.form"),
|
||||
)
|
||||
service.Init()
|
||||
service.HandleFunc("/", index)
|
||||
service.Run()
|
||||
}
|
@ -11,7 +11,7 @@ This is an example of creating a micro function. A function is a one time execut
|
||||
|
||||
```shell
|
||||
while true; do
|
||||
github.com/micro/go-micro/examples/function
|
||||
github.com/asim/go-micro/examples/v3/function
|
||||
done
|
||||
```
|
||||
|
||||
|
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/function/proto"
|
||||
proto "github.com/asim/go-micro/examples/v3/function/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/function/proto/greeter.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/function/proto/greeter.proto
|
||||
|
||||
/*
|
||||
Package greeter is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/function/proto/greeter.proto
|
||||
github.com/asim/go-micro/examples/v3/function/proto/greeter.proto
|
||||
|
||||
It has these top-level messages:
|
||||
HelloRequest
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/function/proto/greeter.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/function/proto/greeter.proto
|
||||
|
||||
/*
|
||||
Package greeter is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/function/proto/greeter.proto
|
||||
github.com/asim/go-micro/examples/v3/function/proto/greeter.proto
|
||||
|
||||
It has these top-level messages:
|
||||
HelloRequest
|
||||
@ -139,11 +139,11 @@ var _Greeter_serviceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/function/proto/greeter.proto",
|
||||
Metadata: "github.com/asim/go-micro/examples/v3/function/proto/greeter.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/function/proto/greeter.proto", fileDescriptor0)
|
||||
proto.RegisterFile("github.com/asim/go-micro/examples/v3/function/proto/greeter.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
This directory contains a grpc gateway generated using [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway).
|
||||
|
||||
Services written with [micro/go-micro/service/grpc](https://github.com/micro/go-micro/service/grpc) are fully compatible with the grpc-gateway and any other
|
||||
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
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
hello "github.com/micro/go-micro/examples/gateway/proto/hello"
|
||||
hello "github.com/asim/go-micro/examples/v3/gateway/proto/hello"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
proto "github.com/micro/go-micro/examples/service/proto"
|
||||
proto "github.com/asim/go-micro/examples/v3/service/proto"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
)
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/service/proto/greeter.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/service/proto/greeter.proto
|
||||
|
||||
/*
|
||||
Package greeter is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/service/proto/greeter.proto
|
||||
github.com/asim/go-micro/examples/v3/service/proto/greeter.proto
|
||||
|
||||
It has these top-level messages:
|
||||
HelloRequest
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/micro/go-micro/examples/service/proto/greeter.proto
|
||||
// source: github.com/asim/go-micro/examples/v3/service/proto/greeter.proto
|
||||
|
||||
/*
|
||||
Package greeter is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/micro/go-micro/examples/service/proto/greeter.proto
|
||||
github.com/asim/go-micro/examples/v3/service/proto/greeter.proto
|
||||
|
||||
It has these top-level messages:
|
||||
HelloRequest
|
||||
@ -139,11 +139,11 @@ var _Greeter_serviceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "github.com/micro/go-micro/examples/service/proto/greeter.proto",
|
||||
Metadata: "github.com/asim/go-micro/examples/v3/service/proto/greeter.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("github.com/micro/go-micro/examples/service/proto/greeter.proto", fileDescriptor0)
|
||||
proto.RegisterFile("github.com/asim/go-micro/examples/v3/service/proto/greeter.proto", fileDescriptor0)
|
||||
}
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
|
@ -1,4 +1,4 @@
|
||||
module github.com/micro/go-micro/examples
|
||||
module github.com/asim/go-micro/examples/v3
|
||||
|
||||
go 1.13
|
||||
|
||||
@ -16,31 +16,30 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.24.0
|
||||
|
||||
require (
|
||||
github.com/99designs/gqlgen v0.10.1
|
||||
github.com/asim/go-micro/plugins/config/encoder/toml/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/config/source/configmap/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/config/source/grpc/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/registry/etcd/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/registry/kubernetes/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/selector/static/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/plugins/wrapper/select/shard/v3 v3.0.0-20210120210110-dc8236ec05ed
|
||||
github.com/asim/go-micro/v3 v3.0.0-20210120135431-d94936f6c97c
|
||||
github.com/astaxie/beego v1.12.0
|
||||
github.com/emicklei/go-restful v2.11.1+incompatible
|
||||
github.com/gin-gonic/gin v1.4.0
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
|
||||
github.com/golang/protobuf v1.3.3
|
||||
github.com/golang/protobuf v1.4.2
|
||||
github.com/google/uuid v1.1.1
|
||||
github.com/gorilla/rpc v1.2.0
|
||||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.12.1
|
||||
github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711
|
||||
github.com/micro/cli/v2 v2.1.2
|
||||
github.com/asim/go-micro/v3 master
|
||||
github.com/micro/go-plugins/broker/grpc/v2 v2.3.0
|
||||
github.com/micro/go-plugins/client/selector/static/v2 v2.3.0
|
||||
github.com/micro/go-plugins/config/source/configmap/v2 v2.3.0
|
||||
github.com/micro/go-plugins/config/source/grpc/v2 v2.3.0
|
||||
github.com/micro/go-plugins/registry/etcd/v2 v2.3.0
|
||||
github.com/micro/go-plugins/registry/kubernetes/v2 v2.3.0
|
||||
github.com/micro/go-plugins/wrapper/select/roundrobin/v2 v2.3.0
|
||||
github.com/micro/go-plugins/wrapper/select/shard/v2 v2.3.0
|
||||
github.com/micro/micro/v2 v2.4.0
|
||||
github.com/pborman/uuid v1.2.0
|
||||
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
|
||||
github.com/vektah/gqlparser v1.2.0
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
|
||||
google.golang.org/grpc v1.26.0
|
||||
)
|
||||
|
441
examples/go.sum
441
examples/go.sum
@ -1,5 +1,7 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.31.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.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo=
|
||||
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=
|
||||
@ -11,7 +13,12 @@ cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
|
||||
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
|
||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||
github.com/99designs/gqlgen v0.10.1 h1:1BgB6XKGTHq7uH4G1/PYyKe2Kz7/vw3AlvMZlD3TEEY=
|
||||
github.com/99designs/gqlgen v0.10.1/go.mod h1:IviubpnyI4gbBcj8IcxSSc/Q/+af5riwCmJmwF0uaPE=
|
||||
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
@ -41,54 +48,57 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx
|
||||
github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ=
|
||||
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
|
||||
github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k=
|
||||
github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75 h1:3ILjVyslFbc4jl1w5TWuvvslFD/nDfR2H8tVaMVLrEY=
|
||||
github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
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 v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/asim/go-micro v1.18.0 h1:gP70EZVHpJuUIT0YWth192JmlIci+qMOEByHm83XE9E=
|
||||
github.com/asim/go-micro v1.18.0 h1:k/qyLA5R175Vr1Owf90Ms1+J/zhBf/aa8aiHGhk0x5s=
|
||||
github.com/asim/go-micro/examples v0.0.0-20210120210110-dc8236ec05ed h1:yN3aVYmIy6eKMsq7WNY3b85v5pxXzgAFyax0Y7+wTps=
|
||||
github.com/asim/go-micro/plugins/config/encoder/toml/v3 v3.0.0-20210120210110-dc8236ec05ed h1:WlogUILlza+BEoxJu9S2jm8DD2eY3pctYZXXBYgCwww=
|
||||
github.com/asim/go-micro/plugins/config/encoder/toml/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:D+mkq2EASL7nsd7UNLpKZZsuhCnxladX3sfM/gmcW+M=
|
||||
github.com/asim/go-micro/plugins/config/source/configmap/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:qRHDylnrxXGQrOotQ2YtW6qoRoRtjQ8+gmhAZ7lbk2I=
|
||||
github.com/asim/go-micro/plugins/config/source/grpc/v3 v3.0.0-20210120210110-dc8236ec05ed h1:+eE7NvtV/Odfpo5seoLwKWLyi8DzJAHjR31sUIKwo38=
|
||||
github.com/asim/go-micro/plugins/config/source/grpc/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:zQevfYGVnE3ojeKbuiawb/vU+TuolXSVilxu9Nyhr/g=
|
||||
github.com/asim/go-micro/plugins/registry/etcd/v3 v3.0.0-20210120210110-dc8236ec05ed h1:tmtnveSqGRYVea4z75JKtTa3eas9wIiADN4X5G+xmgQ=
|
||||
github.com/asim/go-micro/plugins/registry/etcd/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:Atrgz+cvVEyLuc3lASaGW+Ec5O+45WqSQIuUTbBvHww=
|
||||
github.com/asim/go-micro/plugins/registry/kubernetes/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:W3wRH2u98yL4mFB0GXvo2yZ0iMaSwsskJ8y6bLKitC8=
|
||||
github.com/asim/go-micro/plugins/selector/static/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:u1bPSsWwfOXJ+Em32MDRxy5DhQs4G7HSZXS2+KfnbcY=
|
||||
github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v3 v3.0.0-20210120210110-dc8236ec05ed h1:PnsK9uGDbQpICd4jZvsvABDeAF1NUH4Xz/v9sHQtVqs=
|
||||
github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:ylLMnWRirHZgMKEUyhnseG44r0UqXyqpFCIlxbFd9fU=
|
||||
github.com/asim/go-micro/plugins/wrapper/select/shard/v3 v3.0.0-20210120210110-dc8236ec05ed h1:Gmo5LFkIxS51sGPGKY/5khlZzRuWb5ChfZwRbIM4T7s=
|
||||
github.com/asim/go-micro/plugins/wrapper/select/shard/v3 v3.0.0-20210120210110-dc8236ec05ed/go.mod h1:W82nHY+YFENWaye4jazv6nX+OYru9T7It+wUqJA9Vc0=
|
||||
github.com/asim/go-micro/v3 v3.0.0-20210120135431-d94936f6c97c h1:pxZggDV2VJ7aTR7/7xzAJOGam0y8zzrtBgmop1pHAyA=
|
||||
github.com/asim/go-micro/v3 v3.0.0-20210120135431-d94936f6c97c/go.mod h1:fAeb2KUnD3z4XwtQ91XFxw5zgGKhoTsLc6Ie81QdER4=
|
||||
github.com/asim/go-micro/v3 v3.1.0 h1:pENqkNnOKgwTdvulzRDTF4tDiAFj0/0Y6M6RhHSf3NE=
|
||||
github.com/astaxie/beego v1.12.0 h1:MRhVoeeye5N+Flul5PoVfD9CslfdoH+xqC/xvSQ5u2Y=
|
||||
github.com/astaxie/beego v1.12.0/go.mod h1:fysx+LZNZKnvh4GED/xND7jWtjCR6HzydR2Hh2Im57o=
|
||||
github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||
github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
|
||||
github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
|
||||
github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg=
|
||||
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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
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/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||
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/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
|
||||
github.com/bwmarrin/discordgo v0.20.2 h1:nA7jiTtqUA9lT93WL2jPjUp8ZTEInRujBdx1C9gkr20=
|
||||
github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q=
|
||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||
github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c=
|
||||
github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs=
|
||||
github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
|
||||
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
|
||||
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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY=
|
||||
github.com/cloudflare/cloudflare-go v0.10.9 h1:d8KOgLpYiC+Xq3T4tuO+/goM+RZvuO+T4pojuv8giL8=
|
||||
github.com/cloudflare/cloudflare-go v0.10.9/go.mod h1:5TrsWH+3f4NV6WjtS5QFp+DifH81rph40gU374Sh0dQ=
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
|
||||
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
|
||||
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
|
||||
@ -99,16 +109,13 @@ github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv
|
||||
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.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
|
||||
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE=
|
||||
github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/etcd v3.3.25+incompatible h1:0GQEw6h3YnuOVdtwygkIfJ+Omx0tZ8/QkVyXI4LkbeY=
|
||||
github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
|
||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/couchbase/go-couchbase v0.0.0-20181122212707-3e9b6e1258bb/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
|
||||
@ -117,14 +124,10 @@ github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFl
|
||||
github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
|
||||
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.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
|
||||
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/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
|
||||
github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
|
||||
@ -134,52 +137,55 @@ github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r
|
||||
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/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
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/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
|
||||
github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1/go.mod h1:HvODWzv6Y6kBf3Ah2WzN1bHjDUezGLaAhwuWVwfpEJs=
|
||||
github.com/eknkc/basex v1.0.0 h1:R2zGRGJAcqEES03GqHU9leUF5n4Pg6ahazPbSTQWCWc=
|
||||
github.com/eknkc/basex v1.0.0/go.mod h1:k/F/exNEHFdbs3ZHuasoP2E7zeWwZblG84Y7Z59vQRo=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
|
||||
github.com/emicklei/go-restful v2.11.1+incompatible h1:CjKsv3uWcCMvySPQYKxO8XX3f9zD4FeZRsW4G0B4ffE=
|
||||
github.com/emicklei/go-restful v2.11.1+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
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/evanphx/json-patch/v5 v5.0.0 h1:dKTrUeykyQwKb/kx7Z+4ukDs6l+4L41HqG1XHnhX7WE=
|
||||
github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
|
||||
github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE=
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c h1:pBgVXWDXju1m8W4lnEeIqTHPOzhTUO81a7yknM/xQR4=
|
||||
github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY=
|
||||
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
||||
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.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc=
|
||||
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.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=
|
||||
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
|
||||
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
|
||||
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
|
||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/go-acme/lego/v3 v3.3.0 h1:6BePZsOiYA4/w+M7QDytxQtMfCipMPGnWAHs9pWks98=
|
||||
github.com/go-acme/lego/v3 v3.3.0/go.mod h1:iGSY2vQrvQs3WezicSB/oVbO2eCrD88dpWPwb1qLqu0=
|
||||
github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M=
|
||||
github.com/go-chi/chi v3.3.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.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
|
||||
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
|
||||
github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk=
|
||||
github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
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/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
@ -190,33 +196,34 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV
|
||||
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/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-20191027212112-611e8accdfc9/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 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
|
||||
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.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/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.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
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 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
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=
|
||||
@ -225,195 +232,124 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
||||
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
||||
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/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk=
|
||||
github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU=
|
||||
github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
|
||||
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
|
||||
github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk=
|
||||
github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ=
|
||||
github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
|
||||
github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711 h1:Oi8hPOZX0gaM2sPVXse2bMpfOjP47a7O61YuB6Z4sGk=
|
||||
github.com/hailocab/go-geoindex v0.0.0-20160127134810-64631bfe9711/go.mod h1:+v2qJ3UZe4q2GfgZO4od004F/cMgJbmPSs7dD/ZMUkY=
|
||||
github.com/hako/branca v0.0.0-20180808000428-10b799466ada h1:RjbRG4Xq2N5UaUUL9/v+yGBhgLgQwlHk582Pr0j0g00=
|
||||
github.com/hako/branca v0.0.0-20180808000428-10b799466ada/go.mod h1:tOPn4gvKEUWqIJNE+zpTeTALaRAXnrRqqSnPlO3VpEo=
|
||||
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
|
||||
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
|
||||
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/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk=
|
||||
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4=
|
||||
github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
|
||||
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
|
||||
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
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/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 h1:lnrOS18wZBYrzdDmnUeg1OVk+kQ3rxG8mZWU89DpMIA=
|
||||
github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA=
|
||||
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 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
|
||||
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/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/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
|
||||
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||
github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
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.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/pty v1.1.3/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/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/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA=
|
||||
github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ=
|
||||
github.com/lucas-clemente/quic-go v0.14.1 h1:c1aKoBZKOPA+49q96B1wGkibyPP0AxYh45WuAoq+87E=
|
||||
github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU=
|
||||
github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ=
|
||||
github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE=
|
||||
github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI=
|
||||
github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gtbkks=
|
||||
github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc=
|
||||
github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4=
|
||||
github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8=
|
||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
|
||||
github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs=
|
||||
github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ=
|
||||
github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc=
|
||||
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
|
||||
github.com/mattn/go-runewidth v0.0.4/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.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
|
||||
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mholt/certmagic v0.9.3 h1:RmzuNJ5mpFplDbyS41z+gGgE/py24IX6m0nHZ0yNTQU=
|
||||
github.com/mholt/certmagic v0.9.3/go.mod h1:nu8jbsbtwK4205EDH/ZUMTKsfYpJA1Q7MKXHfgTihNw=
|
||||
github.com/micro/cli/v2 v2.1.2 h1:43J1lChg/rZCC1rvdqZNFSQDrGT7qfMrtp6/ztpIkEM=
|
||||
github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg=
|
||||
github.com/asim/go-micro/v3 v2.3.0/go.mod h1:GR69d1AXMg/WjMNf/7K1VO6hCBJDIpqCqnVYNTV6M5w=
|
||||
github.com/asim/go-micro/v3 v2.3.1-0.20200331090613-76ade7efd9b8/go.mod h1:lYuHYFPjY3QE9fdiy3F2awXcsXTdB68AwoY3RQ3dPN4=
|
||||
github.com/asim/go-micro/v3 v2.4.0 h1:icFvqf8fof8bObqgDHGoiUCMuKwOCyWTGXaQjZDgEnE=
|
||||
github.com/asim/go-micro/v3 v2.4.0/go.mod h1:lYuHYFPjY3QE9fdiy3F2awXcsXTdB68AwoY3RQ3dPN4=
|
||||
github.com/micro/go-plugins/broker/grpc/v2 v2.3.0 h1:ldKHjPBCKvW5ib1XIhfih7gEC+SCsoYXdWeW3MNZFzA=
|
||||
github.com/micro/go-plugins/broker/grpc/v2 v2.3.0/go.mod h1:EdJ+TxlDK6ak9eZlE4NKbDAzAhC3n8fL9hbdaGu7pK8=
|
||||
github.com/micro/go-plugins/client/selector/static/v2 v2.3.0 h1:h6+qRGATM88Jx8skCy7cgSlwckm7cikPJRClCUlHrFI=
|
||||
github.com/micro/go-plugins/client/selector/static/v2 v2.3.0/go.mod h1:I+iQFEytwxIBZC1K51+rCzr+jN63XB69pS5hPHDvz7Q=
|
||||
github.com/micro/go-plugins/config/source/configmap/v2 v2.3.0 h1:vKg0mfROGlDW+lMerLyYysTX8QRrtkbSGjv8FCD41L8=
|
||||
github.com/micro/go-plugins/config/source/configmap/v2 v2.3.0/go.mod h1:M7aaE28GkWtKTtjn+NeFYbkV6CyKCdbvQPCRJpMffHw=
|
||||
github.com/micro/go-plugins/config/source/grpc/v2 v2.3.0 h1:RyOxL0L/uYh0uc2PX/Kox5Ga2bfVVtwjqc9IqUK/hiY=
|
||||
github.com/micro/go-plugins/config/source/grpc/v2 v2.3.0/go.mod h1:hJmzNzgSPe9XZzkbB7kXaJBgZheNM79sFYoyqurWAA0=
|
||||
github.com/micro/go-plugins/registry/etcd/v2 v2.3.0 h1:SMwt6KwoBop5t+1FPMQaXY/Xo1VZBkfihgzPe9lNL/M=
|
||||
github.com/micro/go-plugins/registry/etcd/v2 v2.3.0/go.mod h1:ngTHrsHMgpuTmt10Or8PEdjWS50sbauTqsL525gNGdo=
|
||||
github.com/micro/go-plugins/registry/kubernetes/v2 v2.3.0 h1:JwALZIR6T7jsQZLvya+eMse3zLlh4WNBOQqgWHiWNH4=
|
||||
github.com/micro/go-plugins/registry/kubernetes/v2 v2.3.0/go.mod h1:FYW6TeTzkNn9KCK2kkfUFrQzggBbJWTtRXwVoHEBk/c=
|
||||
github.com/micro/go-plugins/wrapper/select/roundrobin/v2 v2.3.0 h1:0Uq6QzvoUNIRQchHtrjgW+byIepyW8Vb0MUSWzHf3Ng=
|
||||
github.com/micro/go-plugins/wrapper/select/roundrobin/v2 v2.3.0/go.mod h1:FMSwQYGcA5k1ksLV7IFzBMdlhNqXzTYTZkHKEh1O3Mo=
|
||||
github.com/micro/go-plugins/wrapper/select/shard/v2 v2.3.0 h1:sJW6fDpSqlvFdUme66gOMSHOGRKFo9NoBqdRmWJaD5g=
|
||||
github.com/micro/go-plugins/wrapper/select/shard/v2 v2.3.0/go.mod h1:+LBWZPqiGqEhJOCt2piU8VRwx5uwxfCgS4gXgO/XIQY=
|
||||
github.com/micro/mdns v0.3.0 h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE=
|
||||
github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc=
|
||||
github.com/micro/micro/v2 v2.4.0 h1:GlbLaD/50KaSFym7GCQZ/2I4fuTTX9U4Zftni4ImJ40=
|
||||
github.com/micro/micro/v2 v2.4.0/go.mod h1:/7lxBaU/Isx3USObggNVw6x6pdIJzTDexee7EsARD+A=
|
||||
github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
||||
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
|
||||
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
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-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0=
|
||||
github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y=
|
||||
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
|
||||
github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0=
|
||||
github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
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 v0.0.0-20170113033406-39771216ff4c/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/nats-io/jwt v0.3.0 h1:xdnzwFETV++jNc4W1mw//qFyJGb2ABOombmZJQS4+Qo=
|
||||
github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
|
||||
github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI=
|
||||
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
|
||||
github.com/nats-io/nats-server/v2 v2.1.4 h1:BILRnsJ2Yb/fefiFbBWADpViGF69uh4sxe8poVDQ06g=
|
||||
github.com/nats-io/nats-server/v2 v2.1.4/go.mod h1:Jw1Z28soD/QasIA2uWjXyM9El1jly3YwyFOuR8tH1rg=
|
||||
github.com/nats-io/nats.go v1.9.1 h1:ik3HbLhZ0YABLto7iX80pZLPw/6dx3T+++MZJwLnMrQ=
|
||||
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
|
||||
github.com/nats-io/nkeys v0.1.0 h1:qMd4+pRHgdr1nAClu+2h/2a5F2TmKcCzjCDazVgRoX4=
|
||||
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nkeys v0.1.3 h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k=
|
||||
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
|
||||
github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f/go.mod h1:ECF8anFVCt/TfTIWVPgPrNaYJXtAtpAOF62ugDbw41A=
|
||||
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249 h1:Pr5gZa2VcmktVwq0lyC39MsN5tz356vC/pQHKvq+QBo=
|
||||
github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk=
|
||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw=
|
||||
github.com/nrdcg/dnspod-go v0.3.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
|
||||
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
|
||||
github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ=
|
||||
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
|
||||
github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M=
|
||||
github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8=
|
||||
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||
@ -423,7 +359,7 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m
|
||||
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
|
||||
github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
|
||||
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
|
||||
github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ=
|
||||
@ -433,35 +369,30 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
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 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
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 v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8=
|
||||
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 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.2.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 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo=
|
||||
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
|
||||
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/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.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=
|
||||
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
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=
|
||||
@ -469,53 +400,66 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
|
||||
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/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
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/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc=
|
||||
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
|
||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
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/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
|
||||
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
|
||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
||||
github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
||||
github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI=
|
||||
github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU=
|
||||
github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag=
|
||||
github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg=
|
||||
github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw=
|
||||
github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y=
|
||||
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
||||
github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q=
|
||||
github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ=
|
||||
github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I=
|
||||
github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0=
|
||||
github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ=
|
||||
github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk=
|
||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
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/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
|
||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
||||
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
|
||||
github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg=
|
||||
github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
|
||||
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 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
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/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/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
|
||||
github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
|
||||
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.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
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 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
|
||||
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=
|
||||
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=
|
||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||
github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY=
|
||||
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
|
||||
github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=
|
||||
@ -523,62 +467,54 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr
|
||||
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U=
|
||||
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
|
||||
github.com/vektah/gqlparser v1.2.0 h1:ntkSCX7F5ZJKl+HIVnmLaO269MruasVpNiMOjX9kgo0=
|
||||
github.com/vektah/gqlparser v1.2.0/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74=
|
||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
||||
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
|
||||
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
|
||||
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
|
||||
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 v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
|
||||
github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI=
|
||||
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
|
||||
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
||||
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.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
|
||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
|
||||
go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM=
|
||||
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
|
||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
||||
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-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/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 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/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-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw=
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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=
|
||||
@ -592,7 +528,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
|
||||
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 h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
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=
|
||||
@ -603,13 +538,15 @@ golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73r
|
||||
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-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/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-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-20190228165749-92fc7df08ae7/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-20190313220215-9f648a60d977/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=
|
||||
@ -621,35 +558,39 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 h1:MsuvTghUPjX762sGLnGsxC3HM0B5r83wEtYcYR8/vRs=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/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 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
||||
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 h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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-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-20181029174526-d69651ed3497/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-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
|
||||
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-20190316082340-a2f829d7f35f/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=
|
||||
@ -662,23 +603,26 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/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 h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4 h1:Hynbrlo6LbYI3H1IqXpkVDOcX/3HiPdhVEuyj5a59RM=
|
||||
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
|
||||
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
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-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w=
|
||||
golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/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-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/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=
|
||||
@ -692,7 +636,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
|
||||
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-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
|
||||
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=
|
||||
@ -700,12 +643,13 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/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-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
|
||||
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=
|
||||
@ -713,12 +657,16 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
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 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
|
||||
google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
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=
|
||||
@ -731,65 +679,62 @@ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveX
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
|
||||
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
|
||||
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.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
||||
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 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
||||
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
|
||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
|
||||
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw=
|
||||
gopkg.in/olivere/elastic.v5 v5.0.83/go.mod h1:LXF6q9XNBxpMqrcgax95C6xyARXWbbCXUrtTxrNrxJI=
|
||||
gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4=
|
||||
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
|
||||
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
|
||||
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
|
||||
gopkg.in/telegram-bot-api.v4 v4.6.4 h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g=
|
||||
gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM=
|
||||
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 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI=
|
||||
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 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
||||
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 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
k8s.io/api v0.0.0-20190708174958-539a33f6e817 h1:V6YPTc5fSnwv7EBjx6es9VyAki/6bqK4M3ECA6WwfBk=
|
||||
k8s.io/api v0.0.0-20190708174958-539a33f6e817/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
|
||||
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA=
|
||||
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
|
||||
k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o=
|
||||
k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
|
||||
k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
|
||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
|
||||
k8s.io/utils v0.0.0-20200109141947-94aeca20bf09 h1:sz6xjn8QP74104YNmJpzLbJ+a3ZtHt0tkD0g8vpdWNw=
|
||||
k8s.io/utils v0.0.0-20200109141947-94aeca20bf09/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
|
||||
sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k=
|
||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||
|
@ -1,12 +0,0 @@
|
||||
# API
|
||||
|
||||
This directory showcases API services which sit behind the micro api and serve a public facing API
|
||||
|
||||
## Services
|
||||
|
||||
- [**api**](api.go) - RPC api with [api.Request](https://github.com/micro/go-micro/blob/master/api/proto/api.proto#L11L18) and [api.Response](https://github.com/micro/go-micro/blob/master/api/proto/api.proto#L21L25) (Micro api handler should be set to --handler=api)
|
||||
- [**beego**](beego) - using beego
|
||||
- [**gin**](gin) - using gin server
|
||||
- [**graphql**](graphql) - using graphql
|
||||
- [**rest**](rest) - using go-restful
|
||||
- [**rpc**](rpc) - using RPC
|
@ -1,61 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
hello "github.com/micro/go-micro/examples/greeter/srv/proto/hello"
|
||||
"github.com/asim/go-micro/v3"
|
||||
api "github.com/asim/go-micro/v3/api/proto"
|
||||
"github.com/asim/go-micro/v3/errors"
|
||||
|
||||
"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() {
|
||||
service := micro.NewService(
|
||||
micro.Name("go.micro.api.greeter"),
|
||||
)
|
||||
|
||||
// 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)
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
# Beego API Example
|
||||
|
||||
This is an example of how to serve an API using beego
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Run the Micro API
|
||||
|
||||
```
|
||||
$ micro api --handler=http
|
||||
```
|
||||
|
||||
### Run the Greeter Service
|
||||
|
||||
```shell
|
||||
$ go run greeter/srv/main.go
|
||||
```
|
||||
|
||||
### Run the Greeter API
|
||||
|
||||
```shell
|
||||
$ go run beego.go
|
||||
```
|
||||
|
||||
### Curl API
|
||||
|
||||
Test the index
|
||||
|
||||
```shell
|
||||
curl http://localhost:8080/greeter
|
||||
```
|
||||
|
||||
Output
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "Hi, this is the Greeter API"
|
||||
}
|
||||
```
|
||||
|
||||
Test a resource
|
||||
|
||||
```shell
|
||||
curl http://localhost:8080/greeter/asim
|
||||
```
|
||||
|
||||
Output
|
||||
```json
|
||||
{
|
||||
"msg": "Hello asim"
|
||||
}
|
||||
```
|
@ -1,68 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
bctx "github.com/astaxie/beego/context"
|
||||
|
||||
hello "github.com/micro/go-micro/examples/greeter/srv/proto/hello"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/web"
|
||||
)
|
||||
|
||||
type Say struct{}
|
||||
|
||||
var (
|
||||
cl hello.SayService
|
||||
)
|
||||
|
||||
func (s *Say) Anything(ctx *bctx.Context) {
|
||||
log.Print("Received Say.Anything API request")
|
||||
ctx.Output.JSON(map[string]string{
|
||||
"message": "Hi, this is the Greeter API",
|
||||
}, false, true)
|
||||
}
|
||||
|
||||
func (s *Say) Hello(ctx *bctx.Context) {
|
||||
log.Print("Received Say.Hello API request")
|
||||
|
||||
name := ctx.Input.Param(":name")
|
||||
|
||||
response, err := cl.Hello(context.TODO(), &hello.Request{
|
||||
Name: name,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
ctx.Output.SetStatus(500)
|
||||
ctx.Output.JSON(err, false, true)
|
||||
}
|
||||
|
||||
ctx.Output.JSON(response, false, true)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Create service
|
||||
service := web.NewService(
|
||||
web.Name("go.micro.api.greeter"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
// Setup Greeter Server Client
|
||||
cl = hello.NewSayService("go.micro.srv.greeter", client.DefaultClient)
|
||||
|
||||
// Create RESTful handler
|
||||
say := new(Say)
|
||||
beego.Get("/greeter", say.Anything)
|
||||
beego.Get("/greeter/:name", say.Hello)
|
||||
|
||||
// Register Handler
|
||||
service.Handle("/", beego.BeeApp.Handlers)
|
||||
|
||||
// Run server
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
# Gin API Example
|
||||
|
||||
This is an example of how to serve an API using gin
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Run the Micro API
|
||||
|
||||
```
|
||||
$ micro api --handler=http
|
||||
```
|
||||
|
||||
### Run the Greeter Service
|
||||
|
||||
```
|
||||
$ go run greeter/srv/main.go
|
||||
```
|
||||
|
||||
### Run the Greeter API
|
||||
|
||||
```
|
||||
$ go run gin.go
|
||||
Listening on [::]:64738
|
||||
```
|
||||
|
||||
### Curl the API
|
||||
|
||||
Test the index
|
||||
```
|
||||
curl http://localhost:8080/greeter
|
||||
{
|
||||
"message": "Hi, this is the Greeter API"
|
||||
}
|
||||
```
|
||||
|
||||
Test a resource
|
||||
```
|
||||
curl http://localhost:8080/greeter/asim
|
||||
{
|
||||
"msg": "Hello asim"
|
||||
}
|
||||
```
|
@ -1,66 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
hello "github.com/micro/go-micro/examples/greeter/srv/proto/hello"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/web"
|
||||
)
|
||||
|
||||
type Say struct{}
|
||||
|
||||
var (
|
||||
cl hello.SayService
|
||||
)
|
||||
|
||||
func (s *Say) Anything(c *gin.Context) {
|
||||
log.Print("Received Say.Anything API request")
|
||||
c.JSON(200, map[string]string{
|
||||
"message": "Hi, this is the Greeter API",
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Say) Hello(c *gin.Context) {
|
||||
log.Print("Received Say.Hello API request")
|
||||
|
||||
name := c.Param("name")
|
||||
|
||||
response, err := cl.Hello(context.TODO(), &hello.Request{
|
||||
Name: name,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
c.JSON(500, err)
|
||||
}
|
||||
|
||||
c.JSON(200, response)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Create service
|
||||
service := web.NewService(
|
||||
web.Name("go.micro.api.greeter"),
|
||||
)
|
||||
|
||||
service.Init()
|
||||
|
||||
// setup Greeter Server Client
|
||||
cl = hello.NewSayService("go.micro.srv.greeter", client.DefaultClient)
|
||||
|
||||
// Create RESTful handler (using Gin)
|
||||
say := new(Say)
|
||||
router := gin.Default()
|
||||
router.GET("/greeter", say.Anything)
|
||||
router.GET("/greeter/:name", say.Hello)
|
||||
|
||||
// Register Handler
|
||||
service.Handle("/", router)
|
||||
|
||||
// Run server
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
# GraphQL with gqlgen
|
||||
|
||||
Uses the gRPC models with a GraphQL schema.
|
||||
|
||||
## Dependencies
|
||||
|
||||
```
|
||||
go get -u github.com/99designs/gqlgen github.com/vektah/gorunpkg
|
||||
```
|
||||
|
||||
## Running the example
|
||||
|
||||
### 1. Start the RPC server
|
||||
|
||||
```
|
||||
go run srv/main.go
|
||||
```
|
||||
|
||||
### 2. Start the GraphQL server
|
||||
|
||||
```
|
||||
go run api/graphql/main.go
|
||||
```
|
||||
|
||||
## Query
|
||||
|
||||
Now you can query your GraphQL API
|
||||
|
||||

|
||||
|
||||
When a GraphQL request comes in, the gRPC handler is called with your request, according to `resolver.go` and a populated model is returned.
|
||||
|
||||
Basic error handling can be seen if you turn off your gRPC service and try to query.
|
||||
|
||||
## Making changes to the GraphQL schema
|
||||
|
||||
If you change the GraphQL schema file (graphql.schema), then you need to be aware of the following
|
||||
|
||||
`gqlgen.yml` tells gqlgen where your models are and if you don't specify, it will create them for you. In this example, I decided to use the protobuf generated models across the board. You might want to do that differently.
|
||||
|
||||
`resolver.go` is generated for you if you don't have it the first time. You need to implement your own resolvers. No way around that, but we have Go types for them, so that's nice.
|
||||
|
||||
To update your generated.go, run `gqlgen` inside graphql/graphql.
|
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user