Merge branch 'v3'
This commit is contained in:
commit
11c868d476
@ -1,13 +1,13 @@
|
||||
package api
|
||||
package api // import "go.unistack.org/micro/v3/api"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
// nolint: revive
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package handler provides http handlers
|
||||
package handler
|
||||
package handler // import "go.unistack.org/micro/v3/api/handler"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/api/router"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/api/router"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
)
|
||||
|
||||
// DefaultMaxRecvSize specifies max recv size for handler
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
|
||||
package grpc
|
||||
package grpc // import "go.unistack.org/micro/v3/api/resolver/grpc"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
)
|
||||
|
||||
// Resolver struct
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Package host resolves using http host
|
||||
package host
|
||||
package host // import "go.unistack.org/micro/v3/api/resolver/host"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
)
|
||||
|
||||
type hostResolver struct {
|
||||
|
@ -3,7 +3,7 @@ package resolver
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
)
|
||||
|
||||
// Options struct
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package path resolves using http path
|
||||
package path
|
||||
package path // import "go.unistack.org/micro/v3/api/resolver/path"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
)
|
||||
|
||||
// Resolver the path resolver
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package resolver resolves a http request to an endpoint
|
||||
package resolver
|
||||
package resolver // import "go.unistack.org/micro/v3/api/resolver"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -1,14 +1,14 @@
|
||||
// Package subdomain is a resolver which uses the subdomain to determine the domain to route to. It
|
||||
// offloads the endpoint resolution to a child resolver which is provided in New.
|
||||
package subdomain
|
||||
package subdomain // import "go.unistack.org/micro/v3/api/resolver/subdomain"
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"golang.org/x/net/publicsuffix"
|
||||
)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver/vpath"
|
||||
"go.unistack.org/micro/v3/api/resolver/vpath"
|
||||
)
|
||||
|
||||
func TestResolve(t *testing.T) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package vpath resolves using http path and recognised versioned urls
|
||||
package vpath
|
||||
package vpath // import "go.unistack.org/micro/v3/api/resolver/vpath"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
)
|
||||
|
||||
// NewResolver creates new vpath api resolver
|
||||
|
@ -3,10 +3,10 @@ package router
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api/resolver"
|
||||
"github.com/unistack-org/micro/v3/api/resolver/vpath"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/api/resolver"
|
||||
"go.unistack.org/micro/v3/api/resolver/vpath"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
)
|
||||
|
||||
// Options holds the options for api router
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Package router provides api service routing
|
||||
package router
|
||||
package router // import "go.unistack.org/micro/v3/api/router"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/unistack-org/micro/v3/api"
|
||||
"go.unistack.org/micro/v3/api"
|
||||
)
|
||||
|
||||
// DefaultRouter contains default router implementation
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Package auth provides authentication and authorization capability
|
||||
package auth
|
||||
package auth // import "go.unistack.org/micro/v3/auth"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,7 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
type noopAuth struct {
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/store"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// NewOptions creates Options struct from slice of options
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package broker is an interface used for asynchronous messaging
|
||||
package broker
|
||||
package broker // import "go.unistack.org/micro/v3/broker"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
// DefaultBroker default memory broker
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
maddr "github.com/unistack-org/micro/v3/util/addr"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
mnet "github.com/unistack-org/micro/v3/util/net"
|
||||
"github.com/unistack-org/micro/v3/util/rand"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
maddr "go.unistack.org/micro/v3/util/addr"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
mnet "go.unistack.org/micro/v3/util/net"
|
||||
"go.unistack.org/micro/v3/util/rand"
|
||||
)
|
||||
|
||||
type memoryBroker struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
func TestMemoryBatchBroker(t *testing.T) {
|
||||
|
@ -5,11 +5,11 @@ import (
|
||||
"crypto/tls"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options struct
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package build is for building source into a package
|
||||
package build
|
||||
package build // import "go.unistack.org/micro/v3/build"
|
||||
|
||||
// Build is an interface for building packages
|
||||
type Build interface {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/util/backoff"
|
||||
"go.unistack.org/micro/v3/util/backoff"
|
||||
)
|
||||
|
||||
// BackoffFunc is the backoff call func
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Package client is an interface for an RPC client
|
||||
package client
|
||||
package client // import "go.unistack.org/micro/v3/client"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"sort"
|
||||
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
)
|
||||
|
||||
// LookupFunc is used to lookup routes for a service
|
||||
|
@ -3,10 +3,10 @@ package client
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
// DefaultCodecs will be used to encode/decode data
|
||||
|
@ -5,16 +5,16 @@ import (
|
||||
"crypto/tls"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"github.com/unistack-org/micro/v3/selector/random"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/selector"
|
||||
"go.unistack.org/micro/v3/selector/random"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options holds client options
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
)
|
||||
|
||||
// RetryFunc that returning either false or a non-nil error will result in the call not being retried
|
||||
|
@ -1,7 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
)
|
||||
|
||||
type testRequest struct {
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package codec is an interface for encoding messages
|
||||
package codec
|
||||
package codec // import "go.unistack.org/micro/v3/codec"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
// Message types
|
||||
|
@ -17,7 +17,7 @@ syntax = "proto3";
|
||||
package micro.codec;
|
||||
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/unistack-org/micro/v3/codec;codec";
|
||||
option go_package = "go.unistack.org/micro/v3/codec;codec";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "MicroCodec";
|
||||
option java_package = "micro.codec";
|
||||
|
@ -3,9 +3,9 @@ package codec
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Option func
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package config is an interface for dynamic configuration.
|
||||
package config
|
||||
package config // import "go.unistack.org/micro/v3/config"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
rutil "github.com/unistack-org/micro/v3/util/reflect"
|
||||
rutil "go.unistack.org/micro/v3/util/reflect"
|
||||
)
|
||||
|
||||
type defaultConfig struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/config"
|
||||
"go.unistack.org/micro/v3/config"
|
||||
)
|
||||
|
||||
type Cfg struct {
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options hold the config options
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Package errors provides a way to return detailed information
|
||||
// for an RPC request error. The error is normally JSON encoded.
|
||||
package errors
|
||||
package errors // import "go.unistack.org/micro/v3/errors"
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
2
event.go
2
event.go
@ -3,7 +3,7 @@ package micro
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
// Event is used to publish messages to a topic
|
||||
|
@ -7,12 +7,12 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/silas/dag"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/store"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
type microFlow struct {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package flow is an interface used for saga pattern microservice workflow
|
||||
package flow
|
||||
package flow // import "go.unistack.org/micro/v3/flow"
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/store"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Option func
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
// Function is a one time executing Service
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
)
|
||||
|
||||
func TestFunction(t *testing.T) {
|
||||
|
4
go.mod
4
go.mod
@ -1,4 +1,4 @@
|
||||
module github.com/unistack-org/micro/v3
|
||||
module go.unistack.org/micro/v3
|
||||
|
||||
go 1.16
|
||||
|
||||
@ -8,7 +8,7 @@ require (
|
||||
github.com/imdario/mergo v0.3.12
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4
|
||||
github.com/unistack-org/micro-proto v0.0.9
|
||||
go.unistack.org/micro-proto/v3 v3.1.0
|
||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
)
|
||||
|
10
go.sum
10
go.sum
@ -1,7 +1,5 @@
|
||||
github.com/ef-ds/deque v1.0.4 h1:iFAZNmveMT9WERAkqLJ+oaABF9AcVQ5AjXem/hroniI=
|
||||
github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg=
|
||||
github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o=
|
||||
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0=
|
||||
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
@ -11,14 +9,10 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34 h1:vBfVmA5mZhsQa2jr1FOL9nfA37N/jnbBmi5XUfviVTI=
|
||||
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
|
||||
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4 h1:fOH64AB0C3ixGf9emky61STvPJL3smxJg+1Zwx1oCdg=
|
||||
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
|
||||
github.com/unistack-org/micro-proto v0.0.9 h1:KrWLS4FUX7UAWNAilQf70uad6ZPf/0EudeddCXllRVc=
|
||||
github.com/unistack-org/micro-proto v0.0.9/go.mod h1:Cckwmzd89gvS7ThxzZp9kQR/EOdksFQcsTAtDDyKwrg=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA=
|
||||
go.unistack.org/micro-proto/v3 v3.1.0/go.mod h1:DpRhYCBXlmSJ/AAXTmntvlh7kQkYU6eFvlmYAx4BQS8=
|
||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b h1:eB48h3HiRycXNy8E0Gf5e0hv7YT6Kt14L/D73G1fuwo=
|
||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package logger provides a log interface
|
||||
package logger
|
||||
package logger // import "go.unistack.org/micro/v3/logger"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -1,10 +1,10 @@
|
||||
package logger
|
||||
package logger // import "go.unistack.org/micro/v3/logger/wrapper"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
rutil "github.com/unistack-org/micro/v3/util/reflect"
|
||||
rutil "go.unistack.org/micro/v3/util/reflect"
|
||||
)
|
||||
|
||||
// LogFunc function used for Log method
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package metadata is a way of defining message headers
|
||||
package metadata
|
||||
package metadata // import "go.unistack.org/micro/v3/metadata"
|
||||
|
||||
import (
|
||||
"net/textproto"
|
||||
|
@ -1,12 +1,12 @@
|
||||
package meter
|
||||
|
||||
//go:generate sh -c "protoc -I./handler -I../ -I$(go list -f '{{ .Dir }}' -m github.com/unistack-org/micro-proto) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./handler handler/handler.proto"
|
||||
//go:generate sh -c "protoc -I./handler -I../ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./handler handler/handler.proto"
|
||||
|
||||
import (
|
||||
|
||||
// import required packages
|
||||
_ "github.com/unistack-org/micro-proto/api"
|
||||
_ "go.unistack.org/micro-proto/v3/api"
|
||||
|
||||
// import required packages
|
||||
_ "github.com/unistack-org/micro-proto/openapiv2"
|
||||
_ "go.unistack.org/micro-proto/v3/openapiv3"
|
||||
)
|
||||
|
@ -1,12 +1,12 @@
|
||||
package handler
|
||||
package handler // import "go.unistack.org/micro/v3/meter/handler"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
)
|
||||
|
||||
// guard to fail early
|
||||
|
@ -1,24 +1,20 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package micro.meter.handler;
|
||||
option go_package = "github.com/unistack-org/micro/v3/meter/handler;handler";
|
||||
option go_package = "go.unistack.org/micro/v3/meter/handler;handler";
|
||||
|
||||
import "api/annotations.proto";
|
||||
import "openapiv2/annotations.proto";
|
||||
import "openapiv3/annotations.proto";
|
||||
import "codec/frame.proto";
|
||||
|
||||
service Meter {
|
||||
rpc Metrics(micro.codec.Frame) returns (micro.codec.Frame) {
|
||||
option (micro.openapiv2.openapiv2_operation) = {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "Metrics";
|
||||
responses: {
|
||||
response_code: {
|
||||
name: "default";
|
||||
value: {
|
||||
json_reference: {
|
||||
description: "Error response";
|
||||
_ref: "micro.codec.Frame";
|
||||
};
|
||||
default: {
|
||||
reference: {
|
||||
_ref: "micro.codec.Frame";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,14 +1,13 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.2
|
||||
// source: handler.proto
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
codec "github.com/unistack-org/micro/v3/codec"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
codec "go.unistack.org/micro/v3/codec"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,15 +1,14 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.2
|
||||
// protoc-gen-go-micro version: v3.5.2
|
||||
// source: handler.proto
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
codec "github.com/unistack-org/micro/v3/codec"
|
||||
server "github.com/unistack-org/micro/v3/server"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
codec "go.unistack.org/micro/v3/codec"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
type meterServer struct {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package meter is for instrumentation
|
||||
package meter
|
||||
package meter // import "go.unistack.org/micro/v3/meter"
|
||||
|
||||
import (
|
||||
"io"
|
||||
@ -28,17 +28,31 @@ var (
|
||||
|
||||
// Meter is an interface for collecting and instrumenting metrics
|
||||
type Meter interface {
|
||||
// Name returns meter name
|
||||
Name() string
|
||||
// Init initialize meter
|
||||
Init(opts ...Option) error
|
||||
// Clone create meter copy with new options
|
||||
Clone(opts ...Option) Meter
|
||||
// Counter get or create counter
|
||||
Counter(name string, labels ...string) Counter
|
||||
// FloatCounter get or create float counter
|
||||
FloatCounter(name string, labels ...string) FloatCounter
|
||||
// Gauge get or create gauge
|
||||
Gauge(name string, fn func() float64, labels ...string) Gauge
|
||||
// Set create new meter metrics set
|
||||
Set(opts ...Option) Meter
|
||||
// Histogram get or create histogram
|
||||
Histogram(name string, labels ...string) Histogram
|
||||
// Summary get or create summary
|
||||
Summary(name string, labels ...string) Summary
|
||||
// SummaryExt get or create summary with spcified quantiles and window time
|
||||
SummaryExt(name string, window time.Duration, quantiles []float64, labels ...string) Summary
|
||||
// Write writes metrics to io.Writer
|
||||
Write(w io.Writer, opts ...Option) error
|
||||
// Options returns meter options
|
||||
Options() Options
|
||||
// String return meter type
|
||||
String() string
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,15 @@ func NewMeter(opts ...Option) Meter {
|
||||
return &noopMeter{opts: NewOptions(opts...)}
|
||||
}
|
||||
|
||||
// Clone return old meter with new options
|
||||
func (r *noopMeter) Clone(opts ...Option) Meter {
|
||||
options := r.opts
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
return &noopMeter{opts: options}
|
||||
}
|
||||
|
||||
func (r *noopMeter) Name() string {
|
||||
return r.opts.Name
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package meter
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
)
|
||||
|
||||
// Option powers the configuration for metrics implementations:
|
||||
@ -51,6 +51,20 @@ func NewOptions(opt ...Option) Options {
|
||||
return opts
|
||||
}
|
||||
|
||||
// LabelPrefix sets the labels prefix
|
||||
func LabelPrefix(pref string) Option {
|
||||
return func(o *Options) {
|
||||
o.LabelPrefix = pref
|
||||
}
|
||||
}
|
||||
|
||||
// MetricPrefix sets the metric prefix
|
||||
func MetricPrefix(pref string) Option {
|
||||
return func(o *Options) {
|
||||
o.MetricPrefix = pref
|
||||
}
|
||||
}
|
||||
|
||||
// Context sets the metrics context
|
||||
func Context(ctx context.Context) Option {
|
||||
return func(o *Options) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
package wrapper
|
||||
package wrapper // import "go.unistack.org/micro/v3/meter/wrapper"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,35 +0,0 @@
|
||||
// +build ignore
|
||||
|
||||
// Package model is an interface for data modelling
|
||||
package model
|
||||
|
||||
// Model provides an interface for data modelling
|
||||
type Model interface {
|
||||
// Initialise options
|
||||
Init(...Option) error
|
||||
// NewEntity creates a new entity to store or access
|
||||
NewEntity(name string, value interface{}) Entity
|
||||
// Create a value
|
||||
Create(Entity) error
|
||||
// Read values
|
||||
Read(...ReadOption) ([]Entity, error)
|
||||
// Update the value
|
||||
Update(Entity) error
|
||||
// Delete an entity
|
||||
Delete(...DeleteOption) error
|
||||
// Implementation of the model
|
||||
String() string
|
||||
}
|
||||
|
||||
type Entity interface {
|
||||
// Unique id of the entity
|
||||
Id() string
|
||||
// Name of the entity
|
||||
Name() string
|
||||
// The value associated with the entity
|
||||
Value() interface{}
|
||||
// Attributes of the entity
|
||||
Attributes() map[string]interface{}
|
||||
// Read a value as a concrete type
|
||||
Read(v interface{}) error
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
// +build ignore
|
||||
|
||||
// Package model is an interface for data modelling
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/sync"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
// Database to write to
|
||||
Database string
|
||||
// for serialising
|
||||
Codec codec.Codec
|
||||
// for locking
|
||||
Sync sync.Sync
|
||||
// for storage
|
||||
Store store.Store
|
||||
// for logger
|
||||
Logger logger.Logger
|
||||
}
|
||||
|
||||
type Option func(o *Options)
|
||||
|
||||
// Logger sets the logger
|
||||
func Logger(l logger.Logger) Option {
|
||||
return func(o *Options) {
|
||||
o.Logger = l
|
||||
}
|
||||
}
|
||||
|
||||
type ReadOptions struct{}
|
||||
|
||||
type ReadOption func(o *ReadOptions)
|
||||
|
||||
type DeleteOptions struct{}
|
||||
|
||||
type DeleteOption func(o *DeleteOptions)
|
@ -1,9 +1,9 @@
|
||||
// Package network is for creating internetworks
|
||||
package network
|
||||
package network // import "go.unistack.org/micro/v3/network"
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
// Error is network node errors
|
||||
|
@ -1,13 +1,13 @@
|
||||
package network
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
"github.com/unistack-org/micro/v3/proxy"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/network/tunnel"
|
||||
"go.unistack.org/micro/v3/proxy"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
// Option func
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
maddr "github.com/unistack-org/micro/v3/util/addr"
|
||||
mnet "github.com/unistack-org/micro/v3/util/net"
|
||||
"github.com/unistack-org/micro/v3/util/rand"
|
||||
maddr "go.unistack.org/micro/v3/util/addr"
|
||||
mnet "go.unistack.org/micro/v3/util/net"
|
||||
"go.unistack.org/micro/v3/util/rand"
|
||||
)
|
||||
|
||||
type memorySocket struct {
|
||||
|
@ -5,10 +5,10 @@ import (
|
||||
"crypto/tls"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/codec"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options struct holds the transport options
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package transport is an interface for synchronous connection based communication
|
||||
package transport
|
||||
package transport // import "go.unistack.org/micro/v3/network/transport"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,15 +1,15 @@
|
||||
// Package broker is a tunnel broker
|
||||
package broker
|
||||
package broker // import "go.unistack.org/micro/v3/network/tunnel/broker"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunBroker struct {
|
||||
|
@ -3,11 +3,11 @@ package tunnel
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package transport
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunListener struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Package transport provides a tunnel transport
|
||||
package transport
|
||||
package transport // import "go.unistack.org/micro/v3/network/tunnel/transport"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunTransport struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Package tunnel provides gre network tunnelling
|
||||
package tunnel
|
||||
package tunnel // import "go.unistack.org/micro/v3/network/transport/tunnel"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"go.unistack.org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
// DefaultTunnel contains default tunnel implementation
|
||||
|
24
options.go
24
options.go
@ -5,18 +5,18 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/auth"
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/config"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/auth"
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/config"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/store"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options for micro service
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package http enables the http profiler
|
||||
package http
|
||||
package http // import "go.unistack.org/micro/v3/profiler/http"
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"net/http/pprof"
|
||||
"sync"
|
||||
|
||||
profile "github.com/unistack-org/micro/v3/profiler"
|
||||
profile "go.unistack.org/micro/v3/profiler"
|
||||
)
|
||||
|
||||
type httpProfile struct {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof
|
||||
package pprof
|
||||
package pprof // import "go.unistack.org/micro/v3/profiler/pprof"
|
||||
|
||||
import (
|
||||
"os"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
profile "github.com/unistack-org/micro/v3/profiler"
|
||||
profile "go.unistack.org/micro/v3/profiler"
|
||||
)
|
||||
|
||||
type profiler struct {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package profiler is for profilers
|
||||
package profiler
|
||||
package profiler // import "go.unistack.org/micro/v3/profiler"
|
||||
|
||||
// Profiler interface
|
||||
type Profiler interface {
|
||||
|
@ -2,11 +2,11 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options for proxy
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Package proxy is a transparent proxy built on the micro/server
|
||||
package proxy
|
||||
package proxy // import "go.unistack.org/micro/v3/proxy"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
// DefaultEndpoint holds default proxy address
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
// ExtractValue from reflect.Type from specified depth
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"crypto/tls"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/meter"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options holds options for register
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package register is an interface for service discovery
|
||||
package register
|
||||
package register // import "go.unistack.org/micro/v3/register"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package dns resolves names to dns records
|
||||
package dns
|
||||
package dns // import "go.unistack.org/micro/v3/resolver/dns"
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// Resolver is a DNS network resolve
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package dnssrv resolves names to dns srv records
|
||||
package dnssrv
|
||||
package dnssrv // import "go.unistack.org/micro/v3/resolver/dnssrv"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// Resolver is a DNS network resolve
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package http resolves names to network addresses using a http request
|
||||
package http
|
||||
package http // import "go.unistack.org/micro/v3/resolver/http"
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// nolint: golint,revive
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Package noop is a noop resolver
|
||||
package noop
|
||||
package noop // import "go.unistack.org/micro/v3/resolver/noop"
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// Resolver contains noop resolver
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package register resolves names using the micro register
|
||||
package register
|
||||
package register // import "go.unistack.org/micro/v3/resolver/registry"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// Resolver is a register network resolver
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package resolver resolves network names to addresses
|
||||
package resolver
|
||||
package resolver // import "go.unistack.org/micro/v3/resolver"
|
||||
|
||||
// Resolver is network resolver. It's used to find network nodes
|
||||
// via the name to connect to. This is done based on Network.Name().
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Package static is a static resolver
|
||||
package static
|
||||
package static // import "go.unistack.org/micro/v3/resolver/static"
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/resolver"
|
||||
"go.unistack.org/micro/v3/resolver"
|
||||
)
|
||||
|
||||
// Resolver returns a static list of nodes. In the event the node list
|
||||
|
@ -3,9 +3,9 @@ package router
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/util/id"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
"go.unistack.org/micro/v3/util/id"
|
||||
)
|
||||
|
||||
// Options are router options
|
||||
|
@ -3,7 +3,7 @@ package router
|
||||
import (
|
||||
"hash/fnv"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package router provides a network routing control plane
|
||||
package router
|
||||
package router // import "go.unistack.org/micro/v3/router"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
)
|
||||
|
||||
// Options configure runtime
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Package runtime is a service runtime manager
|
||||
package runtime
|
||||
package runtime // import "go.unistack.org/micro/v3/runtime"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
)
|
||||
|
||||
// ErrAlreadyExists error
|
||||
|
@ -1,8 +1,8 @@
|
||||
package random
|
||||
package random // import "go.unistack.org/micro/v3/selector/random"
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"github.com/unistack-org/micro/v3/util/rand"
|
||||
"go.unistack.org/micro/v3/selector"
|
||||
"go.unistack.org/micro/v3/util/rand"
|
||||
)
|
||||
|
||||
type random struct{}
|
||||
|
@ -3,7 +3,7 @@ package random
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"go.unistack.org/micro/v3/selector"
|
||||
)
|
||||
|
||||
func TestRandom(t *testing.T) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package roundrobin
|
||||
package roundrobin // import "go.unistack.org/micro/v3/selector/roundrobin"
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"github.com/unistack-org/micro/v3/util/rand"
|
||||
"go.unistack.org/micro/v3/selector"
|
||||
"go.unistack.org/micro/v3/util/rand"
|
||||
)
|
||||
|
||||
// NewSelector returns an initialised round robin selector
|
||||
|
@ -3,7 +3,7 @@ package roundrobin
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"go.unistack.org/micro/v3/selector"
|
||||
)
|
||||
|
||||
func TestRoundRobin(t *testing.T) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package selector is for node selection and load balancing
|
||||
package selector
|
||||
package selector // import "go.unistack.org/micro/v3/selector"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -1,6 +1,6 @@
|
||||
package server
|
||||
|
||||
import "github.com/unistack-org/micro/v3/errors"
|
||||
import "go.unistack.org/micro/v3/errors"
|
||||
|
||||
type Error struct {
|
||||
id string
|
||||
|
@ -3,7 +3,7 @@ package server
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
)
|
||||
|
||||
func TestError(t *testing.T) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package server
|
||||
|
||||
//go:generate sh -c "protoc -I./health -I../ -I$(go list -f '{{ .Dir }}' -m github.com/unistack-org/micro-proto) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./health health/health.proto"
|
||||
//go:generate sh -c "protoc -I./health -I../ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./health health/health.proto"
|
||||
|
||||
import (
|
||||
|
||||
// import required packages
|
||||
_ "github.com/unistack-org/micro-proto/api"
|
||||
_ "go.unistack.org/micro-proto/v3/api"
|
||||
|
||||
// import required packages
|
||||
_ "github.com/unistack-org/micro-proto/openapiv2"
|
||||
_ "go.unistack.org/micro-proto/v3/openapiv3"
|
||||
)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user