github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/proto/filegenerator/messages.go (about)

     1  package filegenerator
     2  
     3  import (
     4  	"github.com/Cloud-Foundations/Dominator/lib/hash"
     5  	"github.com/Cloud-Foundations/Dominator/lib/mdb"
     6  )
     7  
     8  type GetObjectRequest struct {
     9  	Hash hash.Hash
    10  }
    11  
    12  type YieldRequest struct {
    13  	Machine   mdb.Machine
    14  	Pathnames []string
    15  }
    16  
    17  type ClientRequest struct {
    18  	GetObjectRequest *GetObjectRequest
    19  	YieldRequest     *YieldRequest
    20  }
    21  
    22  type GetObjectResponse struct {
    23  	Hash hash.Hash
    24  	Data []byte
    25  }
    26  
    27  type FileInfo struct {
    28  	Pathname string
    29  	Hash     hash.Hash
    30  	Length   uint64
    31  }
    32  
    33  type YieldResponse struct {
    34  	Hostname string
    35  	Files    []FileInfo
    36  }
    37  
    38  // ServerMessage types are sent in response to requests from the client and also
    39  // due to internal state changes in the server.
    40  type ServerMessage struct {
    41  	GetObjectResponse *GetObjectResponse
    42  	YieldResponse     *YieldResponse
    43  }