move to v4

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-04-11 22:20:37 +03:00
parent 1d5e795443
commit ebd8ddf05b
122 changed files with 426 additions and 317 deletions

View File

@ -1,4 +1,4 @@
# Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Doc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/unistack-org/micro/v3?tab=overview) [![Status](https://github.com/unistack-org/micro/workflows/build/badge.svg?branch=master)](https://github.com/unistack-org/micro/actions?query=workflow%3Abuild+branch%3Amaster+event%3Apush) [![Lint](https://goreportcard.com/badge/go.unistack.org/micro/v3)](https://goreportcard.com/report/go.unistack.org/micro/v3) [![Coverage](https://codecov.io/gh/unistack-org/micro/branch/v3/graph/badge.svg?token=OZPO2LP7VS)](https://codecov.io/gh/unistack-org/micro) # Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Doc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/go.unistack.org/micro/v4?tab=overview) [![Status](https://github.com/unistack-org/micro/workflows/build/badge.svg?branch=master)](https://github.com/unistack-org/micro/actions?query=workflow%3Abuild+branch%3Amaster+event%3Apush) [![Lint](https://goreportcard.com/badge/go.unistack.org/micro/v4)](https://goreportcard.com/report/go.unistack.org/micro/v4) [![Coverage](https://codecov.io/gh/unistack-org/micro/branch/v4/graph/badge.svg?token=OZPO2LP7VS)](https://codecov.io/gh/unistack-org/micro)
Micro is a standard library for microservices. Micro is a standard library for microservices.

View File

