github.com/Cloud-Foundations/Dominator@v0.3.4/proto/imageserver/messages.go (about) 1 package imageserver 2 3 import ( 4 "time" 5 6 "github.com/Cloud-Foundations/Dominator/lib/hash" 7 "github.com/Cloud-Foundations/Dominator/lib/image" 8 "github.com/Cloud-Foundations/Dominator/lib/tags" 9 ) 10 11 type AddImageRequest struct { 12 ImageName string 13 Image *image.Image 14 } 15 16 type AddImageResponse struct{} 17 18 type ChangeImageExpirationRequest struct { 19 ExpiresAt time.Time 20 ImageName string 21 } 22 23 type ChangeImageExpirationResponse struct { 24 Error string 25 } 26 27 type ChangeOwnerRequest struct { 28 DirectoryName string 29 OwnerGroup string 30 } 31 32 type ChangeOwnerResponse struct{} 33 34 type CheckDirectoryRequest struct { 35 DirectoryName string 36 } 37 38 type CheckDirectoryResponse struct { 39 DirectoryExists bool 40 } 41 42 type CheckImageRequest struct { 43 ImageName string 44 } 45 46 type CheckImageResponse struct { 47 ImageExists bool 48 } 49 50 type DeleteImageRequest struct { 51 ImageName string 52 } 53 54 type DeleteImageResponse struct{} 55 56 type DeleteUnreferencedObjectsRequest struct { 57 Percentage uint8 58 Bytes uint64 59 } 60 61 type DeleteUnreferencedObjectsResponse struct{} 62 63 type FindLatestImageRequest struct { 64 BuildCommitId string // Optional. 65 DirectoryName string 66 IgnoreExpiringImages bool 67 TagsToMatch tags.MatchTags // Empty: match all tags. 68 } 69 70 type FindLatestImageResponse struct { 71 ImageName string 72 Error string 73 } 74 75 type GetImageExpirationRequest struct { 76 ImageName string 77 } 78 79 type GetImageExpirationResponse struct { 80 Error string 81 ExpiresAt time.Time 82 } 83 84 type GetImageRequest struct { 85 ImageName string 86 IgnoreFilesystem bool 87 IgnoreFilesystemIfExpiring bool 88 Timeout time.Duration 89 } 90 91 type GetImageResponse struct { 92 Image *image.Image 93 } 94 95 const ( 96 OperationAddImage = iota 97 OperationDeleteImage 98 OperationMakeDirectory 99 ) 100 101 // The GetImageUpdates() RPC is fully streamed. 102 // The client sends no information to the server. 103 // The server sends a stream of ImageUpdate messages. 104 105 type ImageUpdate struct { 106 Name string // "" signifies initial list is sent, changes to follow. 107 Directory *image.Directory 108 Operation uint 109 } 110 111 type GetReplicationMasterRequest struct{} 112 113 type GetReplicationMasterResponse struct { 114 Error string 115 ReplicationMaster string 116 } 117 118 // The ListDirectories() RPC is fully streamed. 119 // The client sends no information to the server. 120 // The server sends a stream of image.Directory values with an empty string 121 // for the Name field signifying the end of the list. 122 123 // The ListImages() RPC is fully streamed. 124 // The client sends no information to the server. 125 // The server sends a stream of strings (image names) with an empty string 126 // signifying the end of the list. 127 128 type ListSelectedImagesRequest struct { 129 IgnoreExpiringImages bool 130 TagsToMatch tags.MatchTags // Empty: match all tags. 131 } 132 133 // The server sends a stream of strings (image names) with an empty string 134 // signifying the end of the list. 135 136 // The ListUnreferencedObjects() RPC is fully streamed. 137 // The client sends no information to the server. 138 // The server sends a stream of Object values with a zero Size field signifying 139 // the end of the stream. 140 141 type Object struct { 142 Hash hash.Hash 143 Size uint64 144 } 145 146 type MakeDirectoryRequest struct { 147 DirectoryName string 148 } 149 150 type MakeDirectoryResponse struct{}