rename module grpc-toolkit

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2023-07-08 01:33:10 +02:00
parent 1fa30d9706
commit df505b58d7
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF
37 changed files with 65 additions and 65 deletions

View File

@ -1,4 +1,4 @@
MODULE = go.linka.cloud/grpc MODULE = go.linka.cloud/grpc-toolkit
PROTO_BASE_PATH = $(PWD) PROTO_BASE_PATH = $(PWD)

View File

@ -1,4 +1,4 @@
# gRPC # gRPC-toolkit
A utility module, largely taken from the [go-micro](https://github.com/micro/go-micro) patterns (and a good amount of code too...) A utility module, largely taken from the [go-micro](https://github.com/micro/go-micro) patterns (and a good amount of code too...)
with pure gRPC ecosystem modules. with pure gRPC ecosystem modules.

View File

@ -12,7 +12,7 @@ import (
"google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver"
"go.linka.cloud/grpc/registry/noop" "go.linka.cloud/grpc-toolkit/registry/noop"
) )
type Client interface { type Client interface {

View File

@ -5,8 +5,8 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
) )
type Options interface { type Options interface {

View File

@ -10,8 +10,8 @@ import (
"github.com/fsnotify/fsnotify" "github.com/fsnotify/fsnotify"
"go.linka.cloud/grpc/config" "go.linka.cloud/grpc-toolkit/config"
"go.linka.cloud/grpc/logger" "go.linka.cloud/grpc-toolkit/logger"
) )
func NewConfig(path string) (config.Config, error) { func NewConfig(path string) (config.Config, error) {

View File

@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.linka.cloud/grpc/config" "go.linka.cloud/grpc-toolkit/config"
) )
func newConfigFile(t *testing.T) (config.Config, string, func()) { func newConfigFile(t *testing.T) (config.Config, string, func()) {

View File

@ -19,15 +19,15 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/descriptorpb"
"go.linka.cloud/grpc/client" "go.linka.cloud/grpc-toolkit/client"
"go.linka.cloud/grpc/interceptors/auth" "go.linka.cloud/grpc-toolkit/interceptors/auth"
"go.linka.cloud/grpc/interceptors/ban" "go.linka.cloud/grpc-toolkit/interceptors/ban"
"go.linka.cloud/grpc/interceptors/defaulter" "go.linka.cloud/grpc-toolkit/interceptors/defaulter"
"go.linka.cloud/grpc/interceptors/iface" "go.linka.cloud/grpc-toolkit/interceptors/iface"
metrics2 "go.linka.cloud/grpc/interceptors/metrics" metrics2 "go.linka.cloud/grpc-toolkit/interceptors/metrics"
validation2 "go.linka.cloud/grpc/interceptors/validation" validation2 "go.linka.cloud/grpc-toolkit/interceptors/validation"
"go.linka.cloud/grpc/logger" "go.linka.cloud/grpc-toolkit/logger"
"go.linka.cloud/grpc/service" "go.linka.cloud/grpc-toolkit/service"
) )
var ( var (

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package helloworld; package helloworld;
option go_package = "go.linka.cloud/grpc/example;main"; option go_package = "go.linka.cloud/grpc-toolkit/example;main";
import "google/api/annotations.proto"; import "google/api/annotations.proto";
import "validate/validate.proto"; import "validate/validate.proto";

2
go.mod
View File

@ -1,4 +1,4 @@
module go.linka.cloud/grpc module go.linka.cloud/grpc-toolkit
go 1.20 go 1.20

View File

@ -7,9 +7,9 @@ import (
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"go.linka.cloud/grpc/errors" "go.linka.cloud/grpc-toolkit/errors"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/interceptors/metadata" "go.linka.cloud/grpc-toolkit/interceptors/metadata"
) )
func BasicAuth(user, password string) string { func BasicAuth(user, password string) string {

View File

@ -10,7 +10,7 @@ import (
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/anypb"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
func ChainedAuthFuncs(fn ...grpc_auth.AuthFunc) grpc_auth.AuthFunc { func ChainedAuthFuncs(fn ...grpc_auth.AuthFunc) grpc_auth.AuthFunc {

View File

@ -10,7 +10,7 @@ import (
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"go.linka.cloud/grpc/errors" "go.linka.cloud/grpc-toolkit/errors"
) )
func TestNotProtectedOnly(t *testing.T) { func TestNotProtectedOnly(t *testing.T) {

View File

@ -5,8 +5,8 @@ import (
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/interceptors/metadata" "go.linka.cloud/grpc-toolkit/interceptors/metadata"
) )
type TokenValidator func(ctx context.Context, token string) (context.Context, error) type TokenValidator func(ctx context.Context, token string) (context.Context, error)

View File

@ -7,7 +7,7 @@ import (
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
"google.golang.org/grpc/peer" "google.golang.org/grpc/peer"
"go.linka.cloud/grpc/errors" "go.linka.cloud/grpc-toolkit/errors"
) )
type X509Validator func(ctx context.Context, sans []string) (context.Context, error) type X509Validator func(ctx context.Context, sans []string) (context.Context, error)

View File

@ -8,8 +8,8 @@ import (
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/logger" "go.linka.cloud/grpc-toolkit/logger"
) )
type ban struct { type ban struct {

View File

@ -4,7 +4,7 @@ import (
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type Option func(*chain) type Option func(*chain)

View File

@ -5,7 +5,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type interceptor struct{} type interceptor struct{}

View File

@ -5,7 +5,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type UnaryInterceptor interface { type UnaryInterceptor interface {

View File

@ -6,7 +6,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
func NewForwardInterceptors() interceptors.ServerInterceptors { func NewForwardInterceptors() interceptors.ServerInterceptors {

View File

@ -6,7 +6,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
func NewInterceptors(pairs ...string) interceptors.Interceptors { func NewInterceptors(pairs ...string) interceptors.Interceptors {

View File

@ -5,8 +5,8 @@ import (
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/service" "go.linka.cloud/grpc-toolkit/service"
) )
type Registerer interface { type Registerer interface {

View File

@ -5,7 +5,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
func New() interceptors.Interceptors { func New() interceptors.Interceptors {

View File

@ -4,7 +4,7 @@ import (
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
func NewInterceptors(opts ...grpc_recovery.Option) interceptors.ServerInterceptors { func NewInterceptors(opts ...grpc_recovery.Option) interceptors.ServerInterceptors {

View File

@ -5,7 +5,7 @@ import (
grpc_sentry "github.com/johnbellone/grpc-middleware-sentry" grpc_sentry "github.com/johnbellone/grpc-middleware-sentry"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type interceptor struct { type interceptor struct {

View File

@ -5,7 +5,7 @@ import (
"github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type tracing struct { type tracing struct {

View File

@ -6,8 +6,8 @@ import (
"google.golang.org/genproto/googleapis/rpc/errdetails" "google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/errors" "go.linka.cloud/grpc-toolkit/errors"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
) )
type validatorAll interface { type validatorAll interface {

View File

@ -17,8 +17,8 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
resolver2 "go.linka.cloud/grpc/resolver" resolver2 "go.linka.cloud/grpc-toolkit/resolver"
) )
var ( var (

View File

@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
) )
func TestRegistry(t *testing.T) { func TestRegistry(t *testing.T) {

View File

@ -5,8 +5,8 @@ import (
"google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
resolver2 "go.linka.cloud/grpc/resolver" resolver2 "go.linka.cloud/grpc-toolkit/resolver"
) )
func New() registry.Registry { func New() registry.Registry {

View File

@ -5,7 +5,7 @@ import (
"google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
) )
func New(reg registry.Registry) resolver.Builder { func New(reg registry.Registry) resolver.Builder {

View File

@ -1,8 +1,8 @@
package service package service
import ( import (
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/interceptors/metadata" "go.linka.cloud/grpc-toolkit/interceptors/metadata"
) )
func md(opts *options) interceptors.Interceptors { func md(opts *options) interceptors.Interceptors {

View File

@ -15,11 +15,11 @@ import (
"github.com/rs/cors" "github.com/rs/cors"
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/certs" "go.linka.cloud/grpc-toolkit/certs"
"go.linka.cloud/grpc/interceptors" "go.linka.cloud/grpc-toolkit/interceptors"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
"go.linka.cloud/grpc/transport" "go.linka.cloud/grpc-toolkit/transport"
"go.linka.cloud/grpc/utils/addr" "go.linka.cloud/grpc-toolkit/utils/addr"
) )
var _ Options = (*options)(nil) var _ Options = (*options)(nil)

View File

@ -5,10 +5,10 @@ import (
"strings" "strings"
"time" "time"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
"go.linka.cloud/grpc/utils/addr" "go.linka.cloud/grpc-toolkit/utils/addr"
"go.linka.cloud/grpc/utils/backoff" "go.linka.cloud/grpc-toolkit/utils/backoff"
net2 "go.linka.cloud/grpc/utils/net" net2 "go.linka.cloud/grpc-toolkit/utils/net"
) )
func (s *service) register() error { func (s *service) register() error {

View File

@ -27,9 +27,9 @@ import (
"google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/health/grpc_health_v1"
greflect "google.golang.org/grpc/reflection" greflect "google.golang.org/grpc/reflection"
"go.linka.cloud/grpc/logger" "go.linka.cloud/grpc-toolkit/logger"
"go.linka.cloud/grpc/registry" "go.linka.cloud/grpc-toolkit/registry"
"go.linka.cloud/grpc/registry/noop" "go.linka.cloud/grpc-toolkit/registry/noop"
) )
type Service interface { type Service interface {

View File

@ -6,7 +6,7 @@ import (
"github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/improbable-eng/grpc-web/go/grpcweb"
"go.linka.cloud/grpc/react" "go.linka.cloud/grpc-toolkit/react"
) )
var defaultWebOptions = []grpcweb.Option{ var defaultWebOptions = []grpcweb.Option{

View File

@ -3,7 +3,7 @@ package grpc
import ( import (
"google.golang.org/grpc" "google.golang.org/grpc"
"go.linka.cloud/grpc/transport" "go.linka.cloud/grpc-toolkit/transport"
) )
var ( var (

View File

@ -7,7 +7,7 @@ import (
"github.com/fullstorydev/grpchan/inprocgrpc" "github.com/fullstorydev/grpchan/inprocgrpc"
"go.linka.cloud/grpc/transport" "go.linka.cloud/grpc-toolkit/transport"
) )
var ( var (