github.com/mailgun/holster/v4@v4.20.0/election/structs.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: structs.proto 3 4 /* 5 Package election is a generated protocol buffer package. 6 7 It is generated from these files: 8 9 structs.proto 10 11 It has these top-level messages: 12 13 ResetElectionReq 14 ResetElectionResp 15 ResignReq 16 ResignResp 17 HeartBeatReq 18 HeartBeatResp 19 VoteResp 20 VoteReq 21 SetPeersReq 22 SetPeersResp 23 GetStateReq 24 GetStateResp 25 */ 26 package election 27 28 import ( 29 fmt "fmt" 30 31 proto "github.com/golang/protobuf/proto" 32 33 math "math" 34 ) 35 36 // Reference imports to suppress errors if they are not otherwise used. 37 var _ = proto.Marshal 38 var _ = fmt.Errorf 39 var _ = math.Inf 40 41 // This is a compile-time assertion to ensure that this generated file 42 // is compatible with the proto package it is being compiled against. 43 // A compilation error at this line likely means your copy of the 44 // proto package needs to be updated. 45 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 46 47 // Resets the current state of a node to 'candidate' 48 type ResetElectionReq struct { 49 } 50 51 func (m *ResetElectionReq) Reset() { *m = ResetElectionReq{} } 52 func (m *ResetElectionReq) String() string { return proto.CompactTextString(m) } 53 func (*ResetElectionReq) ProtoMessage() {} 54 func (*ResetElectionReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 55 56 type ResetElectionResp struct { 57 } 58 59 func (m *ResetElectionResp) Reset() { *m = ResetElectionResp{} } 60 func (m *ResetElectionResp) String() string { return proto.CompactTextString(m) } 61 func (*ResetElectionResp) ProtoMessage() {} 62 func (*ResetElectionResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 63 64 // Asks the node to resign as leader 65 type ResignReq struct { 66 } 67 68 func (m *ResignReq) Reset() { *m = ResignReq{} } 69 func (m *ResignReq) String() string { return proto.CompactTextString(m) } 70 func (*ResignReq) ProtoMessage() {} 71 func (*ResignReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 72 73 type ResignResp struct { 74 // True if the receiver is leader and stepped down 75 Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` 76 } 77 78 func (m *ResignResp) Reset() { *m = ResignResp{} } 79 func (m *ResignResp) String() string { return proto.CompactTextString(m) } 80 func (*ResignResp) ProtoMessage() {} 81 func (*ResignResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 82 83 func (m *ResignResp) GetSuccess() bool { 84 if m != nil { 85 return m.Success 86 } 87 return false 88 } 89 90 // Sent by the leader of the election to all followers 91 type HeartBeatReq struct { 92 // The leader this heart beat is from 93 From string `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` 94 // The current term of the leader 95 Term uint64 `protobuf:"varint,2,opt,name=term" json:"term,omitempty"` 96 } 97 98 func (m *HeartBeatReq) Reset() { *m = HeartBeatReq{} } 99 func (m *HeartBeatReq) String() string { return proto.CompactTextString(m) } 100 func (*HeartBeatReq) ProtoMessage() {} 101 func (*HeartBeatReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 102 103 func (m *HeartBeatReq) GetFrom() string { 104 if m != nil { 105 return m.From 106 } 107 return "" 108 } 109 110 func (m *HeartBeatReq) GetTerm() uint64 { 111 if m != nil { 112 return m.Term 113 } 114 return 0 115 } 116 117 // Response to a heart beat request 118 type HeartBeatResp struct { 119 // The follower who is responding 120 From string `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` 121 // The term the heart beat is for 122 Term uint64 `protobuf:"varint,2,opt,name=term" json:"term,omitempty"` 123 } 124 125 func (m *HeartBeatResp) Reset() { *m = HeartBeatResp{} } 126 func (m *HeartBeatResp) String() string { return proto.CompactTextString(m) } 127 func (*HeartBeatResp) ProtoMessage() {} 128 func (*HeartBeatResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } 129 130 func (m *HeartBeatResp) GetFrom() string { 131 if m != nil { 132 return m.From 133 } 134 return "" 135 } 136 137 func (m *HeartBeatResp) GetTerm() uint64 { 138 if m != nil { 139 return m.Term 140 } 141 return 0 142 } 143 144 type VoteResp struct { 145 // The candidate who responded 146 Candidate string `protobuf:"bytes,1,opt,name=candidate" json:"candidate,omitempty"` 147 // The term this vote response is for 148 Term uint64 `protobuf:"varint,2,opt,name=term" json:"term,omitempty"` 149 // If the Vote was granted by this node 150 Granted bool `protobuf:"varint,3,opt,name=granted" json:"granted,omitempty"` 151 } 152 153 func (m *VoteResp) Reset() { *m = VoteResp{} } 154 func (m *VoteResp) String() string { return proto.CompactTextString(m) } 155 func (*VoteResp) ProtoMessage() {} 156 func (*VoteResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } 157 158 func (m *VoteResp) GetCandidate() string { 159 if m != nil { 160 return m.Candidate 161 } 162 return "" 163 } 164 165 func (m *VoteResp) GetTerm() uint64 { 166 if m != nil { 167 return m.Term 168 } 169 return 0 170 } 171 172 func (m *VoteResp) GetGranted() bool { 173 if m != nil { 174 return m.Granted 175 } 176 return false 177 } 178 179 // A vote request sent to all peers at 180 // the start of an election. 181 type VoteReq struct { 182 // The candidate who is requesting the targets vote 183 Candidate string `protobuf:"bytes,1,opt,name=candidate" json:"candidate,omitempty"` 184 // The term this vote is for. 185 Term uint64 `protobuf:"varint,2,opt,name=term" json:"term,omitempty"` 186 } 187 188 func (m *VoteReq) Reset() { *m = VoteReq{} } 189 func (m *VoteReq) String() string { return proto.CompactTextString(m) } 190 func (*VoteReq) ProtoMessage() {} 191 func (*VoteReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } 192 193 func (m *VoteReq) GetCandidate() string { 194 if m != nil { 195 return m.Candidate 196 } 197 return "" 198 } 199 200 func (m *VoteReq) GetTerm() uint64 { 201 if m != nil { 202 return m.Term 203 } 204 return 0 205 } 206 207 // Set the peers this node will consider during the election 208 type SetPeersReq struct { 209 // A list of peers 210 Peers []string `protobuf:"bytes,1,rep,name=peers" json:"peers,omitempty"` 211 } 212 213 func (m *SetPeersReq) Reset() { *m = SetPeersReq{} } 214 func (m *SetPeersReq) String() string { return proto.CompactTextString(m) } 215 func (*SetPeersReq) ProtoMessage() {} 216 func (*SetPeersReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } 217 218 func (m *SetPeersReq) GetPeers() []string { 219 if m != nil { 220 return m.Peers 221 } 222 return nil 223 } 224 225 type SetPeersResp struct { 226 } 227 228 func (m *SetPeersResp) Reset() { *m = SetPeersResp{} } 229 func (m *SetPeersResp) String() string { return proto.CompactTextString(m) } 230 func (*SetPeersResp) ProtoMessage() {} 231 func (*SetPeersResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } 232 233 // Get the current state of the node 234 type GetStateReq struct { 235 } 236 237 func (m *GetStateReq) Reset() { *m = GetStateReq{} } 238 func (m *GetStateReq) String() string { return proto.CompactTextString(m) } 239 func (*GetStateReq) ProtoMessage() {} 240 func (*GetStateReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } 241 242 type GetStateResp struct { 243 Leader string `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"` 244 State string `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` 245 Peers []string `protobuf:"bytes,3,rep,name=peers" json:"peers,omitempty"` 246 } 247 248 func (m *GetStateResp) Reset() { *m = GetStateResp{} } 249 func (m *GetStateResp) String() string { return proto.CompactTextString(m) } 250 func (*GetStateResp) ProtoMessage() {} 251 func (*GetStateResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } 252 253 func (m *GetStateResp) GetLeader() string { 254 if m != nil { 255 return m.Leader 256 } 257 return "" 258 } 259 260 func (m *GetStateResp) GetState() string { 261 if m != nil { 262 return m.State 263 } 264 return "" 265 } 266 267 func (m *GetStateResp) GetPeers() []string { 268 if m != nil { 269 return m.Peers 270 } 271 return nil 272 } 273 274 func init() { 275 proto.RegisterType((*ResetElectionReq)(nil), "ResetElectionReq") 276 proto.RegisterType((*ResetElectionResp)(nil), "ResetElectionResp") 277 proto.RegisterType((*ResignReq)(nil), "ResignReq") 278 proto.RegisterType((*ResignResp)(nil), "ResignResp") 279 proto.RegisterType((*HeartBeatReq)(nil), "HeartBeatReq") 280 proto.RegisterType((*HeartBeatResp)(nil), "HeartBeatResp") 281 proto.RegisterType((*VoteResp)(nil), "VoteResp") 282 proto.RegisterType((*VoteReq)(nil), "VoteReq") 283 proto.RegisterType((*SetPeersReq)(nil), "SetPeersReq") 284 proto.RegisterType((*SetPeersResp)(nil), "SetPeersResp") 285 proto.RegisterType((*GetStateReq)(nil), "GetStateReq") 286 proto.RegisterType((*GetStateResp)(nil), "GetStateResp") 287 } 288 289 func init() { proto.RegisterFile("structs.proto", fileDescriptor0) } 290 291 var fileDescriptor0 = []byte{ 292 // 287 bytes of a gzipped FileDescriptorProto 293 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x4b, 0xc3, 0x40, 294 0x10, 0x85, 0x89, 0xa9, 0x6d, 0x32, 0x49, 0x44, 0xa3, 0x48, 0x0e, 0x1e, 0xc2, 0x0a, 0x92, 0x93, 295 0x17, 0x41, 0x0f, 0xde, 0x0a, 0xa2, 0x47, 0xd9, 0x42, 0x0f, 0xde, 0xd6, 0x64, 0x2c, 0x81, 0x36, 296 0xd9, 0xec, 0x4c, 0xff, 0xbf, 0xec, 0x66, 0x4b, 0x8a, 0x78, 0xd0, 0xdb, 0x7c, 0xc3, 0x7b, 0x6f, 297 0x66, 0xd8, 0x85, 0x8c, 0xd8, 0xec, 0x6b, 0xa6, 0x7b, 0x6d, 0x7a, 0xee, 0x45, 0x0e, 0xe7, 0x12, 298 0x09, 0xf9, 0x65, 0x8b, 0x35, 0xb7, 0x7d, 0x27, 0x71, 0x10, 0x97, 0x70, 0xf1, 0xa3, 0x47, 0x5a, 299 0x24, 0x10, 0x4b, 0xa4, 0x76, 0xe3, 0x14, 0x77, 0x00, 0x07, 0x20, 0x9d, 0x17, 0xb0, 0xa0, 0x7d, 300 0x5d, 0x23, 0x51, 0x11, 0x94, 0x41, 0x15, 0xc9, 0x03, 0x8a, 0x47, 0x48, 0xdf, 0x50, 0x19, 0x5e, 301 0xa2, 0x62, 0x89, 0x43, 0x9e, 0xc3, 0xec, 0xcb, 0xf4, 0x3b, 0x27, 0x8b, 0xa5, 0xab, 0x6d, 0x8f, 302 0xd1, 0xec, 0x8a, 0x93, 0x32, 0xa8, 0x66, 0xd2, 0xd5, 0xe2, 0x09, 0xb2, 0x23, 0x1f, 0xe9, 0x3f, 303 0x1b, 0xd7, 0x10, 0xad, 0x7b, 0x46, 0xe7, 0xb9, 0x81, 0xb8, 0x56, 0x5d, 0xd3, 0x36, 0x8a, 0xd1, 304 0x1b, 0xa7, 0xc6, 0x6f, 0x6e, 0x7b, 0xc8, 0xc6, 0xa8, 0x8e, 0xb1, 0x29, 0xc2, 0xf1, 0x10, 0x8f, 305 0xe2, 0x19, 0x16, 0x63, 0xee, 0xf0, 0xff, 0x58, 0x71, 0x0b, 0xc9, 0x0a, 0xf9, 0x1d, 0xd1, 0x90, 306 0x0d, 0xb8, 0x82, 0x53, 0x6d, 0xeb, 0x22, 0x28, 0xc3, 0x2a, 0x96, 0x23, 0x88, 0x33, 0x48, 0x27, 307 0x11, 0x69, 0x91, 0x41, 0xf2, 0x8a, 0xbc, 0x62, 0xe5, 0xa6, 0x0a, 0x09, 0xe9, 0x84, 0xa4, 0xf3, 308 0x6b, 0x98, 0x6f, 0x51, 0x35, 0x68, 0xfc, 0x0a, 0x9e, 0x6c, 0x38, 0x59, 0x91, 0x5b, 0x20, 0x96, 309 0x23, 0x4c, 0x23, 0xc3, 0xa3, 0x91, 0x4b, 0xf8, 0x88, 0xd0, 0x3f, 0xf1, 0xe7, 0xdc, 0x7d, 0x87, 310 0x87, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xdf, 0xef, 0x28, 0x1f, 0x02, 0x00, 0x00, 311 }