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.
|
||||
|
||||
@ -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
|
||||
|
||||
```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))
|
||||
@ -127,4 +127,4 @@ See [github.com/go-micro](https://github.com/go-micro) for tooling.
|
||||
|
||||
## License
|
||||
|
||||
Go Micro is Apache 2.0 licensed.
|
||||
[Business Source License 1.1](LICENSE)
|
||||
|
@ -7,10 +7,10 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/client"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/server"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/client"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/server"
|
||||
)
|
||||
|
||||
// API interface provides a way to
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,11 +3,11 @@ package api
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/api/handler"
|
||||
"go-micro.dev/v4/api/handler/rpc"
|
||||
"go-micro.dev/v4/api/router/registry"
|
||||
"go-micro.dev/v4/api/server"
|
||||
"go-micro.dev/v4/api/server/http"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
"go-micro.dev/v5/api/handler/rpc"
|
||||
"go-micro.dev/v5/api/router/registry"
|
||||
"go-micro.dev/v5/api/server"
|
||||
"go-micro.dev/v5/api/server/http"
|
||||
)
|
||||
|
||||
type api struct {
|
||||
|
@ -4,13 +4,13 @@ package api
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go-micro.dev/v4/api/handler"
|
||||
api "go-micro.dev/v4/api/proto"
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/client"
|
||||
"go-micro.dev/v4/errors"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v4/util/ctx"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
api "go-micro.dev/v5/api/proto"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/client"
|
||||
"go-micro.dev/v5/errors"
|
||||
"go-micro.dev/v5/selector"
|
||||
"go-micro.dev/v5/util/ctx"
|
||||
)
|
||||
|
||||
type apiHandler struct {
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/oxtoacart/bpool"
|
||||
api "go-micro.dev/v4/api/proto"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/selector"
|
||||
api "go-micro.dev/v5/api/proto"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/selector"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -12,9 +12,9 @@ import (
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/oxtoacart/bpool"
|
||||
"go-micro.dev/v4/api/handler"
|
||||
proto "go-micro.dev/v4/api/proto"
|
||||
"go-micro.dev/v4/util/ctx"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
proto "go-micro.dev/v5/api/proto"
|
||||
"go-micro.dev/v5/util/ctx"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
|
||||
"go-micro.dev/v4/api/handler"
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/selector"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -6,12 +6,12 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/api/handler"
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v4/api/resolver/vpath"
|
||||
"go-micro.dev/v4/api/router"
|
||||
regRouter "go-micro.dev/v4/api/router/registry"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver/vpath"
|
||||
"go-micro.dev/v5/api/router"
|
||||
regRouter "go-micro.dev/v5/api/router/registry"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
func testHttp(t *testing.T, path, service, ns string) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/client"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/client"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -11,20 +11,20 @@ import (
|
||||
|
||||
jsonpatch "github.com/evanphx/json-patch/v5"
|
||||
"github.com/oxtoacart/bpool"
|
||||
"go-micro.dev/v4/api/handler"
|
||||
"go-micro.dev/v4/api/internal/proto"
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/client"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v4/codec/jsonrpc"
|
||||
"go-micro.dev/v4/codec/protorpc"
|
||||
"go-micro.dev/v4/errors"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v4/util/ctx"
|
||||
"go-micro.dev/v4/util/qson"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
"go-micro.dev/v5/api/internal/proto"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/client"
|
||||
"go-micro.dev/v5/codec"
|
||||
"go-micro.dev/v5/codec/jsonrpc"
|
||||
"go-micro.dev/v5/codec/protorpc"
|
||||
"go-micro.dev/v5/errors"
|
||||
log "go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/selector"
|
||||
"go-micro.dev/v5/util/ctx"
|
||||
"go-micro.dev/v5/util/qson"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"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) {
|
||||
|
@ -12,10 +12,10 @@ import (
|
||||
"github.com/gobwas/httphead"
|
||||
"github.com/gobwas/ws"
|
||||
"github.com/gobwas/ws/wsutil"
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/client"
|
||||
raw "go-micro.dev/v4/codec/bytes"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/client"
|
||||
raw "go-micro.dev/v5/codec/bytes"
|
||||
"go-micro.dev/v5/selector"
|
||||
)
|
||||
|
||||
// serveWebsocket will stream rpc back over websockets assuming json.
|
||||
|
@ -11,9 +11,9 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/api/handler"
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v5/api/handler"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/selector"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,10 +1,10 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/api/router"
|
||||
registry2 "go-micro.dev/v4/api/router/registry"
|
||||
"go-micro.dev/v4/client"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/api/router"
|
||||
registry2 "go-micro.dev/v5/api/router/registry"
|
||||
"go-micro.dev/v5/client"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
func NewOptions(opts ...Option) Options {
|
||||
@ -43,4 +43,3 @@ func WithRegistry(r registry.Registry) Option {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
)
|
||||
|
||||
// Resolver is the gRPC Resolver.
|
||||
|
@ -4,7 +4,7 @@ package host
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
)
|
||||
|
||||
// Resolver is a host resolver.
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
)
|
||||
|
||||
// Resolver is a path resolver.
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
)
|
||||
|
||||
// NewResolver returns a new vpath resolver.
|
||||
|
@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v4/api/resolver/vpath"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
"go-micro.dev/v5/api/resolver/vpath"
|
||||
"go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
// Options is a struct of options available.
|
||||
|
@ -10,12 +10,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/api/router/util"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/registry/cache"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/api/router/util"
|
||||
log "go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/registry/cache"
|
||||
)
|
||||
|
||||
// endpoint struct, that holds compiled pcre.
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
func TestStoreRegex(t *testing.T) {
|
||||
|
@ -4,7 +4,7 @@ package router
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
// Router is used to determine an endpoint for a request.
|
||||
|
@ -8,12 +8,12 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"go-micro.dev/v4/api/router"
|
||||
"go-micro.dev/v4/api/router/util"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/registry"
|
||||
rutil "go-micro.dev/v4/util/registry"
|
||||
"go-micro.dev/v5/api/router"
|
||||
"go-micro.dev/v5/api/router/util"
|
||||
log "go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/registry"
|
||||
rutil "go-micro.dev/v5/util/registry"
|
||||
)
|
||||
|
||||
type endpoint struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
log "go-micro.dev/v4/logger"
|
||||
log "go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
// InvalidTemplateError indicates that the path template is not valid.
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
func TestTokenize(t *testing.T) {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
log "go-micro.dev/v4/logger"
|
||||
log "go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"go-micro.dev/v4/api/server/acme"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/api/server/acme"
|
||||
log "go-micro.dev/v5/logger"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,7 @@ package acme
|
||||
|
||||
import (
|
||||
"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.
|
||||
|
@ -9,9 +9,9 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/gorilla/handlers"
|
||||
"go-micro.dev/v4/api/server"
|
||||
"go-micro.dev/v4/api/server/cors"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/api/server"
|
||||
"go-micro.dev/v5/api/server/cors"
|
||||
log "go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
type httpServer struct {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/api/server"
|
||||
"go-micro.dev/v4/api/server/cors"
|
||||
"go-micro.dev/v5/api/server"
|
||||
"go-micro.dev/v5/api/server/cors"
|
||||
)
|
||||
|
||||
func TestHTTPServer(t *testing.T) {
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
|
||||
"go-micro.dev/v4/api/resolver"
|
||||
"go-micro.dev/v4/api/server/acme"
|
||||
"go-micro.dev/v4/api/server/cors"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/api/resolver"
|
||||
"go-micro.dev/v5/api/server/acme"
|
||||
"go-micro.dev/v5/api/server/cors"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
type Option func(o *Options)
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
func NewOptions(opts ...Option) Options {
|
||||
|
@ -16,14 +16,14 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"go-micro.dev/v4/codec/json"
|
||||
merr "go-micro.dev/v4/errors"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/registry/cache"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
maddr "go-micro.dev/v4/util/addr"
|
||||
mnet "go-micro.dev/v4/util/net"
|
||||
mls "go-micro.dev/v4/util/tls"
|
||||
"go-micro.dev/v5/codec/json"
|
||||
merr "go-micro.dev/v5/errors"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/registry/cache"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
maddr "go-micro.dev/v5/util/addr"
|
||||
mnet "go-micro.dev/v5/util/net"
|
||||
mls "go-micro.dev/v5/util/tls"
|
||||
"golang.org/x/net/http2"
|
||||
)
|
||||
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"go-micro.dev/v4/broker"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/broker"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
log "go-micro.dev/v4/logger"
|
||||
maddr "go-micro.dev/v4/util/addr"
|
||||
mnet "go-micro.dev/v4/util/net"
|
||||
log "go-micro.dev/v5/logger"
|
||||
maddr "go-micro.dev/v5/util/addr"
|
||||
mnet "go-micro.dev/v5/util/net"
|
||||
)
|
||||
|
||||
type memoryBroker struct {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/broker"
|
||||
"go-micro.dev/v5/broker"
|
||||
)
|
||||
|
||||
func TestMemoryBroker(t *testing.T) {
|
||||
|
@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/codec"
|
||||
"go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
2
cache/options.go
vendored
2
cache/options.go
vendored
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v5/logger"
|
||||
)
|
||||
|
||||
// Options represents the options for the cache.
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"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)
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
)
|
||||
|
||||
// NewCache returns an initialized cache.
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
)
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
|
@ -4,7 +4,7 @@ package client
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,7 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/broker"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v4/transport"
|
||||
"go-micro.dev/v5/broker"
|
||||
"go-micro.dev/v5/codec"
|
||||
"go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/selector"
|
||||
"go-micro.dev/v5/transport"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/transport"
|
||||
"go-micro.dev/v5/transport"
|
||||
)
|
||||
|
||||
func TestCallOptions(t *testing.T) {
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
import (
|
||||
"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.
|
||||
|
@ -10,19 +10,19 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"go-micro.dev/v4/broker"
|
||||
"go-micro.dev/v4/codec"
|
||||
raw "go-micro.dev/v4/codec/bytes"
|
||||
merrors "go-micro.dev/v4/errors"
|
||||
log "go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/metadata"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v4/transport"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
"go-micro.dev/v4/util/buf"
|
||||
"go-micro.dev/v4/util/net"
|
||||
"go-micro.dev/v4/util/pool"
|
||||
"go-micro.dev/v5/broker"
|
||||
"go-micro.dev/v5/codec"
|
||||
raw "go-micro.dev/v5/codec/bytes"
|
||||
merrors "go-micro.dev/v5/errors"
|
||||
log "go-micro.dev/v5/logger"
|
||||
"go-micro.dev/v5/metadata"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/selector"
|
||||
"go-micro.dev/v5/transport"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
"go-micro.dev/v5/util/buf"
|
||||
"go-micro.dev/v5/util/net"
|
||||
"go-micro.dev/v5/util/pool"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/errors"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/selector"
|
||||
"go-micro.dev/v5/errors"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/selector"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -4,17 +4,17 @@ import (
|
||||
"bytes"
|
||||
errs "errors"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
raw "go-micro.dev/v4/codec/bytes"
|
||||
"go-micro.dev/v4/codec/grpc"
|
||||
"go-micro.dev/v4/codec/json"
|
||||
"go-micro.dev/v4/codec/jsonrpc"
|
||||
"go-micro.dev/v4/codec/proto"
|
||||
"go-micro.dev/v4/codec/protorpc"
|
||||
"go-micro.dev/v4/errors"
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/transport"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
"go-micro.dev/v5/codec"
|
||||
raw "go-micro.dev/v5/codec/bytes"
|
||||
"go-micro.dev/v5/codec/grpc"
|
||||
"go-micro.dev/v5/codec/json"
|
||||
"go-micro.dev/v5/codec/jsonrpc"
|
||||
"go-micro.dev/v5/codec/proto"
|
||||
"go-micro.dev/v5/codec/protorpc"
|
||||
"go-micro.dev/v5/errors"
|
||||
"go-micro.dev/v5/registry"
|
||||
"go-micro.dev/v5/transport"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,7 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type rpcRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v4/transport"
|
||||
"go-micro.dev/v5/codec"
|
||||
"go-micro.dev/v5/transport"
|
||||
)
|
||||
|
||||
type rpcResponse struct {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
// Implements the streamer interface.
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v5/registry"
|
||||
)
|
||||
|
||||
// CallFunc represents the individual call func.
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type Codec struct {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package bytes
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type Marshaler struct{}
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v4/transport/headers"
|
||||
"go-micro.dev/v5/codec"
|
||||
"go-micro.dev/v5/transport/headers"
|
||||
)
|
||||
|
||||
type Codec struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type Codec struct {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type clientCodec struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type jsonCodec struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type serverCodec struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"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.
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type Codec struct {
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type flusher interface {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go-micro.dev/v4/codec"
|
||||
"go-micro.dev/v5/codec"
|
||||
)
|
||||
|
||||
type Codec struct {
|
||||
|
@ -4,10 +4,10 @@ package config
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/config/loader"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v4/config/source/file"
|
||||
"go-micro.dev/v5/config/loader"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"go-micro.dev/v5/config/source/file"
|
||||
)
|
||||
|
||||
// Config is an interface abstraction for dynamic configuration.
|
||||
|
@ -3,11 +3,11 @@ package config
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go-micro.dev/v4/config/loader"
|
||||
"go-micro.dev/v4/config/loader/memory"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/reader/json"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/loader"
|
||||
"go-micro.dev/v5/config/loader/memory"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/reader/json"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -9,10 +9,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v4/config/source/env"
|
||||
"go-micro.dev/v4/config/source/file"
|
||||
"go-micro.dev/v4/config/source/memory"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"go-micro.dev/v5/config/source/env"
|
||||
"go-micro.dev/v5/config/source/file"
|
||||
"go-micro.dev/v5/config/source/memory"
|
||||
)
|
||||
|
||||
func createFileForIssue18(t *testing.T, content string) *os.File {
|
||||
|
@ -3,7 +3,7 @@ package json
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"go-micro.dev/v4/config/encoder"
|
||||
"go-micro.dev/v5/config/encoder"
|
||||
)
|
||||
|
||||
type jsonEncoder struct{}
|
||||
|
@ -4,8 +4,8 @@ package loader
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
// Loader manages loading sources.
|
||||
|
@ -10,10 +10,10 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config/loader"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/reader/json"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/loader"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/reader/json"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type memory struct {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package memory
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/config/loader"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/loader"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
// WithSource appends a source to list of sources.
|
||||
|
@ -1,9 +1,9 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/config/loader"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/loader"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
// WithLoader sets the loader for manager config.
|
||||
|
@ -5,10 +5,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"go-micro.dev/v4/config/encoder"
|
||||
"go-micro.dev/v4/config/encoder/json"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/encoder"
|
||||
"go-micro.dev/v5/config/encoder/json"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type jsonReader struct {
|
||||
|
@ -3,7 +3,7 @@ package json
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
func TestReader(t *testing.T) {
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
"time"
|
||||
|
||||
simple "github.com/bitly/go-simplejson"
|
||||
"go-micro.dev/v4/config/reader"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/reader"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type jsonValues struct {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
func TestValues(t *testing.T) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package reader
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/config/encoder"
|
||||
"go-micro.dev/v4/config/encoder/json"
|
||||
"go-micro.dev/v5/config/encoder"
|
||||
"go-micro.dev/v5/config/encoder/json"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
@ -4,7 +4,7 @@ package reader
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
// Reader is an interface for merging changesets.
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go-micro.dev/v4/config/secrets"
|
||||
"go-micro.dev/v5/config/secrets"
|
||||
naclbox "golang.org/x/crypto/nacl/box"
|
||||
)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/config/secrets"
|
||||
"go-micro.dev/v5/config/secrets"
|
||||
naclbox "golang.org/x/crypto/nacl/box"
|
||||
)
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go-micro.dev/v4/config/secrets"
|
||||
"go-micro.dev/v5/config/secrets"
|
||||
"golang.org/x/crypto/nacl/secretbox"
|
||||
)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/config/secrets"
|
||||
"go-micro.dev/v5/config/secrets"
|
||||
)
|
||||
|
||||
func TestSecretBox(t *testing.T) {
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"github.com/urfave/cli/v2"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v4/util/cmd"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"go-micro.dev/v5/util/cmd"
|
||||
)
|
||||
|
||||
type cliSource struct {
|
||||
|
@ -6,10 +6,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"go-micro.dev/v4"
|
||||
"go-micro.dev/v4/config"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v4/util/cmd"
|
||||
"go-micro.dev/v5"
|
||||
"go-micro.dev/v5/config"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"go-micro.dev/v5/util/cmd"
|
||||
)
|
||||
|
||||
func TestCliSourceDefault(t *testing.T) {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type contextKey struct{}
|
||||
|
2
config/source/env/env.go
vendored
2
config/source/env/env.go
vendored
@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
var (
|
||||
|
2
config/source/env/env_test.go
vendored
2
config/source/env/env_test.go
vendored
@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
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"
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type strippedPrefixKey struct{}
|
||||
|
2
config/source/env/watcher.go
vendored
2
config/source/env/watcher.go
vendored
@ -1,7 +1,7 @@
|
||||
package env
|
||||
|
||||
import (
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type watcher struct {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type file struct {
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
"testing/fstest"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config"
|
||||
"go-micro.dev/v4/config/source/file"
|
||||
"go-micro.dev/v5/config"
|
||||
"go-micro.dev/v5/config/source/file"
|
||||
)
|
||||
|
||||
func TestConfig(t *testing.T) {
|
||||
|
@ -3,7 +3,7 @@ package file
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"go-micro.dev/v4/config/encoder"
|
||||
"go-micro.dev/v5/config/encoder"
|
||||
)
|
||||
|
||||
func format(p string, e encoder.Encoder) string {
|
||||
|
@ -3,7 +3,7 @@ package file
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
func TestFormat(t *testing.T) {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"io/fs"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type filePathKey struct{}
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type watcher struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type watcher struct {
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v4/config/source/file"
|
||||
"go-micro.dev/v5/config/source"
|
||||
"go-micro.dev/v5/config/source/file"
|
||||
)
|
||||
|
||||
// createTestFile a local helper to creates a temporary file with the given data
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
type flagsrc struct {
|
||||
|
@ -3,7 +3,7 @@ package flag
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go-micro.dev/v4/config/source"
|
||||
"go-micro.dev/v5/config/source"
|
||||
)
|
||||
|
||||
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