mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
v5
This commit is contained in:
parent
e11395c8f5
commit
610c00859f
@ -1,4 +1,4 @@
|
|||||||
# Go Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/go-micro.dev/v4?tab=doc) [![Go Report Card](https://goreportcard.com/badge/github.com/go-micro/go-micro)](https://goreportcard.com/report/github.com/go-micro/go-micro)
|
# Go Micro [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/go-micro.dev/v5?tab=doc) [![Go Report Card](https://goreportcard.com/badge/github.com/go-micro/go-micro)](https://goreportcard.com/report/github.com/go-micro/go-micro)
|
||||||
|
|
||||||
Go Micro is a framework for distributed systems development.
|
Go Micro is a framework for distributed systems development.
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ Go Micro abstracts away the details of distributed systems. Here are the main fe
|
|||||||
To make use of Go Micro import it
|
To make use of Go Micro import it
|
||||||
|
|
||||||
```golang
|
```golang
|
||||||
import "go-micro.dev/v4"
|
import "go-micro.dev/v5"
|
||||||
```
|
```
|
||||||
|
|
||||||
Define a handler (protobuf is optionally supported - see [example](https://github.com/go-micro/examples/blob/main/helloworld/main.go))
|
Define a handler (protobuf is optionally supported - see [example](https://github.com/go-micro/examples/blob/main/helloworld/main.go))
|
||||||
@ -127,4 +127,4 @@ See [github.com/go-micro](https://github.com/go-micro) for tooling.
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Go Micro is Apache 2.0 licensed.
|
[Business Source License 1.1](LICENSE)
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/server"
|
"go-micro.dev/v5/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
// API interface provides a way to
|
// API interface provides a way to
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -3,11 +3,11 @@ package api
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
"go-micro.dev/v4/api/handler/rpc"
|
"go-micro.dev/v5/api/handler/rpc"
|
||||||
"go-micro.dev/v4/api/router/registry"
|
"go-micro.dev/v5/api/router/registry"
|
||||||
"go-micro.dev/v4/api/server"
|
"go-micro.dev/v5/api/server"
|
||||||
"go-micro.dev/v4/api/server/http"
|
"go-micro.dev/v5/api/server/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type api struct {
|
type api struct {
|
||||||
|
@ -4,13 +4,13 @@ package api
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
api "go-micro.dev/v4/api/proto"
|
api "go-micro.dev/v5/api/proto"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
"go-micro.dev/v4/errors"
|
"go-micro.dev/v5/errors"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
"go-micro.dev/v4/util/ctx"
|
"go-micro.dev/v5/util/ctx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type apiHandler struct {
|
type apiHandler struct {
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/oxtoacart/bpool"
|
"github.com/oxtoacart/bpool"
|
||||||
api "go-micro.dev/v4/api/proto"
|
api "go-micro.dev/v5/api/proto"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -12,9 +12,9 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/oxtoacart/bpool"
|
"github.com/oxtoacart/bpool"
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
proto "go-micro.dev/v4/api/proto"
|
proto "go-micro.dev/v5/api/proto"
|
||||||
"go-micro.dev/v4/util/ctx"
|
"go-micro.dev/v5/util/ctx"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -6,12 +6,12 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
"go-micro.dev/v4/api/resolver/vpath"
|
"go-micro.dev/v5/api/resolver/vpath"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
regRouter "go-micro.dev/v4/api/router/registry"
|
regRouter "go-micro.dev/v5/api/router/registry"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testHttp(t *testing.T, path, service, ns string) {
|
func testHttp(t *testing.T, path, service, ns string) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package handler
|
package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -11,20 +11,20 @@ import (
|
|||||||
|
|
||||||
jsonpatch "github.com/evanphx/json-patch/v5"
|
jsonpatch "github.com/evanphx/json-patch/v5"
|
||||||
"github.com/oxtoacart/bpool"
|
"github.com/oxtoacart/bpool"
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
"go-micro.dev/v4/api/internal/proto"
|
"go-micro.dev/v5/api/internal/proto"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
"go-micro.dev/v4/codec/jsonrpc"
|
"go-micro.dev/v5/codec/jsonrpc"
|
||||||
"go-micro.dev/v4/codec/protorpc"
|
"go-micro.dev/v5/codec/protorpc"
|
||||||
"go-micro.dev/v4/errors"
|
"go-micro.dev/v5/errors"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
"go-micro.dev/v4/util/ctx"
|
"go-micro.dev/v5/util/ctx"
|
||||||
"go-micro.dev/v4/util/qson"
|
"go-micro.dev/v5/util/qson"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
go_api "go-micro.dev/v4/api/proto"
|
go_api "go-micro.dev/v5/api/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRequestPayloadFromRequest(t *testing.T) {
|
func TestRequestPayloadFromRequest(t *testing.T) {
|
||||||
|
@ -12,10 +12,10 @@ import (
|
|||||||
"github.com/gobwas/httphead"
|
"github.com/gobwas/httphead"
|
||||||
"github.com/gobwas/ws"
|
"github.com/gobwas/ws"
|
||||||
"github.com/gobwas/ws/wsutil"
|
"github.com/gobwas/ws/wsutil"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
raw "go-micro.dev/v4/codec/bytes"
|
raw "go-micro.dev/v5/codec/bytes"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
// serveWebsocket will stream rpc back over websockets assuming json.
|
// serveWebsocket will stream rpc back over websockets assuming json.
|
||||||
|
@ -11,9 +11,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/handler"
|
"go-micro.dev/v5/api/handler"
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
registry2 "go-micro.dev/v4/api/router/registry"
|
registry2 "go-micro.dev/v5/api/router/registry"
|
||||||
"go-micro.dev/v4/client"
|
"go-micro.dev/v5/client"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewOptions(opts ...Option) Options {
|
func NewOptions(opts ...Option) Options {
|
||||||
@ -43,4 +43,3 @@ func WithRegistry(r registry.Registry) Option {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resolver is the gRPC Resolver.
|
// Resolver is the gRPC Resolver.
|
||||||
|
@ -4,7 +4,7 @@ package host
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resolver is a host resolver.
|
// Resolver is a host resolver.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resolver is a path resolver.
|
// Resolver is a path resolver.
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewResolver returns a new vpath resolver.
|
// NewResolver returns a new vpath resolver.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
"go-micro.dev/v4/api/resolver/vpath"
|
"go-micro.dev/v5/api/resolver/vpath"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Options is a struct of options available.
|
// Options is a struct of options available.
|
||||||
|
@ -10,12 +10,12 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/api/router/util"
|
"go-micro.dev/v5/api/router/util"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/registry/cache"
|
"go-micro.dev/v5/registry/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// endpoint struct, that holds compiled pcre.
|
// endpoint struct, that holds compiled pcre.
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStoreRegex(t *testing.T) {
|
func TestStoreRegex(t *testing.T) {
|
||||||
|
@ -4,7 +4,7 @@ package router
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Router is used to determine an endpoint for a request.
|
// Router is used to determine an endpoint for a request.
|
||||||
|
@ -8,12 +8,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/router"
|
"go-micro.dev/v5/api/router"
|
||||||
"go-micro.dev/v4/api/router/util"
|
"go-micro.dev/v5/api/router/util"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
rutil "go-micro.dev/v4/util/registry"
|
rutil "go-micro.dev/v5/util/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type endpoint struct {
|
type endpoint struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InvalidTemplateError indicates that the path template is not valid.
|
// InvalidTemplateError indicates that the path template is not valid.
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTokenize(t *testing.T) {
|
func TestTokenize(t *testing.T) {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/server/acme"
|
"go-micro.dev/v5/api/server/acme"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
"golang.org/x/crypto/acme/autocert"
|
"golang.org/x/crypto/acme/autocert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package acme
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-acme/lego/v4/challenge"
|
"github.com/go-acme/lego/v4/challenge"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Option (or Options) are passed to New() to configure providers.
|
// Option (or Options) are passed to New() to configure providers.
|
||||||
|
@ -9,9 +9,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
"go-micro.dev/v4/api/server"
|
"go-micro.dev/v5/api/server"
|
||||||
"go-micro.dev/v4/api/server/cors"
|
"go-micro.dev/v5/api/server/cors"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type httpServer struct {
|
type httpServer struct {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/server"
|
"go-micro.dev/v5/api/server"
|
||||||
"go-micro.dev/v4/api/server/cors"
|
"go-micro.dev/v5/api/server/cors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHTTPServer(t *testing.T) {
|
func TestHTTPServer(t *testing.T) {
|
||||||
|
@ -4,10 +4,10 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"go-micro.dev/v4/api/resolver"
|
"go-micro.dev/v5/api/resolver"
|
||||||
"go-micro.dev/v4/api/server/acme"
|
"go-micro.dev/v5/api/server/acme"
|
||||||
"go-micro.dev/v4/api/server/cors"
|
"go-micro.dev/v5/api/server/cors"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Option func(o *Options)
|
type Option func(o *Options)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewOptions(opts ...Option) Options {
|
func NewOptions(opts ...Option) Options {
|
||||||
|
@ -16,14 +16,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"go-micro.dev/v4/codec/json"
|
"go-micro.dev/v5/codec/json"
|
||||||
merr "go-micro.dev/v4/errors"
|
merr "go-micro.dev/v5/errors"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/registry/cache"
|
"go-micro.dev/v5/registry/cache"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
maddr "go-micro.dev/v4/util/addr"
|
maddr "go-micro.dev/v5/util/addr"
|
||||||
mnet "go-micro.dev/v4/util/net"
|
mnet "go-micro.dev/v5/util/net"
|
||||||
mls "go-micro.dev/v4/util/tls"
|
mls "go-micro.dev/v5/util/tls"
|
||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"go-micro.dev/v4/broker"
|
"go-micro.dev/v5/broker"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
maddr "go-micro.dev/v4/util/addr"
|
maddr "go-micro.dev/v5/util/addr"
|
||||||
mnet "go-micro.dev/v4/util/net"
|
mnet "go-micro.dev/v5/util/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
type memoryBroker struct {
|
type memoryBroker struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/broker"
|
"go-micro.dev/v5/broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMemoryBroker(t *testing.T) {
|
func TestMemoryBroker(t *testing.T) {
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
2
cache/options.go
vendored
2
cache/options.go
vendored
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Options represents the options for the cache.
|
// Options represents the options for the cache.
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/util/backoff"
|
"go-micro.dev/v5/util/backoff"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error)
|
type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error)
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
cache "github.com/patrickmn/go-cache"
|
cache "github.com/patrickmn/go-cache"
|
||||||
|
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCache returns an initialized cache.
|
// NewCache returns an initialized cache.
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCache(t *testing.T) {
|
func TestCache(t *testing.T) {
|
||||||
|
@ -4,7 +4,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -4,12 +4,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/broker"
|
"go-micro.dev/v5/broker"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
"go-micro.dev/v4/logger"
|
"go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
"go-micro.dev/v4/transport"
|
"go-micro.dev/v5/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/transport"
|
"go-micro.dev/v5/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCallOptions(t *testing.T) {
|
func TestCallOptions(t *testing.T) {
|
||||||
|
@ -3,7 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/errors"
|
"go-micro.dev/v5/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// note that returning either false or a non-nil error will result in the call not being retried.
|
// note that returning either false or a non-nil error will result in the call not being retried.
|
||||||
|
@ -10,19 +10,19 @@ import (
|
|||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"go-micro.dev/v4/broker"
|
"go-micro.dev/v5/broker"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
raw "go-micro.dev/v4/codec/bytes"
|
raw "go-micro.dev/v5/codec/bytes"
|
||||||
merrors "go-micro.dev/v4/errors"
|
merrors "go-micro.dev/v5/errors"
|
||||||
log "go-micro.dev/v4/logger"
|
log "go-micro.dev/v5/logger"
|
||||||
"go-micro.dev/v4/metadata"
|
"go-micro.dev/v5/metadata"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
"go-micro.dev/v4/transport"
|
"go-micro.dev/v5/transport"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
"go-micro.dev/v4/util/buf"
|
"go-micro.dev/v5/util/buf"
|
||||||
"go-micro.dev/v4/util/net"
|
"go-micro.dev/v5/util/net"
|
||||||
"go-micro.dev/v4/util/pool"
|
"go-micro.dev/v5/util/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/errors"
|
"go-micro.dev/v5/errors"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/selector"
|
"go-micro.dev/v5/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,17 +4,17 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
errs "errors"
|
errs "errors"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
raw "go-micro.dev/v4/codec/bytes"
|
raw "go-micro.dev/v5/codec/bytes"
|
||||||
"go-micro.dev/v4/codec/grpc"
|
"go-micro.dev/v5/codec/grpc"
|
||||||
"go-micro.dev/v4/codec/json"
|
"go-micro.dev/v5/codec/json"
|
||||||
"go-micro.dev/v4/codec/jsonrpc"
|
"go-micro.dev/v5/codec/jsonrpc"
|
||||||
"go-micro.dev/v4/codec/proto"
|
"go-micro.dev/v5/codec/proto"
|
||||||
"go-micro.dev/v4/codec/protorpc"
|
"go-micro.dev/v5/codec/protorpc"
|
||||||
"go-micro.dev/v4/errors"
|
"go-micro.dev/v5/errors"
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
"go-micro.dev/v4/transport"
|
"go-micro.dev/v5/transport"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcRequest struct {
|
type rpcRequest struct {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
"go-micro.dev/v4/transport"
|
"go-micro.dev/v5/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcResponse struct {
|
type rpcResponse struct {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Implements the streamer interface.
|
// Implements the streamer interface.
|
||||||
|
@ -3,7 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/registry"
|
"go-micro.dev/v5/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CallFunc represents the individual call func.
|
// CallFunc represents the individual call func.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Codec struct {
|
type Codec struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package bytes
|
package bytes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Marshaler struct{}
|
type Marshaler struct{}
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
"go-micro.dev/v4/transport/headers"
|
"go-micro.dev/v5/transport/headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Codec struct {
|
type Codec struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/protobuf/jsonpb"
|
"github.com/golang/protobuf/jsonpb"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Codec struct {
|
type Codec struct {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type clientCodec struct {
|
type clientCodec struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonCodec struct {
|
type jsonCodec struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type serverCodec struct {
|
type serverCodec struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"github.com/oxtoacart/bpool"
|
"github.com/oxtoacart/bpool"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// create buffer pool with 16 instances each preallocated with 256 bytes.
|
// create buffer pool with 16 instances each preallocated with 256 bytes.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Codec struct {
|
type Codec struct {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type flusher interface {
|
type flusher interface {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"go-micro.dev/v4/codec"
|
"go-micro.dev/v5/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Codec struct {
|
type Codec struct {
|
||||||
|
@ -4,10 +4,10 @@ package config
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/loader"
|
"go-micro.dev/v5/config/loader"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"go-micro.dev/v4/config/source/file"
|
"go-micro.dev/v5/config/source/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config is an interface abstraction for dynamic configuration.
|
// Config is an interface abstraction for dynamic configuration.
|
||||||
|
@ -3,11 +3,11 @@ package config
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go-micro.dev/v4/config/loader"
|
"go-micro.dev/v5/config/loader"
|
||||||
"go-micro.dev/v4/config/loader/memory"
|
"go-micro.dev/v5/config/loader/memory"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/reader/json"
|
"go-micro.dev/v5/config/reader/json"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"go-micro.dev/v4/config/source/env"
|
"go-micro.dev/v5/config/source/env"
|
||||||
"go-micro.dev/v4/config/source/file"
|
"go-micro.dev/v5/config/source/file"
|
||||||
"go-micro.dev/v4/config/source/memory"
|
"go-micro.dev/v5/config/source/memory"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createFileForIssue18(t *testing.T, content string) *os.File {
|
func createFileForIssue18(t *testing.T, content string) *os.File {
|
||||||
|
@ -3,7 +3,7 @@ package json
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/encoder"
|
"go-micro.dev/v5/config/encoder"
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonEncoder struct{}
|
type jsonEncoder struct{}
|
||||||
|
@ -4,8 +4,8 @@ package loader
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Loader manages loading sources.
|
// Loader manages loading sources.
|
||||||
|
@ -10,10 +10,10 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/loader"
|
"go-micro.dev/v5/config/loader"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/reader/json"
|
"go-micro.dev/v5/config/reader/json"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type memory struct {
|
type memory struct {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package memory
|
package memory
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/config/loader"
|
"go-micro.dev/v5/config/loader"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WithSource appends a source to list of sources.
|
// WithSource appends a source to list of sources.
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/config/loader"
|
"go-micro.dev/v5/config/loader"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WithLoader sets the loader for manager config.
|
// WithLoader sets the loader for manager config.
|
||||||
|
@ -5,10 +5,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
"go-micro.dev/v4/config/encoder"
|
"go-micro.dev/v5/config/encoder"
|
||||||
"go-micro.dev/v4/config/encoder/json"
|
"go-micro.dev/v5/config/encoder/json"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonReader struct {
|
type jsonReader struct {
|
||||||
|
@ -3,7 +3,7 @@ package json
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReader(t *testing.T) {
|
func TestReader(t *testing.T) {
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
simple "github.com/bitly/go-simplejson"
|
simple "github.com/bitly/go-simplejson"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v5/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonValues struct {
|
type jsonValues struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestValues(t *testing.T) {
|
func TestValues(t *testing.T) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package reader
|
package reader
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/config/encoder"
|
"go-micro.dev/v5/config/encoder"
|
||||||
"go-micro.dev/v4/config/encoder/json"
|
"go-micro.dev/v5/config/encoder/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
@ -4,7 +4,7 @@ package reader
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reader is an interface for merging changesets.
|
// Reader is an interface for merging changesets.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go-micro.dev/v4/config/secrets"
|
"go-micro.dev/v5/config/secrets"
|
||||||
naclbox "golang.org/x/crypto/nacl/box"
|
naclbox "golang.org/x/crypto/nacl/box"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/secrets"
|
"go-micro.dev/v5/config/secrets"
|
||||||
naclbox "golang.org/x/crypto/nacl/box"
|
naclbox "golang.org/x/crypto/nacl/box"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go-micro.dev/v4/config/secrets"
|
"go-micro.dev/v5/config/secrets"
|
||||||
"golang.org/x/crypto/nacl/secretbox"
|
"golang.org/x/crypto/nacl/secretbox"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/secrets"
|
"go-micro.dev/v5/config/secrets"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSecretBox(t *testing.T) {
|
func TestSecretBox(t *testing.T) {
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"go-micro.dev/v4/util/cmd"
|
"go-micro.dev/v5/util/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
type cliSource struct {
|
type cliSource struct {
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"go-micro.dev/v4"
|
"go-micro.dev/v5"
|
||||||
"go-micro.dev/v4/config"
|
"go-micro.dev/v5/config"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"go-micro.dev/v4/util/cmd"
|
"go-micro.dev/v5/util/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCliSourceDefault(t *testing.T) {
|
func TestCliSourceDefault(t *testing.T) {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type contextKey struct{}
|
type contextKey struct{}
|
||||||
|
2
config/source/env/env.go
vendored
2
config/source/env/env.go
vendored
@ -7,7 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
2
config/source/env/env_test.go
vendored
2
config/source/env/env_test.go
vendored
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEnv_Read(t *testing.T) {
|
func TestEnv_Read(t *testing.T) {
|
||||||
|
2
config/source/env/options.go
vendored
2
config/source/env/options.go
vendored
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type strippedPrefixKey struct{}
|
type strippedPrefixKey struct{}
|
||||||
|
2
config/source/env/watcher.go
vendored
2
config/source/env/watcher.go
vendored
@ -1,7 +1,7 @@
|
|||||||
package env
|
package env
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type watcher struct {
|
type watcher struct {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type file struct {
|
type file struct {
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config"
|
"go-micro.dev/v5/config"
|
||||||
"go-micro.dev/v4/config/source/file"
|
"go-micro.dev/v5/config/source/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfig(t *testing.T) {
|
func TestConfig(t *testing.T) {
|
||||||
|
@ -3,7 +3,7 @@ package file
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/encoder"
|
"go-micro.dev/v5/config/encoder"
|
||||||
)
|
)
|
||||||
|
|
||||||
func format(p string, e encoder.Encoder) string {
|
func format(p string, e encoder.Encoder) string {
|
||||||
|
@ -3,7 +3,7 @@ package file
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFormat(t *testing.T) {
|
func TestFormat(t *testing.T) {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type filePathKey struct{}
|
type filePathKey struct{}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type watcher struct {
|
type watcher struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type watcher struct {
|
type watcher struct {
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
"go-micro.dev/v4/config/source/file"
|
"go-micro.dev/v5/config/source/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
// createTestFile a local helper to creates a temporary file with the given data
|
// createTestFile a local helper to creates a temporary file with the given data
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type flagsrc struct {
|
type flagsrc struct {
|
||||||
|
@ -3,7 +3,7 @@ package flag
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v5/config/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
type includeUnsetKey struct{}
|
type includeUnsetKey struct{}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user