rpc

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConnError

func IsConnError(err error) bool

IsConnError 是否为连接错误

Types

type CallStat added in v0.5.8

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

func NewCallStat added in v0.5.8

func NewCallStat(size int) *CallStat

func (*CallStat) Add added in v0.5.8

func (this *CallStat) Add(ok bool, costSeconds float64)

func (*CallStat) Sum added in v0.5.8

func (this *CallStat) Sum() (successPercent float64, avgCostSeconds float64)

type RPCClient

type RPCClient struct {
	NodeRPC                pb.NodeServiceClient
	NodeLogRPC             pb.NodeLogServiceClient
	NodeTaskRPC            pb.NodeTaskServiceClient
	NodeValueRPC           pb.NodeValueServiceClient
	HTTPAccessLogRPC       pb.HTTPAccessLogServiceClient
	HTTPCacheTaskKeyRPC    pb.HTTPCacheTaskKeyServiceClient
	APINodeRPC             pb.APINodeServiceClient
	IPLibraryArtifactRPC   pb.IPLibraryArtifactServiceClient
	IPListRPC              pb.IPListServiceClient
	IPItemRPC              pb.IPItemServiceClient
	FileRPC                pb.FileServiceClient
	FileChunkRPC           pb.FileChunkServiceClient
	ACMEAuthenticationRPC  pb.ACMEAuthenticationServiceClient
	ServerRPC              pb.ServerServiceClient
	ServerDailyStatRPC     pb.ServerDailyStatServiceClient
	ServerBandwidthStatRPC pb.ServerBandwidthStatServiceClient
	MetricStatRPC          pb.MetricStatServiceClient
	FirewallRPC            pb.FirewallServiceClient
	SSLCertRPC             pb.SSLCertServiceClient
	ScriptRPC              pb.ScriptServiceClient
	UserRPC                pb.UserServiceClient
	ClientAgentIPRPC       pb.ClientAgentIPServiceClient
	AuthorityKeyRPC        pb.AuthorityKeyServiceClient
	UpdatingServerListRPC  pb.UpdatingServerListServiceClient
	PlanRPC                pb.PlanServiceClient
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error)

func SharedRPC

func SharedRPC() (*RPCClient, error)

SharedRPC RPC对象

func (*RPCClient) Close

func (this *RPCClient) Close()

Close 关闭连接

func (*RPCClient) ClusterContext

func (this *RPCClient) ClusterContext(clusterId string, clusterSecret string) context.Context

ClusterContext 集群上下文

func (*RPCClient) Context

func (this *RPCClient) Context() context.Context

Context 节点上下文信息

func (*RPCClient) Invoke added in v0.5.2

func (this *RPCClient) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error

func (*RPCClient) NewStream added in v0.5.2

func (this *RPCClient) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

func (*RPCClient) TestEndpoints added in v0.5.8

func (this *RPCClient) TestEndpoints(endpoints []string) bool

TestEndpoints 测试Endpoints是否可用

func (*RPCClient) UpdateConfig

func (this *RPCClient) UpdateConfig(config *configs.APIConfig) error

UpdateConfig 修改配置

Jump to

Keyboard shortcuts

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