Skip to content
Snippets Groups Projects
Commit 4fe6fa30 authored by YGrylls's avatar YGrylls
Browse files

Change hystrix example directory and modified to follow other new examples

parent 515c4722
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 9 deletions
......@@ -27,7 +27,7 @@ import (
)
import (
"github.com/dubbogo/hessian2"
"github.com/apache/dubbo-go-hessian2"
)
import (
......
......@@ -25,7 +25,7 @@ import (
)
import (
hessian "github.com/dubbogo/hessian2"
hessian "github.com/apache/dubbo-go-hessian2"
)
import (
......@@ -34,10 +34,16 @@ import (
type Gender hessian.JavaEnum
var userProvider = new(UserProvider)
var (
userProvider = new(UserProvider)
userProvider1 = new(UserProvider1)
userProvider2 = new(UserProvider2)
)
func init() {
config.SetConsumerService(userProvider)
config.SetConsumerService(userProvider1)
config.SetConsumerService(userProvider2)
}
const (
......@@ -108,14 +114,36 @@ type UserProvider struct {
Echo func(ctx context.Context, req interface{}) (interface{}, error) // Echo represent EchoFilter will be used
}
func (u *UserProvider) Service() string {
return "com.ikurento.user.UserProvider"
func (u *UserProvider) Reference() string {
return "UserProvider"
}
func (u *UserProvider) Version() string {
return ""
type UserProvider1 struct {
GetUsers func(req []interface{}) ([]interface{}, error)
GetErr func(ctx context.Context, req []interface{}, rsp *User) error
GetUser func(ctx context.Context, req []interface{}, rsp *User) error
GetUser0 func(id string, name string) (User, error)
GetUser1 func(ctx context.Context, req []interface{}, rsp *User) error
GetUser2 func(ctx context.Context, req []interface{}, rsp *User) error `dubbo:"getUser"`
GetUser3 func() error
Echo func(ctx context.Context, req interface{}) (interface{}, error) // Echo represent EchoFilter will be used
}
func (u *UserProvider) Reference() string {
return "UserProvider"
func (u *UserProvider1) Reference() string {
return "UserProvider1"
}
type UserProvider2 struct {
GetUsers func(req []interface{}) ([]interface{}, error)
GetErr func(ctx context.Context, req []interface{}, rsp *User) error
GetUser func(ctx context.Context, req []interface{}, rsp *User) error
GetUser0 func(id string, name string) (User, error)
GetUser1 func(ctx context.Context, req []interface{}, rsp *User) error
GetUser2 func(ctx context.Context, req []interface{}, rsp *User) error `dubbo:"getUser"`
GetUser3 func() error
Echo func(ctx context.Context, req interface{}) (interface{}, error) // Echo represent EchoFilter will be used
}
func (u *UserProvider2) Reference() string {
return "UserProvider2"
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment