move to micro v4

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-04-28 22:29:18 +03:00
parent 3f44a41d30
commit 18eb0d9e5c
9 changed files with 30 additions and 36 deletions

View File

@ -5,14 +5,14 @@ This plugin is a http client for micro.
## Overview ## Overview
The http client wraps `net/http` to provide a robust micro client with service discovery, load balancing and streaming. The http client wraps `net/http` to provide a robust micro client with service discovery, load balancing and streaming.
It complies with the [micro.Client](https://godoc.org/go.unistack.org/micro-client-http/v3#Client) interface. It complies with the [micro.Client](https://godoc.org/go.unistack.org/micro-client-http/v4#Client) interface.
## Usage ## Usage
### Use directly ### Use directly
```go ```go
import "go.unistack.org/micro-client-http/v3" import "go.unistack.org/micro-client-http/v4"
service := micro.NewService( service := micro.NewService(
micro.Name("my.service"), micro.Name("my.service"),

6
go.mod
View File

@ -1,5 +1,5 @@
module go.unistack.org/micro-client-http/v3 module go.unistack.org/micro-client-http/v4
go 1.18 go 1.19
require go.unistack.org/micro/v3 v3.10.16 require go.unistack.org/micro/v4 v4.0.1

10
go.sum
View File

@ -1,8 +1,2 @@
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= go.unistack.org/micro/v4 v4.0.1 h1:xo1IxbVfgh8i0eY0VeYa3cbb13u5n/Mxnp3FOgWD4Jo=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= go.unistack.org/micro/v4 v4.0.1/go.mod h1:p/J5UcSJjfHsWGT31uKoghQ5rUQZzQJBAFy+Z4+ZVMs=
github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
go.unistack.org/micro/v3 v3.10.16 h1:2er/SKKYbV60M+UuJM4eYCF0MZYAIq/yNUrAbTfgq8Q=
go.unistack.org/micro/v3 v3.10.16/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

18
http.go
View File

@ -1,5 +1,5 @@
// Package http provides a http client // Package http provides a http client
package http // import "go.unistack.org/micro-client-http/v3" package http // import "go.unistack.org/micro-client-http/v4"
import ( import (
"bufio" "bufio"
@ -15,14 +15,14 @@ import (
"sync" "sync"
"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/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/selector" "go.unistack.org/micro/v4/selector"
rutil "go.unistack.org/micro/v3/util/reflect" rutil "go.unistack.org/micro/v4/util/reflect"
) )
var DefaultContentType = "application/json" var DefaultContentType = "application/json"

View File

@ -1,8 +1,8 @@
package http package http
import ( import (
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
type httpMessage struct { type httpMessage struct {

View File

@ -4,8 +4,8 @@ import (
"net" "net"
"net/http" "net/http"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v4/metadata"
) )
var ( var (

View File

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

View File

@ -9,10 +9,10 @@ import (
"net/http" "net/http"
"sync" "sync"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/codec" "go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
) )
// Implements the streamer interface // Implements the streamer interface

View File

@ -10,10 +10,10 @@ import (
"strings" "strings"
"sync" "sync"
"go.unistack.org/micro/v3/client" "go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v4/errors"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v4/logger"
rutil "go.unistack.org/micro/v3/util/reflect" rutil "go.unistack.org/micro/v4/util/reflect"
) )
var ( var (