client

package
v0.0.0-...-be8dc82 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: BSD-3-Clause Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceClientClosed = errors.New("Service client shutdown")
	MaxRetryCount       = errors.New("Max Retry Count")
)

Functions

func GetServices

func GetServices(criteria *skynet.Criteria) ([]*skynet.ServiceInfo, int64, error)

func RegisterServices

func RegisterServices(si *skynet.ServiceInfo) error

func UnRegisterServices

func UnRegisterServices(si *skynet.ServiceInfo) error

Types

type ClientManager

type ClientManager struct {
	// contains filtered or unexported fields
}

func NewClientManager

func NewClientManager() *ClientManager

func (*ClientManager) DelClient

func (manager *ClientManager) DelClient(serviceName, version string)

func (*ClientManager) DelClientByServiceKey

func (manager *ClientManager) DelClientByServiceKey(serviceKey string)

func (*ClientManager) GetClient

func (manager *ClientManager) GetClient(serviceName, version string) *ServiceClient

type RPCMonitorGetIn

type RPCMonitorGetIn struct {
	Criteria *skynet.Criteria
}

type RPCMonitorGetOut

type RPCMonitorGetOut struct {
	Code     string
	Services []*skynet.ServiceInfo
	RunTime  int64 // 运行时间(Seconds)
}

type RPCMonitorRegisterIn

type RPCMonitorRegisterIn struct {
	Si *skynet.ServiceInfo
}

type RPCMonitorRegisterOut

type RPCMonitorRegisterOut struct {
	Code string
}

type RPCMonitorUnRegisterIn

type RPCMonitorUnRegisterIn struct {
	Si *skynet.ServiceInfo
}

type RPCMonitorUnRegisterOut

type RPCMonitorUnRegisterOut struct {
	Code string
}

type ServiceClient

type ServiceClient struct {
	// contains filtered or unexported fields
}

func GetClient

func GetClient(name, version string) *ServiceClient

会重用全局的ServiceClient

备注: 一定是成功的

func NewClient

func NewClient(name, version string) *ServiceClient

创建一个新的ServiceClient

备注: 一定是成功的

func NewMonitorClient

func NewMonitorClient() *ServiceClient

func NewServiceClient

func NewServiceClient(criteria *skynet.Criteria) *ServiceClient

func (*ServiceClient) Close

func (sc *ServiceClient) Close()

func (*ServiceClient) IsClosed

func (sc *ServiceClient) IsClosed() bool

func (*ServiceClient) Send

func (sc *ServiceClient) Send(fn string, in interface{}, out interface{}) error

func (*ServiceClient) UpdateServices

func (sc *ServiceClient) UpdateServices(services []*skynet.ServiceInfo)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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