raft.pb.go 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650
  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,packed,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. dAtA3 := make([]byte, len(m.RemovedMembers)*10)
  988. var j2 int
  989. for _, num := range m.RemovedMembers {
  990. for num >= 1<<7 {
  991. dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80)
  992. num >>= 7
  993. j2++
  994. }
  995. dAtA3[j2] = uint8(num)
  996. j2++
  997. }
  998. dAtA[i] = 0x1a
  999. i++
  1000. i = encodeVarintRaft(dAtA, i, uint64(j2))
  1001. i += copy(dAtA[i:], dAtA3[:j2])
  1002. }
  1003. return i, nil
  1004. }
  1005. func (m *LeaveRequest) Marshal() (dAtA []byte, err error) {
  1006. size := m.Size()
  1007. dAtA = make([]byte, size)
  1008. n, err := m.MarshalTo(dAtA)
  1009. if err != nil {
  1010. return nil, err
  1011. }
  1012. return dAtA[:n], nil
  1013. }
  1014. func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) {
  1015. var i int
  1016. _ = i
  1017. var l int
  1018. _ = l
  1019. if m.Node != nil {
  1020. dAtA[i] = 0xa
  1021. i++
  1022. i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size()))
  1023. n4, err := m.Node.MarshalTo(dAtA[i:])
  1024. if err != nil {
  1025. return 0, err
  1026. }
  1027. i += n4
  1028. }
  1029. return i, nil
  1030. }
  1031. func (m *LeaveResponse) Marshal() (dAtA []byte, err error) {
  1032. size := m.Size()
  1033. dAtA = make([]byte, size)
  1034. n, err := m.MarshalTo(dAtA)
  1035. if err != nil {
  1036. return nil, err
  1037. }
  1038. return dAtA[:n], nil
  1039. }
  1040. func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) {
  1041. var i int
  1042. _ = i
  1043. var l int
  1044. _ = l
  1045. return i, nil
  1046. }
  1047. func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) {
  1048. size := m.Size()
  1049. dAtA = make([]byte, size)
  1050. n, err := m.MarshalTo(dAtA)
  1051. if err != nil {
  1052. return nil, err
  1053. }
  1054. return dAtA[:n], nil
  1055. }
  1056. func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) {
  1057. var i int
  1058. _ = i
  1059. var l int
  1060. _ = l
  1061. if m.Message != nil {
  1062. dAtA[i] = 0xa
  1063. i++
  1064. i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size()))
  1065. n5, err := m.Message.MarshalTo(dAtA[i:])
  1066. if err != nil {
  1067. return 0, err
  1068. }
  1069. i += n5
  1070. }
  1071. return i, nil
  1072. }
  1073. func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) {
  1074. size := m.Size()
  1075. dAtA = make([]byte, size)
  1076. n, err := m.MarshalTo(dAtA)
  1077. if err != nil {
  1078. return nil, err
  1079. }
  1080. return dAtA[:n], nil
  1081. }
  1082. func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) {
  1083. var i int
  1084. _ = i
  1085. var l int
  1086. _ = l
  1087. return i, nil
  1088. }
  1089. func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) {
  1090. size := m.Size()
  1091. dAtA = make([]byte, size)
  1092. n, err := m.MarshalTo(dAtA)
  1093. if err != nil {
  1094. return nil, err
  1095. }
  1096. return dAtA[:n], nil
  1097. }
  1098. func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) {
  1099. var i int
  1100. _ = i
  1101. var l int
  1102. _ = l
  1103. if m.RaftID != 0 {
  1104. dAtA[i] = 0x8
  1105. i++
  1106. i = encodeVarintRaft(dAtA, i, uint64(m.RaftID))
  1107. }
  1108. return i, nil
  1109. }
  1110. func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) {
  1111. size := m.Size()
  1112. dAtA = make([]byte, size)
  1113. n, err := m.MarshalTo(dAtA)
  1114. if err != nil {
  1115. return nil, err
  1116. }
  1117. return dAtA[:n], nil
  1118. }
  1119. func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) {
  1120. var i int
  1121. _ = i
  1122. var l int
  1123. _ = l
  1124. if len(m.Addr) > 0 {
  1125. dAtA[i] = 0xa
  1126. i++
  1127. i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr)))
  1128. i += copy(dAtA[i:], m.Addr)
  1129. }
  1130. return i, nil
  1131. }
  1132. func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) {
  1133. size := m.Size()
  1134. dAtA = make([]byte, size)
  1135. n, err := m.MarshalTo(dAtA)
  1136. if err != nil {
  1137. return nil, err
  1138. }
  1139. return dAtA[:n], nil
  1140. }
  1141. func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
  1142. var i int
  1143. _ = i
  1144. var l int
  1145. _ = l
  1146. if m.ID != 0 {
  1147. dAtA[i] = 0x8
  1148. i++
  1149. i = encodeVarintRaft(dAtA, i, uint64(m.ID))
  1150. }
  1151. if len(m.Action) > 0 {
  1152. for _, msg := range m.Action {
  1153. dAtA[i] = 0x12
  1154. i++
  1155. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  1156. n, err := msg.MarshalTo(dAtA[i:])
  1157. if err != nil {
  1158. return 0, err
  1159. }
  1160. i += n
  1161. }
  1162. }
  1163. return i, nil
  1164. }
  1165. func (m *StoreAction) Marshal() (dAtA []byte, err error) {
  1166. size := m.Size()
  1167. dAtA = make([]byte, size)
  1168. n, err := m.MarshalTo(dAtA)
  1169. if err != nil {
  1170. return nil, err
  1171. }
  1172. return dAtA[:n], nil
  1173. }
  1174. func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) {
  1175. var i int
  1176. _ = i
  1177. var l int
  1178. _ = l
  1179. if m.Action != 0 {
  1180. dAtA[i] = 0x8
  1181. i++
  1182. i = encodeVarintRaft(dAtA, i, uint64(m.Action))
  1183. }
  1184. if m.Target != nil {
  1185. nn6, err := m.Target.MarshalTo(dAtA[i:])
  1186. if err != nil {
  1187. return 0, err
  1188. }
  1189. i += nn6
  1190. }
  1191. return i, nil
  1192. }
  1193. func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) {
  1194. i := 0
  1195. if m.Node != nil {
  1196. dAtA[i] = 0x12
  1197. i++
  1198. i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size()))
  1199. n7, err := m.Node.MarshalTo(dAtA[i:])
  1200. if err != nil {
  1201. return 0, err
  1202. }
  1203. i += n7
  1204. }
  1205. return i, nil
  1206. }
  1207. func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) {
  1208. i := 0
  1209. if m.Service != nil {
  1210. dAtA[i] = 0x1a
  1211. i++
  1212. i = encodeVarintRaft(dAtA, i, uint64(m.Service.Size()))
  1213. n8, err := m.Service.MarshalTo(dAtA[i:])
  1214. if err != nil {
  1215. return 0, err
  1216. }
  1217. i += n8
  1218. }
  1219. return i, nil
  1220. }
  1221. func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) {
  1222. i := 0
  1223. if m.Task != nil {
  1224. dAtA[i] = 0x22
  1225. i++
  1226. i = encodeVarintRaft(dAtA, i, uint64(m.Task.Size()))
  1227. n9, err := m.Task.MarshalTo(dAtA[i:])
  1228. if err != nil {
  1229. return 0, err
  1230. }
  1231. i += n9
  1232. }
  1233. return i, nil
  1234. }
  1235. func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) {
  1236. i := 0
  1237. if m.Network != nil {
  1238. dAtA[i] = 0x2a
  1239. i++
  1240. i = encodeVarintRaft(dAtA, i, uint64(m.Network.Size()))
  1241. n10, err := m.Network.MarshalTo(dAtA[i:])
  1242. if err != nil {
  1243. return 0, err
  1244. }
  1245. i += n10
  1246. }
  1247. return i, nil
  1248. }
  1249. func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) {
  1250. i := 0
  1251. if m.Cluster != nil {
  1252. dAtA[i] = 0x32
  1253. i++
  1254. i = encodeVarintRaft(dAtA, i, uint64(m.Cluster.Size()))
  1255. n11, err := m.Cluster.MarshalTo(dAtA[i:])
  1256. if err != nil {
  1257. return 0, err
  1258. }
  1259. i += n11
  1260. }
  1261. return i, nil
  1262. }
  1263. func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) {
  1264. i := 0
  1265. if m.Secret != nil {
  1266. dAtA[i] = 0x3a
  1267. i++
  1268. i = encodeVarintRaft(dAtA, i, uint64(m.Secret.Size()))
  1269. n12, err := m.Secret.MarshalTo(dAtA[i:])
  1270. if err != nil {
  1271. return 0, err
  1272. }
  1273. i += n12
  1274. }
  1275. return i, nil
  1276. }
  1277. func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) {
  1278. i := 0
  1279. if m.Resource != nil {
  1280. dAtA[i] = 0x42
  1281. i++
  1282. i = encodeVarintRaft(dAtA, i, uint64(m.Resource.Size()))
  1283. n13, err := m.Resource.MarshalTo(dAtA[i:])
  1284. if err != nil {
  1285. return 0, err
  1286. }
  1287. i += n13
  1288. }
  1289. return i, nil
  1290. }
  1291. func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) {
  1292. i := 0
  1293. if m.Extension != nil {
  1294. dAtA[i] = 0x4a
  1295. i++
  1296. i = encodeVarintRaft(dAtA, i, uint64(m.Extension.Size()))
  1297. n14, err := m.Extension.MarshalTo(dAtA[i:])
  1298. if err != nil {
  1299. return 0, err
  1300. }
  1301. i += n14
  1302. }
  1303. return i, nil
  1304. }
  1305. func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) {
  1306. i := 0
  1307. if m.Config != nil {
  1308. dAtA[i] = 0x52
  1309. i++
  1310. i = encodeVarintRaft(dAtA, i, uint64(m.Config.Size()))
  1311. n15, err := m.Config.MarshalTo(dAtA[i:])
  1312. if err != nil {
  1313. return 0, err
  1314. }
  1315. i += n15
  1316. }
  1317. return i, nil
  1318. }
  1319. func encodeFixed64Raft(dAtA []byte, offset int, v uint64) int {
  1320. dAtA[offset] = uint8(v)
  1321. dAtA[offset+1] = uint8(v >> 8)
  1322. dAtA[offset+2] = uint8(v >> 16)
  1323. dAtA[offset+3] = uint8(v >> 24)
  1324. dAtA[offset+4] = uint8(v >> 32)
  1325. dAtA[offset+5] = uint8(v >> 40)
  1326. dAtA[offset+6] = uint8(v >> 48)
  1327. dAtA[offset+7] = uint8(v >> 56)
  1328. return offset + 8
  1329. }
  1330. func encodeFixed32Raft(dAtA []byte, offset int, v uint32) int {
  1331. dAtA[offset] = uint8(v)
  1332. dAtA[offset+1] = uint8(v >> 8)
  1333. dAtA[offset+2] = uint8(v >> 16)
  1334. dAtA[offset+3] = uint8(v >> 24)
  1335. return offset + 4
  1336. }
  1337. func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
  1338. for v >= 1<<7 {
  1339. dAtA[offset] = uint8(v&0x7f | 0x80)
  1340. v >>= 7
  1341. offset++
  1342. }
  1343. dAtA[offset] = uint8(v)
  1344. return offset + 1
  1345. }
  1346. type raftProxyRaftServer struct {
  1347. local RaftServer
  1348. connSelector raftselector.ConnProvider
  1349. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1350. }
  1351. func NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer {
  1352. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1353. s, ok := transport.StreamFromContext(ctx)
  1354. if !ok {
  1355. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1356. }
  1357. addr := s.ServerTransport().RemoteAddr().String()
  1358. md, ok := metadata.FromContext(ctx)
  1359. if ok && len(md["redirect"]) != 0 {
  1360. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1361. }
  1362. if !ok {
  1363. md = metadata.New(map[string]string{})
  1364. }
  1365. md["redirect"] = append(md["redirect"], addr)
  1366. return metadata.NewContext(ctx, md), nil
  1367. }
  1368. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1369. remoteMods = append(remoteMods, remoteCtxMod)
  1370. var localMods []func(context.Context) (context.Context, error)
  1371. if localCtxMod != nil {
  1372. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1373. }
  1374. return &raftProxyRaftServer{
  1375. local: local,
  1376. connSelector: connSelector,
  1377. localCtxMods: localMods,
  1378. remoteCtxMods: remoteMods,
  1379. }
  1380. }
  1381. func (p *raftProxyRaftServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1382. var err error
  1383. for _, mod := range ctxMods {
  1384. ctx, err = mod(ctx)
  1385. if err != nil {
  1386. return ctx, err
  1387. }
  1388. }
  1389. return ctx, nil
  1390. }
  1391. func (p *raftProxyRaftServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1392. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  1393. defer ticker.Stop()
  1394. for {
  1395. select {
  1396. case <-ticker.C:
  1397. conn, err := p.connSelector.LeaderConn(ctx)
  1398. if err != nil {
  1399. return nil, err
  1400. }
  1401. client := NewHealthClient(conn)
  1402. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1403. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1404. continue
  1405. }
  1406. return conn, nil
  1407. case <-ctx.Done():
  1408. return nil, ctx.Err()
  1409. }
  1410. }
  1411. }
  1412. func (p *raftProxyRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) {
  1413. conn, err := p.connSelector.LeaderConn(ctx)
  1414. if err != nil {
  1415. if err == raftselector.ErrIsLeader {
  1416. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1417. if err != nil {
  1418. return nil, err
  1419. }
  1420. return p.local.ProcessRaftMessage(ctx, r)
  1421. }
  1422. return nil, err
  1423. }
  1424. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1425. if err != nil {
  1426. return nil, err
  1427. }
  1428. resp, err := NewRaftClient(conn).ProcessRaftMessage(modCtx, r)
  1429. if err != nil {
  1430. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1431. return resp, err
  1432. }
  1433. conn, err := p.pollNewLeaderConn(ctx)
  1434. if err != nil {
  1435. if err == raftselector.ErrIsLeader {
  1436. return p.local.ProcessRaftMessage(ctx, r)
  1437. }
  1438. return nil, err
  1439. }
  1440. return NewRaftClient(conn).ProcessRaftMessage(modCtx, r)
  1441. }
  1442. return resp, err
  1443. }
  1444. func (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) {
  1445. conn, err := p.connSelector.LeaderConn(ctx)
  1446. if err != nil {
  1447. if err == raftselector.ErrIsLeader {
  1448. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1449. if err != nil {
  1450. return nil, err
  1451. }
  1452. return p.local.ResolveAddress(ctx, r)
  1453. }
  1454. return nil, err
  1455. }
  1456. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1457. if err != nil {
  1458. return nil, err
  1459. }
  1460. resp, err := NewRaftClient(conn).ResolveAddress(modCtx, r)
  1461. if err != nil {
  1462. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1463. return resp, err
  1464. }
  1465. conn, err := p.pollNewLeaderConn(ctx)
  1466. if err != nil {
  1467. if err == raftselector.ErrIsLeader {
  1468. return p.local.ResolveAddress(ctx, r)
  1469. }
  1470. return nil, err
  1471. }
  1472. return NewRaftClient(conn).ResolveAddress(modCtx, r)
  1473. }
  1474. return resp, err
  1475. }
  1476. type raftProxyRaftMembershipServer struct {
  1477. local RaftMembershipServer
  1478. connSelector raftselector.ConnProvider
  1479. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1480. }
  1481. func NewRaftProxyRaftMembershipServer(local RaftMembershipServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftMembershipServer {
  1482. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1483. s, ok := transport.StreamFromContext(ctx)
  1484. if !ok {
  1485. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1486. }
  1487. addr := s.ServerTransport().RemoteAddr().String()
  1488. md, ok := metadata.FromContext(ctx)
  1489. if ok && len(md["redirect"]) != 0 {
  1490. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1491. }
  1492. if !ok {
  1493. md = metadata.New(map[string]string{})
  1494. }
  1495. md["redirect"] = append(md["redirect"], addr)
  1496. return metadata.NewContext(ctx, md), nil
  1497. }
  1498. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1499. remoteMods = append(remoteMods, remoteCtxMod)
  1500. var localMods []func(context.Context) (context.Context, error)
  1501. if localCtxMod != nil {
  1502. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1503. }
  1504. return &raftProxyRaftMembershipServer{
  1505. local: local,
  1506. connSelector: connSelector,
  1507. localCtxMods: localMods,
  1508. remoteCtxMods: remoteMods,
  1509. }
  1510. }
  1511. func (p *raftProxyRaftMembershipServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1512. var err error
  1513. for _, mod := range ctxMods {
  1514. ctx, err = mod(ctx)
  1515. if err != nil {
  1516. return ctx, err
  1517. }
  1518. }
  1519. return ctx, nil
  1520. }
  1521. func (p *raftProxyRaftMembershipServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1522. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  1523. defer ticker.Stop()
  1524. for {
  1525. select {
  1526. case <-ticker.C:
  1527. conn, err := p.connSelector.LeaderConn(ctx)
  1528. if err != nil {
  1529. return nil, err
  1530. }
  1531. client := NewHealthClient(conn)
  1532. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1533. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1534. continue
  1535. }
  1536. return conn, nil
  1537. case <-ctx.Done():
  1538. return nil, ctx.Err()
  1539. }
  1540. }
  1541. }
  1542. func (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) {
  1543. conn, err := p.connSelector.LeaderConn(ctx)
  1544. if err != nil {
  1545. if err == raftselector.ErrIsLeader {
  1546. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1547. if err != nil {
  1548. return nil, err
  1549. }
  1550. return p.local.Join(ctx, r)
  1551. }
  1552. return nil, err
  1553. }
  1554. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1555. if err != nil {
  1556. return nil, err
  1557. }
  1558. resp, err := NewRaftMembershipClient(conn).Join(modCtx, r)
  1559. if err != nil {
  1560. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1561. return resp, err
  1562. }
  1563. conn, err := p.pollNewLeaderConn(ctx)
  1564. if err != nil {
  1565. if err == raftselector.ErrIsLeader {
  1566. return p.local.Join(ctx, r)
  1567. }
  1568. return nil, err
  1569. }
  1570. return NewRaftMembershipClient(conn).Join(modCtx, r)
  1571. }
  1572. return resp, err
  1573. }
  1574. func (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) {
  1575. conn, err := p.connSelector.LeaderConn(ctx)
  1576. if err != nil {
  1577. if err == raftselector.ErrIsLeader {
  1578. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1579. if err != nil {
  1580. return nil, err
  1581. }
  1582. return p.local.Leave(ctx, r)
  1583. }
  1584. return nil, err
  1585. }
  1586. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1587. if err != nil {
  1588. return nil, err
  1589. }
  1590. resp, err := NewRaftMembershipClient(conn).Leave(modCtx, r)
  1591. if err != nil {
  1592. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1593. return resp, err
  1594. }
  1595. conn, err := p.pollNewLeaderConn(ctx)
  1596. if err != nil {
  1597. if err == raftselector.ErrIsLeader {
  1598. return p.local.Leave(ctx, r)
  1599. }
  1600. return nil, err
  1601. }
  1602. return NewRaftMembershipClient(conn).Leave(modCtx, r)
  1603. }
  1604. return resp, err
  1605. }
  1606. func (m *RaftMember) Size() (n int) {
  1607. var l int
  1608. _ = l
  1609. if m.RaftID != 0 {
  1610. n += 1 + sovRaft(uint64(m.RaftID))
  1611. }
  1612. l = len(m.NodeID)
  1613. if l > 0 {
  1614. n += 1 + l + sovRaft(uint64(l))
  1615. }
  1616. l = len(m.Addr)
  1617. if l > 0 {
  1618. n += 1 + l + sovRaft(uint64(l))
  1619. }
  1620. l = m.Status.Size()
  1621. n += 1 + l + sovRaft(uint64(l))
  1622. return n
  1623. }
  1624. func (m *JoinRequest) Size() (n int) {
  1625. var l int
  1626. _ = l
  1627. l = len(m.Addr)
  1628. if l > 0 {
  1629. n += 1 + l + sovRaft(uint64(l))
  1630. }
  1631. return n
  1632. }
  1633. func (m *JoinResponse) Size() (n int) {
  1634. var l int
  1635. _ = l
  1636. if m.RaftID != 0 {
  1637. n += 1 + sovRaft(uint64(m.RaftID))
  1638. }
  1639. if len(m.Members) > 0 {
  1640. for _, e := range m.Members {
  1641. l = e.Size()
  1642. n += 1 + l + sovRaft(uint64(l))
  1643. }
  1644. }
  1645. if len(m.RemovedMembers) > 0 {
  1646. l = 0
  1647. for _, e := range m.RemovedMembers {
  1648. l += sovRaft(uint64(e))
  1649. }
  1650. n += 1 + sovRaft(uint64(l)) + l
  1651. }
  1652. return n
  1653. }
  1654. func (m *LeaveRequest) Size() (n int) {
  1655. var l int
  1656. _ = l
  1657. if m.Node != nil {
  1658. l = m.Node.Size()
  1659. n += 1 + l + sovRaft(uint64(l))
  1660. }
  1661. return n
  1662. }
  1663. func (m *LeaveResponse) Size() (n int) {
  1664. var l int
  1665. _ = l
  1666. return n
  1667. }
  1668. func (m *ProcessRaftMessageRequest) Size() (n int) {
  1669. var l int
  1670. _ = l
  1671. if m.Message != nil {
  1672. l = m.Message.Size()
  1673. n += 1 + l + sovRaft(uint64(l))
  1674. }
  1675. return n
  1676. }
  1677. func (m *ProcessRaftMessageResponse) Size() (n int) {
  1678. var l int
  1679. _ = l
  1680. return n
  1681. }
  1682. func (m *ResolveAddressRequest) Size() (n int) {
  1683. var l int
  1684. _ = l
  1685. if m.RaftID != 0 {
  1686. n += 1 + sovRaft(uint64(m.RaftID))
  1687. }
  1688. return n
  1689. }
  1690. func (m *ResolveAddressResponse) Size() (n int) {
  1691. var l int
  1692. _ = l
  1693. l = len(m.Addr)
  1694. if l > 0 {
  1695. n += 1 + l + sovRaft(uint64(l))
  1696. }
  1697. return n
  1698. }
  1699. func (m *InternalRaftRequest) Size() (n int) {
  1700. var l int
  1701. _ = l
  1702. if m.ID != 0 {
  1703. n += 1 + sovRaft(uint64(m.ID))
  1704. }
  1705. if len(m.Action) > 0 {
  1706. for _, e := range m.Action {
  1707. l = e.Size()
  1708. n += 1 + l + sovRaft(uint64(l))
  1709. }
  1710. }
  1711. return n
  1712. }
  1713. func (m *StoreAction) Size() (n int) {
  1714. var l int
  1715. _ = l
  1716. if m.Action != 0 {
  1717. n += 1 + sovRaft(uint64(m.Action))
  1718. }
  1719. if m.Target != nil {
  1720. n += m.Target.Size()
  1721. }
  1722. return n
  1723. }
  1724. func (m *StoreAction_Node) Size() (n int) {
  1725. var l int
  1726. _ = l
  1727. if m.Node != nil {
  1728. l = m.Node.Size()
  1729. n += 1 + l + sovRaft(uint64(l))
  1730. }
  1731. return n
  1732. }
  1733. func (m *StoreAction_Service) Size() (n int) {
  1734. var l int
  1735. _ = l
  1736. if m.Service != nil {
  1737. l = m.Service.Size()
  1738. n += 1 + l + sovRaft(uint64(l))
  1739. }
  1740. return n
  1741. }
  1742. func (m *StoreAction_Task) Size() (n int) {
  1743. var l int
  1744. _ = l
  1745. if m.Task != nil {
  1746. l = m.Task.Size()
  1747. n += 1 + l + sovRaft(uint64(l))
  1748. }
  1749. return n
  1750. }
  1751. func (m *StoreAction_Network) Size() (n int) {
  1752. var l int
  1753. _ = l
  1754. if m.Network != nil {
  1755. l = m.Network.Size()
  1756. n += 1 + l + sovRaft(uint64(l))
  1757. }
  1758. return n
  1759. }
  1760. func (m *StoreAction_Cluster) Size() (n int) {
  1761. var l int
  1762. _ = l
  1763. if m.Cluster != nil {
  1764. l = m.Cluster.Size()
  1765. n += 1 + l + sovRaft(uint64(l))
  1766. }
  1767. return n
  1768. }
  1769. func (m *StoreAction_Secret) Size() (n int) {
  1770. var l int
  1771. _ = l
  1772. if m.Secret != nil {
  1773. l = m.Secret.Size()
  1774. n += 1 + l + sovRaft(uint64(l))
  1775. }
  1776. return n
  1777. }
  1778. func (m *StoreAction_Resource) Size() (n int) {
  1779. var l int
  1780. _ = l
  1781. if m.Resource != nil {
  1782. l = m.Resource.Size()
  1783. n += 1 + l + sovRaft(uint64(l))
  1784. }
  1785. return n
  1786. }
  1787. func (m *StoreAction_Extension) Size() (n int) {
  1788. var l int
  1789. _ = l
  1790. if m.Extension != nil {
  1791. l = m.Extension.Size()
  1792. n += 1 + l + sovRaft(uint64(l))
  1793. }
  1794. return n
  1795. }
  1796. func (m *StoreAction_Config) Size() (n int) {
  1797. var l int
  1798. _ = l
  1799. if m.Config != nil {
  1800. l = m.Config.Size()
  1801. n += 1 + l + sovRaft(uint64(l))
  1802. }
  1803. return n
  1804. }
  1805. func sovRaft(x uint64) (n int) {
  1806. for {
  1807. n++
  1808. x >>= 7
  1809. if x == 0 {
  1810. break
  1811. }
  1812. }
  1813. return n
  1814. }
  1815. func sozRaft(x uint64) (n int) {
  1816. return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1817. }
  1818. func (this *RaftMember) String() string {
  1819. if this == nil {
  1820. return "nil"
  1821. }
  1822. s := strings.Join([]string{`&RaftMember{`,
  1823. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1824. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  1825. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1826. `Status:` + strings.Replace(strings.Replace(this.Status.String(), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`,
  1827. `}`,
  1828. }, "")
  1829. return s
  1830. }
  1831. func (this *JoinRequest) String() string {
  1832. if this == nil {
  1833. return "nil"
  1834. }
  1835. s := strings.Join([]string{`&JoinRequest{`,
  1836. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1837. `}`,
  1838. }, "")
  1839. return s
  1840. }
  1841. func (this *JoinResponse) String() string {
  1842. if this == nil {
  1843. return "nil"
  1844. }
  1845. s := strings.Join([]string{`&JoinResponse{`,
  1846. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1847. `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`,
  1848. `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`,
  1849. `}`,
  1850. }, "")
  1851. return s
  1852. }
  1853. func (this *LeaveRequest) String() string {
  1854. if this == nil {
  1855. return "nil"
  1856. }
  1857. s := strings.Join([]string{`&LeaveRequest{`,
  1858. `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "RaftMember", "RaftMember", 1) + `,`,
  1859. `}`,
  1860. }, "")
  1861. return s
  1862. }
  1863. func (this *LeaveResponse) String() string {
  1864. if this == nil {
  1865. return "nil"
  1866. }
  1867. s := strings.Join([]string{`&LeaveResponse{`,
  1868. `}`,
  1869. }, "")
  1870. return s
  1871. }
  1872. func (this *ProcessRaftMessageRequest) String() string {
  1873. if this == nil {
  1874. return "nil"
  1875. }
  1876. s := strings.Join([]string{`&ProcessRaftMessageRequest{`,
  1877. `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`,
  1878. `}`,
  1879. }, "")
  1880. return s
  1881. }
  1882. func (this *ProcessRaftMessageResponse) String() string {
  1883. if this == nil {
  1884. return "nil"
  1885. }
  1886. s := strings.Join([]string{`&ProcessRaftMessageResponse{`,
  1887. `}`,
  1888. }, "")
  1889. return s
  1890. }
  1891. func (this *ResolveAddressRequest) String() string {
  1892. if this == nil {
  1893. return "nil"
  1894. }
  1895. s := strings.Join([]string{`&ResolveAddressRequest{`,
  1896. `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`,
  1897. `}`,
  1898. }, "")
  1899. return s
  1900. }
  1901. func (this *ResolveAddressResponse) String() string {
  1902. if this == nil {
  1903. return "nil"
  1904. }
  1905. s := strings.Join([]string{`&ResolveAddressResponse{`,
  1906. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  1907. `}`,
  1908. }, "")
  1909. return s
  1910. }
  1911. func (this *InternalRaftRequest) String() string {
  1912. if this == nil {
  1913. return "nil"
  1914. }
  1915. s := strings.Join([]string{`&InternalRaftRequest{`,
  1916. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  1917. `Action:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Action), "StoreAction", "StoreAction", 1), `&`, ``, 1) + `,`,
  1918. `}`,
  1919. }, "")
  1920. return s
  1921. }
  1922. func (this *StoreAction) String() string {
  1923. if this == nil {
  1924. return "nil"
  1925. }
  1926. s := strings.Join([]string{`&StoreAction{`,
  1927. `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
  1928. `Target:` + fmt.Sprintf("%v", this.Target) + `,`,
  1929. `}`,
  1930. }, "")
  1931. return s
  1932. }
  1933. func (this *StoreAction_Node) String() string {
  1934. if this == nil {
  1935. return "nil"
  1936. }
  1937. s := strings.Join([]string{`&StoreAction_Node{`,
  1938. `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`,
  1939. `}`,
  1940. }, "")
  1941. return s
  1942. }
  1943. func (this *StoreAction_Service) String() string {
  1944. if this == nil {
  1945. return "nil"
  1946. }
  1947. s := strings.Join([]string{`&StoreAction_Service{`,
  1948. `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`,
  1949. `}`,
  1950. }, "")
  1951. return s
  1952. }
  1953. func (this *StoreAction_Task) String() string {
  1954. if this == nil {
  1955. return "nil"
  1956. }
  1957. s := strings.Join([]string{`&StoreAction_Task{`,
  1958. `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`,
  1959. `}`,
  1960. }, "")
  1961. return s
  1962. }
  1963. func (this *StoreAction_Network) String() string {
  1964. if this == nil {
  1965. return "nil"
  1966. }
  1967. s := strings.Join([]string{`&StoreAction_Network{`,
  1968. `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`,
  1969. `}`,
  1970. }, "")
  1971. return s
  1972. }
  1973. func (this *StoreAction_Cluster) String() string {
  1974. if this == nil {
  1975. return "nil"
  1976. }
  1977. s := strings.Join([]string{`&StoreAction_Cluster{`,
  1978. `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`,
  1979. `}`,
  1980. }, "")
  1981. return s
  1982. }
  1983. func (this *StoreAction_Secret) String() string {
  1984. if this == nil {
  1985. return "nil"
  1986. }
  1987. s := strings.Join([]string{`&StoreAction_Secret{`,
  1988. `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`,
  1989. `}`,
  1990. }, "")
  1991. return s
  1992. }
  1993. func (this *StoreAction_Resource) String() string {
  1994. if this == nil {
  1995. return "nil"
  1996. }
  1997. s := strings.Join([]string{`&StoreAction_Resource{`,
  1998. `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`,
  1999. `}`,
  2000. }, "")
  2001. return s
  2002. }
  2003. func (this *StoreAction_Extension) String() string {
  2004. if this == nil {
  2005. return "nil"
  2006. }
  2007. s := strings.Join([]string{`&StoreAction_Extension{`,
  2008. `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`,
  2009. `}`,
  2010. }, "")
  2011. return s
  2012. }
  2013. func (this *StoreAction_Config) String() string {
  2014. if this == nil {
  2015. return "nil"
  2016. }
  2017. s := strings.Join([]string{`&StoreAction_Config{`,
  2018. `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`,
  2019. `}`,
  2020. }, "")
  2021. return s
  2022. }
  2023. func valueToStringRaft(v interface{}) string {
  2024. rv := reflect.ValueOf(v)
  2025. if rv.IsNil() {
  2026. return "nil"
  2027. }
  2028. pv := reflect.Indirect(rv).Interface()
  2029. return fmt.Sprintf("*%v", pv)
  2030. }
  2031. func (m *RaftMember) Unmarshal(dAtA []byte) error {
  2032. l := len(dAtA)
  2033. iNdEx := 0
  2034. for iNdEx < l {
  2035. preIndex := iNdEx
  2036. var wire uint64
  2037. for shift := uint(0); ; shift += 7 {
  2038. if shift >= 64 {
  2039. return ErrIntOverflowRaft
  2040. }
  2041. if iNdEx >= l {
  2042. return io.ErrUnexpectedEOF
  2043. }
  2044. b := dAtA[iNdEx]
  2045. iNdEx++
  2046. wire |= (uint64(b) & 0x7F) << shift
  2047. if b < 0x80 {
  2048. break
  2049. }
  2050. }
  2051. fieldNum := int32(wire >> 3)
  2052. wireType := int(wire & 0x7)
  2053. if wireType == 4 {
  2054. return fmt.Errorf("proto: RaftMember: wiretype end group for non-group")
  2055. }
  2056. if fieldNum <= 0 {
  2057. return fmt.Errorf("proto: RaftMember: illegal tag %d (wire type %d)", fieldNum, wire)
  2058. }
  2059. switch fieldNum {
  2060. case 1:
  2061. if wireType != 0 {
  2062. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2063. }
  2064. m.RaftID = 0
  2065. for shift := uint(0); ; shift += 7 {
  2066. if shift >= 64 {
  2067. return ErrIntOverflowRaft
  2068. }
  2069. if iNdEx >= l {
  2070. return io.ErrUnexpectedEOF
  2071. }
  2072. b := dAtA[iNdEx]
  2073. iNdEx++
  2074. m.RaftID |= (uint64(b) & 0x7F) << shift
  2075. if b < 0x80 {
  2076. break
  2077. }
  2078. }
  2079. case 2:
  2080. if wireType != 2 {
  2081. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2082. }
  2083. var stringLen uint64
  2084. for shift := uint(0); ; shift += 7 {
  2085. if shift >= 64 {
  2086. return ErrIntOverflowRaft
  2087. }
  2088. if iNdEx >= l {
  2089. return io.ErrUnexpectedEOF
  2090. }
  2091. b := dAtA[iNdEx]
  2092. iNdEx++
  2093. stringLen |= (uint64(b) & 0x7F) << shift
  2094. if b < 0x80 {
  2095. break
  2096. }
  2097. }
  2098. intStringLen := int(stringLen)
  2099. if intStringLen < 0 {
  2100. return ErrInvalidLengthRaft
  2101. }
  2102. postIndex := iNdEx + intStringLen
  2103. if postIndex > l {
  2104. return io.ErrUnexpectedEOF
  2105. }
  2106. m.NodeID = string(dAtA[iNdEx:postIndex])
  2107. iNdEx = postIndex
  2108. case 3:
  2109. if wireType != 2 {
  2110. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2111. }
  2112. var stringLen uint64
  2113. for shift := uint(0); ; shift += 7 {
  2114. if shift >= 64 {
  2115. return ErrIntOverflowRaft
  2116. }
  2117. if iNdEx >= l {
  2118. return io.ErrUnexpectedEOF
  2119. }
  2120. b := dAtA[iNdEx]
  2121. iNdEx++
  2122. stringLen |= (uint64(b) & 0x7F) << shift
  2123. if b < 0x80 {
  2124. break
  2125. }
  2126. }
  2127. intStringLen := int(stringLen)
  2128. if intStringLen < 0 {
  2129. return ErrInvalidLengthRaft
  2130. }
  2131. postIndex := iNdEx + intStringLen
  2132. if postIndex > l {
  2133. return io.ErrUnexpectedEOF
  2134. }
  2135. m.Addr = string(dAtA[iNdEx:postIndex])
  2136. iNdEx = postIndex
  2137. case 4:
  2138. if wireType != 2 {
  2139. return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
  2140. }
  2141. var msglen int
  2142. for shift := uint(0); ; shift += 7 {
  2143. if shift >= 64 {
  2144. return ErrIntOverflowRaft
  2145. }
  2146. if iNdEx >= l {
  2147. return io.ErrUnexpectedEOF
  2148. }
  2149. b := dAtA[iNdEx]
  2150. iNdEx++
  2151. msglen |= (int(b) & 0x7F) << shift
  2152. if b < 0x80 {
  2153. break
  2154. }
  2155. }
  2156. if msglen < 0 {
  2157. return ErrInvalidLengthRaft
  2158. }
  2159. postIndex := iNdEx + msglen
  2160. if postIndex > l {
  2161. return io.ErrUnexpectedEOF
  2162. }
  2163. if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2164. return err
  2165. }
  2166. iNdEx = postIndex
  2167. default:
  2168. iNdEx = preIndex
  2169. skippy, err := skipRaft(dAtA[iNdEx:])
  2170. if err != nil {
  2171. return err
  2172. }
  2173. if skippy < 0 {
  2174. return ErrInvalidLengthRaft
  2175. }
  2176. if (iNdEx + skippy) > l {
  2177. return io.ErrUnexpectedEOF
  2178. }
  2179. iNdEx += skippy
  2180. }
  2181. }
  2182. if iNdEx > l {
  2183. return io.ErrUnexpectedEOF
  2184. }
  2185. return nil
  2186. }
  2187. func (m *JoinRequest) Unmarshal(dAtA []byte) error {
  2188. l := len(dAtA)
  2189. iNdEx := 0
  2190. for iNdEx < l {
  2191. preIndex := iNdEx
  2192. var wire uint64
  2193. for shift := uint(0); ; shift += 7 {
  2194. if shift >= 64 {
  2195. return ErrIntOverflowRaft
  2196. }
  2197. if iNdEx >= l {
  2198. return io.ErrUnexpectedEOF
  2199. }
  2200. b := dAtA[iNdEx]
  2201. iNdEx++
  2202. wire |= (uint64(b) & 0x7F) << shift
  2203. if b < 0x80 {
  2204. break
  2205. }
  2206. }
  2207. fieldNum := int32(wire >> 3)
  2208. wireType := int(wire & 0x7)
  2209. if wireType == 4 {
  2210. return fmt.Errorf("proto: JoinRequest: wiretype end group for non-group")
  2211. }
  2212. if fieldNum <= 0 {
  2213. return fmt.Errorf("proto: JoinRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2214. }
  2215. switch fieldNum {
  2216. case 1:
  2217. if wireType != 2 {
  2218. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2219. }
  2220. var stringLen uint64
  2221. for shift := uint(0); ; shift += 7 {
  2222. if shift >= 64 {
  2223. return ErrIntOverflowRaft
  2224. }
  2225. if iNdEx >= l {
  2226. return io.ErrUnexpectedEOF
  2227. }
  2228. b := dAtA[iNdEx]
  2229. iNdEx++
  2230. stringLen |= (uint64(b) & 0x7F) << shift
  2231. if b < 0x80 {
  2232. break
  2233. }
  2234. }
  2235. intStringLen := int(stringLen)
  2236. if intStringLen < 0 {
  2237. return ErrInvalidLengthRaft
  2238. }
  2239. postIndex := iNdEx + intStringLen
  2240. if postIndex > l {
  2241. return io.ErrUnexpectedEOF
  2242. }
  2243. m.Addr = string(dAtA[iNdEx:postIndex])
  2244. iNdEx = postIndex
  2245. default:
  2246. iNdEx = preIndex
  2247. skippy, err := skipRaft(dAtA[iNdEx:])
  2248. if err != nil {
  2249. return err
  2250. }
  2251. if skippy < 0 {
  2252. return ErrInvalidLengthRaft
  2253. }
  2254. if (iNdEx + skippy) > l {
  2255. return io.ErrUnexpectedEOF
  2256. }
  2257. iNdEx += skippy
  2258. }
  2259. }
  2260. if iNdEx > l {
  2261. return io.ErrUnexpectedEOF
  2262. }
  2263. return nil
  2264. }
  2265. func (m *JoinResponse) Unmarshal(dAtA []byte) error {
  2266. l := len(dAtA)
  2267. iNdEx := 0
  2268. for iNdEx < l {
  2269. preIndex := iNdEx
  2270. var wire uint64
  2271. for shift := uint(0); ; shift += 7 {
  2272. if shift >= 64 {
  2273. return ErrIntOverflowRaft
  2274. }
  2275. if iNdEx >= l {
  2276. return io.ErrUnexpectedEOF
  2277. }
  2278. b := dAtA[iNdEx]
  2279. iNdEx++
  2280. wire |= (uint64(b) & 0x7F) << shift
  2281. if b < 0x80 {
  2282. break
  2283. }
  2284. }
  2285. fieldNum := int32(wire >> 3)
  2286. wireType := int(wire & 0x7)
  2287. if wireType == 4 {
  2288. return fmt.Errorf("proto: JoinResponse: wiretype end group for non-group")
  2289. }
  2290. if fieldNum <= 0 {
  2291. return fmt.Errorf("proto: JoinResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2292. }
  2293. switch fieldNum {
  2294. case 1:
  2295. if wireType != 0 {
  2296. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2297. }
  2298. m.RaftID = 0
  2299. for shift := uint(0); ; shift += 7 {
  2300. if shift >= 64 {
  2301. return ErrIntOverflowRaft
  2302. }
  2303. if iNdEx >= l {
  2304. return io.ErrUnexpectedEOF
  2305. }
  2306. b := dAtA[iNdEx]
  2307. iNdEx++
  2308. m.RaftID |= (uint64(b) & 0x7F) << shift
  2309. if b < 0x80 {
  2310. break
  2311. }
  2312. }
  2313. case 2:
  2314. if wireType != 2 {
  2315. return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
  2316. }
  2317. var msglen int
  2318. for shift := uint(0); ; shift += 7 {
  2319. if shift >= 64 {
  2320. return ErrIntOverflowRaft
  2321. }
  2322. if iNdEx >= l {
  2323. return io.ErrUnexpectedEOF
  2324. }
  2325. b := dAtA[iNdEx]
  2326. iNdEx++
  2327. msglen |= (int(b) & 0x7F) << shift
  2328. if b < 0x80 {
  2329. break
  2330. }
  2331. }
  2332. if msglen < 0 {
  2333. return ErrInvalidLengthRaft
  2334. }
  2335. postIndex := iNdEx + msglen
  2336. if postIndex > l {
  2337. return io.ErrUnexpectedEOF
  2338. }
  2339. m.Members = append(m.Members, &RaftMember{})
  2340. if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2341. return err
  2342. }
  2343. iNdEx = postIndex
  2344. case 3:
  2345. if wireType == 2 {
  2346. var packedLen int
  2347. for shift := uint(0); ; shift += 7 {
  2348. if shift >= 64 {
  2349. return ErrIntOverflowRaft
  2350. }
  2351. if iNdEx >= l {
  2352. return io.ErrUnexpectedEOF
  2353. }
  2354. b := dAtA[iNdEx]
  2355. iNdEx++
  2356. packedLen |= (int(b) & 0x7F) << shift
  2357. if b < 0x80 {
  2358. break
  2359. }
  2360. }
  2361. if packedLen < 0 {
  2362. return ErrInvalidLengthRaft
  2363. }
  2364. postIndex := iNdEx + packedLen
  2365. if postIndex > l {
  2366. return io.ErrUnexpectedEOF
  2367. }
  2368. for iNdEx < postIndex {
  2369. var v uint64
  2370. for shift := uint(0); ; shift += 7 {
  2371. if shift >= 64 {
  2372. return ErrIntOverflowRaft
  2373. }
  2374. if iNdEx >= l {
  2375. return io.ErrUnexpectedEOF
  2376. }
  2377. b := dAtA[iNdEx]
  2378. iNdEx++
  2379. v |= (uint64(b) & 0x7F) << shift
  2380. if b < 0x80 {
  2381. break
  2382. }
  2383. }
  2384. m.RemovedMembers = append(m.RemovedMembers, v)
  2385. }
  2386. } else if wireType == 0 {
  2387. var v uint64
  2388. for shift := uint(0); ; shift += 7 {
  2389. if shift >= 64 {
  2390. return ErrIntOverflowRaft
  2391. }
  2392. if iNdEx >= l {
  2393. return io.ErrUnexpectedEOF
  2394. }
  2395. b := dAtA[iNdEx]
  2396. iNdEx++
  2397. v |= (uint64(b) & 0x7F) << shift
  2398. if b < 0x80 {
  2399. break
  2400. }
  2401. }
  2402. m.RemovedMembers = append(m.RemovedMembers, v)
  2403. } else {
  2404. return fmt.Errorf("proto: wrong wireType = %d for field RemovedMembers", wireType)
  2405. }
  2406. default:
  2407. iNdEx = preIndex
  2408. skippy, err := skipRaft(dAtA[iNdEx:])
  2409. if err != nil {
  2410. return err
  2411. }
  2412. if skippy < 0 {
  2413. return ErrInvalidLengthRaft
  2414. }
  2415. if (iNdEx + skippy) > l {
  2416. return io.ErrUnexpectedEOF
  2417. }
  2418. iNdEx += skippy
  2419. }
  2420. }
  2421. if iNdEx > l {
  2422. return io.ErrUnexpectedEOF
  2423. }
  2424. return nil
  2425. }
  2426. func (m *LeaveRequest) Unmarshal(dAtA []byte) error {
  2427. l := len(dAtA)
  2428. iNdEx := 0
  2429. for iNdEx < l {
  2430. preIndex := iNdEx
  2431. var wire uint64
  2432. for shift := uint(0); ; shift += 7 {
  2433. if shift >= 64 {
  2434. return ErrIntOverflowRaft
  2435. }
  2436. if iNdEx >= l {
  2437. return io.ErrUnexpectedEOF
  2438. }
  2439. b := dAtA[iNdEx]
  2440. iNdEx++
  2441. wire |= (uint64(b) & 0x7F) << shift
  2442. if b < 0x80 {
  2443. break
  2444. }
  2445. }
  2446. fieldNum := int32(wire >> 3)
  2447. wireType := int(wire & 0x7)
  2448. if wireType == 4 {
  2449. return fmt.Errorf("proto: LeaveRequest: wiretype end group for non-group")
  2450. }
  2451. if fieldNum <= 0 {
  2452. return fmt.Errorf("proto: LeaveRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2453. }
  2454. switch fieldNum {
  2455. case 1:
  2456. if wireType != 2 {
  2457. return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
  2458. }
  2459. var msglen int
  2460. for shift := uint(0); ; shift += 7 {
  2461. if shift >= 64 {
  2462. return ErrIntOverflowRaft
  2463. }
  2464. if iNdEx >= l {
  2465. return io.ErrUnexpectedEOF
  2466. }
  2467. b := dAtA[iNdEx]
  2468. iNdEx++
  2469. msglen |= (int(b) & 0x7F) << shift
  2470. if b < 0x80 {
  2471. break
  2472. }
  2473. }
  2474. if msglen < 0 {
  2475. return ErrInvalidLengthRaft
  2476. }
  2477. postIndex := iNdEx + msglen
  2478. if postIndex > l {
  2479. return io.ErrUnexpectedEOF
  2480. }
  2481. if m.Node == nil {
  2482. m.Node = &RaftMember{}
  2483. }
  2484. if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2485. return err
  2486. }
  2487. iNdEx = postIndex
  2488. default:
  2489. iNdEx = preIndex
  2490. skippy, err := skipRaft(dAtA[iNdEx:])
  2491. if err != nil {
  2492. return err
  2493. }
  2494. if skippy < 0 {
  2495. return ErrInvalidLengthRaft
  2496. }
  2497. if (iNdEx + skippy) > l {
  2498. return io.ErrUnexpectedEOF
  2499. }
  2500. iNdEx += skippy
  2501. }
  2502. }
  2503. if iNdEx > l {
  2504. return io.ErrUnexpectedEOF
  2505. }
  2506. return nil
  2507. }
  2508. func (m *LeaveResponse) Unmarshal(dAtA []byte) error {
  2509. l := len(dAtA)
  2510. iNdEx := 0
  2511. for iNdEx < l {
  2512. preIndex := iNdEx
  2513. var wire uint64
  2514. for shift := uint(0); ; shift += 7 {
  2515. if shift >= 64 {
  2516. return ErrIntOverflowRaft
  2517. }
  2518. if iNdEx >= l {
  2519. return io.ErrUnexpectedEOF
  2520. }
  2521. b := dAtA[iNdEx]
  2522. iNdEx++
  2523. wire |= (uint64(b) & 0x7F) << shift
  2524. if b < 0x80 {
  2525. break
  2526. }
  2527. }
  2528. fieldNum := int32(wire >> 3)
  2529. wireType := int(wire & 0x7)
  2530. if wireType == 4 {
  2531. return fmt.Errorf("proto: LeaveResponse: wiretype end group for non-group")
  2532. }
  2533. if fieldNum <= 0 {
  2534. return fmt.Errorf("proto: LeaveResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2535. }
  2536. switch fieldNum {
  2537. default:
  2538. iNdEx = preIndex
  2539. skippy, err := skipRaft(dAtA[iNdEx:])
  2540. if err != nil {
  2541. return err
  2542. }
  2543. if skippy < 0 {
  2544. return ErrInvalidLengthRaft
  2545. }
  2546. if (iNdEx + skippy) > l {
  2547. return io.ErrUnexpectedEOF
  2548. }
  2549. iNdEx += skippy
  2550. }
  2551. }
  2552. if iNdEx > l {
  2553. return io.ErrUnexpectedEOF
  2554. }
  2555. return nil
  2556. }
  2557. func (m *ProcessRaftMessageRequest) Unmarshal(dAtA []byte) error {
  2558. l := len(dAtA)
  2559. iNdEx := 0
  2560. for iNdEx < l {
  2561. preIndex := iNdEx
  2562. var wire uint64
  2563. for shift := uint(0); ; shift += 7 {
  2564. if shift >= 64 {
  2565. return ErrIntOverflowRaft
  2566. }
  2567. if iNdEx >= l {
  2568. return io.ErrUnexpectedEOF
  2569. }
  2570. b := dAtA[iNdEx]
  2571. iNdEx++
  2572. wire |= (uint64(b) & 0x7F) << shift
  2573. if b < 0x80 {
  2574. break
  2575. }
  2576. }
  2577. fieldNum := int32(wire >> 3)
  2578. wireType := int(wire & 0x7)
  2579. if wireType == 4 {
  2580. return fmt.Errorf("proto: ProcessRaftMessageRequest: wiretype end group for non-group")
  2581. }
  2582. if fieldNum <= 0 {
  2583. return fmt.Errorf("proto: ProcessRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2584. }
  2585. switch fieldNum {
  2586. case 1:
  2587. if wireType != 2 {
  2588. return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
  2589. }
  2590. var msglen int
  2591. for shift := uint(0); ; shift += 7 {
  2592. if shift >= 64 {
  2593. return ErrIntOverflowRaft
  2594. }
  2595. if iNdEx >= l {
  2596. return io.ErrUnexpectedEOF
  2597. }
  2598. b := dAtA[iNdEx]
  2599. iNdEx++
  2600. msglen |= (int(b) & 0x7F) << shift
  2601. if b < 0x80 {
  2602. break
  2603. }
  2604. }
  2605. if msglen < 0 {
  2606. return ErrInvalidLengthRaft
  2607. }
  2608. postIndex := iNdEx + msglen
  2609. if postIndex > l {
  2610. return io.ErrUnexpectedEOF
  2611. }
  2612. if m.Message == nil {
  2613. m.Message = &raftpb.Message{}
  2614. }
  2615. if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2616. return err
  2617. }
  2618. iNdEx = postIndex
  2619. default:
  2620. iNdEx = preIndex
  2621. skippy, err := skipRaft(dAtA[iNdEx:])
  2622. if err != nil {
  2623. return err
  2624. }
  2625. if skippy < 0 {
  2626. return ErrInvalidLengthRaft
  2627. }
  2628. if (iNdEx + skippy) > l {
  2629. return io.ErrUnexpectedEOF
  2630. }
  2631. iNdEx += skippy
  2632. }
  2633. }
  2634. if iNdEx > l {
  2635. return io.ErrUnexpectedEOF
  2636. }
  2637. return nil
  2638. }
  2639. func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error {
  2640. l := len(dAtA)
  2641. iNdEx := 0
  2642. for iNdEx < l {
  2643. preIndex := iNdEx
  2644. var wire uint64
  2645. for shift := uint(0); ; shift += 7 {
  2646. if shift >= 64 {
  2647. return ErrIntOverflowRaft
  2648. }
  2649. if iNdEx >= l {
  2650. return io.ErrUnexpectedEOF
  2651. }
  2652. b := dAtA[iNdEx]
  2653. iNdEx++
  2654. wire |= (uint64(b) & 0x7F) << shift
  2655. if b < 0x80 {
  2656. break
  2657. }
  2658. }
  2659. fieldNum := int32(wire >> 3)
  2660. wireType := int(wire & 0x7)
  2661. if wireType == 4 {
  2662. return fmt.Errorf("proto: ProcessRaftMessageResponse: wiretype end group for non-group")
  2663. }
  2664. if fieldNum <= 0 {
  2665. return fmt.Errorf("proto: ProcessRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2666. }
  2667. switch fieldNum {
  2668. default:
  2669. iNdEx = preIndex
  2670. skippy, err := skipRaft(dAtA[iNdEx:])
  2671. if err != nil {
  2672. return err
  2673. }
  2674. if skippy < 0 {
  2675. return ErrInvalidLengthRaft
  2676. }
  2677. if (iNdEx + skippy) > l {
  2678. return io.ErrUnexpectedEOF
  2679. }
  2680. iNdEx += skippy
  2681. }
  2682. }
  2683. if iNdEx > l {
  2684. return io.ErrUnexpectedEOF
  2685. }
  2686. return nil
  2687. }
  2688. func (m *ResolveAddressRequest) Unmarshal(dAtA []byte) error {
  2689. l := len(dAtA)
  2690. iNdEx := 0
  2691. for iNdEx < l {
  2692. preIndex := iNdEx
  2693. var wire uint64
  2694. for shift := uint(0); ; shift += 7 {
  2695. if shift >= 64 {
  2696. return ErrIntOverflowRaft
  2697. }
  2698. if iNdEx >= l {
  2699. return io.ErrUnexpectedEOF
  2700. }
  2701. b := dAtA[iNdEx]
  2702. iNdEx++
  2703. wire |= (uint64(b) & 0x7F) << shift
  2704. if b < 0x80 {
  2705. break
  2706. }
  2707. }
  2708. fieldNum := int32(wire >> 3)
  2709. wireType := int(wire & 0x7)
  2710. if wireType == 4 {
  2711. return fmt.Errorf("proto: ResolveAddressRequest: wiretype end group for non-group")
  2712. }
  2713. if fieldNum <= 0 {
  2714. return fmt.Errorf("proto: ResolveAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2715. }
  2716. switch fieldNum {
  2717. case 1:
  2718. if wireType != 0 {
  2719. return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType)
  2720. }
  2721. m.RaftID = 0
  2722. for shift := uint(0); ; shift += 7 {
  2723. if shift >= 64 {
  2724. return ErrIntOverflowRaft
  2725. }
  2726. if iNdEx >= l {
  2727. return io.ErrUnexpectedEOF
  2728. }
  2729. b := dAtA[iNdEx]
  2730. iNdEx++
  2731. m.RaftID |= (uint64(b) & 0x7F) << shift
  2732. if b < 0x80 {
  2733. break
  2734. }
  2735. }
  2736. default:
  2737. iNdEx = preIndex
  2738. skippy, err := skipRaft(dAtA[iNdEx:])
  2739. if err != nil {
  2740. return err
  2741. }
  2742. if skippy < 0 {
  2743. return ErrInvalidLengthRaft
  2744. }
  2745. if (iNdEx + skippy) > l {
  2746. return io.ErrUnexpectedEOF
  2747. }
  2748. iNdEx += skippy
  2749. }
  2750. }
  2751. if iNdEx > l {
  2752. return io.ErrUnexpectedEOF
  2753. }
  2754. return nil
  2755. }
  2756. func (m *ResolveAddressResponse) Unmarshal(dAtA []byte) error {
  2757. l := len(dAtA)
  2758. iNdEx := 0
  2759. for iNdEx < l {
  2760. preIndex := iNdEx
  2761. var wire uint64
  2762. for shift := uint(0); ; shift += 7 {
  2763. if shift >= 64 {
  2764. return ErrIntOverflowRaft
  2765. }
  2766. if iNdEx >= l {
  2767. return io.ErrUnexpectedEOF
  2768. }
  2769. b := dAtA[iNdEx]
  2770. iNdEx++
  2771. wire |= (uint64(b) & 0x7F) << shift
  2772. if b < 0x80 {
  2773. break
  2774. }
  2775. }
  2776. fieldNum := int32(wire >> 3)
  2777. wireType := int(wire & 0x7)
  2778. if wireType == 4 {
  2779. return fmt.Errorf("proto: ResolveAddressResponse: wiretype end group for non-group")
  2780. }
  2781. if fieldNum <= 0 {
  2782. return fmt.Errorf("proto: ResolveAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2783. }
  2784. switch fieldNum {
  2785. case 1:
  2786. if wireType != 2 {
  2787. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  2788. }
  2789. var stringLen uint64
  2790. for shift := uint(0); ; shift += 7 {
  2791. if shift >= 64 {
  2792. return ErrIntOverflowRaft
  2793. }
  2794. if iNdEx >= l {
  2795. return io.ErrUnexpectedEOF
  2796. }
  2797. b := dAtA[iNdEx]
  2798. iNdEx++
  2799. stringLen |= (uint64(b) & 0x7F) << shift
  2800. if b < 0x80 {
  2801. break
  2802. }
  2803. }
  2804. intStringLen := int(stringLen)
  2805. if intStringLen < 0 {
  2806. return ErrInvalidLengthRaft
  2807. }
  2808. postIndex := iNdEx + intStringLen
  2809. if postIndex > l {
  2810. return io.ErrUnexpectedEOF
  2811. }
  2812. m.Addr = string(dAtA[iNdEx:postIndex])
  2813. iNdEx = postIndex
  2814. default:
  2815. iNdEx = preIndex
  2816. skippy, err := skipRaft(dAtA[iNdEx:])
  2817. if err != nil {
  2818. return err
  2819. }
  2820. if skippy < 0 {
  2821. return ErrInvalidLengthRaft
  2822. }
  2823. if (iNdEx + skippy) > l {
  2824. return io.ErrUnexpectedEOF
  2825. }
  2826. iNdEx += skippy
  2827. }
  2828. }
  2829. if iNdEx > l {
  2830. return io.ErrUnexpectedEOF
  2831. }
  2832. return nil
  2833. }
  2834. func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error {
  2835. l := len(dAtA)
  2836. iNdEx := 0
  2837. for iNdEx < l {
  2838. preIndex := iNdEx
  2839. var wire uint64
  2840. for shift := uint(0); ; shift += 7 {
  2841. if shift >= 64 {
  2842. return ErrIntOverflowRaft
  2843. }
  2844. if iNdEx >= l {
  2845. return io.ErrUnexpectedEOF
  2846. }
  2847. b := dAtA[iNdEx]
  2848. iNdEx++
  2849. wire |= (uint64(b) & 0x7F) << shift
  2850. if b < 0x80 {
  2851. break
  2852. }
  2853. }
  2854. fieldNum := int32(wire >> 3)
  2855. wireType := int(wire & 0x7)
  2856. if wireType == 4 {
  2857. return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group")
  2858. }
  2859. if fieldNum <= 0 {
  2860. return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2861. }
  2862. switch fieldNum {
  2863. case 1:
  2864. if wireType != 0 {
  2865. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2866. }
  2867. m.ID = 0
  2868. for shift := uint(0); ; shift += 7 {
  2869. if shift >= 64 {
  2870. return ErrIntOverflowRaft
  2871. }
  2872. if iNdEx >= l {
  2873. return io.ErrUnexpectedEOF
  2874. }
  2875. b := dAtA[iNdEx]
  2876. iNdEx++
  2877. m.ID |= (uint64(b) & 0x7F) << shift
  2878. if b < 0x80 {
  2879. break
  2880. }
  2881. }
  2882. case 2:
  2883. if wireType != 2 {
  2884. return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  2885. }
  2886. var msglen int
  2887. for shift := uint(0); ; shift += 7 {
  2888. if shift >= 64 {
  2889. return ErrIntOverflowRaft
  2890. }
  2891. if iNdEx >= l {
  2892. return io.ErrUnexpectedEOF
  2893. }
  2894. b := dAtA[iNdEx]
  2895. iNdEx++
  2896. msglen |= (int(b) & 0x7F) << shift
  2897. if b < 0x80 {
  2898. break
  2899. }
  2900. }
  2901. if msglen < 0 {
  2902. return ErrInvalidLengthRaft
  2903. }
  2904. postIndex := iNdEx + msglen
  2905. if postIndex > l {
  2906. return io.ErrUnexpectedEOF
  2907. }
  2908. m.Action = append(m.Action, StoreAction{})
  2909. if err := m.Action[len(m.Action)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2910. return err
  2911. }
  2912. iNdEx = postIndex
  2913. default:
  2914. iNdEx = preIndex
  2915. skippy, err := skipRaft(dAtA[iNdEx:])
  2916. if err != nil {
  2917. return err
  2918. }
  2919. if skippy < 0 {
  2920. return ErrInvalidLengthRaft
  2921. }
  2922. if (iNdEx + skippy) > l {
  2923. return io.ErrUnexpectedEOF
  2924. }
  2925. iNdEx += skippy
  2926. }
  2927. }
  2928. if iNdEx > l {
  2929. return io.ErrUnexpectedEOF
  2930. }
  2931. return nil
  2932. }
  2933. func (m *StoreAction) Unmarshal(dAtA []byte) error {
  2934. l := len(dAtA)
  2935. iNdEx := 0
  2936. for iNdEx < l {
  2937. preIndex := iNdEx
  2938. var wire uint64
  2939. for shift := uint(0); ; shift += 7 {
  2940. if shift >= 64 {
  2941. return ErrIntOverflowRaft
  2942. }
  2943. if iNdEx >= l {
  2944. return io.ErrUnexpectedEOF
  2945. }
  2946. b := dAtA[iNdEx]
  2947. iNdEx++
  2948. wire |= (uint64(b) & 0x7F) << shift
  2949. if b < 0x80 {
  2950. break
  2951. }
  2952. }
  2953. fieldNum := int32(wire >> 3)
  2954. wireType := int(wire & 0x7)
  2955. if wireType == 4 {
  2956. return fmt.Errorf("proto: StoreAction: wiretype end group for non-group")
  2957. }
  2958. if fieldNum <= 0 {
  2959. return fmt.Errorf("proto: StoreAction: illegal tag %d (wire type %d)", fieldNum, wire)
  2960. }
  2961. switch fieldNum {
  2962. case 1:
  2963. if wireType != 0 {
  2964. return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  2965. }
  2966. m.Action = 0
  2967. for shift := uint(0); ; shift += 7 {
  2968. if shift >= 64 {
  2969. return ErrIntOverflowRaft
  2970. }
  2971. if iNdEx >= l {
  2972. return io.ErrUnexpectedEOF
  2973. }
  2974. b := dAtA[iNdEx]
  2975. iNdEx++
  2976. m.Action |= (StoreActionKind(b) & 0x7F) << shift
  2977. if b < 0x80 {
  2978. break
  2979. }
  2980. }
  2981. case 2:
  2982. if wireType != 2 {
  2983. return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
  2984. }
  2985. var msglen int
  2986. for shift := uint(0); ; shift += 7 {
  2987. if shift >= 64 {
  2988. return ErrIntOverflowRaft
  2989. }
  2990. if iNdEx >= l {
  2991. return io.ErrUnexpectedEOF
  2992. }
  2993. b := dAtA[iNdEx]
  2994. iNdEx++
  2995. msglen |= (int(b) & 0x7F) << shift
  2996. if b < 0x80 {
  2997. break
  2998. }
  2999. }
  3000. if msglen < 0 {
  3001. return ErrInvalidLengthRaft
  3002. }
  3003. postIndex := iNdEx + msglen
  3004. if postIndex > l {
  3005. return io.ErrUnexpectedEOF
  3006. }
  3007. v := &Node{}
  3008. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3009. return err
  3010. }
  3011. m.Target = &StoreAction_Node{v}
  3012. iNdEx = postIndex
  3013. case 3:
  3014. if wireType != 2 {
  3015. return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
  3016. }
  3017. var msglen int
  3018. for shift := uint(0); ; shift += 7 {
  3019. if shift >= 64 {
  3020. return ErrIntOverflowRaft
  3021. }
  3022. if iNdEx >= l {
  3023. return io.ErrUnexpectedEOF
  3024. }
  3025. b := dAtA[iNdEx]
  3026. iNdEx++
  3027. msglen |= (int(b) & 0x7F) << shift
  3028. if b < 0x80 {
  3029. break
  3030. }
  3031. }
  3032. if msglen < 0 {
  3033. return ErrInvalidLengthRaft
  3034. }
  3035. postIndex := iNdEx + msglen
  3036. if postIndex > l {
  3037. return io.ErrUnexpectedEOF
  3038. }
  3039. v := &Service{}
  3040. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3041. return err
  3042. }
  3043. m.Target = &StoreAction_Service{v}
  3044. iNdEx = postIndex
  3045. case 4:
  3046. if wireType != 2 {
  3047. return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
  3048. }
  3049. var msglen int
  3050. for shift := uint(0); ; shift += 7 {
  3051. if shift >= 64 {
  3052. return ErrIntOverflowRaft
  3053. }
  3054. if iNdEx >= l {
  3055. return io.ErrUnexpectedEOF
  3056. }
  3057. b := dAtA[iNdEx]
  3058. iNdEx++
  3059. msglen |= (int(b) & 0x7F) << shift
  3060. if b < 0x80 {
  3061. break
  3062. }
  3063. }
  3064. if msglen < 0 {
  3065. return ErrInvalidLengthRaft
  3066. }
  3067. postIndex := iNdEx + msglen
  3068. if postIndex > l {
  3069. return io.ErrUnexpectedEOF
  3070. }
  3071. v := &Task{}
  3072. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3073. return err
  3074. }
  3075. m.Target = &StoreAction_Task{v}
  3076. iNdEx = postIndex
  3077. case 5:
  3078. if wireType != 2 {
  3079. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  3080. }
  3081. var msglen int
  3082. for shift := uint(0); ; shift += 7 {
  3083. if shift >= 64 {
  3084. return ErrIntOverflowRaft
  3085. }
  3086. if iNdEx >= l {
  3087. return io.ErrUnexpectedEOF
  3088. }
  3089. b := dAtA[iNdEx]
  3090. iNdEx++
  3091. msglen |= (int(b) & 0x7F) << shift
  3092. if b < 0x80 {
  3093. break
  3094. }
  3095. }
  3096. if msglen < 0 {
  3097. return ErrInvalidLengthRaft
  3098. }
  3099. postIndex := iNdEx + msglen
  3100. if postIndex > l {
  3101. return io.ErrUnexpectedEOF
  3102. }
  3103. v := &Network{}
  3104. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3105. return err
  3106. }
  3107. m.Target = &StoreAction_Network{v}
  3108. iNdEx = postIndex
  3109. case 6:
  3110. if wireType != 2 {
  3111. return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
  3112. }
  3113. var msglen int
  3114. for shift := uint(0); ; shift += 7 {
  3115. if shift >= 64 {
  3116. return ErrIntOverflowRaft
  3117. }
  3118. if iNdEx >= l {
  3119. return io.ErrUnexpectedEOF
  3120. }
  3121. b := dAtA[iNdEx]
  3122. iNdEx++
  3123. msglen |= (int(b) & 0x7F) << shift
  3124. if b < 0x80 {
  3125. break
  3126. }
  3127. }
  3128. if msglen < 0 {
  3129. return ErrInvalidLengthRaft
  3130. }
  3131. postIndex := iNdEx + msglen
  3132. if postIndex > l {
  3133. return io.ErrUnexpectedEOF
  3134. }
  3135. v := &Cluster{}
  3136. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3137. return err
  3138. }
  3139. m.Target = &StoreAction_Cluster{v}
  3140. iNdEx = postIndex
  3141. case 7:
  3142. if wireType != 2 {
  3143. return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType)
  3144. }
  3145. var msglen int
  3146. for shift := uint(0); ; shift += 7 {
  3147. if shift >= 64 {
  3148. return ErrIntOverflowRaft
  3149. }
  3150. if iNdEx >= l {
  3151. return io.ErrUnexpectedEOF
  3152. }
  3153. b := dAtA[iNdEx]
  3154. iNdEx++
  3155. msglen |= (int(b) & 0x7F) << shift
  3156. if b < 0x80 {
  3157. break
  3158. }
  3159. }
  3160. if msglen < 0 {
  3161. return ErrInvalidLengthRaft
  3162. }
  3163. postIndex := iNdEx + msglen
  3164. if postIndex > l {
  3165. return io.ErrUnexpectedEOF
  3166. }
  3167. v := &Secret{}
  3168. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3169. return err
  3170. }
  3171. m.Target = &StoreAction_Secret{v}
  3172. iNdEx = postIndex
  3173. case 8:
  3174. if wireType != 2 {
  3175. return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
  3176. }
  3177. var msglen int
  3178. for shift := uint(0); ; shift += 7 {
  3179. if shift >= 64 {
  3180. return ErrIntOverflowRaft
  3181. }
  3182. if iNdEx >= l {
  3183. return io.ErrUnexpectedEOF
  3184. }
  3185. b := dAtA[iNdEx]
  3186. iNdEx++
  3187. msglen |= (int(b) & 0x7F) << shift
  3188. if b < 0x80 {
  3189. break
  3190. }
  3191. }
  3192. if msglen < 0 {
  3193. return ErrInvalidLengthRaft
  3194. }
  3195. postIndex := iNdEx + msglen
  3196. if postIndex > l {
  3197. return io.ErrUnexpectedEOF
  3198. }
  3199. v := &Resource{}
  3200. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3201. return err
  3202. }
  3203. m.Target = &StoreAction_Resource{v}
  3204. iNdEx = postIndex
  3205. case 9:
  3206. if wireType != 2 {
  3207. return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
  3208. }
  3209. var msglen int
  3210. for shift := uint(0); ; shift += 7 {
  3211. if shift >= 64 {
  3212. return ErrIntOverflowRaft
  3213. }
  3214. if iNdEx >= l {
  3215. return io.ErrUnexpectedEOF
  3216. }
  3217. b := dAtA[iNdEx]
  3218. iNdEx++
  3219. msglen |= (int(b) & 0x7F) << shift
  3220. if b < 0x80 {
  3221. break
  3222. }
  3223. }
  3224. if msglen < 0 {
  3225. return ErrInvalidLengthRaft
  3226. }
  3227. postIndex := iNdEx + msglen
  3228. if postIndex > l {
  3229. return io.ErrUnexpectedEOF
  3230. }
  3231. v := &Extension{}
  3232. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3233. return err
  3234. }
  3235. m.Target = &StoreAction_Extension{v}
  3236. iNdEx = postIndex
  3237. case 10:
  3238. if wireType != 2 {
  3239. return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
  3240. }
  3241. var msglen int
  3242. for shift := uint(0); ; shift += 7 {
  3243. if shift >= 64 {
  3244. return ErrIntOverflowRaft
  3245. }
  3246. if iNdEx >= l {
  3247. return io.ErrUnexpectedEOF
  3248. }
  3249. b := dAtA[iNdEx]
  3250. iNdEx++
  3251. msglen |= (int(b) & 0x7F) << shift
  3252. if b < 0x80 {
  3253. break
  3254. }
  3255. }
  3256. if msglen < 0 {
  3257. return ErrInvalidLengthRaft
  3258. }
  3259. postIndex := iNdEx + msglen
  3260. if postIndex > l {
  3261. return io.ErrUnexpectedEOF
  3262. }
  3263. v := &Config{}
  3264. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3265. return err
  3266. }
  3267. m.Target = &StoreAction_Config{v}
  3268. iNdEx = postIndex
  3269. default:
  3270. iNdEx = preIndex
  3271. skippy, err := skipRaft(dAtA[iNdEx:])
  3272. if err != nil {
  3273. return err
  3274. }
  3275. if skippy < 0 {
  3276. return ErrInvalidLengthRaft
  3277. }
  3278. if (iNdEx + skippy) > l {
  3279. return io.ErrUnexpectedEOF
  3280. }
  3281. iNdEx += skippy
  3282. }
  3283. }
  3284. if iNdEx > l {
  3285. return io.ErrUnexpectedEOF
  3286. }
  3287. return nil
  3288. }
  3289. func skipRaft(dAtA []byte) (n int, err error) {
  3290. l := len(dAtA)
  3291. iNdEx := 0
  3292. for iNdEx < l {
  3293. var wire uint64
  3294. for shift := uint(0); ; shift += 7 {
  3295. if shift >= 64 {
  3296. return 0, ErrIntOverflowRaft
  3297. }
  3298. if iNdEx >= l {
  3299. return 0, io.ErrUnexpectedEOF
  3300. }
  3301. b := dAtA[iNdEx]
  3302. iNdEx++
  3303. wire |= (uint64(b) & 0x7F) << shift
  3304. if b < 0x80 {
  3305. break
  3306. }
  3307. }
  3308. wireType := int(wire & 0x7)
  3309. switch wireType {
  3310. case 0:
  3311. for shift := uint(0); ; shift += 7 {
  3312. if shift >= 64 {
  3313. return 0, ErrIntOverflowRaft
  3314. }
  3315. if iNdEx >= l {
  3316. return 0, io.ErrUnexpectedEOF
  3317. }
  3318. iNdEx++
  3319. if dAtA[iNdEx-1] < 0x80 {
  3320. break
  3321. }
  3322. }
  3323. return iNdEx, nil
  3324. case 1:
  3325. iNdEx += 8
  3326. return iNdEx, nil
  3327. case 2:
  3328. var length int
  3329. for shift := uint(0); ; shift += 7 {
  3330. if shift >= 64 {
  3331. return 0, ErrIntOverflowRaft
  3332. }
  3333. if iNdEx >= l {
  3334. return 0, io.ErrUnexpectedEOF
  3335. }
  3336. b := dAtA[iNdEx]
  3337. iNdEx++
  3338. length |= (int(b) & 0x7F) << shift
  3339. if b < 0x80 {
  3340. break
  3341. }
  3342. }
  3343. iNdEx += length
  3344. if length < 0 {
  3345. return 0, ErrInvalidLengthRaft
  3346. }
  3347. return iNdEx, nil
  3348. case 3:
  3349. for {
  3350. var innerWire uint64
  3351. var start int = iNdEx
  3352. for shift := uint(0); ; shift += 7 {
  3353. if shift >= 64 {
  3354. return 0, ErrIntOverflowRaft
  3355. }
  3356. if iNdEx >= l {
  3357. return 0, io.ErrUnexpectedEOF
  3358. }
  3359. b := dAtA[iNdEx]
  3360. iNdEx++
  3361. innerWire |= (uint64(b) & 0x7F) << shift
  3362. if b < 0x80 {
  3363. break
  3364. }
  3365. }
  3366. innerWireType := int(innerWire & 0x7)
  3367. if innerWireType == 4 {
  3368. break
  3369. }
  3370. next, err := skipRaft(dAtA[start:])
  3371. if err != nil {
  3372. return 0, err
  3373. }
  3374. iNdEx = start + next
  3375. }
  3376. return iNdEx, nil
  3377. case 4:
  3378. return iNdEx, nil
  3379. case 5:
  3380. iNdEx += 4
  3381. return iNdEx, nil
  3382. default:
  3383. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  3384. }
  3385. }
  3386. panic("unreachable")
  3387. }
  3388. var (
  3389. ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling")
  3390. ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow")
  3391. )
  3392. func init() { proto.RegisterFile("raft.proto", fileDescriptorRaft) }
  3393. var fileDescriptorRaft = []byte{
  3394. // 949 bytes of a gzipped FileDescriptorProto
  3395. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0x4f, 0x6f, 0x1b, 0x45,
  3396. 0x18, 0xc6, 0x77, 0xed, 0xad, 0x9d, 0xbc, 0x6e, 0xe2, 0x68, 0x42, 0xc2, 0x76, 0x29, 0x8e, 0xbb,
  3397. 0x45, 0xaa, 0x5b, 0x91, 0xb5, 0x30, 0x48, 0xa0, 0x42, 0x0f, 0xb1, 0x63, 0xc9, 0xa6, 0xad, 0x53,
  3398. 0x6d, 0x12, 0xe8, 0x2d, 0xac, 0x77, 0x27, 0xee, 0x62, 0x7b, 0xc7, 0xcc, 0x8c, 0x1d, 0xb8, 0xa0,
  3399. 0x1e, 0x51, 0xae, 0x48, 0xc0, 0xa5, 0x27, 0x38, 0xf7, 0x03, 0xf0, 0x01, 0x50, 0xc4, 0x89, 0x1b,
  3400. 0x9c, 0x22, 0xea, 0x0f, 0x00, 0x5f, 0x01, 0xcd, 0xec, 0xae, 0x1d, 0x9c, 0xb5, 0x9b, 0x8b, 0x3d,
  3401. 0x9e, 0xf9, 0x3d, 0xef, 0xf3, 0xce, 0xbf, 0x77, 0x0c, 0x40, 0x9d, 0x63, 0x6e, 0x0d, 0x28, 0xe1,
  3402. 0x04, 0x21, 0x8f, 0xb8, 0x5d, 0x4c, 0x2d, 0x76, 0xe2, 0xd0, 0x7e, 0xd7, 0xe7, 0xd6, 0xe8, 0x3d,
  3403. 0x63, 0x85, 0xb4, 0xbf, 0xc4, 0x2e, 0x67, 0x21, 0x62, 0xe4, 0xf8, 0x37, 0x03, 0x1c, 0xff, 0xd8,
  3404. 0xee, 0xf8, 0xfc, 0xd9, 0xb0, 0x6d, 0xb9, 0xa4, 0x5f, 0x76, 0x09, 0xc5, 0x84, 0x95, 0x31, 0x77,
  3405. 0xbd, 0xb2, 0x08, 0x29, 0x3f, 0x06, 0xed, 0xf2, 0x34, 0xbc, 0xf1, 0x46, 0x87, 0x74, 0x88, 0x6c,
  3406. 0x96, 0x45, 0x2b, 0xea, 0x5d, 0x1f, 0xf4, 0x86, 0x1d, 0x3f, 0x28, 0x87, 0x5f, 0x61, 0xa7, 0xf9,
  3407. 0x52, 0x05, 0xb0, 0x9d, 0x63, 0xfe, 0x18, 0xf7, 0xdb, 0x98, 0xa2, 0xdb, 0x90, 0x15, 0x71, 0x8e,
  3408. 0x7c, 0x4f, 0x57, 0x8b, 0x6a, 0x49, 0xab, 0xc2, 0xf8, 0x7c, 0x2b, 0x23, 0x80, 0xe6, 0xae, 0x9d,
  3409. 0x11, 0x43, 0x4d, 0x4f, 0x40, 0x01, 0xf1, 0xb0, 0x80, 0x52, 0x45, 0xb5, 0xb4, 0x1c, 0x42, 0x2d,
  3410. 0xe2, 0x61, 0x01, 0x89, 0xa1, 0xa6, 0x87, 0x10, 0x68, 0x8e, 0xe7, 0x51, 0x3d, 0x2d, 0x08, 0x5b,
  3411. 0xb6, 0x51, 0x15, 0x32, 0x8c, 0x3b, 0x7c, 0xc8, 0x74, 0xad, 0xa8, 0x96, 0x72, 0x95, 0x77, 0xac,
  3412. 0xcb, 0xeb, 0x60, 0x4d, 0xb3, 0xd9, 0x97, 0x6c, 0x55, 0x3b, 0x3b, 0xdf, 0x52, 0xec, 0x48, 0x69,
  3413. 0xde, 0x82, 0xdc, 0xa7, 0xc4, 0x0f, 0x6c, 0xfc, 0xd5, 0x10, 0x33, 0x3e, 0xb1, 0x51, 0xa7, 0x36,
  3414. 0xe6, 0x0f, 0x2a, 0x5c, 0x0f, 0x19, 0x36, 0x20, 0x01, 0xc3, 0x57, 0x9b, 0xd5, 0x47, 0x90, 0xed,
  3415. 0x4b, 0x5b, 0xa6, 0xa7, 0x8a, 0xe9, 0x52, 0xae, 0x52, 0x58, 0x9c, 0x9d, 0x1d, 0xe3, 0xe8, 0x0e,
  3416. 0xe4, 0x29, 0xee, 0x93, 0x11, 0xf6, 0x8e, 0xe2, 0x08, 0xe9, 0x62, 0xba, 0xa4, 0xd9, 0xab, 0x51,
  3417. 0x77, 0x28, 0x60, 0x66, 0x15, 0xae, 0x3f, 0xc2, 0xce, 0x08, 0xc7, 0xc9, 0x57, 0x40, 0x13, 0xab,
  3418. 0x25, 0x93, 0x7a, 0xbd, 0x9f, 0x64, 0xcd, 0x3c, 0xac, 0x44, 0x31, 0xc2, 0xc9, 0x99, 0x8f, 0xe0,
  3419. 0xc6, 0x13, 0x4a, 0x5c, 0xcc, 0x58, 0xc8, 0x32, 0xe6, 0x74, 0x26, 0x0e, 0x77, 0xc5, 0xa4, 0x64,
  3420. 0x4f, 0x64, 0x92, 0xb7, 0xc2, 0xe3, 0x62, 0xc5, 0x60, 0x3c, 0x7e, 0x5f, 0x7b, 0xfe, 0xa3, 0xa9,
  3421. 0x98, 0x37, 0xc1, 0x48, 0x8a, 0x16, 0x79, 0x7d, 0x02, 0x1b, 0x36, 0x66, 0xa4, 0x37, 0xc2, 0x3b,
  3422. 0x9e, 0x47, 0x05, 0x14, 0xf9, 0x5c, 0x65, 0x85, 0xcd, 0x77, 0x61, 0x73, 0x56, 0x1d, 0x6d, 0x50,
  3423. 0xd2, 0x2e, 0xf6, 0x60, 0xbd, 0x19, 0x70, 0x4c, 0x03, 0xa7, 0x27, 0xe2, 0xc4, 0x4e, 0x9b, 0x90,
  3424. 0x9a, 0x98, 0x64, 0xc6, 0xe7, 0x5b, 0xa9, 0xe6, 0xae, 0x9d, 0xf2, 0x3d, 0xf4, 0x00, 0x32, 0x8e,
  3425. 0xcb, 0x7d, 0x12, 0x44, 0xbb, 0xb7, 0x95, 0xb4, 0x9a, 0xfb, 0x9c, 0x50, 0xbc, 0x23, 0xb1, 0xf8,
  3426. 0x58, 0x85, 0x22, 0xf3, 0x37, 0x0d, 0x72, 0x17, 0x46, 0xd1, 0xc7, 0x93, 0x70, 0xc2, 0x6a, 0xb5,
  3427. 0x72, 0xfb, 0x35, 0xe1, 0x1e, 0xfa, 0x81, 0x17, 0x07, 0x43, 0x56, 0xb4, 0xaf, 0x29, 0xb9, 0xe4,
  3428. 0x7a, 0x92, 0x54, 0xdc, 0x96, 0x86, 0x12, 0xee, 0x29, 0xfa, 0x10, 0xb2, 0x0c, 0xd3, 0x91, 0xef,
  3429. 0x62, 0x79, 0x5d, 0x72, 0x95, 0xb7, 0x12, 0xdd, 0x42, 0xa4, 0xa1, 0xd8, 0x31, 0x2d, 0x8c, 0xb8,
  3430. 0xc3, 0xba, 0xd1, 0x75, 0x4a, 0x34, 0x3a, 0x70, 0x58, 0x57, 0x18, 0x09, 0x4e, 0x18, 0x05, 0x98,
  3431. 0x9f, 0x10, 0xda, 0xd5, 0xaf, 0xcd, 0x37, 0x6a, 0x85, 0x88, 0x30, 0x8a, 0x68, 0x21, 0x74, 0x7b,
  3432. 0x43, 0xc6, 0x31, 0xd5, 0x33, 0xf3, 0x85, 0xb5, 0x10, 0x11, 0xc2, 0x88, 0x46, 0x1f, 0x40, 0x86,
  3433. 0x61, 0x97, 0x62, 0xae, 0x67, 0xa5, 0xce, 0x48, 0x9e, 0x99, 0x20, 0x1a, 0xe2, 0x92, 0xcb, 0x16,
  3434. 0xba, 0x0f, 0x4b, 0x14, 0x33, 0x32, 0xa4, 0x2e, 0xd6, 0x97, 0xa4, 0xee, 0x66, 0xe2, 0xe5, 0x88,
  3435. 0x98, 0x86, 0x62, 0x4f, 0x78, 0xf4, 0x00, 0x96, 0xf1, 0xd7, 0x1c, 0x07, 0x4c, 0x6c, 0xde, 0xb2,
  3436. 0x14, 0xbf, 0x9d, 0x24, 0xae, 0xc7, 0x50, 0x43, 0xb1, 0xa7, 0x0a, 0x91, 0xb0, 0x4b, 0x82, 0x63,
  3437. 0xbf, 0xa3, 0xc3, 0xfc, 0x84, 0x6b, 0x92, 0x10, 0x09, 0x87, 0x6c, 0x75, 0x09, 0x32, 0xdc, 0xa1,
  3438. 0x1d, 0xcc, 0xef, 0xfd, 0xab, 0x42, 0x7e, 0xe6, 0x5c, 0xa0, 0x3b, 0x90, 0x3d, 0x6c, 0x3d, 0x6c,
  3439. 0xed, 0x7d, 0xde, 0x5a, 0x53, 0x0c, 0xe3, 0xf4, 0x45, 0x71, 0x73, 0x86, 0x38, 0x0c, 0xba, 0x01,
  3440. 0x39, 0x09, 0x50, 0x05, 0xd6, 0xf7, 0x0f, 0xf6, 0xec, 0xfa, 0xd1, 0x4e, 0xed, 0xa0, 0xb9, 0xd7,
  3441. 0x3a, 0xaa, 0xd9, 0xf5, 0x9d, 0x83, 0xfa, 0x9a, 0x6a, 0xdc, 0x38, 0x7d, 0x51, 0xdc, 0x98, 0x11,
  3442. 0xd5, 0x28, 0x76, 0x38, 0xbe, 0xa4, 0x39, 0x7c, 0xb2, 0x2b, 0x34, 0xa9, 0x44, 0xcd, 0xe1, 0xc0,
  3443. 0x4b, 0xd2, 0xd8, 0xf5, 0xc7, 0x7b, 0x9f, 0xd5, 0xd7, 0xd2, 0x89, 0x1a, 0x5b, 0x16, 0x31, 0xe3,
  3444. 0xcd, 0xef, 0x7e, 0x2e, 0x28, 0xbf, 0xfe, 0x52, 0x98, 0x9d, 0x5d, 0xe5, 0xfb, 0x14, 0x68, 0xe2,
  3445. 0x86, 0xa2, 0x53, 0x15, 0xd0, 0xe5, 0xe2, 0x81, 0xb6, 0x93, 0x56, 0x70, 0x6e, 0xc9, 0x32, 0xac,
  3446. 0xab, 0xe2, 0x51, 0x4d, 0xda, 0xf8, 0xfd, 0xe5, 0x3f, 0x3f, 0xa5, 0xf2, 0xb0, 0x22, 0xf9, 0xed,
  3447. 0xbe, 0x13, 0x38, 0x1d, 0x4c, 0xd1, 0xb7, 0xb0, 0xfa, 0xff, 0x62, 0x83, 0xee, 0xce, 0x3b, 0x42,
  3448. 0x97, 0xca, 0x99, 0x71, 0xef, 0x2a, 0xe8, 0x42, 0xff, 0xca, 0x9f, 0x2a, 0xac, 0x4e, 0x8b, 0x37,
  3449. 0x7b, 0xe6, 0x0f, 0xd0, 0x17, 0xa0, 0x89, 0x67, 0x09, 0x25, 0x96, 0xa6, 0x0b, 0x8f, 0x9a, 0x51,
  3450. 0x9c, 0x0f, 0x2c, 0x9e, 0xb4, 0x0b, 0xd7, 0xe4, 0xe3, 0x80, 0x12, 0x23, 0x5c, 0x7c, 0x7b, 0x8c,
  3451. 0x5b, 0x0b, 0x88, 0x85, 0x26, 0x55, 0xfd, 0xec, 0x55, 0x41, 0xf9, 0xeb, 0x55, 0x41, 0x79, 0x3e,
  3452. 0x2e, 0xa8, 0x67, 0xe3, 0x82, 0xfa, 0xc7, 0xb8, 0xa0, 0xfe, 0x3d, 0x2e, 0xa8, 0x4f, 0xd3, 0x4f,
  3453. 0xb5, 0x76, 0x46, 0xfe, 0xaf, 0x78, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0x31, 0xfd,
  3454. 0xe7, 0xef, 0x08, 0x00, 0x00,
  3455. }