rpc_client

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadService

func LoadService(wrapper *rpcConsumerWrapper, rpcConfig *config.RpcConfig) error

func RegisterConsumer

func RegisterConsumer(consumer RpcConsumer)

func ServiceLoad

func ServiceLoad() error

most important

Types

type Directory

type Directory interface {
	ListProviderUrls(serviceName string) []*config.URL
	LookupProvider(serviceName string, url *config.URL) (*transport.Provider, error)
	InvalidProvider(serviceNmae string, url *config.URL) error
	DeleteProvider(serviceNmae string, url *config.URL) error
	// contains filtered or unexported methods
}

func GetDirectory

func GetDirectory() Directory

type FailFastClusterInvoker

type FailFastClusterInvoker struct {
	Directory
	Next    framework.Invoker
	LB      slb.LoadBalance
	Retries int32
}

func NewFailFastClusterInvoker

func NewFailFastClusterInvoker(invoker framework.Invoker, lb slb.LoadBalance, retris int32) *FailFastClusterInvoker

func (*FailFastClusterInvoker) Invoke

type GenericService

type GenericService struct {
	Invoke func(ctx context.Context, methodName string, args map[string]interface{}) (interface{}, error) `rpc:"$invoke"`
}

type MethodSpecial

type MethodSpecial struct {
	MethodName    string
	Async         bool
	OneWay        bool
	Timeout       int
	LoadBalance   string
	HashArgsIndex string
}

type ProviderInvoker

type ProviderInvoker struct {
}

func NewProviderInvoker

func NewProviderInvoker() *ProviderInvoker

func (*ProviderInvoker) Invoke

func (p *ProviderInvoker) Invoke(context *framework.InvokerContext) (*entity.Result, error)

type ReferConfig

type ReferConfig struct {
	//是否泛化
	Generic    bool
	Retries    int32
	SerialType serializations.SERIALIZATION

	Fallback      map[string]interface{}
	JavaClassName string
	Version       string
	Group         string
	Timeout       time.Duration
	LoadBalance   string

	HashNodes     int
	HashArgsIndex string

	UniqueMetaName    string
	UniqueServiceName string

	//ipv4:port
	TargetAddress []string

	MethodSpecials []*MethodSpecial
	IsInit         bool
	// contains filtered or unexported fields
}

func NewReferConfig

func NewReferConfig(javaClass string, timeout time.Duration, targetAddress string) *ReferConfig

func (*ReferConfig) AddMethodSpecial

func (r *ReferConfig) AddMethodSpecial(special *MethodSpecial)

func (*ReferConfig) GetGenericService

func (r *ReferConfig) GetGenericService() (*GenericService, error)

func (*ReferConfig) Init

func (r *ReferConfig) Init()

func (*ReferConfig) SetGeneric

func (r *ReferConfig) SetGeneric(generic bool)

func (*ReferConfig) SetTargetAddresses

func (r *ReferConfig) SetTargetAddresses(targetAddresses string)

type RpcConsumer

type RpcConsumer interface {
	ConsumerClassName() string
}

type RpcConsumerFunc

type RpcConsumerFunc func() string

func (RpcConsumerFunc) ConsumerClassName

func (t RpcConsumerFunc) ConsumerClassName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL