1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
This commit is contained in:
asim 2024-06-04 21:40:43 +01:00
parent e11395c8f5
commit 610c00859f
224 changed files with 549 additions and 550 deletions

View File

@ -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)

View File

@ -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

View File

@ -12,7 +12,7 @@ import (
"time"
"github.com/gorilla/websocket"
"go-micro.dev/v4/logger"
"go-micro.dev/v5/logger"
)
const (

View File

@ -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 {

View File

@ -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 {

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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) {

View File

@ -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 (

View File

@ -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 (

View File

@ -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) {

View File

@ -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.

View File

@ -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 (

View File

@ -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
}
}

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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) {

View File

@ -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.

View File

@ -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 {

View File

@ -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.

View File

@ -8,7 +8,7 @@ import (
"reflect"
"testing"
"go-micro.dev/v4/logger"
"go-micro.dev/v5/logger"
)
func TestTokenize(t *testing.T) {

View File

@ -7,7 +7,7 @@ import (
"fmt"
"strings"
log "go-micro.dev/v4/logger"
log "go-micro.dev/v5/logger"
)
var (

View File

@ -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"
)

View File

@ -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.

View File

@ -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 {

View File

@ -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) {

View File

@ -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)

View File

@ -4,7 +4,7 @@ import (
"context"
"time"
"go-micro.dev/v4/logger"
"go-micro.dev/v5/logger"
)
func NewOptions(opts ...Option) Options {

View File

@ -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"
)

View File

@ -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 (

View File

@ -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 {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"go-micro.dev/v4/broker"
"go-micro.dev/v5/broker"
)
func TestMemoryBroker(t *testing.T) {

View File

@ -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
View File

@ -4,7 +4,7 @@ import (
"context"
"time"
"go-micro.dev/v4/logger"
"go-micro.dev/v5/logger"
)
// Options represents the options for the cache.

View File

@ -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)

View File

@ -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.

View File

@ -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) {

View File

@ -4,7 +4,7 @@ package client
import (
"context"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
var (

View File

@ -1,7 +1,7 @@
package client
import (
"go-micro.dev/v4/registry"
"go-micro.dev/v5/registry"
)
var (

View File

@ -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 (

View File

@ -4,7 +4,7 @@ import (
"testing"
"time"
"go-micro.dev/v4/transport"
"go-micro.dev/v5/transport"
)
func TestCallOptions(t *testing.T) {

View File

@ -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.

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -1,7 +1,7 @@
package client
import (
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type rpcRequest struct {

View File

@ -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 {

View File

@ -6,7 +6,7 @@ import (
"io"
"sync"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
// Implements the streamer interface.

View File

@ -3,7 +3,7 @@ package client
import (
"context"
"go-micro.dev/v4/registry"
"go-micro.dev/v5/registry"
)
// CallFunc represents the individual call func.

View File

@ -5,7 +5,7 @@ import (
"fmt"
"io"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type Codec struct {

View File

@ -1,7 +1,7 @@
package bytes
import (
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type Marshaler struct{}

View File

@ -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 {

View File

@ -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 {

View File

@ -6,7 +6,7 @@ import (
"io"
"sync"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type clientCodec struct {

View File

@ -7,7 +7,7 @@ import (
"fmt"
"io"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type jsonCodec struct {

View File

@ -5,7 +5,7 @@ import (
"fmt"
"io"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type serverCodec struct {

View File

@ -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.

View File

@ -5,7 +5,7 @@ import (
"io"
"github.com/golang/protobuf/proto"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type Codec struct {

View File

@ -9,7 +9,7 @@ import (
"sync"
"github.com/golang/protobuf/proto"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type flusher interface {

View File

@ -5,7 +5,7 @@ import (
"fmt"
"io"
"go-micro.dev/v4/codec"
"go-micro.dev/v5/codec"
)
type Codec struct {

View File

@ -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.

View File

@ -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"
)

View File

@ -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 {

View 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{}

View File

@ -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.

View File

@ -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 {

View File

@ -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.

View File

@ -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.

View File

@ -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 {

View File

@ -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) {

View File

@ -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 {

View File

@ -4,7 +4,7 @@ import (
"reflect"
"testing"
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
func TestValues(t *testing.T) {

View File

@ -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 {

View File

@ -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.

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"go-micro.dev/v4/config/secrets"
"go-micro.dev/v5/config/secrets"
)
func TestSecretBox(t *testing.T) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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{}

View File

@ -7,7 +7,7 @@ import (
"time"
"github.com/imdario/mergo"
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
var (

View File

@ -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) {

View File

@ -4,7 +4,7 @@ import (
"context"
"strings"
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
type strippedPrefixKey struct{}

View File

@ -1,7 +1,7 @@
package env
import (
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
type watcher struct {

View File

@ -6,7 +6,7 @@ import (
"io/fs"
"os"
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
type file struct {

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -4,7 +4,7 @@ import (
"context"
"io/fs"
"go-micro.dev/v4/config/source"
"go-micro.dev/v5/config/source"
)
type filePathKey struct{}

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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