move to v4
Some checks failed
coverage / build (push) Failing after 56s
test / test (push) Successful in 2m30s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2025-01-25 15:48:10 +03:00
parent 3f82cb3ba4
commit f3f2a9b737
98 changed files with 294 additions and 294 deletions

View File

@ -6,8 +6,8 @@ import (
"errors" "errors"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
// DefaultBroker default memory broker // DefaultBroker default memory broker

View File

@ -4,14 +4,14 @@ import (
"context" "context"
"sync" "sync"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
maddr "go.unistack.org/micro/v3/util/addr" maddr "go.unistack.org/micro/v4/util/addr"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
mnet "go.unistack.org/micro/v3/util/net" mnet "go.unistack.org/micro/v4/util/net"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
type memoryBroker struct { type memoryBroker struct {

View File

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
func TestMemoryBatchBroker(t *testing.T) { func TestMemoryBatchBroker(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"strings" "strings"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
) )
type NoopBroker struct { type NoopBroker struct {

View File

@ -5,13 +5,13 @@ import (
"crypto/tls" "crypto/tls"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/sync" "go.unistack.org/micro/v4/sync"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options struct // Options struct

View File

@ -5,7 +5,7 @@ import (
"math" "math"
"time" "time"
"go.unistack.org/micro/v3/util/backoff" "go.unistack.org/micro/v4/util/backoff"
) )
// BackoffFunc is the backoff call func // BackoffFunc is the backoff call func

View File

@ -5,8 +5,8 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"sort" "sort"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
) )
// LookupFunc is used to lookup routes for a service // LookupFunc is used to lookup routes for a service

View File

@ -7,14 +7,14 @@ import (
"strconv" "strconv"
"time" "time"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
"go.unistack.org/micro/v3/semconv" "go.unistack.org/micro/v4/semconv"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// DefaultCodecs will be used to encode/decode data // DefaultCodecs will be used to encode/decode data

View File

@ -6,17 +6,17 @@ import (
"net" "net"
"time" "time"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
"go.unistack.org/micro/v3/selector/random" "go.unistack.org/micro/v4/selector/random"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options holds client options // Options holds client options

View File

@ -3,7 +3,7 @@ package client
import ( import (
"context" "context"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
) )
// RetryFunc that returning either false or a non-nil error will result in the call not being retried // RetryFunc that returning either false or a non-nil error will result in the call not being retried

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
) )
func TestRetryAlways(t *testing.T) { func TestRetryAlways(t *testing.T) {

View File

@ -1,7 +1,7 @@
package client package client
import ( import (
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
) )
type testRequest struct { type testRequest struct {

View File

@ -3,7 +3,7 @@ package cluster
import ( import (
"context" "context"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
// Message sent to member in cluster // Message sent to member in cluster

View File

@ -3,9 +3,9 @@ package codec
import ( import (
"context" "context"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Option func // Option func

View File

@ -9,10 +9,10 @@ import (
"dario.cat/mergo" "dario.cat/mergo"
"github.com/google/uuid" "github.com/google/uuid"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
mid "go.unistack.org/micro/v3/util/id" mid "go.unistack.org/micro/v4/util/id"
rutil "go.unistack.org/micro/v3/util/reflect" rutil "go.unistack.org/micro/v4/util/reflect"
mtime "go.unistack.org/micro/v3/util/time" mtime "go.unistack.org/micro/v4/util/time"
) )
type defaultConfig struct { type defaultConfig struct {
@ -210,7 +210,7 @@ func fillValue(value reflect.Value, val string) error {
return err return err
} }
value.Set(reflect.ValueOf(v)) value.Set(reflect.ValueOf(v))
case value.Type().String() == "time.Duration" && value.Type().PkgPath() == "go.unistack.org/micro/v3/util/time": case value.Type().String() == "time.Duration" && value.Type().PkgPath() == "go.unistack.org/micro/v4/util/time":
v, err := mtime.ParseDuration(val) v, err := mtime.ParseDuration(val)
if err != nil { if err != nil {
return err return err

View File

@ -7,8 +7,8 @@ import (
"testing" "testing"
"time" "time"
"go.unistack.org/micro/v3/config" "go.unistack.org/micro/v4/config"
mtime "go.unistack.org/micro/v3/util/time" mtime "go.unistack.org/micro/v4/util/time"
) )
type cfg struct { type cfg struct {

View File

@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options hold the config options // Options hold the config options

View File

@ -3,7 +3,7 @@ package micro
import ( import (
"context" "context"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
) )
// Event is used to publish messages to a topic // Event is used to publish messages to a topic

View File

@ -6,12 +6,12 @@ import (
"sync" "sync"
"github.com/silas/dag" "github.com/silas/dag"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
type microFlow struct { type microFlow struct {

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Option func // Option func

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
) )
func TestFSMStart(t *testing.T) { func TestFSMStart(t *testing.T) {

12
go.mod
View File

@ -1,11 +1,11 @@
module go.unistack.org/micro/v3 module go.unistack.org/micro/v4
go 1.22.0 go 1.22.0
require ( require (
dario.cat/mergo v1.0.1 dario.cat/mergo v1.0.1
github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/KimMachineGun/automemlimit v0.6.1 github.com/KimMachineGun/automemlimit v0.7.0
github.com/ash3in/uuidv8 v1.2.0 github.com/ash3in/uuidv8 v1.2.0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/matoous/go-nanoid v1.5.1 github.com/matoous/go-nanoid v1.5.1
@ -14,8 +14,8 @@ require (
go.uber.org/automaxprocs v1.6.0 go.uber.org/automaxprocs v1.6.0
go.unistack.org/micro-proto/v3 v3.4.1 go.unistack.org/micro-proto/v3 v3.4.1
golang.org/x/sync v0.10.0 golang.org/x/sync v0.10.0
google.golang.org/grpc v1.69.2 google.golang.org/grpc v1.69.4
google.golang.org/protobuf v1.36.1 google.golang.org/protobuf v1.36.3
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
@ -36,8 +36,8 @@ require (
github.com/stretchr/testify v1.10.0 // indirect github.com/stretchr/testify v1.10.0 // indirect
go.uber.org/goleak v1.3.0 // indirect go.uber.org/goleak v1.3.0 // indirect
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect
golang.org/x/net v0.33.0 // indirect golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.28.0 // indirect golang.org/x/sys v0.29.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
) )

View File

@ -8,7 +8,7 @@ import (
"slices" "slices"
"time" "time"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
) )
// Option func signature // Option func signature

View File

@ -13,9 +13,9 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/semconv" "go.unistack.org/micro/v4/semconv"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
const ( const (

View File

@ -12,9 +12,9 @@ import (
"time" "time"
"github.com/google/uuid" "github.com/google/uuid"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/util/buffer" "go.unistack.org/micro/v4/util/buffer"
) )
// always first to have proper check // always first to have proper check

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
) )
const sf = "0-+# " const sf = "0-+# "

View File

@ -5,7 +5,7 @@ import (
"strings" "strings"
"testing" "testing"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
) )
func TestUnwrap(t *testing.T) { func TestUnwrap(t *testing.T) {

View File

@ -3,21 +3,21 @@ package micro
import ( import (
"reflect" "reflect"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/flow" "go.unistack.org/micro/v4/flow"
"go.unistack.org/micro/v3/fsm" "go.unistack.org/micro/v4/fsm"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/sync" "go.unistack.org/micro/v4/sync"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
func As(b any, target any) bool { func As(b any, target any) bool {

View File

@ -6,8 +6,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/fsm" "go.unistack.org/micro/v4/fsm"
) )
func TestAs(t *testing.T) { func TestAs(t *testing.T) {

View File

@ -2,8 +2,8 @@
package network package network
import ( import (
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
) )
// Error is network node errors // Error is network node errors

View File

@ -1,13 +1,13 @@
package network package network
import ( import (
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/network/tunnel" "go.unistack.org/micro/v4/network/tunnel"
"go.unistack.org/micro/v3/proxy" "go.unistack.org/micro/v4/proxy"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
// Option func // Option func

View File

@ -8,9 +8,9 @@ import (
"sync" "sync"
"time" "time"
maddr "go.unistack.org/micro/v3/util/addr" maddr "go.unistack.org/micro/v4/util/addr"
mnet "go.unistack.org/micro/v3/util/net" mnet "go.unistack.org/micro/v4/util/net"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
type memorySocket struct { type memorySocket struct {

View File

@ -5,10 +5,10 @@ import (
"crypto/tls" "crypto/tls"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options struct holds the transport options // Options struct holds the transport options

View File

@ -5,7 +5,7 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

@ -5,11 +5,11 @@ import (
"context" "context"
"fmt" "fmt"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
"go.unistack.org/micro/v3/network/tunnel" "go.unistack.org/micro/v4/network/tunnel"
) )
type tunBroker struct { type tunBroker struct {

View File

@ -3,11 +3,11 @@ package tunnel
import ( import (
"time" "time"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
var ( var (

View File

@ -1,8 +1,8 @@
package transport package transport
import ( import (
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
"go.unistack.org/micro/v3/network/tunnel" "go.unistack.org/micro/v4/network/tunnel"
) )
type tunListener struct { type tunListener struct {

View File

@ -5,8 +5,8 @@ import (
"context" "context"
"fmt" "fmt"
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
"go.unistack.org/micro/v3/network/tunnel" "go.unistack.org/micro/v4/network/tunnel"
) )
type tunTransport struct { type tunTransport struct {

View File

@ -6,7 +6,7 @@ import (
"errors" "errors"
"time" "time"
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
) )
// DefaultTunnel contains default tunnel implementation // DefaultTunnel contains default tunnel implementation

View File

@ -5,17 +5,17 @@ import (
"fmt" "fmt"
"time" "time"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/config" "go.unistack.org/micro/v4/config"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options for micro service // Options for micro service

View File

@ -7,7 +7,7 @@ import (
"net/http/pprof" "net/http/pprof"
"sync" "sync"
profile "go.unistack.org/micro/v3/profiler" profile "go.unistack.org/micro/v4/profiler"
) )
type httpProfile struct { type httpProfile struct {

View File

@ -9,7 +9,7 @@ import (
"sync" "sync"
"time" "time"
profile "go.unistack.org/micro/v3/profiler" profile "go.unistack.org/micro/v4/profiler"
) )
type profiler struct { type profiler struct {

View File

@ -2,11 +2,11 @@
package proxy package proxy
import ( import (
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options for proxy // Options for proxy

View File

@ -4,7 +4,7 @@ package proxy
import ( import (
"context" "context"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
) )
// DefaultEndpoint holds default proxy address // DefaultEndpoint holds default proxy address

View File

@ -6,9 +6,9 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
var ( var (

View File

@ -7,7 +7,7 @@ import (
"testing" "testing"
"time" "time"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
) )
var testData = map[string][]*register.Service{ var testData = map[string][]*register.Service{

View File

@ -5,10 +5,10 @@ import (
"crypto/tls" "crypto/tls"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options holds options for register // Options holds options for register

View File

@ -5,7 +5,7 @@ import (
"context" "context"
"errors" "errors"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
const ( const (

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// Resolver is a DNS network resolve // Resolver is a DNS network resolve

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"net" "net"
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// Resolver is a DNS network resolve // Resolver is a DNS network resolve

View File

@ -8,7 +8,7 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// nolint: golint,revive // nolint: golint,revive

View File

@ -2,7 +2,7 @@
package noop package noop
import ( import (
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// Resolver contains noop resolver // Resolver contains noop resolver

View File

@ -4,8 +4,8 @@ package register
import ( import (
"context" "context"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// Resolver is a register network resolver // Resolver is a register network resolver

View File

@ -2,7 +2,7 @@
package static package static
import ( import (
"go.unistack.org/micro/v3/resolver" "go.unistack.org/micro/v4/resolver"
) )
// Resolver returns a static list of nodes. In the event the node list // Resolver returns a static list of nodes. In the event the node list

View File

@ -3,9 +3,9 @@ package router
import ( import (
"context" "context"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
// Options are router options // Options are router options

View File

@ -3,7 +3,7 @@ package router
import ( import (
"hash/fnv" "hash/fnv"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

@ -1,8 +1,8 @@
package random package random
import ( import (
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
type random struct{} type random struct{}

View File

@ -3,7 +3,7 @@ package random
import ( import (
"testing" "testing"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
) )
func TestRandom(t *testing.T) { func TestRandom(t *testing.T) {

View File

@ -1,8 +1,8 @@
package roundrobin package roundrobin
import ( import (
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
// NewSelector returns an initialised round robin selector // NewSelector returns an initialised round robin selector

View File

@ -3,7 +3,7 @@ package roundrobin
import ( import (
"testing" "testing"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
) )
func TestRoundRobin(t *testing.T) { func TestRoundRobin(t *testing.T) {

View File

@ -1,6 +1,6 @@
package server package server
import "go.unistack.org/micro/v3/errors" import "go.unistack.org/micro/v4/errors"
type Error struct { type Error struct {
id string id string

View File

@ -3,7 +3,7 @@ package server
import ( import (
"testing" "testing"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
) )
func TestError(t *testing.T) { func TestError(t *testing.T) {

View File

@ -9,16 +9,16 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
maddr "go.unistack.org/micro/v3/util/addr" maddr "go.unistack.org/micro/v4/util/addr"
mnet "go.unistack.org/micro/v3/util/net" mnet "go.unistack.org/micro/v4/util/net"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
// DefaultCodecs will be used to encode/decode // DefaultCodecs will be used to encode/decode

View File

@ -5,12 +5,12 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
) )
type TestHandler struct { type TestHandler struct {

View File

@ -7,16 +7,16 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
msync "go.unistack.org/micro/v3/sync" msync "go.unistack.org/micro/v4/sync"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
// Option func // Option func

View File

@ -4,10 +4,10 @@ import (
"net" "net"
"time" "time"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/util/addr" "go.unistack.org/micro/v4/util/addr"
"go.unistack.org/micro/v3/util/backoff" "go.unistack.org/micro/v4/util/backoff"
) )
var ( var (

View File

@ -5,8 +5,8 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
// DefaultServer default server // DefaultServer default server

View File

@ -9,17 +9,17 @@ import (
"github.com/KimMachineGun/automemlimit/memlimit" "github.com/KimMachineGun/automemlimit/memlimit"
"go.uber.org/automaxprocs/maxprocs" "go.uber.org/automaxprocs/maxprocs"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/config" "go.unistack.org/micro/v4/config"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
utildns "go.unistack.org/micro/v3/util/dns" utildns "go.unistack.org/micro/v4/util/dns"
) )
func init() { func init() {

View File

@ -5,16 +5,16 @@ import (
"reflect" "reflect"
"testing" "testing"
"go.unistack.org/micro/v3/broker" "go.unistack.org/micro/v4/broker"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/config" "go.unistack.org/micro/v4/config"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
func TestClient(t *testing.T) { func TestClient(t *testing.T) {

View File

@ -8,8 +8,8 @@ import (
"time" "time"
cache "github.com/patrickmn/go-cache" cache "github.com/patrickmn/go-cache"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
) )
// NewStore returns a memory store // NewStore returns a memory store

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"time" "time"
"go.unistack.org/micro/v3/store" "go.unistack.org/micro/v4/store"
) )
type testHook struct { type testHook struct {

View File

@ -5,8 +5,8 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
var _ Store = (*noopStore)(nil) var _ Store = (*noopStore)(nil)

View File

@ -5,12 +5,12 @@ import (
"crypto/tls" "crypto/tls"
"time" "time"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/options" "go.unistack.org/micro/v4/options"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options contains configuration for the Store // Options contains configuration for the Store

View File

@ -3,9 +3,9 @@ package sync
import ( import (
"time" "time"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options holds the sync options // Options holds the sync options

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
var _ tracer.Tracer = (*Tracer)(nil) var _ tracer.Tracer = (*Tracer)(nil)

View File

@ -7,9 +7,9 @@ import (
"strings" "strings"
"testing" "testing"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/logger/slog" "go.unistack.org/micro/v4/logger/slog"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
func TestLoggerWithTracer(t *testing.T) { func TestLoggerWithTracer(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
var _ Tracer = (*noopTracer)(nil) var _ Tracer = (*noopTracer)(nil)

View File

@ -3,7 +3,7 @@ package tracer
import ( import (
"context" "context"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
) )
type SpanStatus int type SpanStatus int

View File

@ -4,7 +4,7 @@ package tracer
import ( import (
"context" "context"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
) )
var ( var (

View File

@ -7,8 +7,8 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/semconv" "go.unistack.org/micro/v4/semconv"
) )
// DialFunc is a [net.Resolver.Dial] function. // DialFunc is a [net.Resolver.Dial] function.

View File

@ -8,7 +8,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
grpc_codes "google.golang.org/grpc/codes" grpc_codes "google.golang.org/grpc/codes"
"google.golang.org/grpc/peer" "google.golang.org/grpc/peer"
"google.golang.org/grpc/stats" "google.golang.org/grpc/stats"

View File

@ -23,7 +23,7 @@ import (
"strings" "strings"
"sync" "sync"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
const ( const (

View File

@ -8,8 +8,8 @@ import (
"net/http" "net/http"
"strings" "strings"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/selector/random" "go.unistack.org/micro/v4/selector/random"
) )
// Write sets the status and body on a http ResponseWriter // Write sets the status and body on a http ResponseWriter

View File

@ -9,10 +9,10 @@ import (
"net/http" "net/http"
"testing" "testing"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
"go.unistack.org/micro/v3/register/memory" "go.unistack.org/micro/v4/register/memory"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
regRouter "go.unistack.org/micro/v3/router/register" regRouter "go.unistack.org/micro/v4/router/register"
) )
func TestRoundTripper(t *testing.T) { func TestRoundTripper(t *testing.T) {

View File

@ -1,6 +1,6 @@
package http package http
import "go.unistack.org/micro/v3/router" import "go.unistack.org/micro/v4/router"
// Options struct // Options struct
type Options struct { type Options struct {

View File

@ -4,8 +4,8 @@ import (
"errors" "errors"
"net/http" "net/http"
"go.unistack.org/micro/v3/router" "go.unistack.org/micro/v4/router"
"go.unistack.org/micro/v3/selector" "go.unistack.org/micro/v4/selector"
) )
type roundTripper struct { type roundTripper struct {

View File

@ -4,7 +4,7 @@ package jitter
import ( import (
"time" "time"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
// Random returns a random time to jitter with max cap specified // Random returns a random time to jitter with max cap specified

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/util/rand" "go.unistack.org/micro/v4/util/rand"
) )
// Ticker is similar to time.Ticker but ticks at random intervals between // Ticker is similar to time.Ticker but ticks at random intervals between

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"time" "time"
rutil "go.unistack.org/micro/v3/util/reflect" rutil "go.unistack.org/micro/v4/util/reflect"
) )
func TestStructFields(t *testing.T) { func TestStructFields(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
jitter "go.unistack.org/micro/v3/util/jitter" jitter "go.unistack.org/micro/v4/util/jitter"
) )
func addNodes(old, neu []*register.Node) []*register.Node { func addNodes(old, neu []*register.Node) []*register.Node {

View File

@ -4,7 +4,7 @@ import (
"os" "os"
"testing" "testing"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
) )
func TestRemove(t *testing.T) { func TestRemove(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"sync" "sync"
"time" "time"
"go.unistack.org/micro/v3/util/id" "go.unistack.org/micro/v4/util/id"
) )
// Buffer is ring buffer // Buffer is ring buffer

View File

@ -4,7 +4,7 @@ package socket
import ( import (
"io" "io"
"go.unistack.org/micro/v3/network/transport" "go.unistack.org/micro/v4/network/transport"
) )
// Socket is our pseudo socket for transport.Socket // Socket is our pseudo socket for transport.Socket

View File

@ -5,10 +5,10 @@ import (
"context" "context"
"sync" "sync"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
) )
// Stream interface // Stream interface

View File

@ -16,10 +16,10 @@ import (
"time" "time"
sqlmock "github.com/DATA-DOG/go-sqlmock" sqlmock "github.com/DATA-DOG/go-sqlmock"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"

View File

@ -8,8 +8,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/semconv" "go.unistack.org/micro/v4/semconv"
) )
var ( var (