rpc

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelTaskLocal

func CancelTaskLocal(taskId string, nodeId string) error

func CancelTaskRemote

func CancelTaskRemote(taskId string, nodeId string) (err error)

func ClientFunc

func ClientFunc(msg entity.RpcMessage) func() (entity.RpcMessage, error)

客户端处理消息函数

func GetInstalledDepsLocal

func GetInstalledDepsLocal(lang string) (deps []entity.Dependency, err error)

获取本地已安装依赖列表

func GetInstalledDepsRemote

func GetInstalledDepsRemote(nodeId string, lang string) (deps []entity.Dependency, err error)

func GetLangLocal

func GetLangLocal(lang entity.Lang) entity.Lang

func GetLangRemote

func GetLangRemote(nodeId string, lang entity.Lang) (l entity.Lang, err error)

func GetNodejsInstalledDepListLocal

func GetNodejsInstalledDepListLocal() ([]entity.Dependency, error)

获取Node.js本地已安装依赖列表

func GetPythonInstalledDepListLocal

func GetPythonInstalledDepListLocal() ([]entity.Dependency, error)

获取Python本地已安装依赖列表

func GetSystemInfoServiceLocal

func GetSystemInfoServiceLocal() (sysInfo entity.SystemInfo, err error)

func GetSystemInfoServiceRemote

func GetSystemInfoServiceRemote(nodeId string) (sysInfo entity.SystemInfo, err error)

func InitRpcService

func InitRpcService() error

初始化服务端RPC服务

func InstallDepLocal

func InstallDepLocal(lang string, depName string) error

func InstallDepRemote

func InstallDepRemote(nodeId string, lang string, depName string) (err error)

func InstallLangLocal

func InstallLangLocal(lang string) (o string, err error)

本地安装语言

func InstallLangRemote

func InstallLangRemote(nodeId string, lang string) (o string, err error)

远端安装语言

func InstallNodejsDepLocal

func InstallNodejsDepLocal(depName string) (string, error)

func InstallPythonDepLocal

func InstallPythonDepLocal(depName string) (string, error)

安装Python本地依赖

func RemoveSpiderServiceLocal

func RemoveSpiderServiceLocal(spiderId string) error

func RemoveSpiderServiceRemote

func RemoveSpiderServiceRemote(spiderId string, nodeId string) (err error)

func UninstallDepLocal

func UninstallDepLocal(lang string, depName string) error

func UninstallDepRemote

func UninstallDepRemote(nodeId string, lang string, depName string) (err error)

func UninstallNodejsDepLocal

func UninstallNodejsDepLocal(depName string) (string, error)

func UninstallPythonDepLocal

func UninstallPythonDepLocal(depName string) (string, error)

Types

type CancelTaskService

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

func (*CancelTaskService) ClientHandle

func (s *CancelTaskService) ClientHandle() (o interface{}, err error)

func (*CancelTaskService) ServerHandle

func (s *CancelTaskService) ServerHandle() (entity.RpcMessage, error)

type GetInstalledDepsService

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

func (*GetInstalledDepsService) ClientHandle

func (s *GetInstalledDepsService) ClientHandle() (o interface{}, err error)

func (*GetInstalledDepsService) ServerHandle

func (s *GetInstalledDepsService) ServerHandle() (entity.RpcMessage, error)

type GetLangService

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

func (*GetLangService) ClientHandle

func (s *GetLangService) ClientHandle() (o interface{}, err error)

func (*GetLangService) ServerHandle

func (s *GetLangService) ServerHandle() (entity.RpcMessage, error)

type GetSystemInfoService

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

func (*GetSystemInfoService) ClientHandle

func (s *GetSystemInfoService) ClientHandle() (o interface{}, err error)

func (*GetSystemInfoService) ServerHandle

func (s *GetSystemInfoService) ServerHandle() (entity.RpcMessage, error)

type InstallDepService

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

func (*InstallDepService) ClientHandle

func (s *InstallDepService) ClientHandle() (o interface{}, err error)

func (*InstallDepService) ServerHandle

func (s *InstallDepService) ServerHandle() (entity.RpcMessage, error)

type InstallLangService

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

func (*InstallLangService) ClientHandle

func (s *InstallLangService) ClientHandle() (o interface{}, err error)

func (*InstallLangService) ServerHandle

func (s *InstallLangService) ServerHandle() (entity.RpcMessage, error)

type RemoveSpiderService

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

func (*RemoveSpiderService) ClientHandle

func (s *RemoveSpiderService) ClientHandle() (o interface{}, err error)

func (*RemoveSpiderService) ServerHandle

func (s *RemoveSpiderService) ServerHandle() (entity.RpcMessage, error)

type Service

type Service interface {
	ServerHandle() (entity.RpcMessage, error)
	ClientHandle() (interface{}, error)
}

RPC服务基础类

func GetService

func GetService(msg entity.RpcMessage) Service

获取RPC服务

type UninstallDepService

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

func (*UninstallDepService) ClientHandle

func (s *UninstallDepService) ClientHandle() (o interface{}, err error)

func (*UninstallDepService) ServerHandle

func (s *UninstallDepService) ServerHandle() (entity.RpcMessage, error)

Jump to

Keyboard shortcuts

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