@ -1,12 +1,12 @@
// Package broker is an interface used for asynchronous messaging // Package broker is an interface used for asynchronous messaging
package broker // import "go.unistack.org/micro/v3/broker" package broker // import "go.unistack.org/micro/v4/broker"
import ( import (
"context" "context"
"errors" "errors"
"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,12 +4,12 @@ import (
"context" "context"
"sync" "sync"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
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,7 +5,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
func TestMemoryBatchBroker(t *testing.T) { func TestMemoryBatchBroker(t *testing.T) {

View File

@ -5,11 +5,11 @@ 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/register" "go.unistack.org/micro/v4/register"
"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

@ -1,12 +1,12 @@
// Package client is an interface for an RPC client // Package client is an interface for an RPC client
package client // import "go.unistack.org/micro/v3/client" package client // import "go.unistack.org/micro/v4/client"
import ( 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

@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"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/selector" "go.unistack.org/micro/v4/selector"
) )
// 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/network/transport" "go.unistack.org/micro/v4/network/transport"
"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

@ -1,11 +1,11 @@
// Package codec is an interface for encoding messages // Package codec is an interface for encoding messages
package codec // import "go.unistack.org/micro/v3/codec" package codec // import "go.unistack.org/micro/v4/codec"
import ( import (
"errors" "errors"
"io" "io"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
// Message types // Message types

View File

@ -1,4 +1,4 @@
// Copyright 2021 Unistack LLC // Copyright 2021-2023 Unistack LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@ syntax = "proto3";
package micro.codec; package micro.codec;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option go_package = "go.unistack.org/micro/v3/codec;codec"; option go_package = "go.unistack.org/micro/v4/codec;codec";
option java_multiple_files = true; option java_multiple_files = true;
option java_outer_classname = "MicroCodec"; option java_outer_classname = "MicroCodec";
option java_package = "micro.codec"; option java_package = "micro.codec";

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

@ -1,5 +1,5 @@
// Package config is an interface for dynamic configuration. // Package config is an interface for dynamic configuration.
package config // import "go.unistack.org/micro/v3/config" package config // import "go.unistack.org/micro/v4/config"
import ( import (
"context" "context"

View File

@ -8,8 +8,8 @@ import (
"time" "time"
"github.com/imdario/mergo" "github.com/imdario/mergo"
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 {
@ -169,7 +169,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

@ -6,8 +6,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,10 +4,10 @@ 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/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options hold the config options // Options hold the config options

View File

@ -1,6 +1,6 @@
// Package errors provides a way to return detailed information // Package errors provides a way to return detailed information
// for an RPC request error. The error is normally JSON encoded. // for an RPC request error. The error is normally JSON encoded.
package errors // import "go.unistack.org/micro/v3/errors" package errors // import "go.unistack.org/micro/v4/errors"
import ( import (
"bytes" "bytes"

View File

@ -1,4 +1,4 @@
// Copyright 2021 Unistack LLC // Copyright 2021-2023 Unistack LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@ syntax = "proto3";
package micro.errors; package micro.errors;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option go_package = "go.unistack.org/micro/v3/errors;errors"; option go_package = "go.unistack.org/micro/v4/errors;errors";
option java_multiple_files = true; option java_multiple_files = true;
option java_outer_classname = "MicroErrors"; option java_outer_classname = "MicroErrors";
option java_package = "micro.errors"; option java_package = "micro.errors";

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

@ -1,5 +1,5 @@
// Package flow is an interface used for saga pattern microservice workflow // Package flow is an interface used for saga pattern microservice workflow
package flow // import "go.unistack.org/micro/v3/flow" package flow // import "go.unistack.org/micro/v4/flow"
import ( import (
"context" "context"
@ -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

@ -1,4 +1,4 @@
package fsm // import "go.unistack.org/micro/v3/fsm" package fsm // import "go.unistack.org/micro/v4/fsm"
import ( import (
"context" "context"

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

5
go.mod
View File

@ -1,8 +1,9 @@
module go.unistack.org/micro/v3 module go.unistack.org/micro/v4
go 1.19 go 1.20
require ( require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/imdario/mergo v0.3.14 github.com/imdario/mergo v0.3.14
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35 github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35

2
go.sum
View File

@ -1,3 +1,5 @@
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/imdario/mergo v0.3.14 h1:fOqeC1+nCuuk6PKQdg9YmosXX7Y7mHX6R/0ZldI9iHo= github.com/imdario/mergo v0.3.14 h1:fOqeC1+nCuuk6PKQdg9YmosXX7Y7mHX6R/0ZldI9iHo=
github.com/imdario/mergo v0.3.14/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/imdario/mergo v0.3.14/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=

View File

@ -1,5 +1,5 @@
// Package logger provides a log interface // Package logger provides a log interface
package logger // import "go.unistack.org/micro/v3/logger" package logger // import "go.unistack.org/micro/v4/logger"
import ( import (
"context" "context"

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

@ -5,9 +5,9 @@ import (
"context" "context"
"fmt" "fmt"
"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/server" "go.unistack.org/micro/v4/server"
) )
var ( var (

View File

@ -1,5 +1,5 @@
// Package metadata is a way of defining message headers // Package metadata is a way of defining message headers
package metadata // import "go.unistack.org/micro/v3/metadata" package metadata // import "go.unistack.org/micro/v4/metadata"
import ( import (
"net/textproto" "net/textproto"

View File

@ -1,5 +1,5 @@
// Package meter is for instrumentation // Package meter is for instrumentation
package meter // import "go.unistack.org/micro/v3/meter" package meter // import "go.unistack.org/micro/v4/meter"
import ( import (
"io" "io"

View File

@ -3,7 +3,7 @@ package meter
import ( import (
"context" "context"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
) )
// Option powers the configuration for metrics implementations: // Option powers the configuration for metrics implementations:

View File

@ -1,13 +1,13 @@
package wrapper // import "go.unistack.org/micro/v3/meter/wrapper" package wrapper // import "go.unistack.org/micro/v4/meter/wrapper"
import ( import (
"context" "context"
"fmt" "fmt"
"time" "time"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/meter" "go.unistack.org/micro/v4/meter"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
) )
var ( var (

View File

@ -1,4 +1,4 @@
package mtls // import "go.unistack.org/micro/v3/mtls" package mtls // import "go.unistack.org/micro/v4/mtls"
import ( import (
"bytes" "bytes"

View File

@ -1,9 +1,9 @@
// Package network is for creating internetworks // Package network is for creating internetworks
package network // import "go.unistack.org/micro/v3/network" package network // import "go.unistack.org/micro/v4/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

@ -1,11 +1,11 @@
// Package transport is an interface for synchronous connection based communication // Package transport is an interface for synchronous connection based communication
package transport // import "go.unistack.org/micro/v3/network/transport" package transport // import "go.unistack.org/micro/v4/network/transport"
import ( import (
"context" "context"
"time" "time"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

@ -1,15 +1,15 @@
// Package broker is a tunnel broker // Package broker is a tunnel broker
package broker // import "go.unistack.org/micro/v3/network/tunnel/broker" package broker // import "go.unistack.org/micro/v4/network/tunnel/broker"
import ( 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

@ -1,12 +1,12 @@
// Package transport provides a tunnel transport // Package transport provides a tunnel transport
package transport // import "go.unistack.org/micro/v3/network/tunnel/transport" package transport // import "go.unistack.org/micro/v4/network/tunnel/transport"
import ( 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

@ -1,12 +1,12 @@
// Package tunnel provides gre network tunnelling // Package tunnel provides gre network tunnelling
package tunnel // import "go.unistack.org/micro/v3/network/transport/tunnel" package tunnel // import "go.unistack.org/micro/v4/network/transport/tunnel"
import ( import (
"context" "context"
"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

@ -1,4 +1,4 @@
package options // import "go.unistack.org/micro/v3/options" package options // import "go.unistack.org/micro/v4/options"
// Hook func interface // Hook func interface
type Hook interface{} type Hook interface{}

View File

@ -1,5 +1,5 @@
// Package http enables the http profiler // Package http enables the http profiler
package http // import "go.unistack.org/micro/v3/profiler/http" package http // import "go.unistack.org/micro/v4/profiler/http"
import ( import (
"context" "context"
@ -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

@ -1,5 +1,5 @@
// Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof // Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof
package pprof // import "go.unistack.org/micro/v3/profiler/pprof" package pprof // import "go.unistack.org/micro/v4/profiler/pprof"
import ( import (
"os" "os"
@ -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

@ -1,5 +1,5 @@
// Package profiler is for profilers // Package profiler is for profilers
package profiler // import "go.unistack.org/micro/v3/profiler" package profiler // import "go.unistack.org/micro/v4/profiler"
// Profiler interface // Profiler interface
type Profiler interface { type Profiler interface {

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

@ -1,10 +1,10 @@
// Package proxy is a transparent proxy built on the micro/server // Package proxy is a transparent proxy built on the micro/server
package proxy // import "go.unistack.org/micro/v3/proxy" package proxy // import "go.unistack.org/micro/v4/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,7 +6,7 @@ import (
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
// ExtractValue from reflect.Type from specified depth // ExtractValue from reflect.Type from specified depth

View File

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

View File

@ -5,9 +5,9 @@ import (
"crypto/tls" "crypto/tls"
"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 options for register // Options holds options for register

View File

@ -1,11 +1,11 @@
// Package register is an interface for service discovery // Package register is an interface for service discovery
package register // import "go.unistack.org/micro/v3/register" package register // import "go.unistack.org/micro/v4/register"
import ( import (
"context" "context"
"errors" "errors"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
const ( const (

View File

@ -1,5 +1,5 @@
// Package dns resolves names to dns records // Package dns resolves names to dns records
package dns // import "go.unistack.org/micro/v3/resolver/dns" package dns // import "go.unistack.org/micro/v4/resolver/dns"
import ( import (
"context" "context"
@ -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

@ -1,11 +1,11 @@
// Package dnssrv resolves names to dns srv records // Package dnssrv resolves names to dns srv records
package dnssrv // import "go.unistack.org/micro/v3/resolver/dnssrv" package dnssrv // import "go.unistack.org/micro/v4/resolver/dnssrv"
import ( 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

@ -1,5 +1,5 @@
// Package http resolves names to network addresses using a http request // Package http resolves names to network addresses using a http request
package http // import "go.unistack.org/micro/v3/resolver/http" package http // import "go.unistack.org/micro/v4/resolver/http"
import ( import (
"encoding/json" "encoding/json"
@ -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

@ -1,8 +1,8 @@
// Package noop is a noop resolver // Package noop is a noop resolver
package noop // import "go.unistack.org/micro/v3/resolver/noop" package noop // import "go.unistack.org/micro/v4/resolver/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

@ -1,11 +1,11 @@
// Package register resolves names using the micro register // Package register resolves names using the micro register
package register // import "go.unistack.org/micro/v3/resolver/registry" package register // import "go.unistack.org/micro/v4/resolver/registry"
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

@ -1,5 +1,5 @@
// Package resolver resolves network names to addresses // Package resolver resolves network names to addresses
package resolver // import "go.unistack.org/micro/v3/resolver" package resolver // import "go.unistack.org/micro/v4/resolver"
// Resolver is network resolver. It's used to find network nodes // Resolver is network resolver. It's used to find network nodes
// via the name to connect to. This is done based on Network.Name(). // via the name to connect to. This is done based on Network.Name().

View File

@ -1,8 +1,8 @@
// Package static is a static resolver // Package static is a static resolver
package static // import "go.unistack.org/micro/v3/resolver/static" package static // import "go.unistack.org/micro/v4/resolver/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,5 +1,5 @@
// Package router provides a network routing control plane // Package router provides a network routing control plane
package router // import "go.unistack.org/micro/v3/router" package router // import "go.unistack.org/micro/v4/router"
import ( import (
"errors" "errors"

View File

@ -1,8 +1,8 @@
package random // import "go.unistack.org/micro/v3/selector/random" package random // import "go.unistack.org/micro/v4/selector/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 // import "go.unistack.org/micro/v3/selector/roundrobin" package roundrobin // import "go.unistack.org/micro/v4/selector/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,5 +1,5 @@
// Package selector is for node selection and load balancing // Package selector is for node selection and load balancing
package selector // import "go.unistack.org/micro/v3/selector" package selector // import "go.unistack.org/micro/v4/selector"
import ( import (
"errors" "errors"

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

@ -3,7 +3,7 @@ package server
import ( import (
"reflect" "reflect"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
) )
type rpcHandler struct { type rpcHandler struct {

View File

@ -6,13 +6,13 @@ 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/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/metadata" "go.unistack.org/micro/v4/metadata"
"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/network/transport" "go.unistack.org/micro/v4/network/transport"
"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/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

@ -1,8 +1,8 @@
package server package server
import ( import (
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
type rpcMessage struct { type rpcMessage struct {

View File

@ -1,13 +1,13 @@
// Package server is an interface for a micro server // Package server is an interface for a micro server
package server // import "go.unistack.org/micro/v3/server" package server // import "go.unistack.org/micro/v4/server"
import ( 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"
"go.unistack.org/micro/v3/register" "go.unistack.org/micro/v4/register"
) )
// DefaultServer default server // DefaultServer default server

View File

@ -10,12 +10,12 @@ import (
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
"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/register" "go.unistack.org/micro/v4/register"
) )
const ( const (

View File

@ -1,20 +1,20 @@
// Package micro is a pluggable framework for microservices // Package micro is a pluggable framework for microservices
package micro // import "go.unistack.org/micro/v3" package micro // import "go.unistack.org/micro/v4"
import ( import (
"fmt" "fmt"
"sync" "sync"
"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"
) )
// Service is an interface that wraps the lower level components. // Service is an interface that wraps the lower level components.

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"
) )
type testItem struct { type testItem struct {

View File

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

View File

@ -5,11 +5,11 @@ 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/tracer" "go.unistack.org/micro/v4/tracer"
) )
// Options contains configuration for the Store // Options contains configuration for the Store

View File

@ -1,5 +1,5 @@
// Package store is an interface for distributed data storage. // Package store is an interface for distributed data storage.
package store // import "go.unistack.org/micro/v3/store" package store // import "go.unistack.org/micro/v4/store"
import ( import (
"context" "context"

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

@ -1,5 +1,5 @@
// Package sync is an interface for distributed synchronization // Package sync is an interface for distributed synchronization
package sync // import "go.unistack.org/micro/v3/sync" package sync // import "go.unistack.org/micro/v4/sync"
import ( import (
"errors" "errors"

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

@ -1,5 +1,5 @@
// Package tracer provides an interface for distributed tracing // Package tracer provides an interface for distributed tracing
package tracer // import "go.unistack.org/micro/v3/tracer" package tracer // import "go.unistack.org/micro/v4/tracer"
import ( import (
"context" "context"

View File

@ -1,14 +1,14 @@
// Package wrapper provides wrapper for Tracer // Package wrapper provides wrapper for Tracer
package wrapper // import "go.unistack.org/micro/v3/tracer/wrapper" package wrapper // import "go.unistack.org/micro/v4/tracer/wrapper"
import ( import (
"context" "context"
"fmt" "fmt"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
"go.unistack.org/micro/v3/server" "go.unistack.org/micro/v4/server"
"go.unistack.org/micro/v3/tracer" "go.unistack.org/micro/v4/tracer"
) )
var ( var (

View File

@ -1,4 +1,4 @@
package addr // import "go.unistack.org/micro/v3/util/addr" package addr // import "go.unistack.org/micro/v4/util/addr"
import ( import (
"fmt" "fmt"

View File

@ -1,5 +1,5 @@
// Package backoff provides backoff functionality // Package backoff provides backoff functionality
package backoff // import "go.unistack.org/micro/v3/util/backoff" package backoff // import "go.unistack.org/micro/v4/util/backoff"
import ( import (
"math" "math"

View File

@ -1,4 +1,4 @@
package buf // import "go.unistack.org/micro/v3/util/buf" package buf // import "go.unistack.org/micro/v4/util/buf"
import ( import (
"bytes" "bytes"

View File

@ -1,4 +1,4 @@
package http // import "go.unistack.org/micro/v3/util/http" package http // import "go.unistack.org/micro/v4/util/http"
import ( import (
"context" "context"
@ -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) {

Some files were not shown because too many files have changed in this diff Show More