當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Client.RequestReply方法代碼示例

本文整理匯總了Golang中github.com/Symantec/Dominator/lib/srpc.Client.RequestReply方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.RequestReply方法的具體用法?Golang Client.RequestReply怎麽用?Golang Client.RequestReply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/Symantec/Dominator/lib/srpc.Client的用法示例。


在下文中一共展示了Client.RequestReply方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: deleteUnreferencedObjects

func deleteUnreferencedObjects(client *srpc.Client, percentage uint8,
	bytes uint64) error {
	request := imageserver.DeleteUnreferencedObjectsRequest{percentage, bytes}
	var reply imageserver.DeleteUnreferencedObjectsResponse
	return client.RequestReply("ImageServer.DeleteUnreferencedObjects",
		request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:7,代碼來源:deleteUnreferencedObjects.go

示例2: fetch

func fetch(srpcClient *srpc.Client, hashesFilename string) error {
	hashesFile, err := os.Open(hashesFilename)
	if err != nil {
		return err
	}
	defer hashesFile.Close()
	scanner := bufio.NewScanner(hashesFile)
	serverAddress := fmt.Sprintf("%s:%d",
		*objectServerHostname, *objectServerPortNum)
	hashes := make([]hash.Hash, 0)
	for scanner.Scan() {
		hashval, err := objectcache.FilenameToHash(scanner.Text())
		if err != nil {
			return err
		}
		hashes = append(hashes, hashval)
	}
	if err := scanner.Err(); err != nil {
		return err
	}
	return srpcClient.RequestReply("Subd.Fetch", sub.FetchRequest{
		ServerAddress: serverAddress,
		Wait:          true,
		Hashes:        hashes},
		&sub.FetchResponse{})
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:26,代碼來源:fetch.go

示例3: configureSubs

func configureSubs(client *srpc.Client) error {
	var request dominator.ConfigureSubsRequest
	var reply dominator.ConfigureSubsResponse
	request.ScanSpeedPercent = *scanSpeedPercent
	request.NetworkSpeedPercent = *networkSpeedPercent
	request.ScanExclusionList = scanExcludeList
	return client.RequestReply("Dominator.ConfigureSubs", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:8,代碼來源:configureSubs.go

示例4: disableUpdates

func disableUpdates(client *srpc.Client, reason string) error {
	if reason == "" {
		return errors.New("cannot disable updates: no reason given")
	}
	var request dominator.DisableUpdatesRequest
	var reply dominator.DisableUpdatesResponse
	request.Reason = reason
	return client.RequestReply("Dominator.DisableUpdates", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:9,代碼來源:disableUpdates.go

示例5: checkImage

func checkImage(client *srpc.Client, name string) (bool, error) {
	request := imageserver.CheckImageRequest{name}
	var reply imageserver.CheckImageResponse
	err := client.RequestReply("ImageServer.CheckImage", request, &reply)
	if err != nil {
		return false, err
	}
	return reply.ImageExists, nil
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:9,代碼來源:checkImage.go

示例6: setDefaultImage

func setDefaultImage(client *srpc.Client, imageName string) error {
	var request dominator.SetDefaultImageRequest
	var reply dominator.SetDefaultImageResponse
	request.ImageName = imageName
	if err := client.RequestReply("Dominator.SetDefaultImage", request,
		&reply); err != nil {
		return err
	}
	return nil
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:10,代碼來源:setDefaultImage.go

示例7: getSubsConfiguration

func getSubsConfiguration(client *srpc.Client) error {
	var request dominator.GetSubsConfigurationRequest
	var reply dominator.GetSubsConfigurationResponse
	if err := client.RequestReply("Dominator.GetSubsConfiguration", request,
		&reply); err != nil {
		return err
	}
	fmt.Println(sub.Configuration(reply))
	return nil
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:10,代碼來源:getSubsConfiguration.go

示例8: getDefaultImage

func getDefaultImage(client *srpc.Client) error {
	var request dominator.GetDefaultImageRequest
	var reply dominator.GetDefaultImageResponse
	if err := client.RequestReply("Dominator.GetDefaultImage", request,
		&reply); err != nil {
		return err
	}
	if reply.ImageName != "" {
		fmt.Println(reply.ImageName)
	}
	return nil
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:12,代碼來源:getDefaultImage.go

示例9: setConfiguration

func setConfiguration(client *srpc.Client, config sub.Configuration) error {
	var request sub.SetConfigurationRequest
	request = sub.SetConfigurationRequest(config)
	var reply sub.SetConfigurationResponse
	return client.RequestReply("Subd.SetConfiguration", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:6,代碼來源:setConfiguration.go

示例10: fetch

func fetch(client *srpc.Client, serverAddress string,
	hashes []hash.Hash) error {
	request := sub.FetchRequest{ServerAddress: serverAddress, Hashes: hashes}
	var reply sub.FetchResponse
	return client.RequestReply("Subd.Fetch", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:6,代碼來源:fetch.go

示例11: addImage

func addImage(client *srpc.Client, name string, img *image.Image) error {
	request := imageserver.AddImageRequest{name, img}
	var reply imageserver.AddImageResponse
	return client.RequestReply("ImageServer.AddImage", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:5,代碼來源:addImage.go

示例12: callUpdate

func callUpdate(client *srpc.Client, request sub.UpdateRequest,
	reply *sub.UpdateResponse) error {
	return client.RequestReply("Subd.Update", request, reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:4,代碼來源:update.go

示例13: getConfiguration

func getConfiguration(client *srpc.Client) (sub.Configuration, error) {
	var request sub.GetConfigurationRequest
	var reply sub.GetConfigurationResponse
	err := client.RequestReply("Subd.GetConfiguration", request, &reply)
	return sub.Configuration(reply), err
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:6,代碼來源:getConfiguration.go

示例14: deleteImage

func deleteImage(client *srpc.Client, name string) error {
	request := imageserver.DeleteImageRequest{name}
	var reply imageserver.DeleteImageResponse
	return client.RequestReply("ImageServer.DeleteImage", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:5,代碼來源:deleteImage.go

示例15: chownDirectory

func chownDirectory(client *srpc.Client, dirname, ownerGroup string) error {
	request := imageserver.ChangeOwnerRequest{DirectoryName: dirname,
		OwnerGroup: ownerGroup}
	var reply imageserver.ChangeOwnerResponse
	return client.RequestReply("ImageServer.ChownDirectory", request, &reply)
}
開發者ID:keep94,項目名稱:Dominator,代碼行數:6,代碼來源:chownDirectory.go


注:本文中的github.com/Symantec/Dominator/lib/srpc.Client.RequestReply方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。