rpc

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 23 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 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
	// 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) 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