Compare commits
142 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d9a6faeb7a | |||
| 4cb6168780 | |||
| b8d7f87d17 | |||
| b2e17a89e5 | |||
| 4ae2528cbe | |||
| 043a82bce2 | |||
| 99e0b182b7 | |||
| ab1b10f13d | |||
| 86eabf4a4c | |||
| a99a1e9356 | |||
| 2ef523a7eb | |||
| a1da40d9aa | |||
| a315fc2dda | |||
| 6dc25053ea | |||
| 4612baa7f8 | |||
| 44ecd6a457 | |||
| 8c39b1e120 | |||
| 12eff1cc60 | |||
| 9deb715ebb | |||
| 3b60db0dcd | |||
| af22cbb108 | |||
| 9d7131a512 | |||
| bca9ab165d | |||
| d111f96993 | |||
| 2f223c276c | |||
| 33acb4a956 | |||
| b515785637 | |||
| 3dcdcdad32 | |||
| 916ed6b8ee | |||
| b8fbe87e1f | |||
| cb3db7dd83 | |||
| 066ce5045b | |||
| a65932ff82 | |||
| 5496086916 | |||
| efd4ef0e62 | |||
| 00d819a199 | |||
| ad532522ea | |||
| 4c7d2e28eb | |||
| d78d35078c | |||
| 22409c8ff3 | |||
| 6c3a5c161f | |||
| fa27250605 | |||
| ac21bb5b19 | |||
| 5b8d22a463 | |||
| 56d5143557 | |||
| 5772697752 | |||
| e23006b1a5 | |||
| 01b7b4409b | |||
| 0dd6afe128 | |||
| a36f52c6d2 | |||
| 440aa4a1ce | |||
| f77c91b7ae | |||
| a58b8883f8 | |||
| 270d910b73 | |||
| 77bf39f2cd | |||
| c45073a308 | |||
| 86de031adc | |||
| 80dbe51077 | |||
| f444dadd50 | |||
| e080791787 | |||
| a159598f36 | |||
| 993e2f55bd | |||
| ed9053ed94 | |||
| 05a299b76c | |||
| dd0a7746ff | |||
| 088ccb5001 | |||
| 4363678e48 | |||
| 9a77c06b44 | |||
| 78bea87690 | |||
| 49eccbc85a | |||
| 7f1ebaa572 | |||
| c7195aae98 | |||
| ffb0a2f896 | |||
| b977a51253 | |||
| 046d0785c9 | |||
| 828d3f2b74 | |||
| a46dc0b856 | |||
| 3e0411a3f6 | |||
| c3107e6843 | |||
| e1bc7e3028 | |||
| 992418236e | |||
| 27a792790b | |||
| bd9821111e | |||
| dbba07e7ed | |||
| 753022d2ae | |||
| 546225f1d8 | |||
| 0532fd9de8 | |||
| 3fbf2c304f | |||
| 6cdf28270f | |||
| 7f1de77e8c | |||
| 1c482e8922 | |||
| 70ed9bf154 | |||
| 93ba8cd0df | |||
| c13bb07171 | |||
| 4929a7c16e | |||
| 212df8e6c3 | |||
| 8dc9bf49a1 | |||
| 4daa499912 | |||
| 939f346d83 | |||
| 08216ccf31 | |||
| 4deeaff8ad | |||
| b892efa25f | |||
| 4af9e245fb | |||
| 52bb3845f6 | |||
| a1e9b88495 | |||
| ed44e9acc3 | |||
| 86d8d8f07e | |||
| 62112b015f | |||
| ca2014bf8e | |||
| acc3f5479f | |||
| f48911d2c3 | |||
| 4c1f81dadb | |||
| 32cb1b435b | |||
| 8c9c7a5927 | |||
| 9e9157d878 | |||
| 1b5d372b5b | |||
| b11a2f17e9 | |||
| a91d1f7a3d | |||
| 0d57213d3f | |||
| 6ae252b892 | |||
| e7a7e3a050 | |||
| bed53b605f | |||
| 9b41d1bf08 | |||
| 0a41e6d80f | |||
| b636a4bfe3 | |||
| df90f2ca63 | |||
| 0bf3719a9a | |||
| bfa9e7c88c | |||
| 57003414be | |||
| a54f40baa7 | |||
| 56c779f9df | |||
| 26b859c4f9 | |||
| 0f0ace1a44 | |||
| f9f5e7422d | |||
| 2653e7a977 | |||
| 55b477ba07 | |||
| 6f666d63c8 | |||
| e8167a8b79 | |||
| 0702501552 | |||
| 89fe31310e | |||
| ca3dfc4580 | |||
| bba3107ae1 |
@@ -1,22 +0,0 @@
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v2.*
|
||||
- v3.*
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
name: Check out repository
|
||||
- uses: elgohr/Publish-Docker-Github-Action@2.12
|
||||
name: Build and Push Docker Image
|
||||
with:
|
||||
name: micro/go-micro
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tag_names: true
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
FROM golang:1.15-alpine
|
||||
|
||||
RUN mkdir /user && \
|
||||
echo 'nobody:x:65534:65534:nobody:/:' > /user/passwd && \
|
||||
echo 'nobody:x:65534:' > /user/group
|
||||
|
||||
ENV GO111MODULE=on
|
||||
RUN apk --no-cache add make git gcc libtool musl-dev ca-certificates dumb-init && \
|
||||
rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
WORKDIR /
|
||||
COPY ./go.mod ./go.sum ./
|
||||
RUN go mod download && rm go.mod go.sum
|
||||
@@ -1,4 +1,4 @@
|
||||
# Go Micro [](https://opensource.org/licenses/Apache-2.0) [](https://pkg.go.dev/github.com/asim/go-micro/v3?tab=doc) [](https://travis-ci.org/micro/go-micro) [](https://goreportcard.com/report/github.com/micro/go-micro)
|
||||
# Go Micro [](https://opensource.org/licenses/Apache-2.0) [](https://pkg.go.dev/github.com/asim/go-micro/v3?tab=doc)
|
||||
|
||||
Go Micro is a framework for distributed systems development.
|
||||
|
||||
@@ -65,7 +65,11 @@ service.Init()
|
||||
service.Run()
|
||||
```
|
||||
|
||||
See the [docs](https://github.com/micro/micro/tree/master/docs/v2) for detailed information on the architecture, installation and use of go-micro.
|
||||
See the [examples](https://github.com/micro/go-micro/tree/master/examples) for detailed information on usage.
|
||||
|
||||
## Command Line Interface
|
||||
|
||||
See [cmd/gomu](https://github.com/asim/go-micro/tree/master/cmd/gomu) for the command line interface.
|
||||
|
||||
## Code Generation
|
||||
|
||||
@@ -79,11 +83,10 @@ See [examples](https://github.com/micro/go-micro/tree/master/examples) directory
|
||||
|
||||
See [plugins](https://github.com/micro/go-micro/tree/master/plugins) directory for all the plugins.
|
||||
|
||||
## Services
|
||||
|
||||
See [services](https://github.com/micro/go-micro/tree/master/services) directory for third party services.
|
||||
|
||||
## License
|
||||
|
||||
Go Micro is Apache 2.0 licensed.
|
||||
|
||||
## Upgrade
|
||||
|
||||
[Micro](https://github.com/micro/micro) v3 consolidates Go Micro into it as a single unified platform.
|
||||
Please see the [upgrade guide](https://micro.mu/v2-to-v3-upgrade-guide).
|
||||
|
||||
@@ -122,7 +122,7 @@ func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
md["Host"] = r.Host
|
||||
md["Method"] = r.Method
|
||||
// get canonical headers
|
||||
for k, _ := range r.Header {
|
||||
for k := range r.Header {
|
||||
// may be need to get all values for key like r.Header.Values() provide in go 1.14
|
||||
md[textproto.CanonicalMIMEHeaderKey(k)] = r.Header.Get(k)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
go_api "github.com/asim/go-micro/v3/api/proto"
|
||||
@@ -27,7 +28,12 @@ func TestRequestPayloadFromRequest(t *testing.T) {
|
||||
t.Fatal("Failed to marshal proto to JSON ", err)
|
||||
}
|
||||
|
||||
jsonUrlBytes := []byte(`{"key1":"val1","key2":"val2","name":"Test"}`)
|
||||
type jsonUrl struct {
|
||||
Key1 string `json:"key1"`
|
||||
Key2 string `json:"key2"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
jUrl := &jsonUrl{Key1: "val1", Key2: "val2", Name: "Test"}
|
||||
|
||||
t.Run("extracting a json from a POST request with url params", func(t *testing.T) {
|
||||
r, err := http.NewRequest("POST", "http://localhost/my/path?key1=val1&key2=val2", bytes.NewReader(jsonBytes))
|
||||
@@ -39,8 +45,12 @@ func TestRequestPayloadFromRequest(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to extract payload from request: %v", err)
|
||||
}
|
||||
if string(extByte) != string(jsonUrlBytes) {
|
||||
t.Fatalf("Expected %v and %v to match", string(extByte), jsonUrlBytes)
|
||||
extJUrl := &jsonUrl{}
|
||||
if err := json.Unmarshal(extByte, extJUrl); err != nil {
|
||||
t.Fatalf("Failed to unmarshal payload from request: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(extJUrl, jUrl) {
|
||||
t.Fatalf("Expected %v and %v to match", extJUrl, jUrl)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ func serveWebsocket(ctx context.Context, w http.ResponseWriter, r *http.Request,
|
||||
}
|
||||
|
||||
hdr := make(http.Header)
|
||||
if proto, ok := r.Header["Sec-WebSocket-Protocol"]; ok {
|
||||
if proto, ok := r.Header["Sec-Websocket-Protocol"]; ok {
|
||||
for _, p := range proto {
|
||||
switch p {
|
||||
case "binary":
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package acme
|
||||
|
||||
import "github.com/go-acme/lego/v3/challenge"
|
||||
import "github.com/go-acme/lego/v4/challenge"
|
||||
|
||||
// Option (or Options) are passed to New() to configure providers
|
||||
type Option func(o *Options)
|
||||
|
||||
+37
-24
@@ -4,41 +4,54 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
AllowOrigin string
|
||||
AllowCredentials bool
|
||||
AllowMethods string
|
||||
AllowHeaders string
|
||||
}
|
||||
|
||||
// CombinedCORSHandler wraps a server and provides CORS headers
|
||||
func CombinedCORSHandler(h http.Handler) http.Handler {
|
||||
return corsHandler{h}
|
||||
}
|
||||
func CombinedCORSHandler(h http.Handler, config *Config) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if config != nil {
|
||||
SetHeaders(w, r, config)
|
||||
}
|
||||
if r.Method == "OPTIONS" {
|
||||
return
|
||||
}
|
||||
|
||||
type corsHandler struct {
|
||||
handler http.Handler
|
||||
}
|
||||
|
||||
func (c corsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
SetHeaders(w, r)
|
||||
|
||||
if r.Method == "OPTIONS" {
|
||||
return
|
||||
}
|
||||
|
||||
c.handler.ServeHTTP(w, r)
|
||||
h.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
// SetHeaders sets the CORS headers
|
||||
func SetHeaders(w http.ResponseWriter, r *http.Request) {
|
||||
func SetHeaders(w http.ResponseWriter, _ *http.Request, config *Config) {
|
||||
set := func(w http.ResponseWriter, k, v string) {
|
||||
if v := w.Header().Get(k); len(v) > 0 {
|
||||
return
|
||||
}
|
||||
w.Header().Set(k, v)
|
||||
}
|
||||
|
||||
if origin := r.Header.Get("Origin"); len(origin) > 0 {
|
||||
set(w, "Access-Control-Allow-Origin", origin)
|
||||
//For forward-compatible code, default values may not be provided in the future
|
||||
if config.AllowCredentials {
|
||||
set(w, "Access-Control-Allow-Credentials", "true")
|
||||
} else {
|
||||
set(w, "Access-Control-Allow-Origin", "*")
|
||||
set(w, "Access-Control-Allow-Credentials", "false")
|
||||
}
|
||||
if config.AllowOrigin == "" {
|
||||
set(w, "Access-Control-Allow-Origin", "*")
|
||||
} else {
|
||||
set(w, "Access-Control-Allow-Origin", config.AllowOrigin)
|
||||
}
|
||||
if config.AllowMethods == "" {
|
||||
set(w, "Access-Control-Allow-Methods", "POST, PATCH, GET, OPTIONS, PUT, DELETE")
|
||||
} else {
|
||||
set(w, "Access-Control-Allow-Methods", config.AllowMethods)
|
||||
}
|
||||
if config.AllowHeaders == "" {
|
||||
set(w, "Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
|
||||
} else {
|
||||
set(w, "Access-Control-Allow-Headers", config.AllowHeaders)
|
||||
}
|
||||
|
||||
set(w, "Access-Control-Allow-Credentials", "true")
|
||||
set(w, "Access-Control-Allow-Methods", "POST, PATCH, GET, OPTIONS, PUT, DELETE")
|
||||
set(w, "Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func (s *httpServer) Handle(path string, handler http.Handler) {
|
||||
|
||||
// wrap with cors
|
||||
if s.opts.EnableCORS {
|
||||
handler = cors.CombinedCORSHandler(handler)
|
||||
handler = cors.CombinedCORSHandler(handler, s.opts.CORSConfig)
|
||||
}
|
||||
|
||||
// wrap with logger
|
||||
|
||||
@@ -2,6 +2,8 @@ package http
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/asim/go-micro/v3/api/server"
|
||||
"github.com/asim/go-micro/v3/api/server/cors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"testing"
|
||||
@@ -39,3 +41,74 @@ func TestHTTPServer(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCORSHTTPServer(t *testing.T) {
|
||||
testResponse := "hello world"
|
||||
testAllowOrigin := "*"
|
||||
testAllowCredentials := true
|
||||
testAllowMethods := "GET"
|
||||
testAllowHeaders := "Accept, Content-Type, Content-Length"
|
||||
|
||||
s := NewServer("localhost:0",
|
||||
server.EnableCORS(true),
|
||||
server.CORSConfig(&cors.Config{
|
||||
AllowCredentials: testAllowCredentials,
|
||||
AllowOrigin: testAllowOrigin,
|
||||
AllowMethods: testAllowMethods,
|
||||
AllowHeaders: testAllowHeaders,
|
||||
}),
|
||||
)
|
||||
|
||||
s.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, testResponse)
|
||||
}))
|
||||
|
||||
if err := s.Start(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
rsp, err := http.Get(fmt.Sprintf("http://%s/", s.Address()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer rsp.Body.Close()
|
||||
|
||||
b, err := ioutil.ReadAll(rsp.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if string(b) != testResponse {
|
||||
t.Fatalf("Unexpected response, got %s, expected %s", string(b), testResponse)
|
||||
}
|
||||
|
||||
allowCredentials := rsp.Header.Get("Access-Control-Allow-Credentials")
|
||||
getTestCredentialsStr := func() string {
|
||||
if testAllowCredentials == true {
|
||||
return "true"
|
||||
} else {
|
||||
return "false"
|
||||
}
|
||||
}
|
||||
if getTestCredentialsStr() != allowCredentials {
|
||||
t.Fatalf("Unexpected Access-Control-Allow-Credentials, got %s, expected %s", allowCredentials, getTestCredentialsStr())
|
||||
}
|
||||
|
||||
allowOrigin := rsp.Header.Get("Access-Control-Allow-Origin")
|
||||
if testAllowOrigin != allowOrigin {
|
||||
t.Fatalf("Unexpected Access-Control-Allow-Origins, got %s, expected %s", allowOrigin, testAllowOrigin)
|
||||
}
|
||||
|
||||
allowMethods := rsp.Header.Get("Access-Control-Allow-Methods")
|
||||
if testAllowMethods != allowMethods {
|
||||
t.Fatalf("Unexpected Access-Control-Allow-Methods, got %s, expected %s", allowMethods, testAllowMethods)
|
||||
}
|
||||
allowHeaders := rsp.Header.Get("Access-Control-Allow-Headers")
|
||||
if testAllowHeaders != allowHeaders {
|
||||
t.Fatalf("Unexpected Access-Control-Allow-Headers, got %s, expected %s", allowHeaders, testAllowHeaders)
|
||||
}
|
||||
|
||||
if err := s.Stop(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package server
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"github.com/asim/go-micro/v3/api/server/cors"
|
||||
"net/http"
|
||||
|
||||
"github.com/asim/go-micro/v3/api/resolver"
|
||||
@@ -13,6 +14,7 @@ type Option func(o *Options)
|
||||
type Options struct {
|
||||
EnableACME bool
|
||||
EnableCORS bool
|
||||
CORSConfig *cors.Config
|
||||
ACMEProvider acme.Provider
|
||||
EnableTLS bool
|
||||
ACMEHosts []string
|
||||
@@ -35,6 +37,12 @@ func EnableCORS(b bool) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func CORSConfig(c *cors.Config) Option {
|
||||
return func(o *Options) {
|
||||
o.CORSConfig = c
|
||||
}
|
||||
}
|
||||
|
||||
func EnableACME(b bool) Option {
|
||||
return func(o *Options) {
|
||||
o.EnableACME = b
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ func Verify(rules []*Rule, acc *Account, res *Resource) error {
|
||||
// not case sensitive.
|
||||
func include(slice []string, val string) bool {
|
||||
for _, s := range slice {
|
||||
if strings.ToLower(s) == strings.ToLower(val) {
|
||||
if strings.EqualFold(s, val) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultCache is the default cache.
|
||||
DefaultCache Cache = NewCache()
|
||||
// DefaultExpiration is the default duration for items stored in
|
||||
// the cache to expire.
|
||||
DefaultExpiration time.Duration = 0
|
||||
|
||||
// ErrItemExpired is returned in Cache.Get when the item found in the cache
|
||||
// has expired.
|
||||
ErrItemExpired error = errors.New("item has expired")
|
||||
// ErrKeyNotFound is returned in Cache.Get and Cache.Delete when the
|
||||
// provided key could not be found in cache.
|
||||
ErrKeyNotFound error = errors.New("key not found in cache")
|
||||
)
|
||||
|
||||
// Cache is the interface that wraps the cache.
|
||||
//
|
||||
// Context specifies the context for the cache.
|
||||
// Get gets a cached value by key.
|
||||
// Put stores a key-value pair into cache.
|
||||
// Delete removes a key from cache.
|
||||
type Cache interface {
|
||||
Context(ctx context.Context) Cache
|
||||
Get(key string) (interface{}, time.Time, error)
|
||||
Put(key string, val interface{}, d time.Duration) error
|
||||
Delete(key string) error
|
||||
}
|
||||
|
||||
// Item represents an item stored in the cache.
|
||||
type Item struct {
|
||||
Value interface{}
|
||||
Expiration int64
|
||||
}
|
||||
|
||||
// Expired returns true if the item has expired.
|
||||
func (i *Item) Expired() bool {
|
||||
if i.Expiration == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
return time.Now().UnixNano() > i.Expiration
|
||||
}
|
||||
|
||||
// NewCache returns a new cache.
|
||||
func NewCache(opts ...Option) Cache {
|
||||
options := NewOptions(opts...)
|
||||
items := make(map[string]Item)
|
||||
|
||||
if len(options.Items) > 0 {
|
||||
items = options.Items
|
||||
}
|
||||
|
||||
return &memCache{
|
||||
opts: options,
|
||||
items: items,
|
||||
}
|
||||
}
|
||||
Vendored
+111
@@ -0,0 +1,111 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
ctx context.Context = context.TODO()
|
||||
key string = "test"
|
||||
val interface{} = "hello go-micro"
|
||||
)
|
||||
|
||||
// TestMemCache tests the in-memory cache implementation.
|
||||
func TestCache(t *testing.T) {
|
||||
t.Run("CacheGetMiss", func(t *testing.T) {
|
||||
if _, _, err := NewCache().Context(ctx).Get(key); err == nil {
|
||||
t.Error("expected to get no value from cache")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheGetHit", func(t *testing.T) {
|
||||
c := NewCache()
|
||||
|
||||
if err := c.Context(ctx).Put(key, val, 0); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if a, _, err := c.Context(ctx).Get(key); err != nil {
|
||||
t.Errorf("Expected a value, got err: %s", err)
|
||||
} else if a != val {
|
||||
t.Errorf("Expected '%v', got '%v'", val, a)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheGetExpired", func(t *testing.T) {
|
||||
c := NewCache()
|
||||
e := 20 * time.Millisecond
|
||||
|
||||
if err := c.Context(ctx).Put(key, val, e); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
<-time.After(25 * time.Millisecond)
|
||||
if _, _, err := c.Context(ctx).Get(key); err == nil {
|
||||
t.Error("expected to get no value from cache")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheGetValid", func(t *testing.T) {
|
||||
c := NewCache()
|
||||
e := 25 * time.Millisecond
|
||||
|
||||
if err := c.Context(ctx).Put(key, val, e); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
<-time.After(20 * time.Millisecond)
|
||||
if _, _, err := c.Context(ctx).Get(key); err != nil {
|
||||
t.Errorf("expected a value, got err: %s", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheDeleteMiss", func(t *testing.T) {
|
||||
if err := NewCache().Context(ctx).Delete(key); err == nil {
|
||||
t.Error("expected to delete no value from cache")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheDeleteHit", func(t *testing.T) {
|
||||
c := NewCache()
|
||||
|
||||
if err := c.Context(ctx).Put(key, val, 0); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if err := c.Context(ctx).Delete(key); err != nil {
|
||||
t.Errorf("Expected to delete an item, got err: %s", err)
|
||||
}
|
||||
|
||||
if _, _, err := c.Context(ctx).Get(key); err == nil {
|
||||
t.Errorf("Expected error")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestCacheWithOptions(t *testing.T) {
|
||||
t.Run("CacheWithExpiration", func(t *testing.T) {
|
||||
c := NewCache(Expiration(20 * time.Millisecond))
|
||||
|
||||
if err := c.Context(ctx).Put(key, val, 0); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
<-time.After(25 * time.Millisecond)
|
||||
if _, _, err := c.Context(ctx).Get(key); err == nil {
|
||||
t.Error("expected to get no value from cache")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CacheWithItems", func(t *testing.T) {
|
||||
c := NewCache(Items(map[string]Item{key: {val, 0}}))
|
||||
|
||||
if a, _, err := c.Context(ctx).Get(key); err != nil {
|
||||
t.Errorf("Expected a value, got err: %s", err)
|
||||
} else if a != val {
|
||||
t.Errorf("Expected '%v', got '%v'", val, a)
|
||||
}
|
||||
})
|
||||
}
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type memCache struct {
|
||||
opts Options
|
||||
sync.RWMutex
|
||||
ctx context.Context
|
||||
|
||||
items map[string]Item
|
||||
}
|
||||
|
||||
func (c *memCache) Context(ctx context.Context) Cache {
|
||||
c.ctx = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *memCache) Get(key string) (interface{}, time.Time, error) {
|
||||
c.RWMutex.Lock()
|
||||
defer c.RWMutex.Unlock()
|
||||
|
||||
item, found := c.items[key]
|
||||
if !found {
|
||||
return nil, time.Time{}, ErrKeyNotFound
|
||||
}
|
||||
if item.Expired() {
|
||||
return nil, time.Time{}, ErrItemExpired
|
||||
}
|
||||
|
||||
return item.Value, time.Unix(0, item.Expiration), nil
|
||||
}
|
||||
|
||||
func (c *memCache) Put(key string, val interface{}, d time.Duration) error {
|
||||
var e int64
|
||||
if d == DefaultExpiration {
|
||||
d = c.opts.Expiration
|
||||
}
|
||||
if d > 0 {
|
||||
e = time.Now().Add(d).UnixNano()
|
||||
}
|
||||
|
||||
c.RWMutex.Lock()
|
||||
defer c.RWMutex.Unlock()
|
||||
|
||||
c.items[key] = Item{
|
||||
Value: val,
|
||||
Expiration: e,
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *memCache) Delete(key string) error {
|
||||
c.RWMutex.Lock()
|
||||
defer c.RWMutex.Unlock()
|
||||
|
||||
_, found := c.items[key]
|
||||
if !found {
|
||||
return ErrKeyNotFound
|
||||
}
|
||||
|
||||
delete(c.items, key)
|
||||
return nil
|
||||
}
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
package cache
|
||||
|
||||
import "time"
|
||||
|
||||
// Options represents the options for the cache.
|
||||
type Options struct {
|
||||
Expiration time.Duration
|
||||
Items map[string]Item
|
||||
}
|
||||
|
||||
// Option manipulates the Options passed.
|
||||
type Option func(o *Options)
|
||||
|
||||
// Expiration sets the duration for items stored in the cache to expire.
|
||||
func Expiration(d time.Duration) Option {
|
||||
return func(o *Options) {
|
||||
o.Expiration = d
|
||||
}
|
||||
}
|
||||
|
||||
// Items initializes the cache with preconfigured items.
|
||||
func Items(i map[string]Item) Option {
|
||||
return func(o *Options) {
|
||||
o.Items = i
|
||||
}
|
||||
}
|
||||
|
||||
// NewOptions returns a new options struct.
|
||||
func NewOptions(opts ...Option) Options {
|
||||
options := Options{
|
||||
Expiration: DefaultExpiration,
|
||||
Items: make(map[string]Item),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestOptions(t *testing.T) {
|
||||
testData := map[string]struct {
|
||||
set bool
|
||||
expiration time.Duration
|
||||
items map[string]Item
|
||||
}{
|
||||
"DefaultOptions": {false, DefaultExpiration, map[string]Item{}},
|
||||
"ModifiedOptions": {true, time.Second, map[string]Item{"test": {"hello go-micro", 0}}},
|
||||
}
|
||||
|
||||
for k, d := range testData {
|
||||
t.Run(k, func(t *testing.T) {
|
||||
var opts Options
|
||||
|
||||
if d.set {
|
||||
opts = NewOptions(
|
||||
Expiration(d.expiration),
|
||||
Items(d.items),
|
||||
)
|
||||
} else {
|
||||
opts = NewOptions()
|
||||
}
|
||||
|
||||
// test options
|
||||
for _, o := range []Options{opts} {
|
||||
if o.Expiration != d.expiration {
|
||||
t.Fatalf("Expected expiration '%v', got '%v'", d.expiration, o.Expiration)
|
||||
}
|
||||
|
||||
if o.Items["test"] != d.items["test"] {
|
||||
t.Fatalf("Expected items %#v, got %#v", d.items, o.Items)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,10 @@ import (
|
||||
)
|
||||
|
||||
type rpcClient struct {
|
||||
seq uint64
|
||||
once atomic.Value
|
||||
opts Options
|
||||
pool pool.Pool
|
||||
seq uint64
|
||||
}
|
||||
|
||||
func newRpcClient(opt ...Option) Client {
|
||||
@@ -379,7 +379,7 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
|
||||
} else {
|
||||
// got a deadline so no need to setup context
|
||||
// but we need to set the timeout we pass along
|
||||
opt := WithRequestTimeout(d.Sub(time.Now()))
|
||||
opt := WithRequestTimeout(time.Until(d))
|
||||
opt(&callOpts)
|
||||
}
|
||||
|
||||
|
||||
+32
-3
@@ -7,13 +7,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
|
||||
"github.com/asim/go-micro/v3/auth"
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/cache"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/debug/profile"
|
||||
"github.com/asim/go-micro/v3/debug/profile/http"
|
||||
"github.com/asim/go-micro/v3/debug/profile/pprof"
|
||||
"github.com/asim/go-micro/v3/debug/trace"
|
||||
"github.com/asim/go-micro/v3/logger"
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
@@ -22,6 +23,7 @@ import (
|
||||
"github.com/asim/go-micro/v3/server"
|
||||
"github.com/asim/go-micro/v3/store"
|
||||
"github.com/asim/go-micro/v3/transport"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
type Cmd interface {
|
||||
@@ -258,9 +260,14 @@ var (
|
||||
|
||||
DefaultAuths = map[string]func(...auth.Option) auth.Auth{}
|
||||
|
||||
DefaultProfiles = map[string]func(...profile.Option) profile.Profile{}
|
||||
DefaultProfiles = map[string]func(...profile.Option) profile.Profile{
|
||||
"http": http.NewProfile,
|
||||
"pprof": pprof.NewProfile,
|
||||
}
|
||||
|
||||
DefaultConfigs = map[string]func(...config.Option) (config.Config, error){}
|
||||
|
||||
DefaultCaches = map[string]func(...cache.Option) cache.Cache{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -281,6 +288,7 @@ func newCmd(opts ...Option) Cmd {
|
||||
Tracer: &trace.DefaultTracer,
|
||||
Profile: &profile.DefaultProfile,
|
||||
Config: &config.DefaultConfig,
|
||||
Cache: &cache.DefaultCache,
|
||||
|
||||
Brokers: DefaultBrokers,
|
||||
Clients: DefaultClients,
|
||||
@@ -294,6 +302,7 @@ func newCmd(opts ...Option) Cmd {
|
||||
Auths: DefaultAuths,
|
||||
Profiles: DefaultProfiles,
|
||||
Configs: DefaultConfigs,
|
||||
Caches: DefaultCaches,
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
@@ -399,6 +408,14 @@ func (c *cmd) Before(ctx *cli.Context) error {
|
||||
if len(ctx.String("auth_namespace")) > 0 {
|
||||
authOpts = append(authOpts, auth.Namespace(ctx.String("auth_namespace")))
|
||||
}
|
||||
if name := ctx.String("auth"); len(name) > 0 {
|
||||
r, ok := c.opts.Auths[name]
|
||||
if !ok {
|
||||
return fmt.Errorf("Unsupported auth: %s", name)
|
||||
}
|
||||
|
||||
*c.opts.Auth = r(authOpts...)
|
||||
}
|
||||
|
||||
// Set the registry
|
||||
if name := ctx.String("registry"); len(name) > 0 && (*c.opts.Registry).String() != name {
|
||||
@@ -595,6 +612,18 @@ func (c *cmd) Before(ctx *cli.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// config
|
||||
if name := ctx.String("config"); len(name) > 0 {
|
||||
// only change if we have the server and type differs
|
||||
if r, ok := c.opts.Configs[name]; ok {
|
||||
rc, err := r()
|
||||
if err != nil {
|
||||
logger.Fatalf("Error configuring config: %v", err)
|
||||
}
|
||||
*c.opts.Config = rc
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
_build
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
|
||||
# ignore go build and test outputs
|
||||
coverage.txt
|
||||
coverage.out
|
||||
|
||||
# ignore locally built binaries
|
||||
gomu
|
||||
dist
|
||||
@@ -0,0 +1,389 @@
|
||||
# Gomu
|
||||
|
||||
Gomu is a helper tool for developing [Go Micro][1] projects.
|
||||
|
||||
## Getting Started
|
||||
|
||||
[Download][2] and install **Go**. Version `1.16` or higher is required.
|
||||
|
||||
Installation is done by using the [`go install`][3] command.
|
||||
|
||||
```bash
|
||||
go install github.com/asim/go-micro/cmd/gomu@latest
|
||||
```
|
||||
|
||||
Let's create a new service using the `new` command.
|
||||
|
||||
```bash
|
||||
gomu new service helloworld
|
||||
```
|
||||
|
||||
Follow the on-screen instructions. Next, we can run the program.
|
||||
|
||||
```bash
|
||||
cd helloworld
|
||||
make proto tidy
|
||||
gomu run
|
||||
```
|
||||
|
||||
Finally we can call the service.
|
||||
|
||||
```bash
|
||||
gomu call helloworld Helloworld.Call '{"name": "John"}'
|
||||
```
|
||||
|
||||
That's all you need to know to get started. Refer to the [Go Micro][1]
|
||||
documentation for more info on developing services.
|
||||
|
||||
## Dependencies
|
||||
|
||||
You will need protoc-gen-micro for code generation
|
||||
|
||||
* [protobuf][4]
|
||||
* [protoc-gen-go][5]
|
||||
* [protoc-gen-micro][6]
|
||||
|
||||
```bash
|
||||
# Download latest proto release
|
||||
# https://github.com/protocolbuffers/protobuf/releases
|
||||
go get -u google.golang.org/protobuf/proto
|
||||
go install github.com/golang/protobuf/protoc-gen-go@latest
|
||||
go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest
|
||||
```
|
||||
|
||||
## Creating A Service
|
||||
|
||||
To create a new service, use the `gomu new service` command.
|
||||
|
||||
```bash
|
||||
$ gomu new service helloworld
|
||||
creating service helloworld
|
||||
|
||||
download protoc zip packages (protoc-$VERSION-$PLATFORM.zip) and install:
|
||||
|
||||
visit https://github.com/protocolbuffers/protobuf/releases/latest
|
||||
|
||||
download protobuf for go-micro:
|
||||
|
||||
go get -u google.golang.org/protobuf/proto
|
||||
go install github.com/golang/protobuf/protoc-gen-go@latest
|
||||
go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest
|
||||
|
||||
compile the proto file helloworld.proto:
|
||||
|
||||
cd helloworld
|
||||
make proto tidy
|
||||
```
|
||||
|
||||
To create a new function, use the `gomu new function` command. Functions differ
|
||||
from services in that they exit after returning.
|
||||
|
||||
```bash
|
||||
$ gomu new function helloworld
|
||||
creating function helloworld
|
||||
|
||||
download protoc zip packages (protoc-$VERSION-$PLATFORM.zip) and install:
|
||||
|
||||
visit https://github.com/protocolbuffers/protobuf/releases/latest
|
||||
|
||||
download protobuf for go-micro:
|
||||
|
||||
go get -u google.golang.org/protobuf/proto
|
||||
go install github.com/golang/protobuf/protoc-gen-go@latest
|
||||
go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest
|
||||
|
||||
compile the proto file helloworld.proto:
|
||||
|
||||
cd helloworld
|
||||
make proto tidy
|
||||
```
|
||||
|
||||
### Jaeger
|
||||
|
||||
To create a new service with [Jaeger][7] integration, pass the `--jaeger` flag
|
||||
to the `gomu new service` or `gomu new function` commands. You may configure
|
||||
the Jaeger client using [environment variables][8].
|
||||
|
||||
```bash
|
||||
gomu new service --jaeger helloworld
|
||||
```
|
||||
|
||||
You may invoke `trace.NewSpan(context.Context).Finish()` to nest spans. For
|
||||
example, consider the following handler implementing a greeter.
|
||||
|
||||
`handler/helloworld.go`
|
||||
|
||||
```go
|
||||
package helloworld
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
|
||||
"helloworld/greeter"
|
||||
pb "helloworld/proto"
|
||||
)
|
||||
|
||||
type Helloworld struct{}
|
||||
|
||||
func (e *Helloworld) Call(ctx context.Context, req pb.CallRequest, rsp *pb.CallResponse) error {
|
||||
log.Infof("Received Helloworld.Call request: %v", req)
|
||||
rsp.Msg = greeter.Greet(ctx, req.Name)
|
||||
return nil
|
||||
}
|
||||
```
|
||||
|
||||
`greeter/greeter.go`
|
||||
|
||||
```go
|
||||
package greeter
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/debug/trace"
|
||||
)
|
||||
|
||||
func Greet(ctx context.Context, name string) string {
|
||||
defer trace.NewSpan(ctx).Finish()
|
||||
return fmt.Sprint("Hello " + name)
|
||||
}
|
||||
```
|
||||
|
||||
### Skaffold
|
||||
|
||||
To create a new service with [Skaffold][9] files, pass the `--skaffold` flag to
|
||||
the `gomu new service` or `gomu new function` commands.
|
||||
|
||||
```bash
|
||||
gomu new service --skaffold helloworld
|
||||
```
|
||||
|
||||
## Running A Service
|
||||
|
||||
To run a service, use the `gomu run` command to build and run your service
|
||||
continuously.
|
||||
|
||||
```bash
|
||||
$ gomu run
|
||||
2021-08-20 14:05:54 file=v3@v3.5.2/service.go:199 level=info Starting [service] helloworld
|
||||
2021-08-20 14:05:54 file=server/rpc_server.go:820 level=info Transport [http] Listening on [::]:34531
|
||||
2021-08-20 14:05:54 file=server/rpc_server.go:840 level=info Broker [http] Connected to 127.0.0.1:44975
|
||||
2021-08-20 14:05:54 file=server/rpc_server.go:654 level=info Registry [mdns] Registering node: helloworld-45f43a6f-5fc0-4b0d-af73-e4a10c36ef54
|
||||
```
|
||||
|
||||
### With Docker
|
||||
|
||||
To run a service with Docker, build the Docker image and run the Docker
|
||||
container.
|
||||
|
||||
```bash
|
||||
$ make docker
|
||||
$ docker run helloworld:latest
|
||||
2021-08-20 12:07:31 file=v3@v3.5.2/service.go:199 level=info Starting [service] helloworld
|
||||
2021-08-20 12:07:31 file=server/rpc_server.go:820 level=info Transport [http] Listening on [::]:36037
|
||||
2021-08-20 12:07:31 file=server/rpc_server.go:840 level=info Broker [http] Connected to 127.0.0.1:46157
|
||||
2021-08-20 12:07:31 file=server/rpc_server.go:654 level=info Registry [mdns] Registering node: helloworld-31f58714-72f5-4d12-b2eb-98f66aea7a34
|
||||
```
|
||||
|
||||
### With Skaffold
|
||||
|
||||
When you've created your service using the `--skaffold` flag, you may run the
|
||||
Skaffold pipeline using the `skaffold` command.
|
||||
|
||||
```bash
|
||||
skaffold dev
|
||||
```
|
||||
|
||||
## Creating A Client
|
||||
|
||||
To create a new client, use the `gomu new client` command. The name is the
|
||||
service you'd like to create a client project for.
|
||||
|
||||
```bash
|
||||
$ gomu new client helloworld
|
||||
creating client helloworld
|
||||
cd helloworld-client
|
||||
make tidy
|
||||
```
|
||||
|
||||
You may optionally pass the fully qualified package name of the service you'd
|
||||
like to create a client project for.
|
||||
|
||||
```bash
|
||||
$ gomu new client github.com/auditemarlow/helloworld
|
||||
creating client helloworld
|
||||
cd helloworld-client
|
||||
make tidy
|
||||
```
|
||||
|
||||
## Running A Client
|
||||
|
||||
To run a client, use the `gomu run` command to build and run your client
|
||||
continuously.
|
||||
|
||||
```bash
|
||||
$ gomu run
|
||||
2021-09-03 12:52:23 file=helloworld-client/main.go:33 level=info msg:"Hello John"
|
||||
```
|
||||
|
||||
## Generating Files
|
||||
|
||||
To generate Go Micro project template files after the fact, use the `gomu
|
||||
generate` command. It will place the generated files in the current working
|
||||
directory.
|
||||
|
||||
```bash
|
||||
$ gomu generate skaffold
|
||||
skaffold project template files generated
|
||||
```
|
||||
|
||||
## Listing Services
|
||||
|
||||
To list services, use the `gomu services` command.
|
||||
|
||||
```bash
|
||||
$ gomu services
|
||||
helloworld
|
||||
```
|
||||
|
||||
## Describing A Service
|
||||
|
||||
To describe a service, use the `gomu describe service` command.
|
||||
|
||||
```bash
|
||||
$ gomu describe service helloworld
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "latest",
|
||||
"metadata": null,
|
||||
"endpoints": [
|
||||
{
|
||||
"name": "Helloworld.Call",
|
||||
"request": {
|
||||
"name": "CallRequest",
|
||||
"type": "CallRequest",
|
||||
"values": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"values": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"name": "CallResponse",
|
||||
"type": "CallResponse",
|
||||
"values": [
|
||||
{
|
||||
"name": "msg",
|
||||
"type": "string",
|
||||
"values": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "helloworld-9660f06a-d608-43d9-9f44-e264ff63c554",
|
||||
"address": "172.26.165.161:45059",
|
||||
"metadata": {
|
||||
"broker": "http",
|
||||
"protocol": "mucp",
|
||||
"registry": "mdns",
|
||||
"server": "mucp",
|
||||
"transport": "http"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You may pass the `--format=yaml` flag to output a YAML formatted object.
|
||||
|
||||
```bash
|
||||
$ gomu describe service --format=yaml helloworld
|
||||
name: helloworld
|
||||
version: latest
|
||||
metadata: {}
|
||||
endpoints:
|
||||
- name: Helloworld.Call
|
||||
request:
|
||||
name: CallRequest
|
||||
type: CallRequest
|
||||
values:
|
||||
- name: name
|
||||
type: string
|
||||
values: []
|
||||
response:
|
||||
name: CallResponse
|
||||
type: CallResponse
|
||||
values:
|
||||
- name: msg
|
||||
type: string
|
||||
values: []
|
||||
nodes:
|
||||
- id: helloworld-9660f06a-d608-43d9-9f44-e264ff63c554
|
||||
address: 172.26.165.161:45059
|
||||
metadata:
|
||||
broker: http
|
||||
protocol: mucp
|
||||
registry: mdns
|
||||
server: mucp
|
||||
transport: http
|
||||
```
|
||||
|
||||
## Calling A Service
|
||||
|
||||
To call a service, use the `gomu call` command. This will send a single request
|
||||
and expect a single response.
|
||||
|
||||
```bash
|
||||
$ gomu call helloworld Helloworld.Call '{"name": "John"}'
|
||||
{"msg":"Hello John"}
|
||||
```
|
||||
|
||||
To call a service's server stream, use the `gomu stream server` command. This
|
||||
will send a single request and expect a stream of responses.
|
||||
|
||||
```bash
|
||||
$ gomu stream server helloworld Helloworld.ServerStream '{"count": 10}'
|
||||
{"count":0}
|
||||
{"count":1}
|
||||
{"count":2}
|
||||
{"count":3}
|
||||
{"count":4}
|
||||
{"count":5}
|
||||
{"count":6}
|
||||
{"count":7}
|
||||
{"count":8}
|
||||
{"count":9}
|
||||
```
|
||||
|
||||
To call a service's bidirectional stream, use the `gomu stream bidi` command.
|
||||
This will send a stream of requests and expect a stream of responses.
|
||||
|
||||
```bash
|
||||
$ gomu stream bidi helloworld Helloworld.BidiStream '{"stroke": 1}' '{"stroke": 2}' '{"stroke": 3}'
|
||||
{"stroke":1}
|
||||
{"stroke":2}
|
||||
{"stroke":3}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This software is published under the [MIT license][10].
|
||||
|
||||
[1]: https://github.com/asim/go-micro
|
||||
[2]: https://golang.org/dl/
|
||||
[3]: https://golang.org/cmd/go/#hdr-Compile_and_install_packages_and_dependencies
|
||||
[4]: https://grpc.io/docs/protoc-installation/
|
||||
[5]: https://micro.mu/github.com/golang/protobuf/protoc-gen-go
|
||||
[6]: https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro
|
||||
[7]: https://www.jaegertracing.io/
|
||||
[8]: https://github.com/jaegertracing/jaeger-client-go#environment-variables
|
||||
[9]: https://skaffold.dev/
|
||||
[10]: LICENSE
|
||||
@@ -0,0 +1,63 @@
|
||||
package call
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "call",
|
||||
Usage: "Call a service, e.g. " + cmd.App().Name + " call helloworld Helloworld.Call '{\"name\": \"John\"}'",
|
||||
Action: RunCall,
|
||||
})
|
||||
}
|
||||
|
||||
// RunCall calls a service endpoint and prints its response. Exits on error.
|
||||
func RunCall(ctx *cli.Context) error {
|
||||
args := ctx.Args().Slice()
|
||||
if len(args) < 2 {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
|
||||
service := args[0]
|
||||
endpoint := args[1]
|
||||
req := strings.Join(args[2:], " ")
|
||||
if len(req) == 0 {
|
||||
req = `{}`
|
||||
}
|
||||
|
||||
d := json.NewDecoder(strings.NewReader(req))
|
||||
d.UseNumber()
|
||||
|
||||
var creq map[string]interface{}
|
||||
if err := d.Decode(&creq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
srv := micro.NewService()
|
||||
srv.Init()
|
||||
c := srv.Client()
|
||||
|
||||
request := c.NewRequest(service, endpoint, creq, client.WithContentType("application/json"))
|
||||
var response map[string]interface{}
|
||||
|
||||
if err := c.Call(context.Background(), request, &response); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
b, err := json.Marshal(response)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(string(b))
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/call"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/describe"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/generate"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/new"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/run"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/services"
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli/stream"
|
||||
)
|
||||
@@ -0,0 +1,30 @@
|
||||
package describe
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var flags []cli.Flag = []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "format",
|
||||
Value: "json",
|
||||
Usage: "output a formatted description, e.g. json or yaml",
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "describe",
|
||||
Usage: "Describe a resource",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "service",
|
||||
Aliases: []string{"s"},
|
||||
Usage: "Describe a service resource, e.g. " + cmd.App().Name + " describe service helloworld",
|
||||
Action: Service,
|
||||
Flags: flags,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package describe
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/urfave/cli/v2"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
// Service fetches information for a service from the registry and prints it in
|
||||
// either JSON or YAML, depending on the format flag passed. Exits on error.
|
||||
func Service(ctx *cli.Context) error {
|
||||
args := ctx.Args().Slice()
|
||||
if len(args) < 1 {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
if ctx.String("format") != "json" && ctx.String("format") != "yaml" {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
|
||||
r := *cmd.DefaultOptions().Registry
|
||||
srvs, err := r.GetService(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(srvs) == 0 {
|
||||
return fmt.Errorf("service %s not found", args[0])
|
||||
}
|
||||
|
||||
for _, srv := range srvs {
|
||||
var b []byte
|
||||
var err error
|
||||
if ctx.String("format") == "json" {
|
||||
b, err = json.MarshalIndent(srv, "", " ")
|
||||
} else if ctx.String("format") == "yaml" {
|
||||
b, err = yaml.Marshal(srv)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package generate
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/asim/go-micro/cmd/gomu/generator"
|
||||
tmpl "github.com/asim/go-micro/cmd/gomu/generator/template"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "generate",
|
||||
Usage: "Generate project template files after the fact",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "kubernetes",
|
||||
Usage: "Generate Kubernetes resource template files",
|
||||
Action: Kubernetes,
|
||||
},
|
||||
{
|
||||
Name: "skaffold",
|
||||
Usage: "Generate Skaffold template files",
|
||||
Action: Skaffold,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Kubernetes generates Kubernetes resource template files in the current
|
||||
// working directory. Exits on error.
|
||||
func Kubernetes(ctx *cli.Context) error {
|
||||
service, err := getService()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vendor, err := getServiceVendor(service)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
g := generator.New(
|
||||
generator.Service(service),
|
||||
generator.Vendor(vendor),
|
||||
generator.Directory("."),
|
||||
generator.Client(strings.HasSuffix(service, "-client")),
|
||||
)
|
||||
|
||||
files := []generator.File{
|
||||
{"plugins.go", tmpl.Plugins},
|
||||
{"resources/clusterrole.yaml", tmpl.KubernetesClusterRole},
|
||||
{"resources/configmap.yaml", tmpl.KubernetesEnv},
|
||||
{"resources/deployment.yaml", tmpl.KubernetesDeployment},
|
||||
{"resources/rolebinding.yaml", tmpl.KubernetesRoleBinding},
|
||||
}
|
||||
|
||||
g.Generate(files)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Skaffold generates Skaffold template files in the current working directory.
|
||||
// Exits on error.
|
||||
func Skaffold(ctx *cli.Context) error {
|
||||
service, err := getService()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vendor, err := getServiceVendor(service)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
g := generator.New(
|
||||
generator.Service(service),
|
||||
generator.Vendor(vendor),
|
||||
generator.Directory("."),
|
||||
generator.Client(strings.HasSuffix(service, "-client")),
|
||||
generator.Skaffold(true),
|
||||
)
|
||||
|
||||
files := []generator.File{
|
||||
{".dockerignore", tmpl.DockerIgnore},
|
||||
{"go.mod", tmpl.Module},
|
||||
{"plugins.go", tmpl.Plugins},
|
||||
{"resources/clusterrole.yaml", tmpl.KubernetesClusterRole},
|
||||
{"resources/configmap.yaml", tmpl.KubernetesEnv},
|
||||
{"resources/deployment.yaml", tmpl.KubernetesDeployment},
|
||||
{"resources/rolebinding.yaml", tmpl.KubernetesRoleBinding},
|
||||
{"skaffold.yaml", tmpl.SkaffoldCFG},
|
||||
}
|
||||
|
||||
if err := g.Generate(files); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("skaffold project template files generated")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getService() (string, error) {
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return dir[strings.LastIndex(dir, "/")+1:], nil
|
||||
}
|
||||
|
||||
func getServiceVendor(s string) (string, error) {
|
||||
f, err := os.Open("go.mod")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
line := ""
|
||||
scanner := bufio.NewScanner(f)
|
||||
for scanner.Scan() {
|
||||
if strings.HasPrefix(scanner.Text(), "module ") {
|
||||
line = scanner.Text()
|
||||
break
|
||||
|
||||
}
|
||||
}
|
||||
if line == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
module := line[strings.LastIndex(line, " ")+1:]
|
||||
if module == s {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return module[:strings.LastIndex(module, "/")] + "/", nil
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package new
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/asim/go-micro/cmd/gomu/generator"
|
||||
tmpl "github.com/asim/go-micro/cmd/gomu/generator/template"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var flags []cli.Flag = []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "jaeger",
|
||||
Usage: "Generate Jaeger tracer files",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "kubernetes",
|
||||
Usage: "Generate Kubernetes resource files",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "skaffold",
|
||||
Usage: "Generate Skaffold files",
|
||||
},
|
||||
}
|
||||
|
||||
// NewCommand returns a new new cli command.
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "new",
|
||||
Usage: "Create a project template",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "client",
|
||||
Usage: "Create a client template, e.g. " + cmd.App().Name + " new client [github.com/auditemarlow/]helloworld",
|
||||
Action: Client,
|
||||
Flags: flags,
|
||||
},
|
||||
{
|
||||
Name: "function",
|
||||
Usage: "Create a function template, e.g. " + cmd.App().Name + " new function [github.com/auditemarlow/]helloworld",
|
||||
Action: Function,
|
||||
Flags: flags,
|
||||
},
|
||||
{
|
||||
Name: "service",
|
||||
Usage: "Create a service template, e.g. " + cmd.App().Name + " new service [github.com/auditemarlow/]helloworld",
|
||||
Action: Service,
|
||||
Flags: flags,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func Client(ctx *cli.Context) error {
|
||||
return createProject(ctx, "client")
|
||||
}
|
||||
|
||||
// Function creates a new function project template. Exits on error.
|
||||
func Function(ctx *cli.Context) error {
|
||||
return createProject(ctx, "function")
|
||||
}
|
||||
|
||||
// Service creates a new service project template. Exits on error.
|
||||
func Service(ctx *cli.Context) error {
|
||||
return createProject(ctx, "service")
|
||||
}
|
||||
|
||||
func createProject(ctx *cli.Context, pt string) error {
|
||||
arg := ctx.Args().First()
|
||||
if len(arg) == 0 {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
|
||||
client := pt == "client"
|
||||
name, vendor := getNameAndVendor(arg)
|
||||
|
||||
dir := name
|
||||
if client {
|
||||
dir += "-client"
|
||||
}
|
||||
|
||||
if path.IsAbs(dir) {
|
||||
fmt.Println("must provide a relative path as service name")
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := os.Stat(dir); !os.IsNotExist(err) {
|
||||
return fmt.Errorf("%s already exists", dir)
|
||||
}
|
||||
|
||||
fmt.Printf("creating %s %s\n", pt, name)
|
||||
|
||||
g := generator.New(
|
||||
generator.Service(name),
|
||||
generator.Vendor(vendor),
|
||||
generator.Directory(dir),
|
||||
generator.Client(client),
|
||||
generator.Jaeger(ctx.Bool("jaeger")),
|
||||
generator.Skaffold(ctx.Bool("skaffold")),
|
||||
)
|
||||
|
||||
files := []generator.File{
|
||||
{".dockerignore", tmpl.DockerIgnore},
|
||||
{".gitignore", tmpl.GitIgnore},
|
||||
{"Dockerfile", tmpl.Dockerfile},
|
||||
{"Makefile", tmpl.Makefile},
|
||||
{"go.mod", tmpl.Module},
|
||||
}
|
||||
|
||||
switch pt {
|
||||
case "client":
|
||||
files = append(files, []generator.File{
|
||||
{"main.go", tmpl.MainCLT},
|
||||
}...)
|
||||
case "function":
|
||||
files = append(files, []generator.File{
|
||||
{"handler/" + name + ".go", tmpl.HandlerFNC},
|
||||
{"main.go", tmpl.MainFNC},
|
||||
{"proto/" + name + ".proto", tmpl.ProtoFNC},
|
||||
}...)
|
||||
case "service":
|
||||
files = append(files, []generator.File{
|
||||
{"handler/" + name + ".go", tmpl.HandlerSRV},
|
||||
{"main.go", tmpl.MainSRV},
|
||||
{"proto/" + name + ".proto", tmpl.ProtoSRV},
|
||||
}...)
|
||||
default:
|
||||
return fmt.Errorf("%s project type not supported", pt)
|
||||
}
|
||||
|
||||
if ctx.Bool("kubernetes") || ctx.Bool("skaffold") {
|
||||
files = append(files, []generator.File{
|
||||
{"plugins.go", tmpl.Plugins},
|
||||
{"resources/clusterrole.yaml", tmpl.KubernetesClusterRole},
|
||||
{"resources/configmap.yaml", tmpl.KubernetesEnv},
|
||||
{"resources/deployment.yaml", tmpl.KubernetesDeployment},
|
||||
{"resources/rolebinding.yaml", tmpl.KubernetesRoleBinding},
|
||||
}...)
|
||||
}
|
||||
|
||||
if ctx.Bool("skaffold") {
|
||||
files = append(files, []generator.File{
|
||||
{"skaffold.yaml", tmpl.SkaffoldCFG},
|
||||
}...)
|
||||
}
|
||||
|
||||
if err := g.Generate(files); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var comments []string
|
||||
if client {
|
||||
comments = clientComments(name, dir)
|
||||
} else {
|
||||
comments = protoComments(name, dir)
|
||||
}
|
||||
|
||||
for _, comment := range comments {
|
||||
fmt.Println(comment)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func clientComments(name, dir string) []string {
|
||||
return []string{
|
||||
"cd " + dir,
|
||||
"make tidy\n",
|
||||
}
|
||||
}
|
||||
|
||||
func protoComments(name, dir string) []string {
|
||||
return []string{
|
||||
"\ndownload protoc zip packages (protoc-$VERSION-$PLATFORM.zip) and install:\n",
|
||||
"visit https://github.com/protocolbuffers/protobuf/releases/latest",
|
||||
"\ndownload protobuf for go-micro:\n",
|
||||
"go get -u google.golang.org/protobuf/proto",
|
||||
"go install github.com/golang/protobuf/protoc-gen-go@latest",
|
||||
"go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest",
|
||||
"\ncompile the proto file " + name + ".proto:\n",
|
||||
"cd " + dir,
|
||||
"make proto tidy\n",
|
||||
}
|
||||
}
|
||||
|
||||
func getNameAndVendor(s string) (string, string) {
|
||||
var n string
|
||||
var v string
|
||||
|
||||
if i := strings.LastIndex(s, "/"); i == -1 {
|
||||
n = s
|
||||
v = ""
|
||||
} else {
|
||||
n = s[i+1:]
|
||||
v = s[:i+1]
|
||||
}
|
||||
|
||||
return n, v
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package run
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/asim/go-micro/v3/runtime"
|
||||
"github.com/asim/go-micro/v3/runtime/local/git"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
DefaultRetries = 3
|
||||
|
||||
flags []cli.Flag = []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "command",
|
||||
Usage: "command to execute",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "args",
|
||||
Usage: "command arguments",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "type",
|
||||
Usage: "the type of service to operate on",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "run",
|
||||
Usage: "Build and run a service continuously, e.g. gomu run [github.com/auditemarlow/helloworld]",
|
||||
Flags: flags,
|
||||
Action: Run,
|
||||
})
|
||||
}
|
||||
|
||||
// Run runs a service and watches the project directory for change events. On
|
||||
// write, the service is restarted. Exits on error.
|
||||
func Run(ctx *cli.Context) error {
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
source, err := git.ParseSourceLocal(wd, ctx.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
svc := &runtime.Service{
|
||||
Name: source.RuntimeName(),
|
||||
Source: source.RuntimeSource(),
|
||||
Version: source.Ref,
|
||||
Metadata: make(map[string]string),
|
||||
}
|
||||
|
||||
typ := ctx.String("type")
|
||||
command := strings.TrimSpace(ctx.String("command"))
|
||||
args := strings.TrimSpace(ctx.String("args"))
|
||||
|
||||
r := *cmd.DefaultCmd.Options().Runtime
|
||||
|
||||
var retries = DefaultRetries
|
||||
if ctx.IsSet("retries") {
|
||||
retries = ctx.Int("retries")
|
||||
}
|
||||
|
||||
opts := []runtime.CreateOption{
|
||||
runtime.WithOutput(os.Stdout),
|
||||
runtime.WithRetries(retries),
|
||||
runtime.CreateType(typ),
|
||||
}
|
||||
|
||||
if len(command) > 0 {
|
||||
opts = append(opts, runtime.WithCommand(command))
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
opts = append(opts, runtime.WithArgs(args))
|
||||
}
|
||||
|
||||
if err := r.Create(svc, opts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
done := make(chan bool)
|
||||
if r.String() == "local" {
|
||||
sig := make(chan os.Signal)
|
||||
signal.Notify(sig, os.Interrupt)
|
||||
go func() {
|
||||
<-sig
|
||||
r.Delete(svc)
|
||||
done <- true
|
||||
}()
|
||||
}
|
||||
|
||||
if source.Local {
|
||||
watcher, err := fsnotify.NewWatcher()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
defer watcher.Close()
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case event, ok := <-watcher.Events:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if event.Op&fsnotify.Write == fsnotify.Write {
|
||||
r.Update(svc)
|
||||
}
|
||||
if event.Op&fsnotify.Create == fsnotify.Create {
|
||||
watcher.Add(event.Name)
|
||||
}
|
||||
if event.Op&fsnotify.Remove == fsnotify.Remove {
|
||||
watcher.Remove(event.Name)
|
||||
}
|
||||
case err, ok := <-watcher.Errors:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
fmt.Println("ERROR", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
var files []string
|
||||
filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
files = append(files, path)
|
||||
return nil
|
||||
})
|
||||
|
||||
for _, file := range files {
|
||||
if err := watcher.Add(file); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if r.String() == "local" {
|
||||
<-done
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "services",
|
||||
Usage: "List services in the registry",
|
||||
Action: List,
|
||||
})
|
||||
}
|
||||
|
||||
// List fetches running services from the registry and lists them. Exits on
|
||||
// error.
|
||||
func List(ctx *cli.Context) error {
|
||||
r := *cmd.DefaultOptions().Registry
|
||||
srvs, err := r.ListServices()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var services []string
|
||||
for _, srv := range srvs {
|
||||
services = append(services, srv.Name)
|
||||
}
|
||||
|
||||
sort.Strings(services)
|
||||
for _, srv := range services {
|
||||
fmt.Println(srv)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package stream
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Bidirectional streams client requests and prints the server stream responses
|
||||
// it receives. Exits on error.
|
||||
func Bidirectional(ctx *cli.Context) error {
|
||||
args := ctx.Args().Slice()
|
||||
if len(args) < 2 {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
|
||||
service := args[0]
|
||||
endpoint := args[1]
|
||||
requests := args[2:]
|
||||
|
||||
srv := micro.NewService()
|
||||
srv.Init()
|
||||
c := srv.Client()
|
||||
|
||||
var r interface{}
|
||||
request := c.NewRequest(service, endpoint, r, client.WithContentType("application/json"))
|
||||
var rsp map[string]interface{}
|
||||
stream, err := c.Stream(ctx.Context, request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, req := range requests {
|
||||
d := json.NewDecoder(strings.NewReader(req))
|
||||
d.UseNumber()
|
||||
|
||||
var creq map[string]interface{}
|
||||
if err := d.Decode(&creq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := stream.Send(creq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err := stream.Recv(&rsp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
b, err := json.Marshal(rsp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
if stream.Error() != nil {
|
||||
return stream.Error()
|
||||
}
|
||||
if err := stream.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package stream
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Server sends a single client request and prints the server stream responses
|
||||
// it receives. Exits on error.
|
||||
func Server(ctx *cli.Context) error {
|
||||
args := ctx.Args().Slice()
|
||||
if len(args) < 2 {
|
||||
return cli.ShowSubcommandHelp(ctx)
|
||||
}
|
||||
|
||||
service := args[0]
|
||||
endpoint := args[1]
|
||||
req := strings.Join(args[2:], " ")
|
||||
if len(req) == 0 {
|
||||
req = `{}`
|
||||
}
|
||||
|
||||
d := json.NewDecoder(strings.NewReader(req))
|
||||
d.UseNumber()
|
||||
|
||||
var creq map[string]interface{}
|
||||
if err := d.Decode(&creq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
srv := micro.NewService()
|
||||
srv.Init()
|
||||
c := srv.Client()
|
||||
|
||||
var r interface{}
|
||||
request := c.NewRequest(service, endpoint, r, client.WithContentType("application/json"))
|
||||
|
||||
stream, err := c.Stream(context.Background(), request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := stream.Send(creq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for stream.Error() == nil {
|
||||
rsp := &map[string]interface{}{}
|
||||
err := stream.Recv(rsp)
|
||||
if err == io.EOF {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b, err := json.Marshal(rsp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
if stream.Error() != nil {
|
||||
return stream.Error()
|
||||
}
|
||||
if err := stream.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package stream
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd.Register(&cli.Command{
|
||||
Name: "stream",
|
||||
Usage: "Create a service stream",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "bidi",
|
||||
Aliases: []string{"b"},
|
||||
Usage: "Create a bidirectional service stream, e.g. " + cmd.App().Name + " stream bidirectional helloworld Helloworld.PingPong '{\"stroke\": 1}' '{\"stroke\": 2}'",
|
||||
Action: Bidirectional,
|
||||
},
|
||||
{
|
||||
Name: "server",
|
||||
Aliases: []string{"s"},
|
||||
Usage: "Create a server service stream, e.g. " + cmd.App().Name + " stream server helloworld Helloworld.ServerStream '{\"count\": 10}'",
|
||||
Action: Server,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
mcmd "github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultCmd is the default, unmodified root command.
|
||||
DefaultCmd Cmd = NewCmd()
|
||||
|
||||
name string = "gomu"
|
||||
description string = "The Go Micro CLI tool"
|
||||
version string = "latest"
|
||||
)
|
||||
|
||||
// Cmd is the interface that wraps the cli app.
|
||||
//
|
||||
// Cmd embeds the Cmd interface from the github.com/asim/go-micro/v3/cmd
|
||||
// package and adds a Run method.
|
||||
//
|
||||
// Run runs the cli app within this command and exits on error.
|
||||
type Cmd interface {
|
||||
mcmd.Cmd
|
||||
Run() error
|
||||
}
|
||||
|
||||
type cmd struct {
|
||||
app *cli.App
|
||||
opts mcmd.Options
|
||||
}
|
||||
|
||||
// App returns the cli app within this command.
|
||||
func (c *cmd) App() *cli.App {
|
||||
return c.app
|
||||
}
|
||||
|
||||
// Options returns the options set within this command.
|
||||
func (c *cmd) Options() mcmd.Options {
|
||||
return c.opts
|
||||
}
|
||||
|
||||
// Init adds options, parses flags and exits on error.
|
||||
func (c *cmd) Init(opts ...mcmd.Option) error {
|
||||
return mcmd.Init(opts...)
|
||||
}
|
||||
|
||||
// Run runs the cli app within this command and exits on error.
|
||||
func (c *cmd) Run() error {
|
||||
return c.app.Run(os.Args)
|
||||
}
|
||||
|
||||
// DefaultOptions returns the options passed to the default command.
|
||||
func DefaultOptions() mcmd.Options {
|
||||
return DefaultCmd.Options()
|
||||
}
|
||||
|
||||
// App returns the cli app within the default command.
|
||||
func App() *cli.App {
|
||||
return DefaultCmd.App()
|
||||
}
|
||||
|
||||
// Register appends commands to the default app.
|
||||
func Register(cmds ...*cli.Command) {
|
||||
app := DefaultCmd.App()
|
||||
app.Commands = append(app.Commands, cmds...)
|
||||
}
|
||||
|
||||
// Run runs the cli app within the default command. On error, it prints the
|
||||
// error message and exits.
|
||||
func Run() {
|
||||
if err := DefaultCmd.Run(); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// NewCmd returns a new command.
|
||||
func NewCmd(opts ...mcmd.Option) Cmd {
|
||||
options := mcmd.DefaultOptions()
|
||||
|
||||
// Clear the name, version and description parameters from the default
|
||||
// options so the options passed may override them.
|
||||
options.Name = ""
|
||||
options.Version = ""
|
||||
options.Description = ""
|
||||
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
if len(options.Name) == 0 {
|
||||
options.Name = name
|
||||
}
|
||||
if len(options.Description) == 0 {
|
||||
options.Description = description
|
||||
}
|
||||
if len(options.Version) == 0 {
|
||||
options.Version = version
|
||||
}
|
||||
|
||||
c := new(cmd)
|
||||
c.opts = options
|
||||
c.app = cli.NewApp()
|
||||
c.app.Name = c.opts.Name
|
||||
c.app.Usage = c.opts.Description
|
||||
c.app.Version = c.opts.Version
|
||||
c.app.Flags = mcmd.DefaultFlags
|
||||
|
||||
if len(options.Version) == 0 {
|
||||
c.app.HideVersion = true
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package jaeger
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
jaegercfg "github.com/uber/jaeger-client-go/config"
|
||||
)
|
||||
|
||||
// NewTracer returns a new Jaeger tracer based on the current configuration,
|
||||
// using the given options, and a closer func that can be used to flush buffers
|
||||
// before shutdown.
|
||||
func NewTracer(opts ...Option) (opentracing.Tracer, io.Closer, error) {
|
||||
options := newOptions(opts...)
|
||||
|
||||
cfg := &jaegercfg.Configuration{}
|
||||
if options.FromEnv {
|
||||
c, err := jaegercfg.FromEnv()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
cfg = c
|
||||
}
|
||||
|
||||
if options.Name != "" {
|
||||
cfg.ServiceName = options.Name
|
||||
}
|
||||
|
||||
var jOptions []jaegercfg.Option
|
||||
if options.Logger != nil {
|
||||
jOptions = append(jOptions, jaegercfg.Logger(options.Logger))
|
||||
}
|
||||
if options.Metrics != nil {
|
||||
jOptions = append(jOptions, jaegercfg.Metrics(options.Metrics))
|
||||
}
|
||||
|
||||
tracer, closer, err := cfg.NewTracer(jOptions...)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if options.GlobalTracer {
|
||||
opentracing.SetGlobalTracer(tracer)
|
||||
}
|
||||
|
||||
return tracer, closer, nil
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package jaeger
|
||||
|
||||
import (
|
||||
"github.com/uber/jaeger-client-go"
|
||||
"github.com/uber/jaeger-lib/metrics"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultLogger is the default Jaeger logger.
|
||||
DefaultLogger = jaeger.StdLogger
|
||||
|
||||
// DefaultMetrics is the default Jaeger metrics factory.
|
||||
DefaultMetrics = metrics.NullFactory
|
||||
)
|
||||
|
||||
// Options represents the options passed to the Jaeger tracer.
|
||||
type Options struct {
|
||||
Name string
|
||||
FromEnv bool
|
||||
GlobalTracer bool
|
||||
Logger jaeger.Logger
|
||||
Metrics metrics.Factory
|
||||
}
|
||||
|
||||
// Option manipulates the passed Options struct.
|
||||
type Option func(o *Options)
|
||||
|
||||
func newOptions(opts ...Option) Options {
|
||||
options := Options{
|
||||
Logger: DefaultLogger,
|
||||
Metrics: DefaultMetrics,
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
// Name sets the service name for the Jaeger tracer.
|
||||
func Name(s string) Option {
|
||||
return func(o *Options) {
|
||||
o.Name = s
|
||||
}
|
||||
}
|
||||
|
||||
// FromEnv determines whether the Jaeger tracer configuration should use
|
||||
// environment variables.
|
||||
func FromEnv(e bool) Option {
|
||||
return func(o *Options) {
|
||||
o.FromEnv = e
|
||||
}
|
||||
}
|
||||
|
||||
// GlobalTracer determines whether the Jaeger tracer should be set as the
|
||||
// global tracer.
|
||||
func GlobalTracer(e bool) Option {
|
||||
return func(o *Options) {
|
||||
o.GlobalTracer = e
|
||||
}
|
||||
}
|
||||
|
||||
// Logger sets the logger for the Jaeger tracer.
|
||||
func Logger(l jaeger.Logger) Option {
|
||||
return func(o *Options) {
|
||||
o.Logger = l
|
||||
}
|
||||
}
|
||||
|
||||
// Metrics sets the metrics factory for the Jaeger tracer.
|
||||
func Metrics(m metrics.Factory) Option {
|
||||
return func(o *Options) {
|
||||
o.Metrics = m
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package trace
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
)
|
||||
|
||||
// NewSpan accepts a context and returns an OpenTracing span. Can be used to
|
||||
// nest spans.
|
||||
func NewSpan(ctx context.Context) opentracing.Span {
|
||||
pc := make([]uintptr, 10) // at least 1 entry needed
|
||||
runtime.Callers(2, pc)
|
||||
span := opentracing.StartSpan(
|
||||
runtime.FuncForPC(pc[0]).Name(),
|
||||
opentracing.ChildOf(opentracing.SpanFromContext(ctx).Context()),
|
||||
)
|
||||
return span
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// Generator is the interface that generates project template files.
|
||||
//
|
||||
// Generate accepts a list of files and generates them based on their template.
|
||||
type Generator interface {
|
||||
Generate([]File) error
|
||||
}
|
||||
|
||||
type generator struct {
|
||||
opts Options
|
||||
}
|
||||
|
||||
// File represents a file to generate.
|
||||
type File struct {
|
||||
// Path specifies where the file will reside.
|
||||
Path string
|
||||
// Template is the template used to generate the file.
|
||||
Template string
|
||||
}
|
||||
|
||||
// Generate generates project template files.
|
||||
func (g *generator) Generate(files []File) error {
|
||||
for _, file := range files {
|
||||
fp := filepath.Join(g.opts.Directory, file.Path)
|
||||
dir := filepath.Dir(fp)
|
||||
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
f, err := os.Create(fp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fn := template.FuncMap{
|
||||
"dehyphen": func(s string) string {
|
||||
return strings.ReplaceAll(s, "-", "")
|
||||
},
|
||||
"lower": strings.ToLower,
|
||||
"title": func(s string) string {
|
||||
return strings.ReplaceAll(strings.Title(s), "-", "")
|
||||
},
|
||||
}
|
||||
t, err := template.New(fp).Funcs(fn).Parse(file.Template)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = t.Execute(f, g.opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// New returns a new generator struct.
|
||||
func New(opts ...Option) Generator {
|
||||
var options Options
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return &generator{
|
||||
opts: options,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package generator
|
||||
|
||||
// Options represents the options for the generator.
|
||||
type Options struct {
|
||||
// Service is the name of the service the generator will generate files
|
||||
// for.
|
||||
Service string
|
||||
// Vendor is the service vendor.
|
||||
Vendor string
|
||||
// Directory is the directory where the files will be generated to.
|
||||
Directory string
|
||||
|
||||
// Client determines whether or not the project is a client project.
|
||||
Client bool
|
||||
// Jaeger determines whether or not Jaeger integration is enabled.
|
||||
Jaeger bool
|
||||
// Jaeger determines whether or not Skaffold integration is enabled.
|
||||
Skaffold bool
|
||||
}
|
||||
|
||||
// Option manipulates the Options passed.
|
||||
type Option func(o *Options)
|
||||
|
||||
// Service sets the service name.
|
||||
func Service(s string) Option {
|
||||
return func(o *Options) {
|
||||
o.Service = s
|
||||
}
|
||||
}
|
||||
|
||||
// Vendor sets the service vendor.
|
||||
func Vendor(v string) Option {
|
||||
return func(o *Options) {
|
||||
o.Vendor = v
|
||||
}
|
||||
}
|
||||
|
||||
// Directory sets the directory in which files are generated.
|
||||
func Directory(d string) Option {
|
||||
return func(o *Options) {
|
||||
o.Directory = d
|
||||
}
|
||||
}
|
||||
|
||||
// Client sets whether or not the project is a client project.
|
||||
func Client(c bool) Option {
|
||||
return func(o *Options) {
|
||||
o.Client = c
|
||||
}
|
||||
}
|
||||
|
||||
// Jaeger sets whether or not Jaeger integration is enabled.
|
||||
func Jaeger(j bool) Option {
|
||||
return func(o *Options) {
|
||||
o.Jaeger = j
|
||||
}
|
||||
}
|
||||
|
||||
// Skaffold sets whether or not Skaffold integration is enabled.
|
||||
func Skaffold(s bool) Option {
|
||||
return func(o *Options) {
|
||||
o.Skaffold = s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package template
|
||||
|
||||
// Dockerfile is the Dockerfile template used for new projects.
|
||||
var Dockerfile = `FROM golang:alpine AS builder
|
||||
ENV CGO_ENABLED=0 GOOS=linux
|
||||
WORKDIR /go/src/{{.Service}}{{if .Client}}-client{{end}}
|
||||
RUN apk --update --no-cache add ca-certificates gcc libtool make musl-dev protoc
|
||||
COPY {{if not .Client}}Makefile {{end}}go.mod go.sum ./
|
||||
RUN {{if not .Client}}make init && {{end}}go mod download
|
||||
COPY . .
|
||||
RUN make {{if not .Client}}proto {{end}}tidy build
|
||||
|
||||
FROM scratch
|
||||
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
|
||||
COPY --from=builder /go/src/{{.Service}}{{if .Client}}-client{{end}}/{{.Service}}{{if .Client}}-client{{end}} /{{.Service}}{{if .Client}}-client{{end}}
|
||||
ENTRYPOINT ["/{{.Service}}{{if .Client}}-client{{end}}"]
|
||||
CMD []
|
||||
`
|
||||
|
||||
// DockerIgnore is the .dockerignore template used for new projects.
|
||||
var DockerIgnore = `.gitignore
|
||||
Dockerfile{{if .Skaffold}}
|
||||
resources/
|
||||
skaffold.yaml{{end}}
|
||||
`
|
||||
@@ -0,0 +1,6 @@
|
||||
package template
|
||||
|
||||
// GitIgnore is the .gitignore template used for new projects.
|
||||
var GitIgnore = `# don't commit the service binary to vcs
|
||||
{{.Service}}{{if .Client}}-client{{end}}
|
||||
`
|
||||
@@ -0,0 +1,89 @@
|
||||
package template
|
||||
|
||||
// HandlerFNC is the handler template used for new function projects.
|
||||
var HandlerFNC = `package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
|
||||
pb "{{.Vendor}}{{.Service}}/proto"
|
||||
)
|
||||
|
||||
type {{title .Service}} struct{}
|
||||
|
||||
func (e *{{title .Service}}) Call(ctx context.Context, req *pb.CallRequest, rsp *pb.CallResponse) error {
|
||||
log.Infof("Received {{title .Service}}.Call request: %v", req)
|
||||
rsp.Msg = "Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
`
|
||||
|
||||
// HandlerSRV is the handler template used for new service projects.
|
||||
var HandlerSRV = `package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
|
||||
pb "{{.Vendor}}{{.Service}}/proto"
|
||||
)
|
||||
|
||||
type {{title .Service}} struct{}
|
||||
|
||||
func (e *{{title .Service}}) Call(ctx context.Context, req *pb.CallRequest, rsp *pb.CallResponse) error {
|
||||
log.Infof("Received {{title .Service}}.Call request: %v", req)
|
||||
rsp.Msg = "Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *{{title .Service}}) ClientStream(ctx context.Context, stream pb.{{title .Service}}_ClientStreamStream) error {
|
||||
var count int64
|
||||
for {
|
||||
req, err := stream.Recv()
|
||||
if err == io.EOF {
|
||||
log.Infof("Got %v pings total", count)
|
||||
return stream.SendMsg(&pb.ClientStreamResponse{Count: count})
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Got ping %v", req.Stroke)
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
func (e *{{title .Service}}) ServerStream(ctx context.Context, req *pb.ServerStreamRequest, stream pb.{{title .Service}}_ServerStreamStream) error {
|
||||
log.Infof("Received {{title .Service}}.ServerStream request: %v", req)
|
||||
for i := 0; i < int(req.Count); i++ {
|
||||
log.Infof("Sending %d", i)
|
||||
if err := stream.Send(&pb.ServerStreamResponse{
|
||||
Count: int64(i),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
time.Sleep(time.Millisecond * 250)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *{{title .Service}}) BidiStream(ctx context.Context, stream pb.{{title .Service}}_BidiStreamStream) error {
|
||||
for {
|
||||
req, err := stream.Recv()
|
||||
if err == io.EOF {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Got ping %v", req.Stroke)
|
||||
if err := stream.Send(&pb.BidiStreamResponse{Stroke: req.Stroke}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -0,0 +1,78 @@
|
||||
package template
|
||||
|
||||
// KubernetesEnv is a Kubernetes configmap manifest template used for
|
||||
// environment variables in new projects.
|
||||
var KubernetesEnv = `---
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{.Service}}{{if .Client}}-client{{end}}-env
|
||||
data:
|
||||
MICRO_REGISTRY: kubernetes
|
||||
`
|
||||
|
||||
// KubernetesClusterRole is a Kubernetes cluster role manifest template
|
||||
// required for the Kubernetes registry plugin to function correctly.
|
||||
var KubernetesClusterRole = `---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: micro-registry
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- list
|
||||
- patch
|
||||
- watch
|
||||
`
|
||||
|
||||
// KubernetesRoleBinding is a Kubernetes role binding manifest template
|
||||
// required for the Kubernetes registry plugin to function correctly.
|
||||
var KubernetesRoleBinding = `---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: micro-registry
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: micro-registry
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: default
|
||||
`
|
||||
|
||||
// KubernetesDeployment is a Kubernetes deployment manifest template used for
|
||||
// new projects.
|
||||
var KubernetesDeployment = `---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{.Service}}{{if .Client}}-client{{end}}
|
||||
labels:
|
||||
app: {{.Service}}{{if .Client}}-client{{end}}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{.Service}}{{if .Client}}-client{{end}}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{.Service}}{{if .Client}}-client{{end}}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{.Service}}{{if .Client}}-client{{end}}
|
||||
image: {{.Service}}{{if .Client}}-client{{end}}:latest
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{.Service}}{{if .Client}}-client{{end}}-env
|
||||
`
|
||||
@@ -0,0 +1,144 @@
|
||||
package template
|
||||
|
||||
// MainCLT is the main template used for new client projects.
|
||||
var MainCLT = `package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
pb "{{.Vendor}}{{lower .Service}}/proto"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
service = "{{lower .Service}}"
|
||||
version = "latest"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create service
|
||||
srv := micro.NewService()
|
||||
srv.Init()
|
||||
|
||||
// Create client
|
||||
c := pb.NewHelloworldService(service, srv.Client())
|
||||
|
||||
for {
|
||||
// Call service
|
||||
rsp, err := c.Call(context.Background(), &pb.CallRequest{Name: "John"})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Info(rsp)
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
// MainFNC is the main template used for new function projects.
|
||||
var MainFNC = `package main
|
||||
|
||||
import (
|
||||
"{{.Vendor}}{{.Service}}/handler"
|
||||
|
||||
{{if .Jaeger}} ot "github.com/asim/go-micro/plugins/wrapper/trace/opentracing/v3"
|
||||
{{end}} "github.com/asim/go-micro/v3"
|
||||
log "github.com/asim/go-micro/v3/logger"{{if .Jaeger}}
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/debug/trace/jaeger"{{end}}
|
||||
)
|
||||
|
||||
var (
|
||||
service = "{{lower .Service}}"
|
||||
version = "latest"
|
||||
)
|
||||
|
||||
func main() {
|
||||
{{if .Jaeger}} // Create tracer
|
||||
tracer, closer, err := jaeger.NewTracer(
|
||||
jaeger.Name(service),
|
||||
jaeger.FromEnv(true),
|
||||
jaeger.GlobalTracer(true),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer closer.Close()
|
||||
|
||||
{{end}} // Create function
|
||||
fnc := micro.NewFunction(
|
||||
micro.Name(service),
|
||||
micro.Version(version),
|
||||
{{if .Jaeger}} micro.WrapCall(ot.NewCallWrapper(tracer)),
|
||||
micro.WrapClient(ot.NewClientWrapper(tracer)),
|
||||
micro.WrapHandler(ot.NewHandlerWrapper(tracer)),
|
||||
micro.WrapSubscriber(ot.NewSubscriberWrapper(tracer)),
|
||||
{{end}} )
|
||||
fnc.Init()
|
||||
|
||||
// Handle function
|
||||
fnc.Handle(new(handler.{{title .Service}}))
|
||||
|
||||
// Run function
|
||||
if err := fnc.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
// MainSRV is the main template used for new service projects.
|
||||
var MainSRV = `package main
|
||||
|
||||
import (
|
||||
"{{.Vendor}}{{.Service}}/handler"
|
||||
pb "{{.Vendor}}{{.Service}}/proto"
|
||||
|
||||
{{if .Jaeger}} ot "github.com/asim/go-micro/plugins/wrapper/trace/opentracing/v3"
|
||||
{{end}} "github.com/asim/go-micro/v3"
|
||||
log "github.com/asim/go-micro/v3/logger"{{if .Jaeger}}
|
||||
|
||||
"github.com/asim/go-micro/cmd/gomu/debug/trace/jaeger"{{end}}
|
||||
)
|
||||
|
||||
var (
|
||||
service = "{{lower .Service}}"
|
||||
version = "latest"
|
||||
)
|
||||
|
||||
func main() {
|
||||
{{if .Jaeger}} // Create tracer
|
||||
tracer, closer, err := jaeger.NewTracer(
|
||||
jaeger.Name(service),
|
||||
jaeger.FromEnv(true),
|
||||
jaeger.GlobalTracer(true),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer closer.Close()
|
||||
|
||||
{{end}} // Create service
|
||||
srv := micro.NewService(
|
||||
micro.Name(service),
|
||||
micro.Version(version),
|
||||
{{if .Jaeger}} micro.WrapCall(ot.NewCallWrapper(tracer)),
|
||||
micro.WrapClient(ot.NewClientWrapper(tracer)),
|
||||
micro.WrapHandler(ot.NewHandlerWrapper(tracer)),
|
||||
micro.WrapSubscriber(ot.NewSubscriberWrapper(tracer)),
|
||||
{{end}} )
|
||||
srv.Init()
|
||||
|
||||
// Register handler
|
||||
pb.Register{{title .Service}}Handler(srv.Server(), new(handler.{{title .Service}}))
|
||||
|
||||
// Run service
|
||||
if err := srv.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -0,0 +1,31 @@
|
||||
package template
|
||||
|
||||
// Makefile is the Makefile template used for new projects.
|
||||
var Makefile = `GOPATH:=$(shell go env GOPATH)
|
||||
|
||||
.PHONY: init
|
||||
init:
|
||||
@go get -u google.golang.org/protobuf/proto
|
||||
@go install github.com/golang/protobuf/protoc-gen-go@latest
|
||||
@go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest
|
||||
|
||||
.PHONY: proto
|
||||
proto:
|
||||
@protoc --proto_path=. --micro_out=. --go_out=:. proto/{{.Service}}.proto
|
||||
|
||||
.PHONY: tidy
|
||||
tidy:
|
||||
@go mod tidy
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
@go build -o {{.Service}}{{if .Client}}-client{{end}} *.go
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@go test -v ./... -cover
|
||||
|
||||
.PHONY: docker
|
||||
docker:
|
||||
@docker build -t {{.Service}}{{if .Client}}-client{{end}}:latest .
|
||||
`
|
||||
@@ -0,0 +1,17 @@
|
||||
package template
|
||||
|
||||
// Module is the go.mod template used for new projects.
|
||||
var Module = `module {{.Vendor}}{{.Service}}{{if .Client}}-client{{end}}
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/asim/go-micro/v3 v3.5.2
|
||||
)
|
||||
|
||||
// This can be removed once etcd becomes go gettable, version 3.4 and 3.5 is not,
|
||||
// see https://github.com/etcd-io/etcd/issues/11154 and https://github.com/etcd-io/etcd/issues/11931.
|
||||
replace google.golang.org/grpc => google.golang.org/grpc v1.26.0{{if .Vendor}}{{if not .Skaffold}}
|
||||
|
||||
replace {{.Vendor}}{{lower .Service}} => ../{{lower .Service}}{{end}}{{end}}
|
||||
`
|
||||
@@ -0,0 +1,9 @@
|
||||
package template
|
||||
|
||||
// Plugins is the plugins template used for new projects.
|
||||
var Plugins = `package main
|
||||
|
||||
import (
|
||||
_ "github.com/asim/go-micro/plugins/registry/kubernetes/v3"
|
||||
)
|
||||
`
|
||||
@@ -0,0 +1,68 @@
|
||||
package template
|
||||
|
||||
// ProtoFNC is the .proto file template used for new function projects.
|
||||
var ProtoFNC = `syntax = "proto3";
|
||||
|
||||
package {{dehyphen .Service}};
|
||||
|
||||
option go_package = "./proto;{{dehyphen .Service}}";
|
||||
|
||||
service {{title .Service}} {
|
||||
rpc Call(CallRequest) returns (CallResponse) {}
|
||||
}
|
||||
|
||||
message CallRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CallResponse {
|
||||
string msg = 1;
|
||||
}
|
||||
`
|
||||
|
||||
// ProtoSRV is the .proto file template used for new service projects.
|
||||
var ProtoSRV = `syntax = "proto3";
|
||||
|
||||
package {{dehyphen .Service}};
|
||||
|
||||
option go_package = "./proto;{{dehyphen .Service}}";
|
||||
|
||||
service {{title .Service}} {
|
||||
rpc Call(CallRequest) returns (CallResponse) {}
|
||||
rpc ClientStream(stream ClientStreamRequest) returns (ClientStreamResponse) {}
|
||||
rpc ServerStream(ServerStreamRequest) returns (stream ServerStreamResponse) {}
|
||||
rpc BidiStream(stream BidiStreamRequest) returns (stream BidiStreamResponse) {}
|
||||
}
|
||||
|
||||
message CallRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CallResponse {
|
||||
string msg = 1;
|
||||
}
|
||||
|
||||
message ClientStreamRequest {
|
||||
int64 stroke = 1;
|
||||
}
|
||||
|
||||
message ClientStreamResponse {
|
||||
int64 count = 1;
|
||||
}
|
||||
|
||||
message ServerStreamRequest {
|
||||
int64 count = 1;
|
||||
}
|
||||
|
||||
message ServerStreamResponse {
|
||||
int64 count = 1;
|
||||
}
|
||||
|
||||
message BidiStreamRequest {
|
||||
int64 stroke = 1;
|
||||
}
|
||||
|
||||
message BidiStreamResponse {
|
||||
int64 stroke = 1;
|
||||
}
|
||||
`
|
||||
@@ -0,0 +1,17 @@
|
||||
package template
|
||||
|
||||
// SkaffoldCFG is the Skaffold config template used for new projects.
|
||||
var SkaffoldCFG = `---
|
||||
|
||||
apiVersion: skaffold/v2beta21
|
||||
kind: Config
|
||||
metadata:
|
||||
name: {{.Service}}{{if .Client}}-client{{end}}
|
||||
build:
|
||||
artifacts:
|
||||
- image: {{.Service}}{{if .Client}}-client{{end}}
|
||||
deploy:
|
||||
kubectl:
|
||||
manifests:
|
||||
- resources/*.yaml
|
||||
`
|
||||
@@ -0,0 +1,14 @@
|
||||
module github.com/asim/go-micro/cmd/gomu
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
||||
github.com/asim/go-micro/v3 v3.6.1-0.20210831082736-088ccb50019c
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/opentracing/opentracing-go v1.2.0
|
||||
github.com/uber/jaeger-client-go v2.29.1+incompatible
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible
|
||||
github.com/urfave/cli/v2 v2.3.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
)
|
||||
+848
@@ -0,0 +1,848 @@
|
||||
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||
github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg=
|
||||
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM=
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U=
|
||||
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
|
||||
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
|
||||
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
|
||||
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
|
||||
github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88=
|
||||
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM=
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
|
||||
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
|
||||
github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
|
||||
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
|
||||
github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
|
||||
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
|
||||
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
|
||||
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.1.0/go.mod h1:kX6YddBkXqqywAe8c9LyvgTCyFuZCTMF4cRPQhc3Fy8=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.976/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/asim/go-micro/v3 v3.6.1-0.20210831082736-088ccb50019c h1:bwjwOyCBbClb9BwnVo8XohDYzA3Huk/PVpxSfqrx3xg=
|
||||
github.com/asim/go-micro/v3 v3.6.1-0.20210831082736-088ccb50019c/go.mod h1:UQd2JfP/+4goQxddksr2r6ZSaUXNIlVE8hlepbAx/DI=
|
||||
github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
|
||||
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
|
||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw=
|
||||
github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304=
|
||||
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
|
||||
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
|
||||
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
|
||||
github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
|
||||
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||
github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
|
||||
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
||||
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
|
||||
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
|
||||
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpu/goacmedns v0.1.1/go.mod h1:MuaouqEhPAHxsbqjgnck5zeghuwBP1dLnPoobeGqugQ=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/deepmap/oapi-codegen v1.3.11/go.mod h1:suMvK7+rKlx3+tpa8ByptmvoXbAV70wERKTOGH3hLp0=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
|
||||
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
|
||||
github.com/dnsimple/dnsimple-go v0.63.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg=
|
||||
github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg=
|
||||
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
|
||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
|
||||
github.com/exoscale/egoscale v0.46.0/go.mod h1:mpEXBpROAa/2i5GC0r33rfxG+TxSEka11g1PIXt9+zc=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsouza/go-dockerclient v1.7.3/go.mod h1:8xfZB8o9SptLNJ13VoV5pMiRbZGWkU/Omu5VOu/KC9Y=
|
||||
github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s+pcEVXFuAjw=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/go-acme/lego/v4 v4.4.0/go.mod h1:l3+tFUFZb590dWcqhWZegynUthtaHJbG2fevUpoOOE0=
|
||||
github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
|
||||
github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s=
|
||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
|
||||
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
|
||||
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
|
||||
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
|
||||
github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
|
||||
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw=
|
||||
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
|
||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.4/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
||||
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4=
|
||||
github.com/gophercloud/gophercloud v0.16.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4=
|
||||
github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4=
|
||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/infobloxopen/infoblox-go-client v1.1.1/go.mod h1:BXiw7S2b9qJoM8MS40vfgCNB2NLHGusk1DtO16BD9zI=
|
||||
github.com/jarcoal/httpmock v1.0.6/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA=
|
||||
github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w=
|
||||
github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g=
|
||||
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
|
||||
github.com/linode/linodego v0.25.3/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE=
|
||||
github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs=
|
||||
github.com/liquidweb/go-lwApi v0.0.5/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs=
|
||||
github.com/liquidweb/liquidweb-cli v0.6.9/go.mod h1:cE1uvQ+x24NGUL75D0QagOFCG8Wdvmwu8aL9TLmA/eQ=
|
||||
github.com/liquidweb/liquidweb-go v1.6.3/go.mod h1:SuXXp+thr28LnjEw18AYtWwIbWMHSUiajPQs8T9c/Rc=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
|
||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
|
||||
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
|
||||
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0=
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/moby/sys/mount v0.2.0/go.mod h1:aAivFE2LB3W4bACsUXChRHQ0qKWsetY4Y9V7sxOougM=
|
||||
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/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/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nrdcg/auroradns v1.0.1/go.mod h1:y4pc0i9QXYlFCWrhWrUSIETnZgrf4KuwjDIWmmXo3JI=
|
||||
github.com/nrdcg/desec v0.5.0/go.mod h1:2ejvMazkav1VdDbv2HeQO7w+Ta1CGHqzQr27ZBYTuEQ=
|
||||
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
|
||||
github.com/nrdcg/goinwx v0.8.1/go.mod h1:tILVc10gieBp/5PMvbcYeXM6pVQ+c9jxDZnpaR1UW7c=
|
||||
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
|
||||
github.com/nrdcg/porkbun v0.1.1/go.mod h1:JWl/WKnguWos4mjfp4YizvvToigk9qpQwrodOk+CPoA=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
|
||||
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
|
||||
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
|
||||
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
|
||||
github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
|
||||
github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
|
||||
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/sacloud/libsacloud v1.36.2/go.mod h1:P7YAOVmnIn3DKHqCZcUKYUXmSwGBm3yS7IBEjKVSrjg=
|
||||
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
||||
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/gunit v1.0.4/go.mod h1:EH5qMBab2UclzXUcpR8b93eHsIlp9u+pDQIRp5DZNzQ=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
|
||||
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
|
||||
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
|
||||
github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4=
|
||||
github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
|
||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
|
||||
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
|
||||
github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
|
||||
github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg=
|
||||
github.com/vultr/govultr/v2 v2.0.0/go.mod h1:2PsEeg+gs3p/Fo5Pw8F9mv+DUBEOlrNZ8GmCTGmhOhs=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.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/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210216224549-f992740a1bac/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E=
|
||||
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201113234701-d7a72108b828/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
|
||||
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
|
||||
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
||||
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
|
||||
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ns1/ns1-go.v2 v2.4.4/go.mod h1:GMnKY+ZuoJ+lVLL+78uSTjwTz2jMazq6AfGKQOYhsPk=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
|
||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/cmd/gomu/cmd"
|
||||
|
||||
// register commands
|
||||
_ "github.com/asim/go-micro/cmd/gomu/cmd/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd.Run()
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/asim/go-micro/v3/auth"
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/cache"
|
||||
"github.com/asim/go-micro/v3/client"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/debug/profile"
|
||||
@@ -28,6 +29,7 @@ type Options struct {
|
||||
Registry *registry.Registry
|
||||
Selector *selector.Selector
|
||||
Transport *transport.Transport
|
||||
Cache *cache.Cache
|
||||
Config *config.Config
|
||||
Client *client.Client
|
||||
Server *server.Server
|
||||
@@ -38,6 +40,7 @@ type Options struct {
|
||||
Profile *profile.Profile
|
||||
|
||||
Brokers map[string]func(...broker.Option) broker.Broker
|
||||
Caches map[string]func(...cache.Option) cache.Cache
|
||||
Configs map[string]func(...config.Option) (config.Config, error)
|
||||
Clients map[string]func(...client.Option) client.Client
|
||||
Registries map[string]func(...registry.Option) registry.Registry
|
||||
@@ -82,6 +85,12 @@ func Broker(b *broker.Broker) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func Cache(c *cache.Cache) Option {
|
||||
return func(o *Options) {
|
||||
o.Cache = c
|
||||
}
|
||||
}
|
||||
|
||||
func Config(c *config.Config) Option {
|
||||
return func(o *Options) {
|
||||
o.Config = c
|
||||
@@ -155,6 +164,13 @@ func NewBroker(name string, b func(...broker.Option) broker.Broker) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// New cache func
|
||||
func NewCache(name string, c func(...cache.Option) cache.Cache) Option {
|
||||
return func(o *Options) {
|
||||
o.Caches[name] = c
|
||||
}
|
||||
}
|
||||
|
||||
// New client func
|
||||
func NewClient(name string, b func(...client.Option) client.Client) Option {
|
||||
return func(o *Options) {
|
||||
@@ -210,3 +226,17 @@ func NewAuth(name string, t func(...auth.Option) auth.Auth) Option {
|
||||
o.Auths[name] = t
|
||||
}
|
||||
}
|
||||
|
||||
// New config func
|
||||
func NewConfig(name string, t func(...config.Option) (config.Config, error)) Option {
|
||||
return func(o *Options) {
|
||||
o.Configs[name] = t
|
||||
}
|
||||
}
|
||||
|
||||
// New profile func
|
||||
func NewProfile(name string, t func(...profile.Option) profile.Profile) Option {
|
||||
return func(o *Options) {
|
||||
o.Profiles[name] = t
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ This is protobuf code generation for go-micro. We use protoc-gen-micro to reduce
|
||||
## Install
|
||||
|
||||
```
|
||||
go get github.com/asim/go-micro/cmd/protoc-gen-micro/v3
|
||||
go install github.com/asim/go-micro/cmd/protoc-gen-micro/v3@latest
|
||||
```
|
||||
|
||||
Also required:
|
||||
|
||||
- [protoc](https://github.com/google/protobuf)
|
||||
- [protoc-gen-go](https://github.com/golang/protobuf)
|
||||
- [protoc-gen-go](https://google.golang.org/protobuf)
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -1,124 +1,227 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: examples/greeter/greeter.proto
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.15.6
|
||||
// source: greeter.proto
|
||||
|
||||
package greeter
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// 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
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Msg *string `protobuf:"bytes,2,opt,name=msg,proto3,oneof" json:"msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Request) Reset() { *m = Request{} }
|
||||
func (m *Request) String() string { return proto.CompactTextString(m) }
|
||||
func (*Request) ProtoMessage() {}
|
||||
func (x *Request) Reset() {
|
||||
*x = Request{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_greeter_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Request) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Request) ProtoMessage() {}
|
||||
|
||||
func (x *Request) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_greeter_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Request.ProtoReflect.Descriptor instead.
|
||||
func (*Request) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3cc58d5671cc8265, []int{0}
|
||||
return file_greeter_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *Request) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Request.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Request.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Request) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Request.Merge(m, src)
|
||||
}
|
||||
func (m *Request) XXX_Size() int {
|
||||
return xxx_messageInfo_Request.Size(m)
|
||||
}
|
||||
func (m *Request) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Request.DiscardUnknown(m)
|
||||
func (x *Request) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Request proto.InternalMessageInfo
|
||||
|
||||
func (m *Request) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
func (x *Request) GetMsg() string {
|
||||
if x != nil && x.Msg != nil {
|
||||
return *x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Response) Reset() { *m = Response{} }
|
||||
func (m *Response) String() string { return proto.CompactTextString(m) }
|
||||
func (*Response) ProtoMessage() {}
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_greeter_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Response) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_greeter_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3cc58d5671cc8265, []int{1}
|
||||
return file_greeter_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *Response) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Response.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Response.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Response) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Response.Merge(m, src)
|
||||
}
|
||||
func (m *Response) XXX_Size() int {
|
||||
return xxx_messageInfo_Response.Size(m)
|
||||
}
|
||||
func (m *Response) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Response.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Response proto.InternalMessageInfo
|
||||
|
||||
func (m *Response) GetMsg() string {
|
||||
if m != nil {
|
||||
return m.Msg
|
||||
func (x *Response) GetMsg() string {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Request)(nil), "Request")
|
||||
proto.RegisterType((*Response)(nil), "Response")
|
||||
var File_greeter_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_greeter_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x67, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3c, 0x0a,
|
||||
0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x03,
|
||||
0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x67,
|
||||
0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x1c, 0x0a, 0x08, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x6e, 0x0a, 0x07, 0x47, 0x72, 0x65,
|
||||
0x65, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x08, 0x2e,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x68, 0x65, 0x6c,
|
||||
0x6c, 0x6f, 0x3a, 0x01, 0x2a, 0x12, 0x32, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12,
|
||||
0x08, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x73,
|
||||
0x74, 0x72, 0x65, 0x61, 0x6d, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2e, 0x2f,
|
||||
0x67, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("examples/greeter/greeter.proto", fileDescriptor_3cc58d5671cc8265) }
|
||||
var (
|
||||
file_greeter_proto_rawDescOnce sync.Once
|
||||
file_greeter_proto_rawDescData = file_greeter_proto_rawDesc
|
||||
)
|
||||
|
||||
var fileDescriptor_3cc58d5671cc8265 = []byte{
|
||||
// 201 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xad, 0x48, 0xcc,
|
||||
0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x4f, 0x2f, 0x4a, 0x4d, 0x2d, 0x49, 0x2d, 0x82, 0xd1, 0x7a, 0x05,
|
||||
0x45, 0xf9, 0x25, 0xf9, 0x52, 0x32, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x89, 0x05, 0x99,
|
||||
0xfa, 0x89, 0x79, 0x79, 0xf9, 0x25, 0x89, 0x25, 0x99, 0xf9, 0x79, 0xc5, 0x10, 0x59, 0x25, 0x59,
|
||||
0x2e, 0xf6, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc,
|
||||
0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, 0x49, 0x86, 0x8b, 0x23, 0x28, 0xb5,
|
||||
0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0x48, 0x80, 0x8b, 0x39, 0xb7, 0x38, 0x1d, 0x2a, 0x0d, 0x62,
|
||||
0x1a, 0xe5, 0x71, 0xb1, 0xbb, 0x43, 0xec, 0x12, 0xd2, 0xe7, 0x62, 0xf5, 0x48, 0xcd, 0xc9, 0xc9,
|
||||
0x17, 0xe2, 0xd0, 0x83, 0x9a, 0x27, 0xc5, 0xa9, 0x07, 0xd3, 0xaa, 0x24, 0xd8, 0x74, 0xf9, 0xc9,
|
||||
0x64, 0x26, 0x6e, 0x25, 0x36, 0xfd, 0x0c, 0x90, 0x22, 0x2b, 0x46, 0x2d, 0x21, 0x23, 0x2e, 0xb6,
|
||||
0xe0, 0x92, 0xa2, 0xd4, 0xc4, 0x5c, 0xec, 0x3a, 0xf8, 0xc1, 0x3a, 0x38, 0x85, 0xd8, 0xf5, 0x8b,
|
||||
0xc1, 0xaa, 0x34, 0x18, 0x0d, 0x18, 0x93, 0xd8, 0xc0, 0x6e, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff,
|
||||
0xff, 0xac, 0x65, 0x8d, 0x1e, 0xf3, 0x00, 0x00, 0x00,
|
||||
func file_greeter_proto_rawDescGZIP() []byte {
|
||||
file_greeter_proto_rawDescOnce.Do(func() {
|
||||
file_greeter_proto_rawDescData = protoimpl.X.CompressGZIP(file_greeter_proto_rawDescData)
|
||||
})
|
||||
return file_greeter_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_greeter_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_greeter_proto_goTypes = []interface{}{
|
||||
(*Request)(nil), // 0: Request
|
||||
(*Response)(nil), // 1: Response
|
||||
}
|
||||
var file_greeter_proto_depIdxs = []int32{
|
||||
0, // 0: Greeter.Hello:input_type -> Request
|
||||
0, // 1: Greeter.Stream:input_type -> Request
|
||||
1, // 2: Greeter.Hello:output_type -> Response
|
||||
1, // 3: Greeter.Stream:output_type -> Response
|
||||
2, // [2:4] is the sub-list for method output_type
|
||||
0, // [0:2] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_greeter_proto_init() }
|
||||
func file_greeter_proto_init() {
|
||||
if File_greeter_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_greeter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Request); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_greeter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Response); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_greeter_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_greeter_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_greeter_proto_goTypes,
|
||||
DependencyIndexes: file_greeter_proto_depIdxs,
|
||||
MessageInfos: file_greeter_proto_msgTypes,
|
||||
}.Build()
|
||||
File_greeter_proto = out.File
|
||||
file_greeter_proto_rawDesc = nil
|
||||
file_greeter_proto_goTypes = nil
|
||||
file_greeter_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: examples/greeter/greeter.proto
|
||||
// source: greeter.proto
|
||||
|
||||
package greeter
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
@@ -22,12 +22,6 @@ 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 _ api.Endpoint
|
||||
var _ context.Context
|
||||
@@ -38,14 +32,14 @@ var _ server.Option
|
||||
|
||||
func NewGreeterEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
&api.Endpoint{
|
||||
{
|
||||
Name: "Greeter.Hello",
|
||||
Path: []string{"/hello"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
{
|
||||
Name: "Greeter.Stream",
|
||||
Path: []string{"/stream"},
|
||||
Method: []string{"GET"},
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "../greeter";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service Greeter {
|
||||
@@ -13,6 +15,7 @@ service Greeter {
|
||||
|
||||
message Request {
|
||||
string name = 1;
|
||||
optional string msg = 2;
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=github.com/golang/protobuf/compiler/generator
|
||||
TARG=github.com/golang/protobuf/protoc-gen-go/generator
|
||||
GOFILES=\
|
||||
generator.go\
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Go support for Protocol Buffers - Google's data interchange format
|
||||
//
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// https://github.com/golang/protobuf
|
||||
// https://google.golang.org/protobuf
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -57,16 +57,14 @@ import (
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
|
||||
"google.golang.org/protobuf/proto"
|
||||
descriptor "google.golang.org/protobuf/types/descriptorpb"
|
||||
plugin "google.golang.org/protobuf/types/pluginpb"
|
||||
)
|
||||
|
||||
// generatedCodeVersion indicates a version of the generated code.
|
||||
// It is incremented whenever an incompatibility between the generated code and
|
||||
// proto package is introduced; the generated code references
|
||||
// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
|
||||
const generatedCodeVersion = 3
|
||||
// SupportedFeatures used to signaling that code generator supports proto3 optional
|
||||
// https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.md#signaling-that-your-code-generator-supports-proto3-optional
|
||||
var SupportedFeatures = uint64(plugin.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
|
||||
|
||||
// A Plugin provides functionality to add to the output during Go code generation,
|
||||
// such as to produce RPC stubs.
|
||||
@@ -1077,6 +1075,7 @@ func (g *Generator) GenerateAllFiles() {
|
||||
Content: proto.String(g.String()),
|
||||
})
|
||||
}
|
||||
g.Response.SupportedFeatures = proto.Uint64(SupportedFeatures)
|
||||
}
|
||||
|
||||
// Run all the plugins associated with the file.
|
||||
@@ -1098,13 +1097,6 @@ func (g *Generator) generate(file *FileDescriptor) {
|
||||
g.usedPackageNames[name] = true
|
||||
}
|
||||
|
||||
g.P("// This is a compile-time assertion to ensure that this generated file")
|
||||
g.P("// is compatible with the proto package it is being compiled against.")
|
||||
g.P("// A compilation error at this line likely means your copy of the")
|
||||
g.P("// proto package needs to be updated.")
|
||||
g.P("const _ = ", g.Pkg["proto"], ".ProtoPackageIsVersion", generatedCodeVersion, " // please upgrade the proto package")
|
||||
g.P()
|
||||
|
||||
for _, td := range g.file.imp {
|
||||
g.generateImported(td)
|
||||
}
|
||||
@@ -1246,7 +1238,7 @@ func (g *Generator) generateImports() {
|
||||
g.P("import (")
|
||||
g.P(g.Pkg["fmt"] + ` "fmt"`)
|
||||
g.P(g.Pkg["math"] + ` "math"`)
|
||||
g.P(g.Pkg["proto"]+" ", GoImportPath(g.ImportPrefix)+"github.com/golang/protobuf/proto")
|
||||
g.P(g.Pkg["proto"]+" ", GoImportPath(g.ImportPrefix)+"google.golang.org/protobuf/proto")
|
||||
for importPath, packageName := range imports {
|
||||
g.P(packageName, " ", GoImportPath(g.ImportPrefix)+importPath)
|
||||
}
|
||||
@@ -2638,7 +2630,7 @@ func dottedSlice(elem []string) string { return strings.Join(elem, ".") }
|
||||
|
||||
// Is this field optional?
|
||||
func isOptional(field *descriptor.FieldDescriptorProto) bool {
|
||||
return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL
|
||||
return *field.Proto3Optional
|
||||
}
|
||||
|
||||
// Is this field required?
|
||||
|
||||
@@ -34,7 +34,7 @@ package generator
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
descriptor "google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
func TestCamelCase(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module github.com/asim/go-micro/cmd/protoc-gen-micro/v3
|
||||
|
||||
go 1.13
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/asim/go-micro/v3 v3.0.0-20210120135431-d94936f6c97c
|
||||
github.com/golang/protobuf v1.4.2
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
|
||||
github.com/asim/go-micro/v3 v3.6.0
|
||||
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8
|
||||
google.golang.org/protobuf v1.27.1
|
||||
)
|
||||
|
||||
+449
-206
File diff suppressed because it is too large
Load Diff
@@ -52,9 +52,9 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/asim/go-micro/cmd/protoc-gen-micro/v3/generator"
|
||||
_ "github.com/asim/go-micro/cmd/protoc-gen-micro/v3/plugin/micro"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
pb "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
"github.com/asim/go-micro/cmd/protoc-gen-micro/v3/generator"
|
||||
options "google.golang.org/genproto/googleapis/api/annotations"
|
||||
"google.golang.org/protobuf/proto"
|
||||
pb "google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
// Paths for packages used by code generated in this file,
|
||||
@@ -150,7 +150,7 @@ func (g *micro) generateService(file *generator.FileDescriptor, service *pb.Serv
|
||||
g.P("return []*", apiPkg, ".Endpoint{")
|
||||
for _, method := range service.Method {
|
||||
if method.Options != nil && proto.HasExtension(method.Options, options.E_Http) {
|
||||
g.P("&", apiPkg, ".Endpoint{")
|
||||
g.P("{")
|
||||
g.generateEndpoint(servName, method)
|
||||
g.P("},")
|
||||
}
|
||||
@@ -275,10 +275,7 @@ func (g *micro) generateEndpoint(servName string, method *pb.MethodDescriptorPro
|
||||
return
|
||||
}
|
||||
// http rules
|
||||
r, err := proto.GetExtension(method.Options, options.E_Http)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
r := proto.GetExtension(method.Options, options.E_Http)
|
||||
rule := r.(*options.HttpRule)
|
||||
var meth string
|
||||
var path string
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ func decode(r io.Reader) (uint8, []byte, error) {
|
||||
header := make([]byte, 5)
|
||||
|
||||
// read the header
|
||||
if _, err := r.Read(header[:]); err != nil {
|
||||
if _, err := r.Read(header); err != nil {
|
||||
return uint8(0), nil, err
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func encode(cf uint8, buf []byte, w io.Writer) error {
|
||||
binary.BigEndian.PutUint32(header[1:], uint32(len(buf)))
|
||||
|
||||
// read the header
|
||||
if _, err := w.Write(header[:]); err != nil {
|
||||
if _, err := w.Write(header); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ func (c *Codec) ReadBody(b interface{}) error {
|
||||
}
|
||||
|
||||
func (c *Codec) Write(m *codec.Message, b interface{}) error {
|
||||
if b == nil {
|
||||
// Nothing to write
|
||||
return nil
|
||||
}
|
||||
p, ok := b.(proto.Message)
|
||||
if !ok {
|
||||
return codec.ErrInvalidMessage
|
||||
|
||||
+4
-1
@@ -33,7 +33,10 @@ type watcher struct {
|
||||
func newConfig(opts ...Option) (Config, error) {
|
||||
var c config
|
||||
|
||||
c.Init(opts...)
|
||||
err := c.Init(opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
go c.run()
|
||||
|
||||
return &c, nil
|
||||
|
||||
@@ -158,7 +158,7 @@ func TestConfigWatcherDirtyOverrite(t *testing.T) {
|
||||
}
|
||||
runtime.Gosched()
|
||||
|
||||
for i, _ := range ss {
|
||||
for i := range ss {
|
||||
k := fmt.Sprintf("key%d", i)
|
||||
v := fmt.Sprintf("val%d", i)
|
||||
equalS(t, conf.Get(k).String(""), v)
|
||||
|
||||
@@ -140,7 +140,9 @@ func (m *memory) reload() error {
|
||||
}
|
||||
|
||||
// set values
|
||||
m.vals, _ = m.opts.Reader.Values(set)
|
||||
if vals, err := m.opts.Reader.Values(set); err != nil {
|
||||
m.vals = vals
|
||||
}
|
||||
m.snap = &loader.Snapshot{
|
||||
ChangeSet: set,
|
||||
Version: genVer(),
|
||||
|
||||
@@ -4,7 +4,7 @@ The cli source reads config from parsed flags via a cli.Context.
|
||||
|
||||
## Format
|
||||
|
||||
We expect the use of the `micro/cli` package. Upper case flags will be lower cased. Dashes will be used as delimiters for nesting.
|
||||
We expect the use of the `urfave/cli` package. Upper case flags will be lower cased. Dashes will be used as delimiters for nesting.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/config/source"
|
||||
"github.com/imdario/mergo"
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
type cliSource struct {
|
||||
@@ -84,7 +84,7 @@ func (c *cliSource) String() string {
|
||||
return "cli"
|
||||
}
|
||||
|
||||
// NewSource returns a config source for integrating parsed flags from a micro/cli.Context.
|
||||
// NewSource returns a config source for integrating parsed flags from a urfave/cli.Context.
|
||||
// Hyphens are delimiters for nesting, and all keys are lowercased. The assumption is that
|
||||
// command line flags have already been parsed.
|
||||
//
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/asim/go-micro/v3/cmd"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/source"
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func TestCliSourceDefault(t *testing.T) {
|
||||
@@ -30,6 +30,9 @@ func TestCliSourceDefault(t *testing.T) {
|
||||
&cli.StringFlag{
|
||||
Name: "test.testlogfile",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "test.paniconexit0",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "flag",
|
||||
Usage: "It changes something",
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/asim/go-micro/v3/config/source"
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
type contextKey struct{}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"flag"
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) {
|
||||
|
||||
@@ -41,7 +41,7 @@ func (w *watcher) Next() (*source.ChangeSet, error) {
|
||||
|
||||
// try get the event
|
||||
select {
|
||||
case event, _ := <-w.fw.Events:
|
||||
case event := <-w.fw.Events:
|
||||
if event.Op == fsnotify.Rename {
|
||||
// check existence of file, and add watch again
|
||||
_, err := os.Stat(event.Name)
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/debug/profile"
|
||||
)
|
||||
@@ -17,7 +16,6 @@ type profiler struct {
|
||||
|
||||
sync.Mutex
|
||||
running bool
|
||||
exit chan bool
|
||||
|
||||
// where the cpu profile is written
|
||||
cpuFile *os.File
|
||||
@@ -25,23 +23,6 @@ type profiler struct {
|
||||
memFile *os.File
|
||||
}
|
||||
|
||||
func (p *profiler) writeHeap(f *os.File) {
|
||||
defer f.Close()
|
||||
|
||||
t := time.NewTicker(time.Second * 30)
|
||||
defer t.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-t.C:
|
||||
runtime.GC()
|
||||
pprof.WriteHeapProfile(f)
|
||||
case <-p.exit:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (p *profiler) Start() error {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
@@ -50,15 +31,12 @@ func (p *profiler) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// create exit channel
|
||||
p.exit = make(chan bool)
|
||||
|
||||
cpuFile := filepath.Join("/tmp", "cpu.pprof")
|
||||
memFile := filepath.Join("/tmp", "mem.pprof")
|
||||
cpuFile := filepath.Join(os.TempDir(), "cpu.pprof")
|
||||
memFile := filepath.Join(os.TempDir(), "mem.pprof")
|
||||
|
||||
if len(p.opts.Name) > 0 {
|
||||
cpuFile = filepath.Join("/tmp", p.opts.Name+".cpu.pprof")
|
||||
memFile = filepath.Join("/tmp", p.opts.Name+".mem.pprof")
|
||||
cpuFile = filepath.Join(os.TempDir(), p.opts.Name+".cpu.pprof")
|
||||
memFile = filepath.Join(os.TempDir(), p.opts.Name+".mem.pprof")
|
||||
}
|
||||
|
||||
f1, err := os.Create(cpuFile)
|
||||
@@ -76,9 +54,6 @@ func (p *profiler) Start() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// write the heap periodically
|
||||
go p.writeHeap(f2)
|
||||
|
||||
// set cpu file
|
||||
p.cpuFile = f1
|
||||
// set mem file
|
||||
@@ -93,18 +68,19 @@ func (p *profiler) Stop() error {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
|
||||
select {
|
||||
case <-p.exit:
|
||||
return nil
|
||||
default:
|
||||
close(p.exit)
|
||||
pprof.StopCPUProfile()
|
||||
p.cpuFile.Close()
|
||||
p.running = false
|
||||
p.cpuFile = nil
|
||||
p.memFile = nil
|
||||
if !p.running {
|
||||
return nil
|
||||
}
|
||||
|
||||
pprof.StopCPUProfile()
|
||||
p.cpuFile.Close()
|
||||
runtime.GC()
|
||||
pprof.WriteHeapProfile(p.memFile)
|
||||
p.memFile.Close()
|
||||
p.running = false
|
||||
p.cpuFile = nil
|
||||
p.memFile = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *profiler) String() string {
|
||||
|
||||
@@ -4,6 +4,7 @@ package errors
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
@@ -138,9 +139,43 @@ func Equal(err1 error, err2 error) bool {
|
||||
|
||||
// FromError try to convert go error to *Error
|
||||
func FromError(err error) *Error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if verr, ok := err.(*Error); ok && verr != nil {
|
||||
return verr
|
||||
}
|
||||
|
||||
return Parse(err.Error())
|
||||
}
|
||||
|
||||
// As finds the first error in err's chain that matches *Error
|
||||
func As(err error) (*Error, bool) {
|
||||
if err == nil {
|
||||
return nil, false
|
||||
}
|
||||
var merr *Error
|
||||
if errors.As(err, &merr) {
|
||||
return merr, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func NewMultiError() *MultiError {
|
||||
return &MultiError{
|
||||
Errors: make([]*Error, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (e *MultiError) Append(err *Error) {
|
||||
e.Errors = append(e.Errors, err)
|
||||
}
|
||||
|
||||
func (e *MultiError) HasErrors() bool {
|
||||
return len(e.Errors) > 0
|
||||
}
|
||||
|
||||
func (e *MultiError) Error() string {
|
||||
b, _ := json.Marshal(e)
|
||||
return string(b)
|
||||
}
|
||||
+200
-69
@@ -1,102 +1,233 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: errors/errors.proto
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.13.0
|
||||
// source: errors.proto
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// 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
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
|
||||
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
|
||||
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Error) Reset() { *m = Error{} }
|
||||
func (m *Error) String() string { return proto.CompactTextString(m) }
|
||||
func (*Error) ProtoMessage() {}
|
||||
func (x *Error) Reset() {
|
||||
*x = Error{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_errors_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Error) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Error) ProtoMessage() {}
|
||||
|
||||
func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_errors_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_85c4eef3398a32b2, []int{0}
|
||||
return file_errors_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *Error) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Error.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Error.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Error) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Error.Merge(m, src)
|
||||
}
|
||||
func (m *Error) XXX_Size() int {
|
||||
return xxx_messageInfo_Error.Size(m)
|
||||
}
|
||||
func (m *Error) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Error.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Error proto.InternalMessageInfo
|
||||
|
||||
func (m *Error) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
func (x *Error) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Error) GetCode() int32 {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
func (x *Error) GetCode() int32 {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Error) GetDetail() string {
|
||||
if m != nil {
|
||||
return m.Detail
|
||||
func (x *Error) GetDetail() string {
|
||||
if x != nil {
|
||||
return x.Detail
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Error) GetStatus() string {
|
||||
if m != nil {
|
||||
return m.Status
|
||||
func (x *Error) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Error)(nil), "errors.Error")
|
||||
type MultiError struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Errors []*Error `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"`
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("errors/errors.proto", fileDescriptor_85c4eef3398a32b2) }
|
||||
|
||||
var fileDescriptor_85c4eef3398a32b2 = []byte{
|
||||
// 118 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x2d, 0x2a, 0xca,
|
||||
0x2f, 0x2a, 0xd6, 0x87, 0x50, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x6c, 0x10, 0x9e, 0x52,
|
||||
0x34, 0x17, 0xab, 0x2b, 0x88, 0x25, 0xc4, 0xc7, 0xc5, 0x94, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8,
|
||||
0xc1, 0x19, 0xc4, 0x94, 0x99, 0x22, 0x24, 0xc4, 0xc5, 0x92, 0x9c, 0x9f, 0x92, 0x2a, 0xc1, 0xa4,
|
||||
0xc0, 0xa8, 0xc1, 0x1a, 0x04, 0x66, 0x0b, 0x89, 0x71, 0xb1, 0xa5, 0xa4, 0x96, 0x24, 0x66, 0xe6,
|
||||
0x48, 0x30, 0x83, 0xd5, 0x41, 0x79, 0x20, 0xf1, 0xe2, 0x92, 0xc4, 0x92, 0xd2, 0x62, 0x09, 0x16,
|
||||
0x88, 0x38, 0x84, 0x97, 0xc4, 0x06, 0xb6, 0xcb, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xca, 0xc3,
|
||||
0xcb, 0x29, 0x82, 0x00, 0x00, 0x00,
|
||||
func (x *MultiError) Reset() {
|
||||
*x = MultiError{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_errors_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MultiError) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MultiError) ProtoMessage() {}
|
||||
|
||||
func (x *MultiError) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_errors_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MultiError.ProtoReflect.Descriptor instead.
|
||||
func (*MultiError) Descriptor() ([]byte, []int) {
|
||||
return file_errors_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *MultiError) GetErrors() []*Error {
|
||||
if x != nil {
|
||||
return x.Errors
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_errors_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_errors_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
|
||||
0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x5b, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12,
|
||||
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63,
|
||||
0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x22, 0x33, 0x0a, 0x0a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x72, 0x72, 0x6f,
|
||||
0x72, 0x12, 0x25, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||
0x0b, 0x32, 0x0d, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72,
|
||||
0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x42, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_errors_proto_rawDescOnce sync.Once
|
||||
file_errors_proto_rawDescData = file_errors_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_errors_proto_rawDescGZIP() []byte {
|
||||
file_errors_proto_rawDescOnce.Do(func() {
|
||||
file_errors_proto_rawDescData = protoimpl.X.CompressGZIP(file_errors_proto_rawDescData)
|
||||
})
|
||||
return file_errors_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_errors_proto_goTypes = []interface{}{
|
||||
(*Error)(nil), // 0: errors.Error
|
||||
(*MultiError)(nil), // 1: errors.MultiError
|
||||
}
|
||||
var file_errors_proto_depIdxs = []int32{
|
||||
0, // 0: errors.MultiError.errors:type_name -> errors.Error
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_errors_proto_init() }
|
||||
func file_errors_proto_init() {
|
||||
if File_errors_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_errors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Error); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_errors_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MultiError); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_errors_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_errors_proto_goTypes,
|
||||
DependencyIndexes: file_errors_proto_depIdxs,
|
||||
MessageInfos: file_errors_proto_msgTypes,
|
||||
}.Build()
|
||||
File_errors_proto = out.File
|
||||
file_errors_proto_rawDesc = nil
|
||||
file_errors_proto_goTypes = nil
|
||||
file_errors_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: errors/errors.proto
|
||||
// source: errors.proto
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
@@ -13,9 +13,3 @@ import (
|
||||
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
|
||||
|
||||
@@ -8,3 +8,7 @@ message Error {
|
||||
string detail = 3;
|
||||
string status = 4;
|
||||
};
|
||||
|
||||
message MultiError {
|
||||
repeated Error errors = 1;
|
||||
}
|
||||
+102
-1
@@ -17,7 +17,10 @@ func TestFromError(t *testing.T) {
|
||||
if merr.Id != "go.micro.test" || merr.Code != 404 {
|
||||
t.Fatalf("invalid conversation %v != %v", err, merr)
|
||||
}
|
||||
|
||||
merr = FromError(nil)
|
||||
if merr != nil {
|
||||
t.Fatalf("%v should be nil", merr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEqual(t *testing.T) {
|
||||
@@ -75,3 +78,101 @@ func TestErrors(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAs(t *testing.T) {
|
||||
err := NotFound("go.micro.test", "%s", "example")
|
||||
merr, match := As(err)
|
||||
if !match {
|
||||
t.Fatalf("%v should convert to *Error", err)
|
||||
}
|
||||
if merr.Id != "go.micro.test" || merr.Code != 404 || merr.Detail != "example" {
|
||||
t.Fatalf("invalid conversation %v != %v", err, merr)
|
||||
}
|
||||
err = er.New(err.Error())
|
||||
merr, match = As(err)
|
||||
if match || merr != nil {
|
||||
t.Fatalf("%v should not convert to *Error", err)
|
||||
}
|
||||
merr, match = As(nil)
|
||||
if match || merr != nil {
|
||||
t.Fatalf("nil should not convert to *Error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppend(t *testing.T) {
|
||||
mError := NewMultiError()
|
||||
testData := []*Error{
|
||||
{
|
||||
Id: "test1",
|
||||
Code: 500,
|
||||
Detail: "Internal server error",
|
||||
Status: http.StatusText(500),
|
||||
},
|
||||
{
|
||||
Id: "test2",
|
||||
Code: 400,
|
||||
Detail: "Bad Request",
|
||||
Status: http.StatusText(400),
|
||||
},
|
||||
{
|
||||
Id: "test3",
|
||||
Code: 404,
|
||||
Detail: "Not Found",
|
||||
Status: http.StatusText(404),
|
||||
},
|
||||
}
|
||||
|
||||
for _, e := range testData {
|
||||
mError.Append(&Error{
|
||||
Id: e.Id,
|
||||
Code: e.Code,
|
||||
Detail: e.Detail,
|
||||
Status: e.Status,
|
||||
})
|
||||
}
|
||||
|
||||
if len(mError.Errors) != 3 {
|
||||
t.Fatalf("Expected 3 got %v", len(mError.Errors))
|
||||
}
|
||||
}
|
||||
|
||||
func TestHasErrors(t *testing.T) {
|
||||
mError := NewMultiError()
|
||||
testData := []*Error{
|
||||
{
|
||||
Id: "test1",
|
||||
Code: 500,
|
||||
Detail: "Internal server error",
|
||||
Status: http.StatusText(500),
|
||||
},
|
||||
{
|
||||
Id: "test2",
|
||||
Code: 400,
|
||||
Detail: "Bad Request",
|
||||
Status: http.StatusText(400),
|
||||
},
|
||||
{
|
||||
Id: "test3",
|
||||
Code: 404,
|
||||
Detail: "Not Found",
|
||||
Status: http.StatusText(404),
|
||||
},
|
||||
}
|
||||
|
||||
if mError.HasErrors() {
|
||||
t.Fatal("Expected no error")
|
||||
}
|
||||
|
||||
for _, e := range testData {
|
||||
mError.Errors = append(mError.Errors, &Error{
|
||||
Id: e.Id,
|
||||
Code: e.Code,
|
||||
Detail: e.Detail,
|
||||
Status: e.Status,
|
||||
})
|
||||
}
|
||||
|
||||
if !mError.HasErrors() {
|
||||
t.Fatal("Expected errors")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,7 @@ This is a repository for go-micro examples. Feel free to contribute.
|
||||
## Contents
|
||||
|
||||
- [broker](broker) - A example of using Broker for Publish and Subscribing.
|
||||
- [cache](cache) - Usage of the Cache package to create a cache service.
|
||||
- [client](client) - Usage of the Client package to call a service.
|
||||
- [config](config) - Using Go Config for dynamic config
|
||||
- [event](event) - Using the API Gateway event handler
|
||||
@@ -22,7 +23,6 @@ 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 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
|
||||
|
||||
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
# Cache
|
||||
|
||||
This is an example of a cache service using the [asim/go-micro/cache][1] package.
|
||||
|
||||
## Contents
|
||||
|
||||
This project was generated using [Gomu][2].
|
||||
|
||||
* handler - contains the service handler
|
||||
* proto - contains the protocol buffer and generated code
|
||||
|
||||
## Usage
|
||||
|
||||
Run the `go.micro.srv.cache` service using [Gomu][2].
|
||||
|
||||
```bash
|
||||
gomu run
|
||||
```
|
||||
|
||||
You can also run it using plain Go.
|
||||
|
||||
```bash
|
||||
go run main.go
|
||||
```
|
||||
|
||||
We'll be using [Gomu][2] to call the service. You can store a new key-value
|
||||
pair in the cache.
|
||||
|
||||
```bash
|
||||
gomu call go.micro.srv.cache Cache.Put '{"key":"test","value":"hello go-micro","duration":"12h"}'
|
||||
```
|
||||
|
||||
You can get values from the cache.
|
||||
|
||||
```bash
|
||||
$ gomu call go.micro.srv.cache Cache.Get '{"key":"test"}'
|
||||
{"expiration":"2021-09-01 22:42:24.2370591 +0200 CEST","value":"hello go-micro"}
|
||||
```
|
||||
|
||||
Finally you can delete keys from the cache.
|
||||
|
||||
```bash
|
||||
gomu call go.micro.srv.cache Cache.Delete '{"key":"test"}'
|
||||
```
|
||||
|
||||
[1]: https://github.com/asim/go-micro/tree/master/cache
|
||||
[2]: https://github.com/asim/go-micro/tree/master/cmd/gomu
|
||||
Vendored
+60
@@ -0,0 +1,60 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/cache"
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
|
||||
pb "github.com/asim/go-micro/examples/v3/cache/proto"
|
||||
)
|
||||
|
||||
type Cache struct {
|
||||
cache cache.Cache
|
||||
}
|
||||
|
||||
func NewCache(opts ...cache.Option) *Cache {
|
||||
c := cache.NewCache(opts...)
|
||||
return &Cache{c}
|
||||
}
|
||||
|
||||
func (c *Cache) Get(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse) error {
|
||||
log.Infof("Received Cache.Get request: %v", req)
|
||||
|
||||
v, e, err := c.cache.Context(ctx).Get(req.Key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
rsp.Value = fmt.Sprintf("%v", v)
|
||||
rsp.Expiration = e.String()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cache) Put(ctx context.Context, req *pb.PutRequest, rsp *pb.PutResponse) error {
|
||||
log.Infof("Received Cache.Put request: %v", req)
|
||||
|
||||
d, err := time.ParseDuration(req.Duration)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := c.cache.Context(ctx).Put(req.Key, req.Value, d); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cache) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.DeleteResponse) error {
|
||||
log.Infof("Received Cache.Delete request: %v", req)
|
||||
|
||||
if err := c.cache.Context(ctx).Delete(req.Key); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/examples/v3/cache/handler"
|
||||
pb "github.com/asim/go-micro/examples/v3/cache/proto"
|
||||
|
||||
"github.com/asim/go-micro/v3"
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
service = "go.micro.srv.cache"
|
||||
version = "latest"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create service
|
||||
srv := micro.NewService(
|
||||
micro.Name(service),
|
||||
micro.Version(version),
|
||||
)
|
||||
srv.Init()
|
||||
|
||||
// Register handler
|
||||
pb.RegisterCacheHandler(srv.Server(), handler.NewCache())
|
||||
|
||||
// Run service
|
||||
if err := srv.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Vendored
+486
@@ -0,0 +1,486 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.6.1
|
||||
// source: proto/cache.proto
|
||||
|
||||
package cache
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type GetRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The key to fetch from the cache.
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetRequest) Reset() {
|
||||
*x = GetRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetRequest) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The value retrieved from the cache.
|
||||
Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
// The value's expiration datetime.
|
||||
Expiration string `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetResponse) Reset() {
|
||||
*x = GetResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetResponse) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetResponse) GetExpiration() string {
|
||||
if x != nil {
|
||||
return x.Expiration
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type PutRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The key to store in the cache.
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// The value to store in the cache.
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
// The value's time to live. Parsed using time.ParseDuration. 0 means
|
||||
// it doesn't expire.
|
||||
Duration string `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PutRequest) Reset() {
|
||||
*x = PutRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PutRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutRequest) ProtoMessage() {}
|
||||
|
||||
func (x *PutRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
|
||||
func (*PutRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PutRequest) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PutRequest) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PutRequest) GetDuration() string {
|
||||
if x != nil {
|
||||
return x.Duration
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type PutResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *PutResponse) Reset() {
|
||||
*x = PutResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PutResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutResponse) ProtoMessage() {}
|
||||
|
||||
func (x *PutResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
|
||||
func (*PutResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
type DeleteRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The key to remove from the cache.
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeleteRequest) Reset() {
|
||||
*x = DeleteRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeleteRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *DeleteRequest) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *DeleteResponse) Reset() {
|
||||
*x = DeleteResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_cache_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeleteResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_cache_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_cache_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_proto_cache_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_cache_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x22, 0x1e, 0x0a, 0x0a, 0x47, 0x65,
|
||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x43, 0x0a, 0x0b, 0x47, 0x65,
|
||||
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12,
|
||||
0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
|
||||
0x50, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x21, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12,
|
||||
0x2e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x61, 0x63, 0x68,
|
||||
0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x2e, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x11, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x50,
|
||||
0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x61, 0x63, 0x68,
|
||||
0x65, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x37, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x63, 0x61, 0x63, 0x68,
|
||||
0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x15, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_cache_proto_rawDescOnce sync.Once
|
||||
file_proto_cache_proto_rawDescData = file_proto_cache_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_cache_proto_rawDescGZIP() []byte {
|
||||
file_proto_cache_proto_rawDescOnce.Do(func() {
|
||||
file_proto_cache_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_cache_proto_rawDescData)
|
||||
})
|
||||
return file_proto_cache_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_cache_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_proto_cache_proto_goTypes = []interface{}{
|
||||
(*GetRequest)(nil), // 0: cache.GetRequest
|
||||
(*GetResponse)(nil), // 1: cache.GetResponse
|
||||
(*PutRequest)(nil), // 2: cache.PutRequest
|
||||
(*PutResponse)(nil), // 3: cache.PutResponse
|
||||
(*DeleteRequest)(nil), // 4: cache.DeleteRequest
|
||||
(*DeleteResponse)(nil), // 5: cache.DeleteResponse
|
||||
}
|
||||
var file_proto_cache_proto_depIdxs = []int32{
|
||||
0, // 0: cache.Cache.Get:input_type -> cache.GetRequest
|
||||
2, // 1: cache.Cache.Put:input_type -> cache.PutRequest
|
||||
4, // 2: cache.Cache.Delete:input_type -> cache.DeleteRequest
|
||||
1, // 3: cache.Cache.Get:output_type -> cache.GetResponse
|
||||
3, // 4: cache.Cache.Put:output_type -> cache.PutResponse
|
||||
5, // 5: cache.Cache.Delete:output_type -> cache.DeleteResponse
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_cache_proto_init() }
|
||||
func file_proto_cache_proto_init() {
|
||||
if File_proto_cache_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_cache_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_cache_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_cache_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PutRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_cache_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PutResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_cache_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeleteRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_cache_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeleteResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_cache_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_proto_cache_proto_goTypes,
|
||||
DependencyIndexes: file_proto_cache_proto_depIdxs,
|
||||
MessageInfos: file_proto_cache_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_cache_proto = out.File
|
||||
file_proto_cache_proto_rawDesc = nil
|
||||
file_proto_cache_proto_goTypes = nil
|
||||
file_proto_cache_proto_depIdxs = nil
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/cache.proto
|
||||
|
||||
package cache
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/asim/go-micro/v3/api"
|
||||
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
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for Cache service
|
||||
|
||||
func NewCacheEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for Cache service
|
||||
|
||||
type CacheService interface {
|
||||
// Get receives a value and its time to live by key from the cache.
|
||||
Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error)
|
||||
// Put stores a value and its time to live in the cache.
|
||||
Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error)
|
||||
// Delete removes a key from the cache.
|
||||
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
|
||||
}
|
||||
|
||||
type cacheService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewCacheService(name string, c client.Client) CacheService {
|
||||
return &cacheService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cacheService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Cache.Get", in)
|
||||
out := new(GetResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cacheService) Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Cache.Put", in)
|
||||
out := new(PutResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cacheService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Cache.Delete", in)
|
||||
out := new(DeleteResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Cache service
|
||||
|
||||
type CacheHandler interface {
|
||||
// Get receives a value and its time to live by key from the cache.
|
||||
Get(context.Context, *GetRequest, *GetResponse) error
|
||||
// Put stores a value and its time to live in the cache.
|
||||
Put(context.Context, *PutRequest, *PutResponse) error
|
||||
// Delete removes a key from the cache.
|
||||
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
|
||||
}
|
||||
|
||||
func RegisterCacheHandler(s server.Server, hdlr CacheHandler, opts ...server.HandlerOption) error {
|
||||
type cache interface {
|
||||
Get(ctx context.Context, in *GetRequest, out *GetResponse) error
|
||||
Put(ctx context.Context, in *PutRequest, out *PutResponse) error
|
||||
Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
|
||||
}
|
||||
type Cache struct {
|
||||
cache
|
||||
}
|
||||
h := &cacheHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Cache{h}, opts...))
|
||||
}
|
||||
|
||||
type cacheHandler struct {
|
||||
CacheHandler
|
||||
}
|
||||
|
||||
func (h *cacheHandler) Get(ctx context.Context, in *GetRequest, out *GetResponse) error {
|
||||
return h.CacheHandler.Get(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *cacheHandler) Put(ctx context.Context, in *PutRequest, out *PutResponse) error {
|
||||
return h.CacheHandler.Put(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *cacheHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
|
||||
return h.CacheHandler.Delete(ctx, in, out)
|
||||
}
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cache;
|
||||
|
||||
option go_package = "./proto;cache";
|
||||
|
||||
// Cache offers a cache as a service functionality.
|
||||
service Cache {
|
||||
// Get receives a value and its time to live by key from the cache.
|
||||
rpc Get(GetRequest) returns (GetResponse) {}
|
||||
// Put stores a value and its time to live in the cache.
|
||||
rpc Put(PutRequest) returns (PutResponse) {}
|
||||
// Delete removes a key from the cache.
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
|
||||
}
|
||||
|
||||
message GetRequest {
|
||||
// The key to fetch from the cache.
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
message GetResponse {
|
||||
// The value retrieved from the cache.
|
||||
string value = 1;
|
||||
// The value's expiration datetime.
|
||||
string expiration = 2;
|
||||
}
|
||||
|
||||
message PutRequest {
|
||||
// The key to store in the cache.
|
||||
string key = 1;
|
||||
// The value to store in the cache.
|
||||
string value = 2;
|
||||
// The value's time to live. Parsed using time.ParseDuration. 0 means
|
||||
// it doesn't expire.
|
||||
string duration = 3;
|
||||
}
|
||||
|
||||
message PutResponse {}
|
||||
|
||||
message DeleteRequest {
|
||||
// The key to remove from the cache.
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
message DeleteResponse {}
|
||||
@@ -1,9 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/util/log"
|
||||
grpcConfig "github.com/asim/go-micro/plugins/config/source/grpc/v3"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
type Micro struct {
|
||||
@@ -37,7 +37,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Logf("Read config: %s", string(conf.Bytes()))
|
||||
log.Infof("Read config: %s", string(conf.Bytes()))
|
||||
|
||||
// watch the config for changes
|
||||
watcher, err := conf.Watch()
|
||||
@@ -45,7 +45,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Logf("Watching for changes ...")
|
||||
log.Infof("Watching for changes ...")
|
||||
|
||||
for {
|
||||
v, err := watcher.Next()
|
||||
@@ -53,6 +53,6 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Logf("Watching for changes: %v", string(v.Bytes()))
|
||||
log.Infof("Watching for changes: %v", string(v.Bytes()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,13 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/source/file"
|
||||
"github.com/asim/go-micro/v3/util/log"
|
||||
yaml "github.com/asim/go-micro/plugins/config/encoder/yaml/v3"
|
||||
proto "github.com/asim/go-micro/plugins/config/source/grpc/v3/proto"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/reader"
|
||||
"github.com/asim/go-micro/v3/config/reader/json"
|
||||
"github.com/asim/go-micro/v3/config/source/file"
|
||||
log "github.com/asim/go-micro/v3/logger"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -20,11 +23,18 @@ var (
|
||||
mux sync.RWMutex
|
||||
configMaps = make(map[string]*proto.ChangeSet)
|
||||
apps = []string{"micro", "extra"}
|
||||
cfg config.Config
|
||||
)
|
||||
|
||||
type Service struct{}
|
||||
|
||||
func main() {
|
||||
// create config with yaml encoder
|
||||
enc := yaml.NewEncoder()
|
||||
cfg, _ = config.NewConfig(config.WithReader(json.NewReader(
|
||||
reader.WithEncoder(enc),
|
||||
)))
|
||||
|
||||
// load config files
|
||||
err := loadConfigFile()
|
||||
if err != nil {
|
||||
@@ -39,7 +49,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Logf("configServer started")
|
||||
log.Infof("configServer started")
|
||||
err = service.Serve(ts)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -58,8 +68,6 @@ func (s Service) Read(ctx context.Context, req *proto.ReadRequest) (rsp *proto.R
|
||||
err = fmt.Errorf("[Read] the first path is invalid")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (s Service) Watch(req *proto.WatchRequest, server proto.Source_WatchServer) (err error) {
|
||||
@@ -68,7 +76,7 @@ func (s Service) Watch(req *proto.WatchRequest, server proto.Source_WatchServer)
|
||||
ChangeSet: getConfig(appName),
|
||||
}
|
||||
if err = server.Send(rsp); err != nil {
|
||||
log.Logf("[Watch] watch files error,%s", err)
|
||||
log.Infof("[Watch] watch files error,%s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -77,8 +85,8 @@ func (s Service) Watch(req *proto.WatchRequest, server proto.Source_WatchServer)
|
||||
|
||||
func loadConfigFile() (err error) {
|
||||
for _, app := range apps {
|
||||
if err := config.Load(file.NewSource(
|
||||
file.WithPath("./conf/" + app + ".yml"),
|
||||
if err := cfg.Load(file.NewSource(
|
||||
file.WithPath("./conf/" + app + ".yaml"),
|
||||
)); err != nil {
|
||||
log.Fatalf("[loadConfigFile] load files error,%s", err)
|
||||
return err
|
||||
@@ -86,7 +94,7 @@ func loadConfigFile() (err error) {
|
||||
}
|
||||
|
||||
// watch changes
|
||||
watcher, err := config.Watch()
|
||||
watcher, err := cfg.Watch()
|
||||
if err != nil {
|
||||
log.Fatalf("[loadConfigFile] start watching files error,%s", err)
|
||||
return err
|
||||
@@ -100,7 +108,7 @@ func loadConfigFile() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Logf("[loadConfigFile] file change, %s", string(v.Bytes()))
|
||||
log.Infof("[loadConfigFile] file change, %s", string(v.Bytes()))
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -108,9 +116,9 @@ func loadConfigFile() (err error) {
|
||||
}
|
||||
|
||||
func getConfig(appName string) *proto.ChangeSet {
|
||||
bytes := config.Get(appName).Bytes()
|
||||
bytes := cfg.Get(appName).Bytes()
|
||||
|
||||
log.Logf("[getConfig] appName,%s", string(bytes))
|
||||
log.Infof("[getConfig] appName,%s", string(bytes))
|
||||
return &proto.ChangeSet{
|
||||
Data: bytes,
|
||||
Checksum: fmt.Sprintf("%x", md5.Sum(bytes)),
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Yaml Config
|
||||
|
||||
This is an example of reading yaml config in a file.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
go run main.go
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
hosts:
|
||||
database:
|
||||
address: 10.0.0.1
|
||||
port: 3306
|
||||
cache:
|
||||
address: 10.0.0.2
|
||||
port: 6379
|
||||
@@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
yaml "github.com/asim/go-micro/plugins/config/encoder/yaml/v3"
|
||||
"github.com/asim/go-micro/v3/config"
|
||||
"github.com/asim/go-micro/v3/config/reader"
|
||||
"github.com/asim/go-micro/v3/config/reader/json"
|
||||
"github.com/asim/go-micro/v3/config/source/file"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// new yaml encoder
|
||||
enc := yaml.NewEncoder()
|
||||
|
||||
// new config
|
||||
c, _ := config.NewConfig(
|
||||
config.WithReader(
|
||||
json.NewReader( // json reader for internal config merge
|
||||
reader.WithEncoder(enc),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
// load the config from a file source
|
||||
if err := c.Load(file.NewSource(
|
||||
file.WithPath("./config.yaml"),
|
||||
)); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("data", c.Map())
|
||||
|
||||
// define our own host type
|
||||
type Host struct {
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
}
|
||||
|
||||
var host Host
|
||||
|
||||
// read a database host
|
||||
if err := c.Get("hosts", "database").Scan(&host); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(host.Address, host.Port)
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -25,5 +25,5 @@ go run main.go
|
||||
Curl your request at the gateway (localhost:8080)
|
||||
|
||||
```
|
||||
curl -d '{"name": "john"}' http://localhost:8080/greeter/hello
|
||||
curl -H "content-type: application/json" -d '{"name": "john"}' http://localhost:8080/greeter/hello
|
||||
```
|
||||
|
||||
+18
-39
@@ -1,45 +1,24 @@
|
||||
module github.com/asim/go-micro/examples/v3
|
||||
|
||||
go 1.13
|
||||
|
||||
replace k8s.io/api => k8s.io/api v0.0.0-20190708174958-539a33f6e817
|
||||
|
||||
replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d
|
||||
|
||||
replace k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190708180123-608cd7da68f7
|
||||
|
||||
replace k8s.io/client-go => k8s.io/client-go v11.0.0+incompatible
|
||||
|
||||
replace k8s.io/component-base => k8s.io/component-base v0.0.0-20190708175518-244289f83105
|
||||
|
||||
replace google.golang.org/grpc => google.golang.org/grpc v1.24.0
|
||||
go 1.16
|
||||
|
||||
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/asim/go-micro/plugins/client/http/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/plugins/config/encoder/toml/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/plugins/config/encoder/yaml/v3 v3.0.0-20210804083901-3e0411a3f61b
|
||||
github.com/asim/go-micro/plugins/config/source/grpc/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/plugins/server/http/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/plugins/wrapper/select/roundrobin/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/plugins/wrapper/select/shard/v3 v3.0.0-20210403073940-e7a7e3a05092
|
||||
github.com/asim/go-micro/v3 v3.6.1-0.20210831143116-05a299b76c7c
|
||||
github.com/gin-gonic/gin v1.7.0
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
|
||||
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/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-20200707034311-ab3426394381
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
|
||||
google.golang.org/grpc v1.26.0
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||
github.com/pborman/uuid v1.2.1
|
||||
github.com/urfave/cli/v2 v2.3.0
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed
|
||||
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84
|
||||
google.golang.org/grpc v1.38.0
|
||||
google.golang.org/protobuf v1.26.0
|
||||
)
|
||||
|
||||
+516
-149
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
# http server and http client demo
|
||||
|
||||
An example http application
|
||||
|
||||
## Contents
|
||||
|
||||
- **srv** - a http server as server of go-mirco service
|
||||
- **cli** - a http client that call http server
|
||||
- **rpcli** - a http client that call rpc server
|
||||
|
||||
|
||||
## Run Service
|
||||
Start http server
|
||||
```shell
|
||||
go run srv/main.go
|
||||
```
|
||||
|
||||
## Client
|
||||
|
||||
Call http client
|
||||
```shell
|
||||
go run cli/main.go
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Run rpc Service
|
||||
Start greeter service
|
||||
```shell
|
||||
go run ../greeter/srv/main.go
|
||||
```
|
||||
|
||||
## Client
|
||||
http client call rpc service
|
||||
```shell
|
||||
go run rpccli/main.go
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user