raft.pb.go 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638
  1. // Code generated by protoc-gen-gogo.
  2. // source: raft.proto
  3. // DO NOT EDIT!
  4. package api
  5. import proto "github.com/gogo/protobuf/proto"
  6. import fmt "fmt"
  7. import math "math"
  8. import raftpb "github.com/coreos/etcd/raft/raftpb"
  9. // skipping weak import gogoproto "github.com/gogo/protobuf/gogoproto"
  10. // skipping weak import docker_protobuf_plugin "github.com/docker/swarmkit/protobuf/plugin"
  11. import github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
  12. import (
  13. context "golang.org/x/net/context"
  14. grpc "google.golang.org/grpc"
  15. )
  16. import raftselector "github.com/docker/swarmkit/manager/raftselector"
  17. import codes "google.golang.org/grpc/codes"
  18. import metadata "google.golang.org/grpc/metadata"
  19. import transport "google.golang.org/grpc/transport"
  20. import rafttime "time"
  21. import strings "strings"
  22. import reflect "reflect"
  23. import io "io"
  24. // Reference imports to suppress errors if they are not otherwise used.
  25. var _ = proto.Marshal
  26. var _ = fmt.Errorf
  27. var _ = math.Inf
  28. // StoreActionKind defines the operation to take on the store for the target of
  29. // a storage action.
  30. type StoreActionKind int32
  31. const (
  32. StoreActionKindUnknown StoreActionKind = 0
  33. StoreActionKindCreate StoreActionKind = 1
  34. StoreActionKindUpdate StoreActionKind = 2
  35. StoreActionKindRemove StoreActionKind = 3
  36. )
  37. var StoreActionKind_name = map[int32]string{
  38. 0: "UNKNOWN",
  39. 1: "STORE_ACTION_CREATE",
  40. 2: "STORE_ACTION_UPDATE",
  41. 3: "STORE_ACTION_REMOVE",
  42. }
  43. var StoreActionKind_value = map[string]int32{
  44. "UNKNOWN": 0,
  45. "STORE_ACTION_CREATE": 1,
  46. "STORE_ACTION_UPDATE": 2,
  47. "STORE_ACTION_REMOVE": 3,
  48. }
  49. func (x StoreActionKind) String() string {
  50. return proto.EnumName(StoreActionKind_name, int32(x))
  51. }
  52. func (StoreActionKind) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  53. type RaftMember struct {
  54. // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified
  55. // and is used only for information purposes
  56. RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"`
  57. // NodeID is the node's ID.
  58. NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
  59. // Addr specifies the address of the member
  60. Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"`
  61. // Status provides the current status of the manager from the perspective of another manager.
  62. Status RaftMemberStatus `protobuf:"bytes,4,opt,name=status" json:"status"`
  63. }
  64. func (m *RaftMember) Reset() { *m = RaftMember{} }
  65. func (*RaftMember) ProtoMessage() {}
  66. func (*RaftMember) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  67. type JoinRequest struct {
  68. // Addr specifies the address of the member
  69. Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
  70. }
  71. func (m *JoinRequest) Reset() { *m = JoinRequest{} }
  72. func (*JoinRequest) ProtoMessage() {}
  73. func (*JoinRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} }
  74. type JoinResponse struct {
  75. // RaftID is the ID assigned to the new member.
  76. RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"`
  77. // Members is the membership set of the cluster.
  78. Members []*RaftMember `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"`
  79. // RemovedMembers is a list of members that have been removed from
  80. // the cluster, so the new node can avoid communicating with them.
  81. RemovedMembers []uint64 `protobuf:"varint,3,rep,name=removed_members,json=removedMembers" json:"removed_members,omitempty"`
  82. }
  83. func (m *JoinResponse) Reset() { *m = JoinResponse{} }
  84. func (*JoinResponse) ProtoMessage() {}
  85. func (*JoinResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
  86. type LeaveRequest struct {
  87. Node *RaftMember `protobuf:"bytes,1,opt,name=node" json:"node,omitempty"`
  88. }
  89. func (m *LeaveRequest) Reset() { *m = LeaveRequest{} }
  90. func (*LeaveRequest) ProtoMessage() {}
  91. func (*LeaveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} }
  92. type LeaveResponse struct {
  93. }
  94. func (m *LeaveResponse) Reset() { *m = LeaveResponse{} }
  95. func (*LeaveResponse) ProtoMessage() {}
  96. func (*LeaveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{4} }
  97. type ProcessRaftMessageRequest struct {
  98. Message *raftpb.Message `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
  99. }
  100. func (m *ProcessRaftMessageRequest) Reset() { *m = ProcessRaftMessageRequest{} }
  101. func (*ProcessRaftMessageRequest) ProtoMessage() {}
  102. func (*ProcessRaftMessageRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} }
  103. type ProcessRaftMessageResponse struct {
  104. }
  105. func (m *ProcessRaftMessageResponse) Reset() { *m = ProcessRaftMessageResponse{} }
  106. func (*ProcessRaftMessageResponse) ProtoMessage() {}
  107. func (*ProcessRaftMessageResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{6} }
  108. type ResolveAddressRequest struct {
  109. // raft_id is the ID to resolve to an address.
  110. RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"`
  111. }
  112. func (m *ResolveAddressRequest) Reset() { *m = ResolveAddressRequest{} }
  113. func (*ResolveAddressRequest) ProtoMessage() {}
  114. func (*ResolveAddressRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{7} }
  115. type ResolveAddressResponse struct {
  116. // Addr specifies the address of the member
  117. Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
  118. }
  119. func (m *ResolveAddressResponse) Reset() { *m = ResolveAddressResponse{} }
  120. func (*ResolveAddressResponse) ProtoMessage() {}
  121. func (*ResolveAddressResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{8} }
  122. // Contains one of many protobuf encoded objects to replicate
  123. // over the raft backend with a request ID to track when the
  124. // action is effectively applied
  125. type InternalRaftRequest struct {
  126. ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  127. Action []StoreAction `protobuf:"bytes,2,rep,name=action" json:"action"`
  128. }
  129. func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} }
  130. func (*InternalRaftRequest) ProtoMessage() {}
  131. func (*InternalRaftRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{9} }
  132. // StoreAction defines a target and operation to apply on the storage system.
  133. type StoreAction struct {
  134. Action StoreActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.StoreActionKind" json:"action,omitempty"`
  135. // Types that are valid to be assigned to Target:
  136. // *StoreAction_Node
  137. // *StoreAction_Service
  138. // *StoreAction_Task
  139. // *StoreAction_Network
  140. // *StoreAction_Cluster
  141. // *StoreAction_Secret
  142. // *StoreAction_Resource
  143. // *StoreAction_Extension
  144. // *StoreAction_Config
  145. Target isStoreAction_Target `protobuf_oneof:"target"`
  146. }
  147. func (m *StoreAction) Reset() { *m = StoreAction{} }
  148. func (*StoreAction) ProtoMessage() {}
  149. func (*StoreAction) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{10} }
  150. type isStoreAction_Target interface {
  151. isStoreAction_Target()
  152. MarshalTo([]byte) (int, error)
  153. Size() int
  154. }
  155. type StoreAction_Node struct {
  156. Node *Node `protobuf:"bytes,2,opt,name=node,oneof"`
  157. }
  158. type StoreAction_Service struct {
  159. Service *Service `protobuf:"bytes,3,opt,name=service,oneof"`
  160. }
  161. type StoreAction_Task struct {
  162. Task *Task `protobuf:"bytes,4,opt,name=task,oneof"`
  163. }
  164. type StoreAction_Network struct {
  165. Network *Network `protobuf:"bytes,5,opt,name=network,oneof"`
  166. }
  167. type StoreAction_Cluster struct {
  168. Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,oneof"`
  169. }
  170. type StoreAction_Secret struct {
  171. Secret *Secret `protobuf:"bytes,7,opt,name=secret,oneof"`
  172. }
  173. type StoreAction_Resource struct {
  174. Resource *Resource `protobuf:"bytes,8,opt,name=resource,oneof"`
  175. }
  176. type StoreAction_Extension struct {
  177. Extension *Extension `protobuf:"bytes,9,opt,name=extension,oneof"`
  178. }
  179. type StoreAction_Config struct {
  180. Config *Config `protobuf:"bytes,10,opt,name=config,oneof"`
  181. }
  182. func (*StoreAction_Node) isStoreAction_Target() {}
  183. func (*StoreAction_Service) isStoreAction_Target() {}
  184. func (*StoreAction_Task) isStoreAction_Target() {}
  185. func (*StoreAction_Network) isStoreAction_Target() {}
  186. func (*StoreAction_Cluster) isStoreAction_Target() {}
  187. func (*StoreAction_Secret) isStoreAction_Target() {}
  188. func (*StoreAction_Resource) isStoreAction_Target() {}
  189. func (*StoreAction_Extension) isStoreAction_Target() {}
  190. func (*StoreAction_Config) isStoreAction_Target() {}
  191. func (m *StoreAction) GetTarget() isStoreAction_Target {
  192. if m != nil {
  193. return m.Target
  194. }
  195. return nil
  196. }
  197. func (m *StoreAction) GetNode() *Node {
  198. if x, ok := m.GetTarget().(*StoreAction_Node); ok {
  199. return x.Node
  200. }
  201. return nil
  202. }
  203. func (m *StoreAction) GetService() *Service {
  204. if x, ok := m.GetTarget().(*StoreAction_Service); ok {
  205. return x.Service
  206. }
  207. return nil
  208. }
  209. func (m *StoreAction) GetTask() *Task {
  210. if x, ok := m.GetTarget().(*StoreAction_Task); ok {
  211. return x.Task
  212. }
  213. return nil
  214. }
  215. func (m *StoreAction) GetNetwork() *Network {
  216. if x, ok := m.GetTarget().(*StoreAction_Network); ok {
  217. return x.Network
  218. }
  219. return nil
  220. }
  221. func (m *StoreAction) GetCluster() *Cluster {
  222. if x, ok := m.GetTarget().(*StoreAction_Cluster); ok {
  223. return x.Cluster
  224. }
  225. return nil
  226. }
  227. func (m *StoreAction) GetSecret() *Secret {
  228. if x, ok := m.GetTarget().(*StoreAction_Secret); ok {
  229. return x.Secret
  230. }
  231. return nil
  232. }
  233. func (m *StoreAction) GetResource() *Resource {
  234. if x, ok := m.GetTarget().(*StoreAction_Resource); ok {
  235. return x.Resource
  236. }
  237. return nil
  238. }
  239. func (m *StoreAction) GetExtension() *Extension {
  240. if x, ok := m.GetTarget().(*StoreAction_Extension); ok {
  241. return x.Extension
  242. }
  243. return nil
  244. }
  245. func (m *StoreAction) GetConfig() *Config {
  246. if x, ok := m.GetTarget().(*StoreAction_Config); ok {
  247. return x.Config
  248. }
  249. return nil
  250. }
  251. // XXX_OneofFuncs is for the internal use of the proto package.
  252. func (*StoreAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  253. return _StoreAction_OneofMarshaler, _StoreAction_OneofUnmarshaler, _StoreAction_OneofSizer, []interface{}{
  254. (*StoreAction_Node)(nil),
  255. (*StoreAction_Service)(nil),
  256. (*StoreAction_Task)(nil),
  257. (*StoreAction_Network)(nil),
  258. (*StoreAction_Cluster)(nil),
  259. (*StoreAction_Secret)(nil),
  260. (*StoreAction_Resource)(nil),
  261. (*StoreAction_Extension)(nil),
  262. (*StoreAction_Config)(nil),
  263. }
  264. }
  265. func _StoreAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  266. m := msg.(*StoreAction)
  267. // target
  268. switch x := m.Target.(type) {
  269. case *StoreAction_Node:
  270. _ = b.EncodeVarint(2<<3 | proto.WireBytes)
  271. if err := b.EncodeMessage(x.Node); err != nil {
  272. return err
  273. }
  274. case *StoreAction_Service:
  275. _ = b.EncodeVarint(3<<3 | proto.WireBytes)
  276. if err := b.EncodeMessage(x.Service); err != nil {
  277. return err
  278. }
  279. case *StoreAction_Task:
  280. _ = b.EncodeVarint(4<<3 | proto.WireBytes)
  281. if err := b.EncodeMessage(x.Task); err != nil {
  282. return err
  283. }
  284. case *StoreAction_Network:
  285. _ = b.EncodeVarint(5<<3 | proto.WireBytes)
  286. if err := b.EncodeMessage(x.Network); err != nil {
  287. return err
  288. }
  289. case *StoreAction_Cluster:
  290. _ = b.EncodeVarint(6<<3 | proto.WireBytes)
  291. if err := b.EncodeMessage(x.Cluster); err != nil {
  292. return err
  293. }
  294. case *StoreAction_Secret:
  295. _ = b.EncodeVarint(7<<3 | proto.WireBytes)
  296. if err := b.EncodeMessage(x.Secret); err != nil {
  297. return err
  298. }
  299. case *StoreAction_Resource:
  300. _ = b.EncodeVarint(8<<3 | proto.WireBytes)
  301. if err := b.EncodeMessage(x.Resource); err != nil {
  302. return err
  303. }
  304. case *StoreAction_Extension:
  305. _ = b.EncodeVarint(9<<3 | proto.WireBytes)
  306. if err := b.EncodeMessage(x.Extension); err != nil {
  307. return err
  308. }
  309. case *StoreAction_Config:
  310. _ = b.EncodeVarint(10<<3 | proto.WireBytes)
  311. if err := b.EncodeMessage(x.Config); err != nil {
  312. return err
  313. }
  314. case nil:
  315. default:
  316. return fmt.Errorf("StoreAction.Target has unexpected type %T", x)
  317. }
  318. return nil
  319. }
  320. func _StoreAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  321. m := msg.(*StoreAction)
  322. switch tag {
  323. case 2: // target.node
  324. if wire != proto.WireBytes {
  325. return true, proto.ErrInternalBadWireType
  326. }
  327. msg := new(Node)
  328. err := b.DecodeMessage(msg)
  329. m.Target = &StoreAction_Node{msg}
  330. return true, err
  331. case 3: // target.service
  332. if wire != proto.WireBytes {
  333. return true, proto.ErrInternalBadWireType
  334. }
  335. msg := new(Service)
  336. err := b.DecodeMessage(msg)
  337. m.Target = &StoreAction_Service{msg}
  338. return true, err
  339. case 4: // target.task
  340. if wire != proto.WireBytes {
  341. return true, proto.ErrInternalBadWireType
  342. }
  343. msg := new(Task)
  344. err := b.DecodeMessage(msg)
  345. m.Target = &StoreAction_Task{msg}
  346. return true, err
  347. case 5: // target.network
  348. if wire != proto.WireBytes {
  349. return true, proto.ErrInternalBadWireType
  350. }
  351. msg := new(Network)
  352. err := b.DecodeMessage(msg)
  353. m.Target = &StoreAction_Network{msg}
  354. return true, err
  355. case 6: // target.cluster
  356. if wire != proto.WireBytes {
  357. return true, proto.ErrInternalBadWireType
  358. }
  359. msg := new(Cluster)
  360. err := b.DecodeMessage(msg)
  361. m.Target = &StoreAction_Cluster{msg}
  362. return true, err
  363. case 7: // target.secret
  364. if wire != proto.WireBytes {
  365. return true, proto.ErrInternalBadWireType
  366. }
  367. msg := new(Secret)
  368. err := b.DecodeMessage(msg)
  369. m.Target = &StoreAction_Secret{msg}
  370. return true, err
  371. case 8: // target.resource
  372. if wire != proto.WireBytes {
  373. return true, proto.ErrInternalBadWireType
  374. }
  375. msg := new(Resource)
  376. err := b.DecodeMessage(msg)
  377. m.Target = &StoreAction_Resource{msg}
  378. return true, err
  379. case 9: // target.extension
  380. if wire != proto.WireBytes {
  381. return true, proto.ErrInternalBadWireType
  382. }
  383. msg := new(Extension)
  384. err := b.DecodeMessage(msg)
  385. m.Target = &StoreAction_Extension{msg}
  386. return true, err
  387. case 10: // target.config
  388. if wire != proto.WireBytes {
  389. return true, proto.ErrInternalBadWireType
  390. }
  391. msg := new(Config)
  392. err := b.DecodeMessage(msg)
  393. m.Target = &StoreAction_Config{msg}
  394. return true, err
  395. default:
  396. return false, nil
  397. }
  398. }
  399. func _StoreAction_OneofSizer(msg proto.Message) (n int) {
  400. m := msg.(*StoreAction)
  401. // target
  402. switch x := m.Target.(type) {
  403. case *StoreAction_Node:
  404. s := proto.Size(x.Node)
  405. n += proto.SizeVarint(2<<3 | proto.WireBytes)
  406. n += proto.SizeVarint(uint64(s))
  407. n += s
  408. case *StoreAction_Service:
  409. s := proto.Size(x.Service)
  410. n += proto.SizeVarint(3<<3 | proto.WireBytes)
  411. n += proto.SizeVarint(uint64(s))
  412. n += s
  413. case *StoreAction_Task:
  414. s := proto.Size(x.Task)
  415. n += proto.SizeVarint(4<<3 | proto.WireBytes)
  416. n += proto.SizeVarint(uint64(s))
  417. n += s
  418. case *StoreAction_Network:
  419. s := proto.Size(x.Network)
  420. n += proto.SizeVarint(5<<3 | proto.WireBytes)
  421. n += proto.SizeVarint(uint64(s))
  422. n += s
  423. case *StoreAction_Cluster:
  424. s := proto.Size(x.Cluster)
  425. n += proto.SizeVarint(6<<3 | proto.WireBytes)
  426. n += proto.SizeVarint(uint64(s))
  427. n += s
  428. case *StoreAction_Secret:
  429. s := proto.Size(x.Secret)
  430. n += proto.SizeVarint(7<<3 | proto.WireBytes)
  431. n += proto.SizeVarint(uint64(s))
  432. n += s
  433. case *StoreAction_Resource:
  434. s := proto.Size(x.Resource)
  435. n += proto.SizeVarint(8<<3 | proto.WireBytes)
  436. n += proto.SizeVarint(uint64(s))
  437. n += s
  438. case *StoreAction_Extension:
  439. s := proto.Size(x.Extension)
  440. n += proto.SizeVarint(9<<3 | proto.WireBytes)
  441. n += proto.SizeVarint(uint64(s))
  442. n += s
  443. case *StoreAction_Config:
  444. s := proto.Size(x.Config)
  445. n += proto.SizeVarint(10<<3 | proto.WireBytes)
  446. n += proto.SizeVarint(uint64(s))
  447. n += s
  448. case nil:
  449. default:
  450. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  451. }
  452. return n
  453. }
  454. func init() {
  455. proto.RegisterType((*RaftMember)(nil), "docker.swarmkit.v1.RaftMember")
  456. proto.RegisterType((*JoinRequest)(nil), "docker.swarmkit.v1.JoinRequest")
  457. proto.RegisterType((*JoinResponse)(nil), "docker.swarmkit.v1.JoinResponse")
  458. proto.RegisterType((*LeaveRequest)(nil), "docker.swarmkit.v1.LeaveRequest")
  459. proto.RegisterType((*LeaveResponse)(nil), "docker.swarmkit.v1.LeaveResponse")
  460. proto.RegisterType((*ProcessRaftMessageRequest)(nil), "docker.swarmkit.v1.ProcessRaftMessageRequest")
  461. proto.RegisterType((*ProcessRaftMessageResponse)(nil), "docker.swarmkit.v1.ProcessRaftMessageResponse")
  462. proto.RegisterType((*ResolveAddressRequest)(nil), "docker.swarmkit.v1.ResolveAddressRequest")
  463. proto.RegisterType((*ResolveAddressResponse)(nil), "docker.swarmkit.v1.ResolveAddressResponse")
  464. proto.RegisterType((*InternalRaftRequest)(nil), "docker.swarmkit.v1.InternalRaftRequest")
  465. proto.RegisterType((*StoreAction)(nil), "docker.swarmkit.v1.StoreAction")
  466. proto.RegisterEnum("docker.swarmkit.v1.StoreActionKind", StoreActionKind_name, StoreActionKind_value)
  467. }
  468. type authenticatedWrapperRaftServer struct {
  469. local RaftServer
  470. authorize func(context.Context, []string) error
  471. }
  472. func NewAuthenticatedWrapperRaftServer(local RaftServer, authorize func(context.Context, []string) error) RaftServer {
  473. return &authenticatedWrapperRaftServer{
  474. local: local,
  475. authorize: authorize,
  476. }
  477. }
  478. func (p *authenticatedWrapperRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) {
  479. if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil {
  480. return nil, err
  481. }
  482. return p.local.ProcessRaftMessage(ctx, r)
  483. }
  484. func (p *authenticatedWrapperRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) {
  485. if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil {
  486. return nil, err
  487. }
  488. return p.local.ResolveAddress(ctx, r)
  489. }
  490. type authenticatedWrapperRaftMembershipServer struct {
  491. local RaftMembershipServer
  492. authorize func(context.Context, []string) error
  493. }
  494. func NewAuthenticatedWrapperRaftMembershipServer(local RaftMembershipServer, authorize func(context.Context, []string) error) RaftMembershipServer {
  495. return &authenticatedWrapperRaftMembershipServer{
  496. local: local,
  497. authorize: authorize,
  498. }
  499. }
  500. func (p *authenticatedWrapperRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) {
  501. if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil {
  502. return nil, err
  503. }
  504. return p.local.Join(ctx, r)
  505. }
  506. func (p *authenticatedWrapperRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) {
  507. if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil {
  508. return nil, err
  509. }
  510. return p.local.Leave(ctx, r)
  511. }
  512. func (m *RaftMember) Copy() *RaftMember {
  513. if m == nil {
  514. return nil
  515. }
  516. o := &RaftMember{}
  517. o.CopyFrom(m)
  518. return o
  519. }
  520. func (m *RaftMember) CopyFrom(src interface{}) {
  521. o := src.(*RaftMember)
  522. *m = *o
  523. github_com_docker_swarmkit_api_deepcopy.Copy(&m.Status, &o.Status)
  524. }
  525. func (m *JoinRequest) Copy() *JoinRequest {
  526. if m == nil {
  527. return nil
  528. }
  529. o := &JoinRequest{}
  530. o.CopyFrom(m)
  531. return o
  532. }
  533. func (m *JoinRequest) CopyFrom(src interface{}) {
  534. o := src.(*JoinRequest)
  535. *m = *o
  536. }
  537. func (m *JoinResponse) Copy() *JoinResponse {
  538. if m == nil {
  539. return nil
  540. }
  541. o := &JoinResponse{}
  542. o.CopyFrom(m)
  543. return o
  544. }
  545. func (m *JoinResponse) CopyFrom(src interface{}) {
  546. o := src.(*JoinResponse)
  547. *m = *o
  548. if o.Members != nil {
  549. m.Members = make([]*RaftMember, len(o.Members))
  550. for i := range m.Members {
  551. m.Members[i] = &RaftMember{}
  552. github_com_docker_swarmkit_api_deepcopy.Copy(m.Members[i], o.Members[i])
  553. }
  554. }
  555. if o.RemovedMembers != nil {
  556. m.RemovedMembers = make([]uint64, len(o.RemovedMembers))
  557. copy(m.RemovedMembers, o.RemovedMembers)
  558. }
  559. }
  560. func (m *LeaveRequest) Copy() *LeaveRequest {
  561. if m == nil {
  562. return nil
  563. }
  564. o := &LeaveRequest{}
  565. o.CopyFrom(m)
  566. return o
  567. }
  568. func (m *LeaveRequest) CopyFrom(src interface{}) {
  569. o := src.(*LeaveRequest)
  570. *m = *o
  571. if o.Node != nil {
  572. m.Node = &RaftMember{}
  573. github_com_docker_swarmkit_api_deepcopy.Copy(m.Node, o.Node)
  574. }
  575. }
  576. func (m *LeaveResponse) Copy() *LeaveResponse {
  577. if m == nil {
  578. return nil
  579. }
  580. o := &LeaveResponse{}
  581. o.CopyFrom(m)
  582. return o
  583. }
  584. func (m *LeaveResponse) CopyFrom(src interface{}) {}
  585. func (m *ProcessRaftMessageResponse) Copy() *ProcessRaftMessageResponse {
  586. if m == nil {
  587. return nil
  588. }
  589. o := &ProcessRaftMessageResponse{}
  590. o.CopyFrom(m)
  591. return o
  592. }
  593. func (m *ProcessRaftMessageResponse) CopyFrom(src interface{}) {}
  594. func (m *ResolveAddressRequest) Copy() *ResolveAddressRequest {
  595. if m == nil {
  596. return nil
  597. }
  598. o := &ResolveAddressRequest{}
  599. o.CopyFrom(m)
  600. return o
  601. }
  602. func (m *ResolveAddressRequest) CopyFrom(src interface{}) {
  603. o := src.(*ResolveAddressRequest)
  604. *m = *o
  605. }
  606. func (m *ResolveAddressResponse) Copy() *ResolveAddressResponse {
  607. if m == nil {
  608. return nil
  609. }
  610. o := &ResolveAddressResponse{}
  611. o.CopyFrom(m)
  612. return o
  613. }
  614. func (m *ResolveAddressResponse) CopyFrom(src interface{}) {
  615. o := src.(*ResolveAddressResponse)
  616. *m = *o
  617. }
  618. func (m *InternalRaftRequest) Copy() *InternalRaftRequest {
  619. if m == nil {
  620. return nil
  621. }
  622. o := &InternalRaftRequest{}
  623. o.CopyFrom(m)
  624. return o
  625. }
  626. func (m *InternalRaftRequest) CopyFrom(src interface{}) {
  627. o := src.(*InternalRaftRequest)
  628. *m = *o
  629. if o.Action != nil {
  630. m.Action = make([]StoreAction, len(o.Action))
  631. for i := range m.Action {
  632. github_com_docker_swarmkit_api_deepcopy.Copy(&m.Action[i], &o.Action[i])
  633. }
  634. }
  635. }
  636. func (m *StoreAction) Copy() *StoreAction {
  637. if m == nil {
  638. return nil
  639. }
  640. o := &StoreAction{}
  641. o.CopyFrom(m)
  642. return o
  643. }
  644. func (m *StoreAction) CopyFrom(src interface{}) {
  645. o := src.(*StoreAction)
  646. *m = *o
  647. if o.Target != nil {
  648. switch o.Target.(type) {
  649. case *StoreAction_Node:
  650. v := StoreAction_Node{
  651. Node: &Node{},
  652. }
  653. github_com_docker_swarmkit_api_deepcopy.Copy(v.Node, o.GetNode())
  654. m.Target = &v
  655. case *StoreAction_Service:
  656. v := StoreAction_Service{
  657. Service: &Service{},
  658. }
  659. github_com_docker_swarmkit_api_deepcopy.Copy(v.Service, o.GetService())
  660. m.Target = &v
  661. case *StoreAction_Task:
  662. v := StoreAction_Task{
  663. Task: &Task{},
  664. }
  665. github_com_docker_swarmkit_api_deepcopy.Copy(v.Task, o.GetTask())
  666. m.Target = &v
  667. case *StoreAction_Network:
  668. v := StoreAction_Network{
  669. Network: &Network{},
  670. }
  671. github_com_docker_swarmkit_api_deepcopy.Copy(v.Network, o.GetNetwork())
  672. m.Target = &v
  673. case *StoreAction_Cluster:
  674. v := StoreAction_Cluster{
  675. Cluster: &Cluster{},
  676. }
  677. github_com_docker_swarmkit_api_deepcopy.Copy(v.Cluster, o.GetCluster())
  678. m.Target = &v
  679. case *StoreAction_Secret:
  680. v := StoreAction_Secret{
  681. Secret: &Secret{},
  682. }
  683. github_com_docker_swarmkit_api_deepcopy.Copy(v.Secret, o.GetSecret())
  684. m.Target = &v
  685. case *StoreAction_Resource:
  686. v := StoreAction_Resource{
  687. Resource: &Resource{},
  688. }
  689. github_com_docker_swarmkit_api_deepcopy.Copy(v.Resource, o.GetResource())
  690. m.Target = &v
  691. case *StoreAction_Extension:
  692. v := StoreAction_Extension{
  693. Extension: &Extension{},
  694. }
  695. github_com_docker_swarmkit_api_deepcopy.Copy(v.Extension, o.GetExtension())
  696. m.Target = &v
  697. case *StoreAction_Config:
  698. v := StoreAction_Config{
  699. Config: &Config{},
  700. }
  701. github_com_docker_swarmkit_api_deepcopy.Copy(v.Config, o.GetConfig())
  702. m.Target = &v
  703. }
  704. }
  705. }
  706. // Reference imports to suppress errors if they are not otherwise used.
  707. var _ context.Context
  708. var _ grpc.ClientConn
  709. // This is a compile-time assertion to ensure that this generated file
  710. // is compatible with the grpc package it is being compiled against.
  711. const _ = grpc.SupportPackageIsVersion4
  712. // Client API for Raft service
  713. type RaftClient interface {
  714. // ProcessRaftMessage sends a raft message to be processed on a raft member, it is
  715. // called from the RaftMember willing to send a message to its destination ('To' field)
  716. ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error)
  717. // ResolveAddress returns the address where the node with the given ID can be reached.
  718. ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error)
  719. }
  720. type raftClient struct {
  721. cc *grpc.ClientConn
  722. }
  723. func NewRaftClient(cc *grpc.ClientConn) RaftClient {
  724. return &raftClient{cc}
  725. }
  726. func (c *raftClient) ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) {
  727. out := new(ProcessRaftMessageResponse)
  728. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ProcessRaftMessage", in, out, c.cc, opts...)
  729. if err != nil {
  730. return nil, err
  731. }
  732. return out, nil
  733. }
  734. func (c *raftClient) ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) {
  735. out := new(ResolveAddressResponse)
  736. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ResolveAddress", in, out, c.cc, opts...)
  737. if err != nil {
  738. return nil, err
  739. }
  740. return out, nil
  741. }
  742. // Server API for Raft service
  743. type RaftServer interface {
  744. // ProcessRaftMessage sends a raft message to be processed on a raft member, it is
  745. // called from the RaftMember willing to send a message to its destination ('To' field)
  746. ProcessRaftMessage(context.Context, *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error)
  747. // ResolveAddress returns the address where the node with the given ID can be reached.
  748. ResolveAddress(context.Context, *ResolveAddressRequest) (*ResolveAddressResponse, error)
  749. }
  750. func RegisterRaftServer(s *grpc.Server, srv RaftServer) {
  751. s.RegisterService(&_Raft_serviceDesc, srv)
  752. }
  753. func _Raft_ProcessRaftMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  754. in := new(ProcessRaftMessageRequest)
  755. if err := dec(in); err != nil {
  756. return nil, err
  757. }
  758. if interceptor == nil {
  759. return srv.(RaftServer).ProcessRaftMessage(ctx, in)
  760. }
  761. info := &grpc.UnaryServerInfo{
  762. Server: srv,
  763. FullMethod: "/docker.swarmkit.v1.Raft/ProcessRaftMessage",
  764. }
  765. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  766. return srv.(RaftServer).ProcessRaftMessage(ctx, req.(*ProcessRaftMessageRequest))
  767. }
  768. return interceptor(ctx, in, info, handler)
  769. }
  770. func _Raft_ResolveAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  771. in := new(ResolveAddressRequest)
  772. if err := dec(in); err != nil {
  773. return nil, err
  774. }
  775. if interceptor == nil {
  776. return srv.(RaftServer).ResolveAddress(ctx, in)
  777. }
  778. info := &grpc.UnaryServerInfo{
  779. Server: srv,
  780. FullMethod: "/docker.swarmkit.v1.Raft/ResolveAddress",
  781. }
  782. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  783. return srv.(RaftServer).ResolveAddress(ctx, req.(*ResolveAddressRequest))
  784. }
  785. return interceptor(ctx, in, info, handler)
  786. }
  787. var _Raft_serviceDesc = grpc.ServiceDesc{
  788. ServiceName: "docker.swarmkit.v1.Raft",
  789. HandlerType: (*RaftServer)(nil),
  790. Methods: []grpc.MethodDesc{
  791. {
  792. MethodName: "ProcessRaftMessage",
  793. Handler: _Raft_ProcessRaftMessage_Handler,
  794. },
  795. {
  796. MethodName: "ResolveAddress",
  797. Handler: _Raft_ResolveAddress_Handler,
  798. },
  799. },
  800. Streams: []grpc.StreamDesc{},
  801. Metadata: "raft.proto",
  802. }
  803. // Client API for RaftMembership service
  804. type RaftMembershipClient interface {
  805. // Join adds a RaftMember to the raft cluster.
  806. Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error)
  807. // Leave removes a RaftMember from the raft cluster.
  808. Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error)
  809. }
  810. type raftMembershipClient struct {
  811. cc *grpc.ClientConn
  812. }
  813. func NewRaftMembershipClient(cc *grpc.ClientConn) RaftMembershipClient {
  814. return &raftMembershipClient{cc}
  815. }
  816. func (c *raftMembershipClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) {
  817. out := new(JoinResponse)
  818. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Join", in, out, c.cc, opts...)
  819. if err != nil {
  820. return nil, err
  821. }
  822. return out, nil
  823. }
  824. func (c *raftMembershipClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) {
  825. out := new(LeaveResponse)
  826. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Leave", in, out, c.cc, opts...)
  827. if err != nil {
  828. return nil, err
  829. }
  830. return out, nil
  831. }
  832. // Server API for RaftMembership service
  833. type RaftMembershipServer interface {
  834. // Join adds a RaftMember to the raft cluster.
  835. Join(context.Context, *JoinRequest) (*JoinResponse, error)
  836. // Leave removes a RaftMember from the raft cluster.
  837. Leave(context.Context, *LeaveRequest) (*LeaveResponse, error)
  838. }
  839. func RegisterRaftMembershipServer(s *grpc.Server, srv RaftMembershipServer) {
  840. s.RegisterService(&_RaftMembership_serviceDesc, srv)
  841. }
  842. func _RaftMembership_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  843. in := new(JoinRequest)
  844. if err := dec(in); err != nil {
  845. return nil, err
  846. }
  847. if interceptor == nil {
  848. return srv.(RaftMembershipServer).Join(ctx, in)
  849. }
  850. info := &grpc.UnaryServerInfo{
  851. Server: srv,
  852. FullMethod: "/docker.swarmkit.v1.RaftMembership/Join",
  853. }
  854. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  855. return srv.(RaftMembershipServer).Join(ctx, req.(*JoinRequest))
  856. }
  857. return interceptor(ctx, in, info, handler)
  858. }
  859. func _RaftMembership_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  860. in := new(LeaveRequest)
  861. if err := dec(in); err != nil {
  862. return nil, err
  863. }
  864. if interceptor == nil {
  865. return srv.(RaftMembershipServer).Leave(ctx, in)
  866. }
  867. info := &grpc.UnaryServerInfo{
  868. Server: srv,
  869. FullMethod: "/docker.swarmkit.v1.RaftMembership/Leave",
  870. }
  871. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  872. return srv.(RaftMembershipServer).Leave(ctx, req.(*LeaveRequest))
  873. }
  874. return interceptor(ctx, in, info, handler)
  875. }
  876. var _RaftMembership_serviceDesc = grpc.ServiceDesc{
  877. ServiceName: "docker.swarmkit.v1.RaftMembership",
  878. HandlerType: (*RaftMembershipServer)(nil),
  879. Methods: []grpc.MethodDesc{
  880. {
  881. MethodName: "Join",
  882. Handler: _RaftMembership_Join_Handler,
  883. },
  884. {
  885. MethodName: "Leave",
  886. Handler: _RaftMembership_Leave_Handler,
  887. },
  888. },
  889. Streams: []grpc.StreamDesc{},
  890. Metadata: "raft.proto",
  891. }
  892. func (m *RaftMember) Marshal() (dAtA []byte, err error) {
  893. size := m.Size()
  894. dAtA = make([]byte, size)
  895. n, err := m.MarshalTo(dAtA)
  896. if err != nil {
  897. return nil, err
  898. }
  899. return dAtA[:n], nil
  900. }
  901. func (m *RaftMember) MarshalTo(dAtA []byte) (int, error) {
  902. var i int
  903. _ = i
  904. var l int
  905. _ = l
  906. if m.RaftID != 0 {
  907. dAtA[i] = 0x8
  908. i++
  909. i = encodeVarintRaft(dAtA, i, uint64(m.RaftID))
  910. }
  911. if len(m.NodeID) > 0 {
  912. dAtA[i] = 0x12
  913. i++
  914. i = encodeVarintRaft(dAtA, i, uint64(len(m.NodeID)))
  915. i += copy(dAtA[i:], m.NodeID)
  916. }
  917. if len(m.Addr) > 0 {
  918. dAtA[i] = 0x1a
  919. i++
  920. i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr)))
  921. i += copy(dAtA[i:], m.Addr)
  922. }
  923. dAtA[i] = 0x22
  924. i++
  925. i = encodeVarintRaft(dAtA, i, uint64(m.Status.Size()))
  926. n1, err := m.Status.MarshalTo(dAtA[i:])
  927. if err != nil {
  928. return 0, err
  929. }
  930. i += n1
  931. return i, nil
  932. }
  933. func (m *JoinRequest) Marshal() (dAtA []byte, err error) {
  934. size := m.Size()
  935. dAtA = make([]byte, size)
  936. n, err := m.MarshalTo(dAtA)
  937. if err != nil {
  938. return nil, err
  939. }
  940. return dAtA[:n], nil
  941. }
  942. func (m *JoinRequest) MarshalTo(dAtA []byte) (int, error) {
  943. var i int
  944. _ = i
  945. var l int
  946. _ = l
  947. if len(m.Addr) > 0 {
  948. dAtA[i] = 0xa
  949. i++
  950. i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr)))
  951. i += copy(dAtA[i:], m.Addr)
  952. }
  953. return i, nil
  954. }
  955. func (m *JoinResponse) Marshal() (dAtA []byte, err error) {
  956. size := m.Size()
  957. dAtA = make([]byte, size)
  958. n, err := m.MarshalTo(dAtA)
  959. if err != nil {
  960. return nil, err
  961. }
  962. return dAtA[:n], nil
  963. }
  964. func (m *JoinResponse) MarshalTo(dAtA []byte) (int, error) {
  965. var i int
  966. _ = i
  967. var l int
  968. _ = l
  969. if m.RaftID != 0 {
  970. dAtA[i] = 0x8
  971. i++
  972. i = encodeVarintRaft(dAtA, i, uint64(m.RaftID))
  973. }
  974. if len(m.Members) > 0 {
  975. for _, msg := range m.Members {
  976. dAtA[i] = 0x12
  977. i++
  978. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  979. n, err := msg.MarshalTo(dAtA[i:])
  980. if err != nil {
  981. return 0, err
  982. }
  983. i += n
  984. }
  985. }
  986. if len(m.RemovedMembers) > 0 {
  987. for _, num := range m.RemovedMembers {
  988. dAtA[i] = 0x18
  989. i++
  990. i = encodeVarintRaft(dAtA, i, uint64(num))
  991. }
  992. }
  993. return i, nil
  994. }
  995. func (m *LeaveRequest) Marshal() (dAtA []byte, err error) {
  996. size := m.Size()
  997. dAtA = make([]byte, size)
  998. n, err := m.MarshalTo(dAtA)
  999. if err != nil {
  1000. return nil, err
  1001. }
  1002. return dAtA[:n], nil
  1003. }
  1004. func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) {
  1005. var i int
  1006. _ = i
  1007. var l int
  1008. _ = l
  1009. if m.Node != nil {
  1010. dAtA[i] = 0xa
  1011. i++
  1012. i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size()))
  1013. n2, err := m.Node.MarshalTo(dAtA[i:])
  1014. if err != nil {
  1015. return 0, err
  1016. }
  1017. i += n2
  1018. }
  1019. return i, nil
  1020. }
  1021. func (m *LeaveResponse) Marshal() (dAtA []byte, err error) {
  1022. size := m.Size()
  1023. dAtA = make([]byte, size)
  1024. n, err := m.MarshalTo(dAtA)
  1025. if err != nil {
  1026. return nil, err
  1027. }
  1028. return dAtA[:n], nil
  1029. }
  1030. func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) {
  1031. var i int
  1032. _ = i
  1033. var l int
  1034. _ = l
  1035. return i, nil
  1036. }
  1037. func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) {
  1038. size := m.Size()
  1039. dAtA = make([]byte, size)
  1040. n, err := m.MarshalTo(dAtA)
  1041. if err != nil {
  1042. return nil, err
  1043. }
  1044. return dAtA[:n], nil
  1045. }
  1046. func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) {
  1047. var i int
  1048. _ = i
  1049. var l int
  1050. _ = l
  1051. if m.Message != nil {
  1052. dAtA[i] = 0xa
  1053. i++
  1054. i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size()))
  1055. n3, err := m.Message.MarshalTo(dAtA[i:])
  1056. if err != nil {
  1057. return 0, err
  1058. }
  1059. i += n3
  1060. }
  1061. return i, nil
  1062. }
  1063. func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) {
  1064. size := m.Size()
  1065. dAtA = make([]byte, size)
  1066. n, err := m.MarshalTo(dAtA)
  1067. if err != nil {
  1068. return nil, err
  1069. }
  1070. return dAtA[:n], nil
  1071. }
  1072. func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) {
  1073. var i int
  1074. _ = i
  1075. var l int
  1076. _ = l
  1077. return i, nil
  1078. }
  1079. func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) {
  1080. size := m.Size()
  1081. dAtA = make([]byte, size)
  1082. n, err := m.MarshalTo(dAtA)
  1083. if err != nil {
  1084. return nil, err
  1085. }
  1086. return dAtA[:n], nil
  1087. }
  1088. func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) {
  1089. var i int
  1090. _ = i
  1091. var l int
  1092. _ = l
  1093. if m.RaftID != 0 {
  1094. dAtA[i] = 0x8
  1095. i++
  1096. i = encodeVarintRaft(dAtA, i, uint64(m.RaftID))
  1097. }
  1098. return i, nil
  1099. }
  1100. func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) {
  1101. size := m.Size()
  1102. dAtA = make([]byte, size)
  1103. n, err := m.MarshalTo(dAtA)
  1104. if err != nil {
  1105. return nil, err
  1106. }
  1107. return dAtA[:n], nil
  1108. }
  1109. func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) {
  1110. var i int
  1111. _ = i
  1112. var l int
  1113. _ = l
  1114. if len(m.Addr) > 0 {
  1115. dAtA[i] = 0xa
  1116. i++
  1117. i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr)))
  1118. i += copy(dAtA[i:], m.Addr)
  1119. }
  1120. return i, nil
  1121. }
  1122. func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) {
  1123. size := m.Size()
  1124. dAtA = make([]byte, size)
  1125. n, err := m.MarshalTo(dAtA)
  1126. if err != nil {
  1127. return nil, err
  1128. }
  1129. return dAtA[:n], nil
  1130. }
  1131. func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
  1132. var i int
  1133. _ = i
  1134. var l int
  1135. _ = l
  1136. if m.ID != 0 {
  1137. dAtA[i] = 0x8
  1138. i++
  1139. i = encodeVarintRaft(dAtA, i, uint64(m.ID))
  1140. }
  1141. if len(m.Action) > 0 {
  1142. for _, msg := range m.Action {
  1143. dAtA[i] = 0x12
  1144. i++
  1145. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  1146. n, err := msg.MarshalTo(dAtA[i:])
  1147. if err != nil {
  1148. return 0, err
  1149. }
  1150. i += n
  1151. }
  1152. }
  1153. return i, nil
  1154. }
  1155. func (m *StoreAction) Marshal() (dAtA []byte, err error) {
  1156. size := m.Size()
  1157. dAtA = make([]byte, size)
  1158. n, err := m.MarshalTo(dAtA)
  1159. if err != nil {
  1160. return nil, err
  1161. }
  1162. return dAtA[:n], nil
  1163. }
  1164. func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) {
  1165. var i int
  1166. _ = i
  1167. var l int
  1168. _ = l
  1169. if m.Action != 0 {
  1170. dAtA[i] = 0x8
  1171. i++
  1172. i = encodeVarintRaft(dAtA, i, uint64(m.Action))
  1173. }
  1174. if m.Target != nil {
  1175. nn4, err := m.Target.MarshalTo(dAtA[i:])
  1176. if err != nil {
  1177. return 0, err
  1178. }
  1179. i += nn4
  1180. }
  1181. return i, nil
  1182. }
  1183. func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) {
  1184. i := 0
  1185. if m.Node != nil {
  1186. dAtA[i] = 0x12
  1187. i++
  1188. i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size()))
  1189. n5, err := m.Node.MarshalTo(dAtA[i:])
  1190. if err != nil {
  1191. return 0, err
  1192. }
  1193. i += n5
  1194. }
  1195. return i, nil
  1196. }
  1197. func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) {
  1198. i := 0
  1199. if m.Service != nil {
  1200. dAtA[i] = 0x1a
  1201. i++
  1202. i = encodeVarintRaft(dAtA, i, uint64(m.Service.Size()))
  1203. n6, err := m.Service.MarshalTo(dAtA[i:])
  1204. if err != nil {
  1205. return 0, err
  1206. }
  1207. i += n6
  1208. }
  1209. return i, nil
  1210. }
  1211. func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) {
  1212. i := 0
  1213. if m.Task != nil {
  1214. dAtA[i] = 0x22
  1215. i++
  1216. i = encodeVarintRaft(dAtA, i, uint64(m.Task.Size()))
  1217. n7, err := m.Task.MarshalTo(dAtA[i:])
  1218. if err != nil {
  1219. return 0, err
  1220. }
  1221. i += n7
  1222. }
  1223. return i, nil
  1224. }
  1225. func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) {
  1226. i := 0
  1227. if m.Network != nil {
  1228. dAtA[i] = 0x2a
  1229. i++
  1230. i = encodeVarintRaft(dAtA, i, uint64(m.Network.Size()))
  1231. n8, err := m.Network.MarshalTo(dAtA[i:])
  1232. if err != nil {
  1233. return 0, err
  1234. }
  1235. i += n8
  1236. }
  1237. return i, nil
  1238. }
  1239. func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) {
  1240. i := 0
  1241. if m.Cluster != nil {
  1242. dAtA[i] = 0x32
  1243. i++
  1244. i = encodeVarintRaft(dAtA, i, uint64(m.Cluster.Size()))
  1245. n9, err := m.Cluster.MarshalTo(dAtA[i:])
  1246. if err != nil {
  1247. return 0, err
  1248. }
  1249. i += n9
  1250. }
  1251. return i, nil
  1252. }
  1253. func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) {
  1254. i := 0
  1255. if m.Secret != nil {
  1256. dAtA[i] = 0x3a
  1257. i++
  1258. i = encodeVarintRaft(dAtA, i, uint64(m.Secret.Size()))
  1259. n10, err := m.Secret.MarshalTo(dAtA[i:])
  1260. if err != nil {
  1261. return 0, err
  1262. }
  1263. i += n10
  1264. }
  1265. return i, nil
  1266. }
  1267. func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) {
  1268. i := 0
  1269. if m.Resource != nil {
  1270. dAtA[i] = 0x42
  1271. i++
  1272. i = encodeVarintRaft(dAtA, i, uint64(m.Resource.Size()))
  1273. n11, err := m.Resource.MarshalTo(dAtA[i:])
  1274. if err != nil {
  1275. return 0, err
  1276. }
  1277. i += n11
  1278. }
  1279. return i, nil
  1280. }
  1281. func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) {
  1282. i := 0
  1283. if m.Extension != nil {
  1284. dAtA[i] = 0x4a
  1285. i++
  1286. i = encodeVarintRaft(dAtA, i, uint64(m.Extension.Size()))
  1287. n12, err := m.Extension.MarshalTo(dAtA[i:])
  1288. if err != nil {
  1289. return 0, err
  1290. }
  1291. i += n12
  1292. }
  1293. return i, nil
  1294. }
  1295. func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) {
  1296. i := 0
  1297. if m.Config != nil {
  1298. dAtA[i] = 0x52
  1299. i++
  1300. i = encodeVarintRaft(dAtA, i, uint64(m.Config.Size()))
  1301. n13, err := m.Config.MarshalTo(dAtA[i:])
  1302. if err != nil {
  1303. return 0, err
  1304. }
  1305. i += n13
  1306. }
  1307. return i, nil
  1308. }
  1309. func encodeFixed64Raft(dAtA []byte, offset int, v uint64) int {
  1310. dAtA[offset] = uint8(v)
  1311. dAtA[offset+1] = uint8(v >> 8)
  1312. dAtA[offset+2] = uint8(v >> 16)
  1313. dAtA[offset+3] = uint8(v >> 24)
  1314. dAtA[offset+4] = uint8(v >> 32)
  1315. dAtA[offset+5] = uint8(v >> 40)
  1316. dAtA[offset+6] = uint8(v >> 48)
  1317. dAtA[offset+7] = uint8(v >> 56)
  1318. return offset + 8
  1319. }
  1320. func encodeFixed32Raft(dAtA []byte, offset int, v uint32) int {
  1321. dAtA[offset] = uint8(v)
  1322. dAtA[offset+1] = uint8(v >> 8)
  1323. dAtA[offset+2] = uint8(v >> 16)
  1324. dAtA[offset+3] = uint8(v >> 24)
  1325. return offset + 4
  1326. }
  1327. func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
  1328. for v >= 1<<7 {
  1329. dAtA[offset] = uint8(v&0x7f | 0x80)
  1330. v >>= 7
  1331. offset++
  1332. }
  1333. dAtA[offset] = uint8(v)
  1334. return offset + 1
  1335. }
  1336. type raftProxyRaftServer struct {
  1337. local RaftServer
  1338. connSelector raftselector.ConnProvider
  1339. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1340. }
  1341. func NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer {
  1342. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1343. s, ok := transport.StreamFromContext(ctx)
  1344. if !ok {
  1345. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1346. }
  1347. addr := s.ServerTransport().RemoteAddr().String()
  1348. md, ok := metadata.FromContext(ctx)
  1349. if ok && len(md["redirect"]) != 0 {
  1350. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1351. }
  1352. if !ok {
  1353. md = metadata.New(map[string]string{})
  1354. }
  1355. md["redirect"] = append(md["redirect"], addr)
  1356. return metadata.NewContext(ctx, md), nil
  1357. }
  1358. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1359. remoteMods = append(remoteMods, remoteCtxMod)
  1360. var localMods []func(context.Context) (context.Context, error)
  1361. if localCtxMod != nil {
  1362. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1363. }
  1364. return &raftProxyRaftServer{
  1365. local: local,
  1366. connSelector: connSelector,
  1367. localCtxMods: localMods,
  1368. remoteCtxMods: remoteMods,
  1369. }
  1370. }
  1371. func (p *raftProxyRaftServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1372. var err error
  1373. for _, mod := range ctxMods {
  1374. ctx, err = mod(ctx)
  1375. if err != nil {
  1376. return ctx, err
  1377. }
  1378. }
  1379. return ctx, nil
  1380. }
  1381. func (p *raftProxyRaftServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1382. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  1383. defer ticker.Stop()
  1384. for {
  1385. select {
  1386. case <-ticker.C:
  1387. conn, err := p.connSelector.LeaderConn(ctx)
  1388. if err != nil {
  1389. return nil, err
  1390. }
  1391. client := NewHealthClient(conn)
  1392. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1393. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1394. continue
  1395. }
  1396. return conn, nil
  1397. case <-ctx.Done():
  1398. return nil, ctx.Err()
  1399. }
  1400. }
  1401. }
  1402. func (p *raftProxyRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) {
  1403. conn, err := p.connSelector.LeaderConn(ctx)
  1404. if err != nil {
  1405. if err == raftselector.ErrIsLeader {
  1406. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1407. if err != nil {
  1408. return nil, err
  1409. }
  1410. return p.local.ProcessRaftMessage(ctx, r)
  1411. }
  1412. return nil, err
  1413. }
  1414. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1415. if err != nil {
  1416. return nil, err
  1417. }
  1418. resp, err := NewRaftClient(conn).ProcessRaftMessage(modCtx, r)
  1419. if err != nil {
  1420. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1421. return resp, err
  1422. }
  1423. conn, err := p.pollNewLeaderConn(ctx)
  1424. if err != nil {
  1425. if err == raftselector.ErrIsLeader {
  1426. return p.local.ProcessRaftMessage(ctx, r)
  1427. }
  1428. return nil, err
  1429. }
  1430. return NewRaftClient(conn).ProcessRaftMessage(modCtx, r)
  1431. }
  1432. return resp, err
  1433. }
  1434. func (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) {
  1435. conn, err := p.connSelector.LeaderConn(ctx)
  1436. if err != nil {
  1437. if err == raftselector.ErrIsLeader {
  1438. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1439. if err != nil {
  1440. return nil, err
  1441. }
  1442. return p.local.ResolveAddress(ctx, r)
  1443. }
  1444. return nil, err
  1445. }
  1446. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1447. if err != nil {
  1448. return nil, err
  1449. }
  1450. resp, err := NewRaftClient(conn).ResolveAddress(modCtx, r)
  1451. if err != nil {
  1452. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1453. return resp, err
  1454. }
  1455. conn, err := p.pollNewLeaderConn(ctx)
  1456. if err != nil {
  1457. if err == raftselector.ErrIsLeader {
  1458. return p.local.ResolveAddress(ctx, r)
  1459. }
  1460. return nil, err
  1461. }
  1462. return NewRaftClient(conn).ResolveAddress(modCtx, r)
  1463. }
  1464. return resp, err
  1465. }
  1466. type raftProxyRaftMembershipServer struct {
  1467. local RaftMembershipServer
  1468. connSelector raftselector.ConnProvider
  1469. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1470. }
  1471. func NewRaftProxyRaftMembershipServer(local RaftMembershipServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftMembershipServer {
  1472. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1473. s, ok := transport.StreamFromContext(ctx)
  1474. if !ok {
  1475. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1476. }
  1477. addr := s.ServerTransport().RemoteAddr().String()
  1478. md, ok := metadata.FromContext(ctx)
  1479. if ok && len(md["redirect"]) != 0 {
  1480. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1481. }
  1482. if !ok {
  1483. md = metadata.New(map[string]string{})
  1484. }
  1485. md["redirect"] = append(md["redirect"], addr)
  1486. return metadata.NewContext(ctx, md), nil
  1487. }
  1488. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1489. remoteMods = append(remoteMods, remoteCtxMod)
  1490. var localMods []func(context.Context) (context.Context, error)
  1491. if localCtxMod != nil {
  1492. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1493. }
  1494. return &raftProxyRaftMembershipServer{
  1495. local: local,
  1496. connSelector: connSelector,
  1497. localCtxMods: localMods,
  1498. remoteCtxMods: remoteMods,
  1499. }
  1500. }
  1501. func (p *raftProxyRaftMembershipServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1502. var err error
  1503. for _, mod := range ctxMods {
  1504. ctx, err = mod(ctx)
  1505. if err != nil {
  1506. return ctx, err
  1507. }
  1508. }
  1509. return ctx, nil
  1510. }
  1511. func (p *raftProxyRaftMembershipServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1512. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  1513. defer ticker.Stop()
  1514. for {
  1515. select {
  1516. case <-ticker.C:
  1517. conn, err := p.connSelector.LeaderConn(ctx)
  1518. if err != nil {
  1519. return nil, err
  1520. }
  1521. client := NewHealthClient(conn)
  1522. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1523. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1524. continue
  1525. }
  1526. return conn, nil
  1527. case <-ctx.Done():
  1528. return nil, ctx.Err()
  1529. }
  1530. }
  1531. }
  1532. func (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) {
  1533. conn, err := p.connSelector.LeaderConn(ctx)
  1534. if err != nil {
  1535. if err == raftselector.ErrIsLeader {
  1536. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1537. if err != nil {
  1538. return nil, err
  1539. }
  1540. return p.local.Join(ctx, r)
  1541. }
  1542. return nil, err
  1543. }
  1544. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1545. if err != nil {
  1546. return nil, err
  1547. }
  1548. resp, err := NewRaftMembershipClient(conn).Join(modCtx, r)
  1549. if err != nil {
  1550. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1551. return resp, err
  1552. }
  1553. conn, err := p.pollNewLeaderConn(ctx)
  1554. if err != nil {
  1555. if err == raftselector.ErrIsLeader {
  1556. return p.local.Join(ctx, r)
  1557. }
  1558. return nil, err
  1559. }
  1560. return NewRaftMembershipClient(conn).Join(modCtx, r)
  1561. }
  1562. return resp, err
  1563. }
  1564. func (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) {
  1565. conn, err := p.connSelector.LeaderConn(ctx)
  1566. if err != nil {
  1567. if err == raftselector.ErrIsLeader {
  1568. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1569. if err != nil {
  1570. return nil, err
  1571. }
  1572. return p.local.Leave(ctx, r)
  1573. }
  1574. return nil, err
  1575. }
  1576. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1577. if err != nil {
  1578. return nil, err
  1579. }
  1580. resp, err := NewRaftMembershipClient(conn).Leave(modCtx, r)
  1581. if err != nil {
  1582. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1583. return resp, err
  1584. }
  1585. conn, err := p.pollNewLeaderConn(ctx)
  1586. if err != nil {
  1587. if err == raftselector.ErrIsLeader {
  1588. return p.local.Leave(ctx, r)
  1589. }
  1590. return nil, err
  1591. }
  1592. return NewRaftMembershipClient(conn).Leave(modCtx, r)
  1593. }
  1594. return resp, err
  1595. }
  1596. func (m *RaftMember) Size() (n int) {
  1597. var l int
  1598. _ = l
  1599. if m.RaftID != 0 {
  1600. n += 1 + sovRaft(uint64(m.RaftID))
  1601. }
  1602. l = len(m.NodeID)
  1603. if l > 0 {
  1604. n += 1 + l + sovRaft(uint64(l))
  1605. }
  1606. l = len(m.Addr)
  1607. if l > 0 {
  1608. n += 1 + l + sovRaft(uint64(l))
  1609. }
  1610. l = m.Status.Size()
  1611. n += 1 + l + sovRaft(uint64(l))
  1612. return n
  1613. }
  1614. func (m *JoinRequest) Size() (n int) {
  1615. var l int
  1616. _ = l
  1617. l = len(m.Addr)
  1618. if l > 0 {
  1619. n += 1 + l + sovRaft(uint64(l))
  1620. }
  1621. return n
  1622. }
  1623. func (m *JoinResponse) Size() (n int) {
  1624. var l int
  1625. _ = l
  1626. if m.RaftID != 0 {
  1627. n += 1 + sovRaft(uint64(m.RaftID))
  1628. }
  1629. if len(m.Members) > 0 {
  1630. for _, e := range m.Members {
  1631. l = e.Size()
  1632. n += 1 + l + sovRaft(uint64(l))
  1633. }
  1634. }
  1635. if len(m.RemovedMembers) > 0 {
  1636. for _, e := range m.RemovedMembers {
  1637. n += 1 + sovRaft(uint64(e))
  1638. }
  1639. }
  1640. return n
  1641. }
  1642. func (m *LeaveRequest) Size() (n int) {
  1643. var l int
  1644. _ = l
  1645. if m.Node != nil {
  1646. l = m.Node.Size()
  1647. n += 1 + l + sovRaft(uint64(l))
  1648. }
  1649. return n
  1650. }
  1651. func (m *LeaveResponse) Size() (n int) {
  1652. var l int
  1653. _ = l
  1654. return n
  1655. }
  1656. func (m *ProcessRaftMessageRequest) Size() (n int) {
  1657. var l int
  1658. _ = l
  1659. if m.Message != nil {
  1660. l = m.Message.Size()
  1661. n += 1 + l + sovRaft(uint64(l))
  1662. }
  1663. return n
  1664. }
  1665. func (m *ProcessRaftMessageResponse) Size() (n int) {
  1666. var l int
  1667. _ = l
  1668. return n
  1669. }
  1670. func (m *ResolveAddressRequest) Size() (n int) {
  1671. var l int
  1672. _ = l
  1673. if m.RaftID != 0 {
  1674. n += 1 + sovRaft(uint64(m.RaftID))
  1675. }
  1676. return n
  1677. }
  1678. func (m *ResolveAddressResponse) Size() (n int) {
  1679. var l int
  1680. _ = l
  1681. l = len(m.Addr)
  1682. if l > 0 {
  1683. n += 1 + l + sovRaft(uint64(l))
  1684. }
  1685. return n
  1686. }
  1687. func (m *InternalRaftRequest) Size() (n int) {
  1688. var l int
  1689. _ = l
  1690. if m.ID != 0 {
  1691. n += 1 + sovRaft(uint64(m.ID))
  1692. }
  1693. if len(m.Action) > 0 {
  1694. for _, e := range m.Action {
  1695. l = e.Size()
  1696. n += 1 + l + sovRaft(uint64(l))
  1697. }
  1698. }
  1699. return n
  1700. }
  1701. func (m *StoreAction) Size() (n int) {
  1702. var l int
  1703. _ = l
  1704. if m.Action != 0 {
  1705. n += 1 + sovRaft(uint64(m.Action))
  1706. }
  1707. if m.Target != nil {
  1708. n += m.Target.Size()
  1709. }
  1710. return n
  1711. }
  1712. func (m *StoreAction_Node) Size() (n int) {
  1713. var l int
  1714. _ = l
  1715. if m.Node != nil {
  1716. l = m.Node.Size()
  1717. n += 1 + l + sovRaft(uint64(l))
  1718. }
  1719. return n
  1720. }
  1721. func (m *StoreAction_Service) Size() (n int) {
  1722. var l int
  1723. _ = l
  1724. if m.Service != nil {
  1725. l = m.Service.Size()
  1726. n += 1 + l + sovRaft(uint64(l))
  1727. }
  1728. return n
  1729. }
  1730. func (m *StoreAction_Task) Size() (n int) {
  1731. var l int
  1732. _ = l
  1733. if m.Task != nil {
  1734. l = m.Task.Size()
  1735. n += 1 + l + sovRaft(uint64(l))
  1736. }
  1737. return n
  1738. }
  1739. func (m *StoreAction_Network) Size() (n int) {
  1740. var l int
  1741. _ = l
  1742. if m.Network != nil {
  1743. l = m.Network.Size()
  1744. n += 1 + l + sovRaft(uint64(l))
  1745. }
  1746. return n
  1747. }
  1748. func (m *StoreAction_Cluster) Size() (n int) {
  1749. var l int
  1750. _ = l
  1751. if m.Cluster != nil {
  1752. l = m.Cluster.Size()
  1753. n += 1 + l + sovRaft(uint64(l))
  1754. }
  1755. return n
  1756. }
  1757. func (m *StoreAction_Secret) Size() (n int) {
  1758. var l int
  1759. _ = l
  1760. if m.Secret != nil {
  1761. l = m.Secret.Size()
  1762. n += 1 + l + sovRaft(uint64(l))
  1763. }
  1764. return n
  1765. }
  1766. func (m *StoreAction_Resource) Size() (n int) {
  1767. var l int
  1768. _ = l
  1769. if m.Resource != nil {
  1770. l = m.Resource.Size()
  1771. n += 1 + l + sovRaft(uint64(l))
  1772. }
  1773. return n
  1774. }
  1775. func (m *StoreAction_Extension) Size() (n int) {
  1776. var l int
  1777. _ = l
  1778. if m.Extension != nil {
  1779. l = m.Extension.Size()
  1780. n += 1 + l + sovRaft(uint64(l))
  1781. }
  1782. return n
  1783. }
  1784. func (m *StoreAction_Config) Size() (n int) {
  1785. var l int
  1786. _ = l
  1787. if m.Config != nil {
  1788. l = m.Config.Size()
  1789. n += 1 + l + sovRaft(uint64(l))
  1790. }
  1791. return n
  1792. }
  1793. func sovRaft(x uint64) (n int) {
  1794. for {
  1795. n++
  1796. x >>= 7
  1797. if x == 0 {
  1798. break
  1799. }
  1800. }
  1801. return n
  1802. }
  1803. func sozRaft(x uint64) (n int) {
  1804. return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1805. }
  1806. func (this *RaftMember) String() string {
  1807. if this == nil {
  1808. return "nil"
  1809. }
  1810. s := strings.Join([]string{`&RaftMember{`,
  1811. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1812. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  1813. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1814. `Status:` + strings.Replace(strings.Replace(this.Status.String(), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`,
  1815. `}`,
  1816. }, "")
  1817. return s
  1818. }
  1819. func (this *JoinRequest) String() string {
  1820. if this == nil {
  1821. return "nil"
  1822. }
  1823. s := strings.Join([]string{`&JoinRequest{`,
  1824. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1825. `}`,
  1826. }, "")
  1827. return s
  1828. }
  1829. func (this *JoinResponse) String() string {
  1830. if this == nil {
  1831. return "nil"
  1832. }
  1833. s := strings.Join([]string{`&JoinResponse{`,
  1834. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1835. `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`,
  1836. `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`,
  1837. `}`,
  1838. }, "")
  1839. return s
  1840. }
  1841. func (this *LeaveRequest) String() string {
  1842. if this == nil {
  1843. return "nil"
  1844. }
  1845. s := strings.Join([]string{`&LeaveRequest{`,
  1846. `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "RaftMember", "RaftMember", 1) + `,`,
  1847. `}`,
  1848. }, "")
  1849. return s
  1850. }
  1851. func (this *LeaveResponse) String() string {
  1852. if this == nil {
  1853. return "nil"
  1854. }
  1855. s := strings.Join([]string{`&LeaveResponse{`,
  1856. `}`,
  1857. }, "")
  1858. return s
  1859. }
  1860. func (this *ProcessRaftMessageRequest) String() string {
  1861. if this == nil {
  1862. return "nil"
  1863. }
  1864. s := strings.Join([]string{`&ProcessRaftMessageRequest{`,
  1865. `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`,
  1866. `}`,
  1867. }, "")
  1868. return s
  1869. }
  1870. func (this *ProcessRaftMessageResponse) String() string {
  1871. if this == nil {
  1872. return "nil"
  1873. }
  1874. s := strings.Join([]string{`&ProcessRaftMessageResponse{`,
  1875. `}`,
  1876. }, "")
  1877. return s
  1878. }
  1879. func (this *ResolveAddressRequest) String() string {
  1880. if this == nil {
  1881. return "nil"
  1882. }
  1883. s := strings.Join([]string{`&ResolveAddressRequest{`,
  1884. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1885. `}`,
  1886. }, "")
  1887. return s
  1888. }
  1889. func (this *ResolveAddressResponse) String() string {
  1890. if this == nil {
  1891. return "nil"
  1892. }
  1893. s := strings.Join([]string{`&ResolveAddressResponse{`,
  1894. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1895. `}`,
  1896. }, "")
  1897. return s
  1898. }
  1899. func (this *InternalRaftRequest) String() string {
  1900. if this == nil {
  1901. return "nil"
  1902. }
  1903. s := strings.Join([]string{`&InternalRaftRequest{`,
  1904. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  1905. `Action:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Action), "StoreAction", "StoreAction", 1), `&`, ``, 1) + `,`,
  1906. `}`,
  1907. }, "")
  1908. return s
  1909. }
  1910. func (this *StoreAction) String() string {
  1911. if this == nil {
  1912. return "nil"
  1913. }
  1914. s := strings.Join([]string{`&StoreAction{`,
  1915. `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
  1916. `Target:` + fmt.Sprintf("%v", this.Target) + `,`,
  1917. `}`,
  1918. }, "")
  1919. return s
  1920. }
  1921. func (this *StoreAction_Node) String() string {
  1922. if this == nil {
  1923. return "nil"
  1924. }
  1925. s := strings.Join([]string{`&StoreAction_Node{`,
  1926. `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`,
  1927. `}`,
  1928. }, "")
  1929. return s
  1930. }
  1931. func (this *StoreAction_Service) String() string {
  1932. if this == nil {
  1933. return "nil"
  1934. }
  1935. s := strings.Join([]string{`&StoreAction_Service{`,
  1936. `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`,
  1937. `}`,
  1938. }, "")
  1939. return s
  1940. }
  1941. func (this *StoreAction_Task) String() string {
  1942. if this == nil {
  1943. return "nil"
  1944. }
  1945. s := strings.Join([]string{`&StoreAction_Task{`,
  1946. `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`,
  1947. `}`,
  1948. }, "")
  1949. return s
  1950. }
  1951. func (this *StoreAction_Network) String() string {
  1952. if this == nil {
  1953. return "nil"
  1954. }
  1955. s := strings.Join([]string{`&StoreAction_Network{`,
  1956. `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`,
  1957. `}`,
  1958. }, "")
  1959. return s
  1960. }
  1961. func (this *StoreAction_Cluster) String() string {
  1962. if this == nil {
  1963. return "nil"
  1964. }
  1965. s := strings.Join([]string{`&StoreAction_Cluster{`,
  1966. `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`,
  1967. `}`,
  1968. }, "")
  1969. return s
  1970. }
  1971. func (this *StoreAction_Secret) String() string {
  1972. if this == nil {
  1973. return "nil"
  1974. }
  1975. s := strings.Join([]string{`&StoreAction_Secret{`,
  1976. `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`,
  1977. `}`,
  1978. }, "")
  1979. return s
  1980. }
  1981. func (this *StoreAction_Resource) String() string {
  1982. if this == nil {
  1983. return "nil"
  1984. }
  1985. s := strings.Join([]string{`&StoreAction_Resource{`,
  1986. `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`,
  1987. `}`,
  1988. }, "")
  1989. return s
  1990. }
  1991. func (this *StoreAction_Extension) String() string {
  1992. if this == nil {
  1993. return "nil"
  1994. }
  1995. s := strings.Join([]string{`&StoreAction_Extension{`,
  1996. `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`,
  1997. `}`,
  1998. }, "")
  1999. return s
  2000. }
  2001. func (this *StoreAction_Config) String() string {
  2002. if this == nil {
  2003. return "nil"
  2004. }
  2005. s := strings.Join([]string{`&StoreAction_Config{`,
  2006. `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`,
  2007. `}`,
  2008. }, "")
  2009. return s
  2010. }
  2011. func valueToStringRaft(v interface{}) string {
  2012. rv := reflect.ValueOf(v)
  2013. if rv.IsNil() {
  2014. return "nil"
  2015. }
  2016. pv := reflect.Indirect(rv).Interface()
  2017. return fmt.Sprintf("*%v", pv)
  2018. }
  2019. func (m *RaftMember) Unmarshal(dAtA []byte) error {
  2020. l := len(dAtA)
  2021. iNdEx := 0
  2022. for iNdEx < l {
  2023. preIndex := iNdEx
  2024. var wire uint64
  2025. for shift := uint(0); ; shift += 7 {
  2026. if shift >= 64 {
  2027. return ErrIntOverflowRaft
  2028. }
  2029. if iNdEx >= l {
  2030. return io.ErrUnexpectedEOF
  2031. }
  2032. b := dAtA[iNdEx]
  2033. iNdEx++
  2034. wire |= (uint64(b) & 0x7F) << shift
  2035. if b < 0x80 {
  2036. break
  2037. }
  2038. }
  2039. fieldNum := int32(wire >> 3)
  2040. wireType := int(wire & 0x7)
  2041. if wireType == 4 {
  2042. return fmt.Errorf("proto: RaftMember: wiretype end group for non-group")
  2043. }
  2044. if fieldNum <= 0 {
  2045. return fmt.Errorf("proto: RaftMember: illegal tag %d (wire type %d)", fieldNum, wire)
  2046. }
  2047. switch fieldNum {
  2048. case 1:
  2049. if wireType != 0 {
  2050. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2051. }
  2052. m.RaftID = 0
  2053. for shift := uint(0); ; shift += 7 {
  2054. if shift >= 64 {
  2055. return ErrIntOverflowRaft
  2056. }
  2057. if iNdEx >= l {
  2058. return io.ErrUnexpectedEOF
  2059. }
  2060. b := dAtA[iNdEx]
  2061. iNdEx++
  2062. m.RaftID |= (uint64(b) & 0x7F) << shift
  2063. if b < 0x80 {
  2064. break
  2065. }
  2066. }
  2067. case 2:
  2068. if wireType != 2 {
  2069. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2070. }
  2071. var stringLen uint64
  2072. for shift := uint(0); ; shift += 7 {
  2073. if shift >= 64 {
  2074. return ErrIntOverflowRaft
  2075. }
  2076. if iNdEx >= l {
  2077. return io.ErrUnexpectedEOF
  2078. }
  2079. b := dAtA[iNdEx]
  2080. iNdEx++
  2081. stringLen |= (uint64(b) & 0x7F) << shift
  2082. if b < 0x80 {
  2083. break
  2084. }
  2085. }
  2086. intStringLen := int(stringLen)
  2087. if intStringLen < 0 {
  2088. return ErrInvalidLengthRaft
  2089. }
  2090. postIndex := iNdEx + intStringLen
  2091. if postIndex > l {
  2092. return io.ErrUnexpectedEOF
  2093. }
  2094. m.NodeID = string(dAtA[iNdEx:postIndex])
  2095. iNdEx = postIndex
  2096. case 3:
  2097. if wireType != 2 {
  2098. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2099. }
  2100. var stringLen uint64
  2101. for shift := uint(0); ; shift += 7 {
  2102. if shift >= 64 {
  2103. return ErrIntOverflowRaft
  2104. }
  2105. if iNdEx >= l {
  2106. return io.ErrUnexpectedEOF
  2107. }
  2108. b := dAtA[iNdEx]
  2109. iNdEx++
  2110. stringLen |= (uint64(b) & 0x7F) << shift
  2111. if b < 0x80 {
  2112. break
  2113. }
  2114. }
  2115. intStringLen := int(stringLen)
  2116. if intStringLen < 0 {
  2117. return ErrInvalidLengthRaft
  2118. }
  2119. postIndex := iNdEx + intStringLen
  2120. if postIndex > l {
  2121. return io.ErrUnexpectedEOF
  2122. }
  2123. m.Addr = string(dAtA[iNdEx:postIndex])
  2124. iNdEx = postIndex
  2125. case 4:
  2126. if wireType != 2 {
  2127. return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
  2128. }
  2129. var msglen int
  2130. for shift := uint(0); ; shift += 7 {
  2131. if shift >= 64 {
  2132. return ErrIntOverflowRaft
  2133. }
  2134. if iNdEx >= l {
  2135. return io.ErrUnexpectedEOF
  2136. }
  2137. b := dAtA[iNdEx]
  2138. iNdEx++
  2139. msglen |= (int(b) & 0x7F) << shift
  2140. if b < 0x80 {
  2141. break
  2142. }
  2143. }
  2144. if msglen < 0 {
  2145. return ErrInvalidLengthRaft
  2146. }
  2147. postIndex := iNdEx + msglen
  2148. if postIndex > l {
  2149. return io.ErrUnexpectedEOF
  2150. }
  2151. if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2152. return err
  2153. }
  2154. iNdEx = postIndex
  2155. default:
  2156. iNdEx = preIndex
  2157. skippy, err := skipRaft(dAtA[iNdEx:])
  2158. if err != nil {
  2159. return err
  2160. }
  2161. if skippy < 0 {
  2162. return ErrInvalidLengthRaft
  2163. }
  2164. if (iNdEx + skippy) > l {
  2165. return io.ErrUnexpectedEOF
  2166. }
  2167. iNdEx += skippy
  2168. }
  2169. }
  2170. if iNdEx > l {
  2171. return io.ErrUnexpectedEOF
  2172. }
  2173. return nil
  2174. }
  2175. func (m *JoinRequest) Unmarshal(dAtA []byte) error {
  2176. l := len(dAtA)
  2177. iNdEx := 0
  2178. for iNdEx < l {
  2179. preIndex := iNdEx
  2180. var wire uint64
  2181. for shift := uint(0); ; shift += 7 {
  2182. if shift >= 64 {
  2183. return ErrIntOverflowRaft
  2184. }
  2185. if iNdEx >= l {
  2186. return io.ErrUnexpectedEOF
  2187. }
  2188. b := dAtA[iNdEx]
  2189. iNdEx++
  2190. wire |= (uint64(b) & 0x7F) << shift
  2191. if b < 0x80 {
  2192. break
  2193. }
  2194. }
  2195. fieldNum := int32(wire >> 3)
  2196. wireType := int(wire & 0x7)
  2197. if wireType == 4 {
  2198. return fmt.Errorf("proto: JoinRequest: wiretype end group for non-group")
  2199. }
  2200. if fieldNum <= 0 {
  2201. return fmt.Errorf("proto: JoinRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2202. }
  2203. switch fieldNum {
  2204. case 1:
  2205. if wireType != 2 {
  2206. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2207. }
  2208. var stringLen uint64
  2209. for shift := uint(0); ; shift += 7 {
  2210. if shift >= 64 {
  2211. return ErrIntOverflowRaft
  2212. }
  2213. if iNdEx >= l {
  2214. return io.ErrUnexpectedEOF
  2215. }
  2216. b := dAtA[iNdEx]
  2217. iNdEx++
  2218. stringLen |= (uint64(b) & 0x7F) << shift
  2219. if b < 0x80 {
  2220. break
  2221. }
  2222. }
  2223. intStringLen := int(stringLen)
  2224. if intStringLen < 0 {
  2225. return ErrInvalidLengthRaft
  2226. }
  2227. postIndex := iNdEx + intStringLen
  2228. if postIndex > l {
  2229. return io.ErrUnexpectedEOF
  2230. }
  2231. m.Addr = string(dAtA[iNdEx:postIndex])
  2232. iNdEx = postIndex
  2233. default:
  2234. iNdEx = preIndex
  2235. skippy, err := skipRaft(dAtA[iNdEx:])
  2236. if err != nil {
  2237. return err
  2238. }
  2239. if skippy < 0 {
  2240. return ErrInvalidLengthRaft
  2241. }
  2242. if (iNdEx + skippy) > l {
  2243. return io.ErrUnexpectedEOF
  2244. }
  2245. iNdEx += skippy
  2246. }
  2247. }
  2248. if iNdEx > l {
  2249. return io.ErrUnexpectedEOF
  2250. }
  2251. return nil
  2252. }
  2253. func (m *JoinResponse) Unmarshal(dAtA []byte) error {
  2254. l := len(dAtA)
  2255. iNdEx := 0
  2256. for iNdEx < l {
  2257. preIndex := iNdEx
  2258. var wire uint64
  2259. for shift := uint(0); ; shift += 7 {
  2260. if shift >= 64 {
  2261. return ErrIntOverflowRaft
  2262. }
  2263. if iNdEx >= l {
  2264. return io.ErrUnexpectedEOF
  2265. }
  2266. b := dAtA[iNdEx]
  2267. iNdEx++
  2268. wire |= (uint64(b) & 0x7F) << shift
  2269. if b < 0x80 {
  2270. break
  2271. }
  2272. }
  2273. fieldNum := int32(wire >> 3)
  2274. wireType := int(wire & 0x7)
  2275. if wireType == 4 {
  2276. return fmt.Errorf("proto: JoinResponse: wiretype end group for non-group")
  2277. }
  2278. if fieldNum <= 0 {
  2279. return fmt.Errorf("proto: JoinResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2280. }
  2281. switch fieldNum {
  2282. case 1:
  2283. if wireType != 0 {
  2284. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2285. }
  2286. m.RaftID = 0
  2287. for shift := uint(0); ; shift += 7 {
  2288. if shift >= 64 {
  2289. return ErrIntOverflowRaft
  2290. }
  2291. if iNdEx >= l {
  2292. return io.ErrUnexpectedEOF
  2293. }
  2294. b := dAtA[iNdEx]
  2295. iNdEx++
  2296. m.RaftID |= (uint64(b) & 0x7F) << shift
  2297. if b < 0x80 {
  2298. break
  2299. }
  2300. }
  2301. case 2:
  2302. if wireType != 2 {
  2303. return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
  2304. }
  2305. var msglen int
  2306. for shift := uint(0); ; shift += 7 {
  2307. if shift >= 64 {
  2308. return ErrIntOverflowRaft
  2309. }
  2310. if iNdEx >= l {
  2311. return io.ErrUnexpectedEOF
  2312. }
  2313. b := dAtA[iNdEx]
  2314. iNdEx++
  2315. msglen |= (int(b) & 0x7F) << shift
  2316. if b < 0x80 {
  2317. break
  2318. }
  2319. }
  2320. if msglen < 0 {
  2321. return ErrInvalidLengthRaft
  2322. }
  2323. postIndex := iNdEx + msglen
  2324. if postIndex > l {
  2325. return io.ErrUnexpectedEOF
  2326. }
  2327. m.Members = append(m.Members, &RaftMember{})
  2328. if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2329. return err
  2330. }
  2331. iNdEx = postIndex
  2332. case 3:
  2333. if wireType == 0 {
  2334. var v uint64
  2335. for shift := uint(0); ; shift += 7 {
  2336. if shift >= 64 {
  2337. return ErrIntOverflowRaft
  2338. }
  2339. if iNdEx >= l {
  2340. return io.ErrUnexpectedEOF
  2341. }
  2342. b := dAtA[iNdEx]
  2343. iNdEx++
  2344. v |= (uint64(b) & 0x7F) << shift
  2345. if b < 0x80 {
  2346. break
  2347. }
  2348. }
  2349. m.RemovedMembers = append(m.RemovedMembers, v)
  2350. } else if wireType == 2 {
  2351. var packedLen int
  2352. for shift := uint(0); ; shift += 7 {
  2353. if shift >= 64 {
  2354. return ErrIntOverflowRaft
  2355. }
  2356. if iNdEx >= l {
  2357. return io.ErrUnexpectedEOF
  2358. }
  2359. b := dAtA[iNdEx]
  2360. iNdEx++
  2361. packedLen |= (int(b) & 0x7F) << shift
  2362. if b < 0x80 {
  2363. break
  2364. }
  2365. }
  2366. if packedLen < 0 {
  2367. return ErrInvalidLengthRaft
  2368. }
  2369. postIndex := iNdEx + packedLen
  2370. if postIndex > l {
  2371. return io.ErrUnexpectedEOF
  2372. }
  2373. for iNdEx < postIndex {
  2374. var v uint64
  2375. for shift := uint(0); ; shift += 7 {
  2376. if shift >= 64 {
  2377. return ErrIntOverflowRaft
  2378. }
  2379. if iNdEx >= l {
  2380. return io.ErrUnexpectedEOF
  2381. }
  2382. b := dAtA[iNdEx]
  2383. iNdEx++
  2384. v |= (uint64(b) & 0x7F) << shift
  2385. if b < 0x80 {
  2386. break
  2387. }
  2388. }
  2389. m.RemovedMembers = append(m.RemovedMembers, v)
  2390. }
  2391. } else {
  2392. return fmt.Errorf("proto: wrong wireType = %d for field RemovedMembers", wireType)
  2393. }
  2394. default:
  2395. iNdEx = preIndex
  2396. skippy, err := skipRaft(dAtA[iNdEx:])
  2397. if err != nil {
  2398. return err
  2399. }
  2400. if skippy < 0 {
  2401. return ErrInvalidLengthRaft
  2402. }
  2403. if (iNdEx + skippy) > l {
  2404. return io.ErrUnexpectedEOF
  2405. }
  2406. iNdEx += skippy
  2407. }
  2408. }
  2409. if iNdEx > l {
  2410. return io.ErrUnexpectedEOF
  2411. }
  2412. return nil
  2413. }
  2414. func (m *LeaveRequest) Unmarshal(dAtA []byte) error {
  2415. l := len(dAtA)
  2416. iNdEx := 0
  2417. for iNdEx < l {
  2418. preIndex := iNdEx
  2419. var wire uint64
  2420. for shift := uint(0); ; shift += 7 {
  2421. if shift >= 64 {
  2422. return ErrIntOverflowRaft
  2423. }
  2424. if iNdEx >= l {
  2425. return io.ErrUnexpectedEOF
  2426. }
  2427. b := dAtA[iNdEx]
  2428. iNdEx++
  2429. wire |= (uint64(b) & 0x7F) << shift
  2430. if b < 0x80 {
  2431. break
  2432. }
  2433. }
  2434. fieldNum := int32(wire >> 3)
  2435. wireType := int(wire & 0x7)
  2436. if wireType == 4 {
  2437. return fmt.Errorf("proto: LeaveRequest: wiretype end group for non-group")
  2438. }
  2439. if fieldNum <= 0 {
  2440. return fmt.Errorf("proto: LeaveRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2441. }
  2442. switch fieldNum {
  2443. case 1:
  2444. if wireType != 2 {
  2445. return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
  2446. }
  2447. var msglen int
  2448. for shift := uint(0); ; shift += 7 {
  2449. if shift >= 64 {
  2450. return ErrIntOverflowRaft
  2451. }
  2452. if iNdEx >= l {
  2453. return io.ErrUnexpectedEOF
  2454. }
  2455. b := dAtA[iNdEx]
  2456. iNdEx++
  2457. msglen |= (int(b) & 0x7F) << shift
  2458. if b < 0x80 {
  2459. break
  2460. }
  2461. }
  2462. if msglen < 0 {
  2463. return ErrInvalidLengthRaft
  2464. }
  2465. postIndex := iNdEx + msglen
  2466. if postIndex > l {
  2467. return io.ErrUnexpectedEOF
  2468. }
  2469. if m.Node == nil {
  2470. m.Node = &RaftMember{}
  2471. }
  2472. if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2473. return err
  2474. }
  2475. iNdEx = postIndex
  2476. default:
  2477. iNdEx = preIndex
  2478. skippy, err := skipRaft(dAtA[iNdEx:])
  2479. if err != nil {
  2480. return err
  2481. }
  2482. if skippy < 0 {
  2483. return ErrInvalidLengthRaft
  2484. }
  2485. if (iNdEx + skippy) > l {
  2486. return io.ErrUnexpectedEOF
  2487. }
  2488. iNdEx += skippy
  2489. }
  2490. }
  2491. if iNdEx > l {
  2492. return io.ErrUnexpectedEOF
  2493. }
  2494. return nil
  2495. }
  2496. func (m *LeaveResponse) Unmarshal(dAtA []byte) error {
  2497. l := len(dAtA)
  2498. iNdEx := 0
  2499. for iNdEx < l {
  2500. preIndex := iNdEx
  2501. var wire uint64
  2502. for shift := uint(0); ; shift += 7 {
  2503. if shift >= 64 {
  2504. return ErrIntOverflowRaft
  2505. }
  2506. if iNdEx >= l {
  2507. return io.ErrUnexpectedEOF
  2508. }
  2509. b := dAtA[iNdEx]
  2510. iNdEx++
  2511. wire |= (uint64(b) & 0x7F) << shift
  2512. if b < 0x80 {
  2513. break
  2514. }
  2515. }
  2516. fieldNum := int32(wire >> 3)
  2517. wireType := int(wire & 0x7)
  2518. if wireType == 4 {
  2519. return fmt.Errorf("proto: LeaveResponse: wiretype end group for non-group")
  2520. }
  2521. if fieldNum <= 0 {
  2522. return fmt.Errorf("proto: LeaveResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2523. }
  2524. switch fieldNum {
  2525. default:
  2526. iNdEx = preIndex
  2527. skippy, err := skipRaft(dAtA[iNdEx:])
  2528. if err != nil {
  2529. return err
  2530. }
  2531. if skippy < 0 {
  2532. return ErrInvalidLengthRaft
  2533. }
  2534. if (iNdEx + skippy) > l {
  2535. return io.ErrUnexpectedEOF
  2536. }
  2537. iNdEx += skippy
  2538. }
  2539. }
  2540. if iNdEx > l {
  2541. return io.ErrUnexpectedEOF
  2542. }
  2543. return nil
  2544. }
  2545. func (m *ProcessRaftMessageRequest) Unmarshal(dAtA []byte) error {
  2546. l := len(dAtA)
  2547. iNdEx := 0
  2548. for iNdEx < l {
  2549. preIndex := iNdEx
  2550. var wire uint64
  2551. for shift := uint(0); ; shift += 7 {
  2552. if shift >= 64 {
  2553. return ErrIntOverflowRaft
  2554. }
  2555. if iNdEx >= l {
  2556. return io.ErrUnexpectedEOF
  2557. }
  2558. b := dAtA[iNdEx]
  2559. iNdEx++
  2560. wire |= (uint64(b) & 0x7F) << shift
  2561. if b < 0x80 {
  2562. break
  2563. }
  2564. }
  2565. fieldNum := int32(wire >> 3)
  2566. wireType := int(wire & 0x7)
  2567. if wireType == 4 {
  2568. return fmt.Errorf("proto: ProcessRaftMessageRequest: wiretype end group for non-group")
  2569. }
  2570. if fieldNum <= 0 {
  2571. return fmt.Errorf("proto: ProcessRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2572. }
  2573. switch fieldNum {
  2574. case 1:
  2575. if wireType != 2 {
  2576. return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
  2577. }
  2578. var msglen int
  2579. for shift := uint(0); ; shift += 7 {
  2580. if shift >= 64 {
  2581. return ErrIntOverflowRaft
  2582. }
  2583. if iNdEx >= l {
  2584. return io.ErrUnexpectedEOF
  2585. }
  2586. b := dAtA[iNdEx]
  2587. iNdEx++
  2588. msglen |= (int(b) & 0x7F) << shift
  2589. if b < 0x80 {
  2590. break
  2591. }
  2592. }
  2593. if msglen < 0 {
  2594. return ErrInvalidLengthRaft
  2595. }
  2596. postIndex := iNdEx + msglen
  2597. if postIndex > l {
  2598. return io.ErrUnexpectedEOF
  2599. }
  2600. if m.Message == nil {
  2601. m.Message = &raftpb.Message{}
  2602. }
  2603. if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2604. return err
  2605. }
  2606. iNdEx = postIndex
  2607. default:
  2608. iNdEx = preIndex
  2609. skippy, err := skipRaft(dAtA[iNdEx:])
  2610. if err != nil {
  2611. return err
  2612. }
  2613. if skippy < 0 {
  2614. return ErrInvalidLengthRaft
  2615. }
  2616. if (iNdEx + skippy) > l {
  2617. return io.ErrUnexpectedEOF
  2618. }
  2619. iNdEx += skippy
  2620. }
  2621. }
  2622. if iNdEx > l {
  2623. return io.ErrUnexpectedEOF
  2624. }
  2625. return nil
  2626. }
  2627. func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error {
  2628. l := len(dAtA)
  2629. iNdEx := 0
  2630. for iNdEx < l {
  2631. preIndex := iNdEx
  2632. var wire uint64
  2633. for shift := uint(0); ; shift += 7 {
  2634. if shift >= 64 {
  2635. return ErrIntOverflowRaft
  2636. }
  2637. if iNdEx >= l {
  2638. return io.ErrUnexpectedEOF
  2639. }
  2640. b := dAtA[iNdEx]
  2641. iNdEx++
  2642. wire |= (uint64(b) & 0x7F) << shift
  2643. if b < 0x80 {
  2644. break
  2645. }
  2646. }
  2647. fieldNum := int32(wire >> 3)
  2648. wireType := int(wire & 0x7)
  2649. if wireType == 4 {
  2650. return fmt.Errorf("proto: ProcessRaftMessageResponse: wiretype end group for non-group")
  2651. }
  2652. if fieldNum <= 0 {
  2653. return fmt.Errorf("proto: ProcessRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2654. }
  2655. switch fieldNum {
  2656. default:
  2657. iNdEx = preIndex
  2658. skippy, err := skipRaft(dAtA[iNdEx:])
  2659. if err != nil {
  2660. return err
  2661. }
  2662. if skippy < 0 {
  2663. return ErrInvalidLengthRaft
  2664. }
  2665. if (iNdEx + skippy) > l {
  2666. return io.ErrUnexpectedEOF
  2667. }
  2668. iNdEx += skippy
  2669. }
  2670. }
  2671. if iNdEx > l {
  2672. return io.ErrUnexpectedEOF
  2673. }
  2674. return nil
  2675. }
  2676. func (m *ResolveAddressRequest) Unmarshal(dAtA []byte) error {
  2677. l := len(dAtA)
  2678. iNdEx := 0
  2679. for iNdEx < l {
  2680. preIndex := iNdEx
  2681. var wire uint64
  2682. for shift := uint(0); ; shift += 7 {
  2683. if shift >= 64 {
  2684. return ErrIntOverflowRaft
  2685. }
  2686. if iNdEx >= l {
  2687. return io.ErrUnexpectedEOF
  2688. }
  2689. b := dAtA[iNdEx]
  2690. iNdEx++
  2691. wire |= (uint64(b) & 0x7F) << shift
  2692. if b < 0x80 {
  2693. break
  2694. }
  2695. }
  2696. fieldNum := int32(wire >> 3)
  2697. wireType := int(wire & 0x7)
  2698. if wireType == 4 {
  2699. return fmt.Errorf("proto: ResolveAddressRequest: wiretype end group for non-group")
  2700. }
  2701. if fieldNum <= 0 {
  2702. return fmt.Errorf("proto: ResolveAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2703. }
  2704. switch fieldNum {
  2705. case 1:
  2706. if wireType != 0 {
  2707. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2708. }
  2709. m.RaftID = 0
  2710. for shift := uint(0); ; shift += 7 {
  2711. if shift >= 64 {
  2712. return ErrIntOverflowRaft
  2713. }
  2714. if iNdEx >= l {
  2715. return io.ErrUnexpectedEOF
  2716. }
  2717. b := dAtA[iNdEx]
  2718. iNdEx++
  2719. m.RaftID |= (uint64(b) & 0x7F) << shift
  2720. if b < 0x80 {
  2721. break
  2722. }
  2723. }
  2724. default:
  2725. iNdEx = preIndex
  2726. skippy, err := skipRaft(dAtA[iNdEx:])
  2727. if err != nil {
  2728. return err
  2729. }
  2730. if skippy < 0 {
  2731. return ErrInvalidLengthRaft
  2732. }
  2733. if (iNdEx + skippy) > l {
  2734. return io.ErrUnexpectedEOF
  2735. }
  2736. iNdEx += skippy
  2737. }
  2738. }
  2739. if iNdEx > l {
  2740. return io.ErrUnexpectedEOF
  2741. }
  2742. return nil
  2743. }
  2744. func (m *ResolveAddressResponse) Unmarshal(dAtA []byte) error {
  2745. l := len(dAtA)
  2746. iNdEx := 0
  2747. for iNdEx < l {
  2748. preIndex := iNdEx
  2749. var wire uint64
  2750. for shift := uint(0); ; shift += 7 {
  2751. if shift >= 64 {
  2752. return ErrIntOverflowRaft
  2753. }
  2754. if iNdEx >= l {
  2755. return io.ErrUnexpectedEOF
  2756. }
  2757. b := dAtA[iNdEx]
  2758. iNdEx++
  2759. wire |= (uint64(b) & 0x7F) << shift
  2760. if b < 0x80 {
  2761. break
  2762. }
  2763. }
  2764. fieldNum := int32(wire >> 3)
  2765. wireType := int(wire & 0x7)
  2766. if wireType == 4 {
  2767. return fmt.Errorf("proto: ResolveAddressResponse: wiretype end group for non-group")
  2768. }
  2769. if fieldNum <= 0 {
  2770. return fmt.Errorf("proto: ResolveAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2771. }
  2772. switch fieldNum {
  2773. case 1:
  2774. if wireType != 2 {
  2775. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2776. }
  2777. var stringLen uint64
  2778. for shift := uint(0); ; shift += 7 {
  2779. if shift >= 64 {
  2780. return ErrIntOverflowRaft
  2781. }
  2782. if iNdEx >= l {
  2783. return io.ErrUnexpectedEOF
  2784. }
  2785. b := dAtA[iNdEx]
  2786. iNdEx++
  2787. stringLen |= (uint64(b) & 0x7F) << shift
  2788. if b < 0x80 {
  2789. break
  2790. }
  2791. }
  2792. intStringLen := int(stringLen)
  2793. if intStringLen < 0 {
  2794. return ErrInvalidLengthRaft
  2795. }
  2796. postIndex := iNdEx + intStringLen
  2797. if postIndex > l {
  2798. return io.ErrUnexpectedEOF
  2799. }
  2800. m.Addr = string(dAtA[iNdEx:postIndex])
  2801. iNdEx = postIndex
  2802. default:
  2803. iNdEx = preIndex
  2804. skippy, err := skipRaft(dAtA[iNdEx:])
  2805. if err != nil {
  2806. return err
  2807. }
  2808. if skippy < 0 {
  2809. return ErrInvalidLengthRaft
  2810. }
  2811. if (iNdEx + skippy) > l {
  2812. return io.ErrUnexpectedEOF
  2813. }
  2814. iNdEx += skippy
  2815. }
  2816. }
  2817. if iNdEx > l {
  2818. return io.ErrUnexpectedEOF
  2819. }
  2820. return nil
  2821. }
  2822. func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error {
  2823. l := len(dAtA)
  2824. iNdEx := 0
  2825. for iNdEx < l {
  2826. preIndex := iNdEx
  2827. var wire uint64
  2828. for shift := uint(0); ; shift += 7 {
  2829. if shift >= 64 {
  2830. return ErrIntOverflowRaft
  2831. }
  2832. if iNdEx >= l {
  2833. return io.ErrUnexpectedEOF
  2834. }
  2835. b := dAtA[iNdEx]
  2836. iNdEx++
  2837. wire |= (uint64(b) & 0x7F) << shift
  2838. if b < 0x80 {
  2839. break
  2840. }
  2841. }
  2842. fieldNum := int32(wire >> 3)
  2843. wireType := int(wire & 0x7)
  2844. if wireType == 4 {
  2845. return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group")
  2846. }
  2847. if fieldNum <= 0 {
  2848. return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2849. }
  2850. switch fieldNum {
  2851. case 1:
  2852. if wireType != 0 {
  2853. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2854. }
  2855. m.ID = 0
  2856. for shift := uint(0); ; shift += 7 {
  2857. if shift >= 64 {
  2858. return ErrIntOverflowRaft
  2859. }
  2860. if iNdEx >= l {
  2861. return io.ErrUnexpectedEOF
  2862. }
  2863. b := dAtA[iNdEx]
  2864. iNdEx++
  2865. m.ID |= (uint64(b) & 0x7F) << shift
  2866. if b < 0x80 {
  2867. break
  2868. }
  2869. }
  2870. case 2:
  2871. if wireType != 2 {
  2872. return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  2873. }
  2874. var msglen int
  2875. for shift := uint(0); ; shift += 7 {
  2876. if shift >= 64 {
  2877. return ErrIntOverflowRaft
  2878. }
  2879. if iNdEx >= l {
  2880. return io.ErrUnexpectedEOF
  2881. }
  2882. b := dAtA[iNdEx]
  2883. iNdEx++
  2884. msglen |= (int(b) & 0x7F) << shift
  2885. if b < 0x80 {
  2886. break
  2887. }
  2888. }
  2889. if msglen < 0 {
  2890. return ErrInvalidLengthRaft
  2891. }
  2892. postIndex := iNdEx + msglen
  2893. if postIndex > l {
  2894. return io.ErrUnexpectedEOF
  2895. }
  2896. m.Action = append(m.Action, StoreAction{})
  2897. if err := m.Action[len(m.Action)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2898. return err
  2899. }
  2900. iNdEx = postIndex
  2901. default:
  2902. iNdEx = preIndex
  2903. skippy, err := skipRaft(dAtA[iNdEx:])
  2904. if err != nil {
  2905. return err
  2906. }
  2907. if skippy < 0 {
  2908. return ErrInvalidLengthRaft
  2909. }
  2910. if (iNdEx + skippy) > l {
  2911. return io.ErrUnexpectedEOF
  2912. }
  2913. iNdEx += skippy
  2914. }
  2915. }
  2916. if iNdEx > l {
  2917. return io.ErrUnexpectedEOF
  2918. }
  2919. return nil
  2920. }
  2921. func (m *StoreAction) Unmarshal(dAtA []byte) error {
  2922. l := len(dAtA)
  2923. iNdEx := 0
  2924. for iNdEx < l {
  2925. preIndex := iNdEx
  2926. var wire uint64
  2927. for shift := uint(0); ; shift += 7 {
  2928. if shift >= 64 {
  2929. return ErrIntOverflowRaft
  2930. }
  2931. if iNdEx >= l {
  2932. return io.ErrUnexpectedEOF
  2933. }
  2934. b := dAtA[iNdEx]
  2935. iNdEx++
  2936. wire |= (uint64(b) & 0x7F) << shift
  2937. if b < 0x80 {
  2938. break
  2939. }
  2940. }
  2941. fieldNum := int32(wire >> 3)
  2942. wireType := int(wire & 0x7)
  2943. if wireType == 4 {
  2944. return fmt.Errorf("proto: StoreAction: wiretype end group for non-group")
  2945. }
  2946. if fieldNum <= 0 {
  2947. return fmt.Errorf("proto: StoreAction: illegal tag %d (wire type %d)", fieldNum, wire)
  2948. }
  2949. switch fieldNum {
  2950. case 1:
  2951. if wireType != 0 {
  2952. return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  2953. }
  2954. m.Action = 0
  2955. for shift := uint(0); ; shift += 7 {
  2956. if shift >= 64 {
  2957. return ErrIntOverflowRaft
  2958. }
  2959. if iNdEx >= l {
  2960. return io.ErrUnexpectedEOF
  2961. }
  2962. b := dAtA[iNdEx]
  2963. iNdEx++
  2964. m.Action |= (StoreActionKind(b) & 0x7F) << shift
  2965. if b < 0x80 {
  2966. break
  2967. }
  2968. }
  2969. case 2:
  2970. if wireType != 2 {
  2971. return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
  2972. }
  2973. var msglen int
  2974. for shift := uint(0); ; shift += 7 {
  2975. if shift >= 64 {
  2976. return ErrIntOverflowRaft
  2977. }
  2978. if iNdEx >= l {
  2979. return io.ErrUnexpectedEOF
  2980. }
  2981. b := dAtA[iNdEx]
  2982. iNdEx++
  2983. msglen |= (int(b) & 0x7F) << shift
  2984. if b < 0x80 {
  2985. break
  2986. }
  2987. }
  2988. if msglen < 0 {
  2989. return ErrInvalidLengthRaft
  2990. }
  2991. postIndex := iNdEx + msglen
  2992. if postIndex > l {
  2993. return io.ErrUnexpectedEOF
  2994. }
  2995. v := &Node{}
  2996. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2997. return err
  2998. }
  2999. m.Target = &StoreAction_Node{v}
  3000. iNdEx = postIndex
  3001. case 3:
  3002. if wireType != 2 {
  3003. return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
  3004. }
  3005. var msglen int
  3006. for shift := uint(0); ; shift += 7 {
  3007. if shift >= 64 {
  3008. return ErrIntOverflowRaft
  3009. }
  3010. if iNdEx >= l {
  3011. return io.ErrUnexpectedEOF
  3012. }
  3013. b := dAtA[iNdEx]
  3014. iNdEx++
  3015. msglen |= (int(b) & 0x7F) << shift
  3016. if b < 0x80 {
  3017. break
  3018. }
  3019. }
  3020. if msglen < 0 {
  3021. return ErrInvalidLengthRaft
  3022. }
  3023. postIndex := iNdEx + msglen
  3024. if postIndex > l {
  3025. return io.ErrUnexpectedEOF
  3026. }
  3027. v := &Service{}
  3028. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3029. return err
  3030. }
  3031. m.Target = &StoreAction_Service{v}
  3032. iNdEx = postIndex
  3033. case 4:
  3034. if wireType != 2 {
  3035. return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
  3036. }
  3037. var msglen int
  3038. for shift := uint(0); ; shift += 7 {
  3039. if shift >= 64 {
  3040. return ErrIntOverflowRaft
  3041. }
  3042. if iNdEx >= l {
  3043. return io.ErrUnexpectedEOF
  3044. }
  3045. b := dAtA[iNdEx]
  3046. iNdEx++
  3047. msglen |= (int(b) & 0x7F) << shift
  3048. if b < 0x80 {
  3049. break
  3050. }
  3051. }
  3052. if msglen < 0 {
  3053. return ErrInvalidLengthRaft
  3054. }
  3055. postIndex := iNdEx + msglen
  3056. if postIndex > l {
  3057. return io.ErrUnexpectedEOF
  3058. }
  3059. v := &Task{}
  3060. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3061. return err
  3062. }
  3063. m.Target = &StoreAction_Task{v}
  3064. iNdEx = postIndex
  3065. case 5:
  3066. if wireType != 2 {
  3067. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  3068. }
  3069. var msglen int
  3070. for shift := uint(0); ; shift += 7 {
  3071. if shift >= 64 {
  3072. return ErrIntOverflowRaft
  3073. }
  3074. if iNdEx >= l {
  3075. return io.ErrUnexpectedEOF
  3076. }
  3077. b := dAtA[iNdEx]
  3078. iNdEx++
  3079. msglen |= (int(b) & 0x7F) << shift
  3080. if b < 0x80 {
  3081. break
  3082. }
  3083. }
  3084. if msglen < 0 {
  3085. return ErrInvalidLengthRaft
  3086. }
  3087. postIndex := iNdEx + msglen
  3088. if postIndex > l {
  3089. return io.ErrUnexpectedEOF
  3090. }
  3091. v := &Network{}
  3092. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3093. return err
  3094. }
  3095. m.Target = &StoreAction_Network{v}
  3096. iNdEx = postIndex
  3097. case 6:
  3098. if wireType != 2 {
  3099. return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
  3100. }
  3101. var msglen int
  3102. for shift := uint(0); ; shift += 7 {
  3103. if shift >= 64 {
  3104. return ErrIntOverflowRaft
  3105. }
  3106. if iNdEx >= l {
  3107. return io.ErrUnexpectedEOF
  3108. }
  3109. b := dAtA[iNdEx]
  3110. iNdEx++
  3111. msglen |= (int(b) & 0x7F) << shift
  3112. if b < 0x80 {
  3113. break
  3114. }
  3115. }
  3116. if msglen < 0 {
  3117. return ErrInvalidLengthRaft
  3118. }
  3119. postIndex := iNdEx + msglen
  3120. if postIndex > l {
  3121. return io.ErrUnexpectedEOF
  3122. }
  3123. v := &Cluster{}
  3124. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3125. return err
  3126. }
  3127. m.Target = &StoreAction_Cluster{v}
  3128. iNdEx = postIndex
  3129. case 7:
  3130. if wireType != 2 {
  3131. return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType)
  3132. }
  3133. var msglen int
  3134. for shift := uint(0); ; shift += 7 {
  3135. if shift >= 64 {
  3136. return ErrIntOverflowRaft
  3137. }
  3138. if iNdEx >= l {
  3139. return io.ErrUnexpectedEOF
  3140. }
  3141. b := dAtA[iNdEx]
  3142. iNdEx++
  3143. msglen |= (int(b) & 0x7F) << shift
  3144. if b < 0x80 {
  3145. break
  3146. }
  3147. }
  3148. if msglen < 0 {
  3149. return ErrInvalidLengthRaft
  3150. }
  3151. postIndex := iNdEx + msglen
  3152. if postIndex > l {
  3153. return io.ErrUnexpectedEOF
  3154. }
  3155. v := &Secret{}
  3156. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3157. return err
  3158. }
  3159. m.Target = &StoreAction_Secret{v}
  3160. iNdEx = postIndex
  3161. case 8:
  3162. if wireType != 2 {
  3163. return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
  3164. }
  3165. var msglen int
  3166. for shift := uint(0); ; shift += 7 {
  3167. if shift >= 64 {
  3168. return ErrIntOverflowRaft
  3169. }
  3170. if iNdEx >= l {
  3171. return io.ErrUnexpectedEOF
  3172. }
  3173. b := dAtA[iNdEx]
  3174. iNdEx++
  3175. msglen |= (int(b) & 0x7F) << shift
  3176. if b < 0x80 {
  3177. break
  3178. }
  3179. }
  3180. if msglen < 0 {
  3181. return ErrInvalidLengthRaft
  3182. }
  3183. postIndex := iNdEx + msglen
  3184. if postIndex > l {
  3185. return io.ErrUnexpectedEOF
  3186. }
  3187. v := &Resource{}
  3188. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3189. return err
  3190. }
  3191. m.Target = &StoreAction_Resource{v}
  3192. iNdEx = postIndex
  3193. case 9:
  3194. if wireType != 2 {
  3195. return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
  3196. }
  3197. var msglen int
  3198. for shift := uint(0); ; shift += 7 {
  3199. if shift >= 64 {
  3200. return ErrIntOverflowRaft
  3201. }
  3202. if iNdEx >= l {
  3203. return io.ErrUnexpectedEOF
  3204. }
  3205. b := dAtA[iNdEx]
  3206. iNdEx++
  3207. msglen |= (int(b) & 0x7F) << shift
  3208. if b < 0x80 {
  3209. break
  3210. }
  3211. }
  3212. if msglen < 0 {
  3213. return ErrInvalidLengthRaft
  3214. }
  3215. postIndex := iNdEx + msglen
  3216. if postIndex > l {
  3217. return io.ErrUnexpectedEOF
  3218. }
  3219. v := &Extension{}
  3220. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3221. return err
  3222. }
  3223. m.Target = &StoreAction_Extension{v}
  3224. iNdEx = postIndex
  3225. case 10:
  3226. if wireType != 2 {
  3227. return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
  3228. }
  3229. var msglen int
  3230. for shift := uint(0); ; shift += 7 {
  3231. if shift >= 64 {
  3232. return ErrIntOverflowRaft
  3233. }
  3234. if iNdEx >= l {
  3235. return io.ErrUnexpectedEOF
  3236. }
  3237. b := dAtA[iNdEx]
  3238. iNdEx++
  3239. msglen |= (int(b) & 0x7F) << shift
  3240. if b < 0x80 {
  3241. break
  3242. }
  3243. }
  3244. if msglen < 0 {
  3245. return ErrInvalidLengthRaft
  3246. }
  3247. postIndex := iNdEx + msglen
  3248. if postIndex > l {
  3249. return io.ErrUnexpectedEOF
  3250. }
  3251. v := &Config{}
  3252. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3253. return err
  3254. }
  3255. m.Target = &StoreAction_Config{v}
  3256. iNdEx = postIndex
  3257. default:
  3258. iNdEx = preIndex
  3259. skippy, err := skipRaft(dAtA[iNdEx:])
  3260. if err != nil {
  3261. return err
  3262. }
  3263. if skippy < 0 {
  3264. return ErrInvalidLengthRaft
  3265. }
  3266. if (iNdEx + skippy) > l {
  3267. return io.ErrUnexpectedEOF
  3268. }
  3269. iNdEx += skippy
  3270. }
  3271. }
  3272. if iNdEx > l {
  3273. return io.ErrUnexpectedEOF
  3274. }
  3275. return nil
  3276. }
  3277. func skipRaft(dAtA []byte) (n int, err error) {
  3278. l := len(dAtA)
  3279. iNdEx := 0
  3280. for iNdEx < l {
  3281. var wire uint64
  3282. for shift := uint(0); ; shift += 7 {
  3283. if shift >= 64 {
  3284. return 0, ErrIntOverflowRaft
  3285. }
  3286. if iNdEx >= l {
  3287. return 0, io.ErrUnexpectedEOF
  3288. }
  3289. b := dAtA[iNdEx]
  3290. iNdEx++
  3291. wire |= (uint64(b) & 0x7F) << shift
  3292. if b < 0x80 {
  3293. break
  3294. }
  3295. }
  3296. wireType := int(wire & 0x7)
  3297. switch wireType {
  3298. case 0:
  3299. for shift := uint(0); ; shift += 7 {
  3300. if shift >= 64 {
  3301. return 0, ErrIntOverflowRaft
  3302. }
  3303. if iNdEx >= l {
  3304. return 0, io.ErrUnexpectedEOF
  3305. }
  3306. iNdEx++
  3307. if dAtA[iNdEx-1] < 0x80 {
  3308. break
  3309. }
  3310. }
  3311. return iNdEx, nil
  3312. case 1:
  3313. iNdEx += 8
  3314. return iNdEx, nil
  3315. case 2:
  3316. var length int
  3317. for shift := uint(0); ; shift += 7 {
  3318. if shift >= 64 {
  3319. return 0, ErrIntOverflowRaft
  3320. }
  3321. if iNdEx >= l {
  3322. return 0, io.ErrUnexpectedEOF
  3323. }
  3324. b := dAtA[iNdEx]
  3325. iNdEx++
  3326. length |= (int(b) & 0x7F) << shift
  3327. if b < 0x80 {
  3328. break
  3329. }
  3330. }
  3331. iNdEx += length
  3332. if length < 0 {
  3333. return 0, ErrInvalidLengthRaft
  3334. }
  3335. return iNdEx, nil
  3336. case 3:
  3337. for {
  3338. var innerWire uint64
  3339. var start int = iNdEx
  3340. for shift := uint(0); ; shift += 7 {
  3341. if shift >= 64 {
  3342. return 0, ErrIntOverflowRaft
  3343. }
  3344. if iNdEx >= l {
  3345. return 0, io.ErrUnexpectedEOF
  3346. }
  3347. b := dAtA[iNdEx]
  3348. iNdEx++
  3349. innerWire |= (uint64(b) & 0x7F) << shift
  3350. if b < 0x80 {
  3351. break
  3352. }
  3353. }
  3354. innerWireType := int(innerWire & 0x7)
  3355. if innerWireType == 4 {
  3356. break
  3357. }
  3358. next, err := skipRaft(dAtA[start:])
  3359. if err != nil {
  3360. return 0, err
  3361. }
  3362. iNdEx = start + next
  3363. }
  3364. return iNdEx, nil
  3365. case 4:
  3366. return iNdEx, nil
  3367. case 5:
  3368. iNdEx += 4
  3369. return iNdEx, nil
  3370. default:
  3371. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  3372. }
  3373. }
  3374. panic("unreachable")
  3375. }
  3376. var (
  3377. ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling")
  3378. ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow")
  3379. )
  3380. func init() { proto.RegisterFile("raft.proto", fileDescriptorRaft) }
  3381. var fileDescriptorRaft = []byte{
  3382. // 953 bytes of a gzipped FileDescriptorProto
  3383. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0x4d, 0x6f, 0x1b, 0x45,
  3384. 0x18, 0xc7, 0x77, 0xd7, 0x5b, 0x27, 0x79, 0xdc, 0xbc, 0x68, 0x42, 0xc2, 0x76, 0x29, 0x8e, 0xbb,
  3385. 0x45, 0xc2, 0x2d, 0x64, 0x2d, 0x0c, 0x12, 0xa8, 0xd0, 0x43, 0xec, 0x58, 0xb2, 0x69, 0xeb, 0x54,
  3386. 0x9b, 0x04, 0x7a, 0x0b, 0xeb, 0xdd, 0x89, 0xbb, 0xd8, 0xde, 0x31, 0x33, 0x63, 0x07, 0x2e, 0xa8,
  3387. 0x47, 0x94, 0x2b, 0x07, 0x10, 0x52, 0x4f, 0x70, 0xee, 0x07, 0xe0, 0x03, 0xa0, 0x88, 0x13, 0x37,
  3388. 0x38, 0x45, 0xd4, 0x1f, 0x00, 0xbe, 0x02, 0x9a, 0xd9, 0x5d, 0x3b, 0x38, 0x6b, 0x37, 0x17, 0x7b,
  3389. 0x3c, 0xf3, 0xfb, 0x3f, 0xff, 0x79, 0xe6, 0xe5, 0x19, 0x03, 0x50, 0xf7, 0x98, 0xdb, 0x7d, 0x4a,
  3390. 0x38, 0x41, 0xc8, 0x27, 0x5e, 0x07, 0x53, 0x9b, 0x9d, 0xb8, 0xb4, 0xd7, 0x09, 0xb8, 0x3d, 0x7c,
  3391. 0xcf, 0x5c, 0x26, 0xad, 0x2f, 0xb1, 0xc7, 0x59, 0x84, 0x98, 0x39, 0xfe, 0x4d, 0x1f, 0x27, 0x3f,
  3392. 0xb6, 0xdb, 0x01, 0x7f, 0x3a, 0x68, 0xd9, 0x1e, 0xe9, 0x95, 0x3c, 0x42, 0x31, 0x61, 0x25, 0xcc,
  3393. 0x3d, 0xbf, 0x24, 0x42, 0xca, 0x8f, 0x7e, 0xab, 0x34, 0x09, 0x6f, 0xbe, 0xd6, 0x26, 0x6d, 0x22,
  3394. 0x9b, 0x25, 0xd1, 0x8a, 0x7b, 0xd7, 0xfb, 0xdd, 0x41, 0x3b, 0x08, 0x4b, 0xd1, 0x57, 0xd4, 0x69,
  3395. 0xbd, 0x50, 0x01, 0x1c, 0xf7, 0x98, 0x3f, 0xc2, 0xbd, 0x16, 0xa6, 0xe8, 0x36, 0x2c, 0x88, 0x38,
  3396. 0x47, 0x81, 0x6f, 0xa8, 0x05, 0xb5, 0xa8, 0x57, 0x60, 0x74, 0xbe, 0x95, 0x15, 0x40, 0x63, 0xd7,
  3397. 0xc9, 0x8a, 0xa1, 0x86, 0x2f, 0xa0, 0x90, 0xf8, 0x58, 0x40, 0x5a, 0x41, 0x2d, 0x2e, 0x45, 0x50,
  3398. 0x93, 0xf8, 0x58, 0x40, 0x62, 0xa8, 0xe1, 0x23, 0x04, 0xba, 0xeb, 0xfb, 0xd4, 0xc8, 0x08, 0xc2,
  3399. 0x91, 0x6d, 0x54, 0x81, 0x2c, 0xe3, 0x2e, 0x1f, 0x30, 0x43, 0x2f, 0xa8, 0xc5, 0x5c, 0xf9, 0x2d,
  3400. 0xfb, 0xf2, 0x3a, 0xd8, 0x93, 0xd9, 0xec, 0x4b, 0xb6, 0xa2, 0x9f, 0x9d, 0x6f, 0x29, 0x4e, 0xac,
  3401. 0xb4, 0x6e, 0x41, 0xee, 0x53, 0x12, 0x84, 0x0e, 0xfe, 0x6a, 0x80, 0x19, 0x1f, 0xdb, 0xa8, 0x13,
  3402. 0x1b, 0xeb, 0x27, 0x15, 0xae, 0x47, 0x0c, 0xeb, 0x93, 0x90, 0xe1, 0xab, 0x65, 0xf5, 0x11, 0x2c,
  3403. 0xf4, 0xa4, 0x2d, 0x33, 0xb4, 0x42, 0xa6, 0x98, 0x2b, 0xe7, 0xe7, 0xcf, 0xce, 0x49, 0x70, 0xf4,
  3404. 0x0e, 0xac, 0x52, 0xdc, 0x23, 0x43, 0xec, 0x1f, 0x25, 0x11, 0x32, 0x85, 0x4c, 0x51, 0xaf, 0x68,
  3405. 0x6b, 0x8a, 0xb3, 0x12, 0x0f, 0x45, 0x22, 0x66, 0x55, 0xe0, 0xfa, 0x43, 0xec, 0x0e, 0x71, 0x92,
  3406. 0x40, 0x19, 0x74, 0xb1, 0x62, 0x72, 0x62, 0xaf, 0xf6, 0x94, 0xac, 0xb5, 0x0a, 0xcb, 0x71, 0x8c,
  3407. 0x28, 0x41, 0xeb, 0x21, 0xdc, 0x78, 0x4c, 0x89, 0x87, 0x19, 0x8b, 0x58, 0xc6, 0xdc, 0xf6, 0xd8,
  3408. 0xe1, 0x8e, 0x48, 0x4c, 0xf6, 0xc4, 0x26, 0xab, 0x76, 0x74, 0x64, 0xec, 0x04, 0x4c, 0xc6, 0xef,
  3409. 0xe9, 0xcf, 0x7e, 0xb0, 0x14, 0xeb, 0x26, 0x98, 0x69, 0xd1, 0x62, 0xaf, 0x4f, 0x60, 0xc3, 0xc1,
  3410. 0x8c, 0x74, 0x87, 0x78, 0xc7, 0xf7, 0xa9, 0x80, 0x62, 0x9f, 0xab, 0xac, 0xb2, 0xf5, 0x2e, 0x6c,
  3411. 0x4e, 0xab, 0xe3, 0x4d, 0x4a, 0xdb, 0xc9, 0x2e, 0xac, 0x37, 0x42, 0x8e, 0x69, 0xe8, 0x76, 0x45,
  3412. 0x9c, 0xc4, 0x69, 0x13, 0xb4, 0xb1, 0x49, 0x76, 0x74, 0xbe, 0xa5, 0x35, 0x76, 0x1d, 0x2d, 0xf0,
  3413. 0xd1, 0x7d, 0xc8, 0xba, 0x1e, 0x0f, 0x48, 0x18, 0xef, 0xe0, 0x56, 0xda, 0x6a, 0xee, 0x73, 0x42,
  3414. 0xf1, 0x8e, 0xc4, 0x92, 0xa3, 0x15, 0x89, 0xac, 0xdf, 0x74, 0xc8, 0x5d, 0x18, 0x45, 0x1f, 0x8f,
  3415. 0xc3, 0x09, 0xab, 0x95, 0xf2, 0xed, 0x57, 0x84, 0x7b, 0x10, 0x84, 0x7e, 0x12, 0x0c, 0xd9, 0xf1,
  3416. 0xbe, 0x6a, 0x72, 0xc9, 0x8d, 0x34, 0xa9, 0xb8, 0x31, 0x75, 0x25, 0xda, 0x53, 0xf4, 0x21, 0x2c,
  3417. 0x30, 0x4c, 0x87, 0x81, 0x87, 0xe5, 0x95, 0xc9, 0x95, 0xdf, 0x48, 0x75, 0x8b, 0x90, 0xba, 0xe2,
  3418. 0x24, 0xb4, 0x30, 0xe2, 0x2e, 0xeb, 0xc4, 0x57, 0x2a, 0xd5, 0xe8, 0xc0, 0x65, 0x1d, 0x61, 0x24,
  3419. 0x38, 0x61, 0x14, 0x62, 0x7e, 0x42, 0x68, 0xc7, 0xb8, 0x36, 0xdb, 0xa8, 0x19, 0x21, 0xc2, 0x28,
  3420. 0xa6, 0x85, 0xd0, 0xeb, 0x0e, 0x18, 0xc7, 0xd4, 0xc8, 0xce, 0x16, 0x56, 0x23, 0x44, 0x08, 0x63,
  3421. 0x1a, 0x7d, 0x00, 0x59, 0x86, 0x3d, 0x8a, 0xb9, 0xb1, 0x20, 0x75, 0x66, 0x7a, 0x66, 0x82, 0xa8,
  3422. 0x8b, 0x8b, 0x2e, 0x5b, 0xe8, 0x1e, 0x2c, 0x52, 0xcc, 0xc8, 0x80, 0x7a, 0xd8, 0x58, 0x94, 0xba,
  3423. 0x9b, 0xa9, 0x97, 0x23, 0x66, 0xea, 0x8a, 0x33, 0xe6, 0xd1, 0x7d, 0x58, 0xc2, 0x5f, 0x73, 0x1c,
  3424. 0x32, 0xb1, 0x79, 0x4b, 0x52, 0xfc, 0x66, 0x9a, 0xb8, 0x96, 0x40, 0x75, 0xc5, 0x99, 0x28, 0xc4,
  3425. 0x84, 0x3d, 0x12, 0x1e, 0x07, 0x6d, 0x03, 0x66, 0x4f, 0xb8, 0x2a, 0x09, 0x31, 0xe1, 0x88, 0xad,
  3426. 0x2c, 0x42, 0x96, 0xbb, 0xb4, 0x8d, 0xf9, 0xdd, 0x7f, 0x55, 0x58, 0x9d, 0x3a, 0x17, 0xe8, 0x6d,
  3427. 0x58, 0x38, 0x6c, 0x3e, 0x68, 0xee, 0x7d, 0xde, 0x5c, 0x53, 0x4c, 0xf3, 0xf4, 0x79, 0x61, 0x73,
  3428. 0x8a, 0x38, 0x0c, 0x3b, 0x21, 0x39, 0x09, 0x51, 0x19, 0xd6, 0xf7, 0x0f, 0xf6, 0x9c, 0xda, 0xd1,
  3429. 0x4e, 0xf5, 0xa0, 0xb1, 0xd7, 0x3c, 0xaa, 0x3a, 0xb5, 0x9d, 0x83, 0xda, 0x9a, 0x6a, 0xde, 0x38,
  3430. 0x7d, 0x5e, 0xd8, 0x98, 0x12, 0x55, 0x29, 0x76, 0x39, 0xbe, 0xa4, 0x39, 0x7c, 0xbc, 0x2b, 0x34,
  3431. 0x5a, 0xaa, 0xe6, 0xb0, 0xef, 0xa7, 0x69, 0x9c, 0xda, 0xa3, 0xbd, 0xcf, 0x6a, 0x6b, 0x99, 0x54,
  3432. 0x8d, 0x23, 0x8b, 0x98, 0xf9, 0xfa, 0x77, 0x3f, 0xe7, 0x95, 0x5f, 0x7f, 0xc9, 0x4f, 0x67, 0x57,
  3433. 0xfe, 0x5e, 0x03, 0x5d, 0xdc, 0x50, 0x74, 0xaa, 0x02, 0xba, 0x5c, 0x3c, 0xd0, 0x76, 0xda, 0x0a,
  3434. 0xce, 0x2c, 0x59, 0xa6, 0x7d, 0x55, 0x3c, 0xae, 0x49, 0x1b, 0xbf, 0xbf, 0xf8, 0xe7, 0x47, 0x6d,
  3435. 0x15, 0x96, 0x25, 0xbf, 0xdd, 0x73, 0x43, 0xb7, 0x8d, 0x29, 0xfa, 0x16, 0x56, 0xfe, 0x5f, 0x6c,
  3436. 0xd0, 0x9d, 0x59, 0x47, 0xe8, 0x52, 0x39, 0x33, 0xef, 0x5e, 0x05, 0x9d, 0xeb, 0x5f, 0xfe, 0x53,
  3437. 0x85, 0x95, 0x49, 0xf1, 0x66, 0x4f, 0x83, 0x3e, 0xfa, 0x02, 0x74, 0xf1, 0x34, 0xa1, 0xd4, 0xd2,
  3438. 0x74, 0xe1, 0x61, 0x33, 0x0b, 0xb3, 0x81, 0xf9, 0x49, 0x7b, 0x70, 0x4d, 0x3e, 0x0e, 0x28, 0x35,
  3439. 0xc2, 0xc5, 0xb7, 0xc7, 0xbc, 0x35, 0x87, 0x98, 0x6b, 0x52, 0x31, 0xce, 0x5e, 0xe6, 0x95, 0xbf,
  3440. 0x5e, 0xe6, 0x95, 0x67, 0xa3, 0xbc, 0x7a, 0x36, 0xca, 0xab, 0x7f, 0x8c, 0xf2, 0xea, 0xdf, 0xa3,
  3441. 0xbc, 0xfa, 0x24, 0xf3, 0x44, 0x6f, 0x65, 0xe5, 0x7f, 0x8b, 0xf7, 0xff, 0x0b, 0x00, 0x00, 0xff,
  3442. 0xff, 0x9a, 0xef, 0x6e, 0xdb, 0xf3, 0x08, 0x00, 0x00,
  3443. }