github.com/Cloud-Foundations/Dominator@v0.3.4/sub/client/fetch.go (about)

     1  package client
     2  
     3  import (
     4  	"github.com/Cloud-Foundations/Dominator/lib/hash"
     5  	"github.com/Cloud-Foundations/Dominator/lib/srpc"
     6  	"github.com/Cloud-Foundations/Dominator/proto/sub"
     7  )
     8  
     9  func callFetch(client *srpc.Client, request sub.FetchRequest,
    10  	reply *sub.FetchResponse) error {
    11  	return client.RequestReply("Subd.Fetch", request, reply)
    12  }
    13  
    14  func fetch(client *srpc.Client, serverAddress string,
    15  	hashes []hash.Hash) error {
    16  	request := sub.FetchRequest{ServerAddress: serverAddress, Hashes: hashes}
    17  	var reply sub.FetchResponse
    18  	return callFetch(client, request, &reply)
    19  }