ShowAlgo()
Method and class:
ShowAlgo(req *configuration.RequestConfig) ([]*structs.Algo, error)
Example: Acquire information of all installed algorithms
func TestMisc(t *testing.T) {
// omit code of establishing server connection 'conn'
responseAlgos, _ := conn.ShowAlgo(nil)
printers.PrintAlgoList(responseAlgos)
}
InstallAlgo()
Method and class:
InstallAlgo(algoFilePath string,
algoInfoFilePath string,
req *configuration.RequestConfig
) (*ultipa.InstallAlgoReply, error)
Example: Install algorithm LPA. The config file 'lpa.yml' and the installation package 'libplugin_lpa.so' are placed under the path of current Go file
func TestMisc(t *testing.T) {
// omit code of establishing server connection 'conn'
resp, err := conn.InstallAlgo("libplugin_lpa.so", "lpa.yml", nil)
if resp.Status.ErrorCode != ultipa.ErrorCode_SUCCESS {
printers.PrintError(resp.Status.Msg)
}
if err != nil {
printers.PrintErrAndExist(err.Error())
}
}
UninstallAlgo()
Method and class:
UninstallAlgo(algoName string, req *configuration.RequestConfig) (*ultipa.UninstallAlgoReply, error)
Example: Uninstall algorithm LPA
func TestMisc(t *testing.T) {
// omit code of establishing server connection 'conn'
resp, err := conn.UninstallAlgo("lpa", nil)
if resp.Status.ErrorCode != ultipa.ErrorCode_SUCCESS {
printers.PrintError(resp.Status.Msg)
}
if err != nil {
printers.PrintErrAndExist(err.Error())
}
}