logbroker.pb.go 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190
  1. // Code generated by protoc-gen-gogo.
  2. // source: logbroker.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 _ "github.com/gogo/protobuf/gogoproto"
  9. import docker_swarmkit_v1 "github.com/docker/swarmkit/api/timestamp"
  10. import _ "github.com/docker/swarmkit/protobuf/plugin"
  11. import strings "strings"
  12. import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
  13. import sort "sort"
  14. import strconv "strconv"
  15. import reflect "reflect"
  16. import (
  17. context "golang.org/x/net/context"
  18. grpc "google.golang.org/grpc"
  19. )
  20. import raftselector "github.com/docker/swarmkit/manager/raftselector"
  21. import codes "google.golang.org/grpc/codes"
  22. import metadata "google.golang.org/grpc/metadata"
  23. import transport "google.golang.org/grpc/transport"
  24. import time "time"
  25. import io "io"
  26. // Reference imports to suppress errors if they are not otherwise used.
  27. var _ = proto.Marshal
  28. var _ = fmt.Errorf
  29. var _ = math.Inf
  30. // LogStream defines the stream from which the log message came.
  31. type LogStream int32
  32. const (
  33. LogStreamUnknown LogStream = 0
  34. LogStreamStdout LogStream = 1
  35. LogStreamStderr LogStream = 2
  36. )
  37. var LogStream_name = map[int32]string{
  38. 0: "LOG_STREAM_UNKNOWN",
  39. 1: "LOG_STREAM_STDOUT",
  40. 2: "LOG_STREAM_STDERR",
  41. }
  42. var LogStream_value = map[string]int32{
  43. "LOG_STREAM_UNKNOWN": 0,
  44. "LOG_STREAM_STDOUT": 1,
  45. "LOG_STREAM_STDERR": 2,
  46. }
  47. func (x LogStream) String() string {
  48. return proto.EnumName(LogStream_name, int32(x))
  49. }
  50. func (LogStream) EnumDescriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{0} }
  51. type LogSubscriptionOptions struct {
  52. // Streams defines which log streams should be sent from the task source.
  53. // Empty means send all the messages.
  54. Streams []LogStream `protobuf:"varint,1,rep,name=streams,enum=docker.swarmkit.v1.LogStream" json:"streams,omitempty"`
  55. // Follow instructs the publisher to continue sending log messages as they
  56. // are produced, after satisfying the initial query.
  57. Follow bool `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"`
  58. // Tail defines how many messages relative to the log stream to send when
  59. // starting the stream.
  60. //
  61. // Positive values will skip that number of messages from the start of the
  62. // stream before publishing.
  63. //
  64. // Negative values will specify messages relative to the end of the stream,
  65. // offset by one. We can say that the last (-n-1) lines are returned when n
  66. // < 0. As reference, -1 would mean send no log lines (typically used with
  67. // follow), -2 would return the last log line, -11 would return the last 10
  68. // and so on.
  69. //
  70. // The default value of zero will return all logs.
  71. //
  72. // Note that this is very different from the Docker API.
  73. Tail int64 `protobuf:"varint,3,opt,name=tail,proto3" json:"tail,omitempty"`
  74. // Since indicates that only log messages produced after this timestamp
  75. // should be sent.
  76. Since *docker_swarmkit_v1.Timestamp `protobuf:"bytes,4,opt,name=since" json:"since,omitempty"`
  77. }
  78. func (m *LogSubscriptionOptions) Reset() { *m = LogSubscriptionOptions{} }
  79. func (*LogSubscriptionOptions) ProtoMessage() {}
  80. func (*LogSubscriptionOptions) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{0} }
  81. // LogSelector will match logs from ANY of the defined parameters.
  82. //
  83. // For the best effect, the client should use the least specific parameter
  84. // possible. For example, if they want to listen to all the tasks of a service,
  85. // they should use the service id, rather than specifying the individual tasks.
  86. type LogSelector struct {
  87. ServiceIDs []string `protobuf:"bytes,1,rep,name=service_ids,json=serviceIds" json:"service_ids,omitempty"`
  88. NodeIDs []string `protobuf:"bytes,2,rep,name=node_ids,json=nodeIds" json:"node_ids,omitempty"`
  89. TaskIDs []string `protobuf:"bytes,3,rep,name=task_ids,json=taskIds" json:"task_ids,omitempty"`
  90. }
  91. func (m *LogSelector) Reset() { *m = LogSelector{} }
  92. func (*LogSelector) ProtoMessage() {}
  93. func (*LogSelector) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{1} }
  94. // LogContext marks the context from which a log message was generated.
  95. type LogContext struct {
  96. ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
  97. NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
  98. TaskID string `protobuf:"bytes,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
  99. }
  100. func (m *LogContext) Reset() { *m = LogContext{} }
  101. func (*LogContext) ProtoMessage() {}
  102. func (*LogContext) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{2} }
  103. // LogMessage
  104. type LogMessage struct {
  105. // Context identifies the source of the log message.
  106. Context LogContext `protobuf:"bytes,1,opt,name=context" json:"context"`
  107. // Timestamp is the time at which the message was generated.
  108. Timestamp *docker_swarmkit_v1.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"`
  109. // Stream identifies the stream of the log message, stdout or stderr.
  110. Stream LogStream `protobuf:"varint,3,opt,name=stream,proto3,enum=docker.swarmkit.v1.LogStream" json:"stream,omitempty"`
  111. // Data is the raw log message, as generated by the application.
  112. Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
  113. }
  114. func (m *LogMessage) Reset() { *m = LogMessage{} }
  115. func (*LogMessage) ProtoMessage() {}
  116. func (*LogMessage) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{3} }
  117. type SubscribeLogsRequest struct {
  118. // LogSelector describes the logs to which the subscriber is
  119. Selector *LogSelector `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"`
  120. Options *LogSubscriptionOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
  121. }
  122. func (m *SubscribeLogsRequest) Reset() { *m = SubscribeLogsRequest{} }
  123. func (*SubscribeLogsRequest) ProtoMessage() {}
  124. func (*SubscribeLogsRequest) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{4} }
  125. type SubscribeLogsMessage struct {
  126. Messages []LogMessage `protobuf:"bytes,1,rep,name=messages" json:"messages"`
  127. }
  128. func (m *SubscribeLogsMessage) Reset() { *m = SubscribeLogsMessage{} }
  129. func (*SubscribeLogsMessage) ProtoMessage() {}
  130. func (*SubscribeLogsMessage) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{5} }
  131. // ListenSubscriptionsRequest is a placeholder to begin listening for
  132. // subscriptions.
  133. type ListenSubscriptionsRequest struct {
  134. }
  135. func (m *ListenSubscriptionsRequest) Reset() { *m = ListenSubscriptionsRequest{} }
  136. func (*ListenSubscriptionsRequest) ProtoMessage() {}
  137. func (*ListenSubscriptionsRequest) Descriptor() ([]byte, []int) {
  138. return fileDescriptorLogbroker, []int{6}
  139. }
  140. // SubscriptionMessage instructs the listener to start publishing messages for
  141. // the stream or end a subscription.
  142. //
  143. // If Options.Follow == false, the worker should end the subscription on its own.
  144. type SubscriptionMessage struct {
  145. // ID identifies the subscription.
  146. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  147. // Selector defines which sources should be sent for the subscription.
  148. Selector *LogSelector `protobuf:"bytes,2,opt,name=selector" json:"selector,omitempty"`
  149. // Options specify how the subscription should be satisfied.
  150. Options *LogSubscriptionOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
  151. // Close will be true if the node should shutdown the subscription with the
  152. // provided identifier.
  153. Close bool `protobuf:"varint,4,opt,name=close,proto3" json:"close,omitempty"`
  154. }
  155. func (m *SubscriptionMessage) Reset() { *m = SubscriptionMessage{} }
  156. func (*SubscriptionMessage) ProtoMessage() {}
  157. func (*SubscriptionMessage) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{7} }
  158. type PublishLogsMessage struct {
  159. // SubscriptionID identifies which subscription the set of messages should
  160. // be sent to. We can think of this as a "mail box" for the subscription.
  161. SubscriptionID string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"`
  162. // Messages is the log message for publishing.
  163. Messages []LogMessage `protobuf:"bytes,2,rep,name=messages" json:"messages"`
  164. }
  165. func (m *PublishLogsMessage) Reset() { *m = PublishLogsMessage{} }
  166. func (*PublishLogsMessage) ProtoMessage() {}
  167. func (*PublishLogsMessage) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{8} }
  168. type PublishLogsResponse struct {
  169. }
  170. func (m *PublishLogsResponse) Reset() { *m = PublishLogsResponse{} }
  171. func (*PublishLogsResponse) ProtoMessage() {}
  172. func (*PublishLogsResponse) Descriptor() ([]byte, []int) { return fileDescriptorLogbroker, []int{9} }
  173. func init() {
  174. proto.RegisterType((*LogSubscriptionOptions)(nil), "docker.swarmkit.v1.LogSubscriptionOptions")
  175. proto.RegisterType((*LogSelector)(nil), "docker.swarmkit.v1.LogSelector")
  176. proto.RegisterType((*LogContext)(nil), "docker.swarmkit.v1.LogContext")
  177. proto.RegisterType((*LogMessage)(nil), "docker.swarmkit.v1.LogMessage")
  178. proto.RegisterType((*SubscribeLogsRequest)(nil), "docker.swarmkit.v1.SubscribeLogsRequest")
  179. proto.RegisterType((*SubscribeLogsMessage)(nil), "docker.swarmkit.v1.SubscribeLogsMessage")
  180. proto.RegisterType((*ListenSubscriptionsRequest)(nil), "docker.swarmkit.v1.ListenSubscriptionsRequest")
  181. proto.RegisterType((*SubscriptionMessage)(nil), "docker.swarmkit.v1.SubscriptionMessage")
  182. proto.RegisterType((*PublishLogsMessage)(nil), "docker.swarmkit.v1.PublishLogsMessage")
  183. proto.RegisterType((*PublishLogsResponse)(nil), "docker.swarmkit.v1.PublishLogsResponse")
  184. proto.RegisterEnum("docker.swarmkit.v1.LogStream", LogStream_name, LogStream_value)
  185. }
  186. type authenticatedWrapperLogsServer struct {
  187. local LogsServer
  188. authorize func(context.Context, []string) error
  189. }
  190. func NewAuthenticatedWrapperLogsServer(local LogsServer, authorize func(context.Context, []string) error) LogsServer {
  191. return &authenticatedWrapperLogsServer{
  192. local: local,
  193. authorize: authorize,
  194. }
  195. }
  196. func (p *authenticatedWrapperLogsServer) SubscribeLogs(r *SubscribeLogsRequest, stream Logs_SubscribeLogsServer) error {
  197. if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil {
  198. return err
  199. }
  200. return p.local.SubscribeLogs(r, stream)
  201. }
  202. type authenticatedWrapperLogBrokerServer struct {
  203. local LogBrokerServer
  204. authorize func(context.Context, []string) error
  205. }
  206. func NewAuthenticatedWrapperLogBrokerServer(local LogBrokerServer, authorize func(context.Context, []string) error) LogBrokerServer {
  207. return &authenticatedWrapperLogBrokerServer{
  208. local: local,
  209. authorize: authorize,
  210. }
  211. }
  212. func (p *authenticatedWrapperLogBrokerServer) ListenSubscriptions(r *ListenSubscriptionsRequest, stream LogBroker_ListenSubscriptionsServer) error {
  213. if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil {
  214. return err
  215. }
  216. return p.local.ListenSubscriptions(r, stream)
  217. }
  218. func (p *authenticatedWrapperLogBrokerServer) PublishLogs(stream LogBroker_PublishLogsServer) error {
  219. if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil {
  220. return err
  221. }
  222. return p.local.PublishLogs(stream)
  223. }
  224. func (m *LogSubscriptionOptions) Copy() *LogSubscriptionOptions {
  225. if m == nil {
  226. return nil
  227. }
  228. o := &LogSubscriptionOptions{
  229. Follow: m.Follow,
  230. Tail: m.Tail,
  231. Since: m.Since.Copy(),
  232. }
  233. if m.Streams != nil {
  234. o.Streams = make([]LogStream, 0, len(m.Streams))
  235. o.Streams = append(o.Streams, m.Streams...)
  236. }
  237. return o
  238. }
  239. func (m *LogSelector) Copy() *LogSelector {
  240. if m == nil {
  241. return nil
  242. }
  243. o := &LogSelector{}
  244. if m.ServiceIDs != nil {
  245. o.ServiceIDs = make([]string, 0, len(m.ServiceIDs))
  246. o.ServiceIDs = append(o.ServiceIDs, m.ServiceIDs...)
  247. }
  248. if m.NodeIDs != nil {
  249. o.NodeIDs = make([]string, 0, len(m.NodeIDs))
  250. o.NodeIDs = append(o.NodeIDs, m.NodeIDs...)
  251. }
  252. if m.TaskIDs != nil {
  253. o.TaskIDs = make([]string, 0, len(m.TaskIDs))
  254. o.TaskIDs = append(o.TaskIDs, m.TaskIDs...)
  255. }
  256. return o
  257. }
  258. func (m *LogContext) Copy() *LogContext {
  259. if m == nil {
  260. return nil
  261. }
  262. o := &LogContext{
  263. ServiceID: m.ServiceID,
  264. NodeID: m.NodeID,
  265. TaskID: m.TaskID,
  266. }
  267. return o
  268. }
  269. func (m *LogMessage) Copy() *LogMessage {
  270. if m == nil {
  271. return nil
  272. }
  273. o := &LogMessage{
  274. Context: *m.Context.Copy(),
  275. Timestamp: m.Timestamp.Copy(),
  276. Stream: m.Stream,
  277. Data: m.Data,
  278. }
  279. return o
  280. }
  281. func (m *SubscribeLogsRequest) Copy() *SubscribeLogsRequest {
  282. if m == nil {
  283. return nil
  284. }
  285. o := &SubscribeLogsRequest{
  286. Selector: m.Selector.Copy(),
  287. Options: m.Options.Copy(),
  288. }
  289. return o
  290. }
  291. func (m *SubscribeLogsMessage) Copy() *SubscribeLogsMessage {
  292. if m == nil {
  293. return nil
  294. }
  295. o := &SubscribeLogsMessage{}
  296. if m.Messages != nil {
  297. o.Messages = make([]LogMessage, 0, len(m.Messages))
  298. for _, v := range m.Messages {
  299. o.Messages = append(o.Messages, *v.Copy())
  300. }
  301. }
  302. return o
  303. }
  304. func (m *ListenSubscriptionsRequest) Copy() *ListenSubscriptionsRequest {
  305. if m == nil {
  306. return nil
  307. }
  308. o := &ListenSubscriptionsRequest{}
  309. return o
  310. }
  311. func (m *SubscriptionMessage) Copy() *SubscriptionMessage {
  312. if m == nil {
  313. return nil
  314. }
  315. o := &SubscriptionMessage{
  316. ID: m.ID,
  317. Selector: m.Selector.Copy(),
  318. Options: m.Options.Copy(),
  319. Close: m.Close,
  320. }
  321. return o
  322. }
  323. func (m *PublishLogsMessage) Copy() *PublishLogsMessage {
  324. if m == nil {
  325. return nil
  326. }
  327. o := &PublishLogsMessage{
  328. SubscriptionID: m.SubscriptionID,
  329. }
  330. if m.Messages != nil {
  331. o.Messages = make([]LogMessage, 0, len(m.Messages))
  332. for _, v := range m.Messages {
  333. o.Messages = append(o.Messages, *v.Copy())
  334. }
  335. }
  336. return o
  337. }
  338. func (m *PublishLogsResponse) Copy() *PublishLogsResponse {
  339. if m == nil {
  340. return nil
  341. }
  342. o := &PublishLogsResponse{}
  343. return o
  344. }
  345. func (this *LogSubscriptionOptions) GoString() string {
  346. if this == nil {
  347. return "nil"
  348. }
  349. s := make([]string, 0, 8)
  350. s = append(s, "&api.LogSubscriptionOptions{")
  351. s = append(s, "Streams: "+fmt.Sprintf("%#v", this.Streams)+",\n")
  352. s = append(s, "Follow: "+fmt.Sprintf("%#v", this.Follow)+",\n")
  353. s = append(s, "Tail: "+fmt.Sprintf("%#v", this.Tail)+",\n")
  354. if this.Since != nil {
  355. s = append(s, "Since: "+fmt.Sprintf("%#v", this.Since)+",\n")
  356. }
  357. s = append(s, "}")
  358. return strings.Join(s, "")
  359. }
  360. func (this *LogSelector) GoString() string {
  361. if this == nil {
  362. return "nil"
  363. }
  364. s := make([]string, 0, 7)
  365. s = append(s, "&api.LogSelector{")
  366. s = append(s, "ServiceIDs: "+fmt.Sprintf("%#v", this.ServiceIDs)+",\n")
  367. s = append(s, "NodeIDs: "+fmt.Sprintf("%#v", this.NodeIDs)+",\n")
  368. s = append(s, "TaskIDs: "+fmt.Sprintf("%#v", this.TaskIDs)+",\n")
  369. s = append(s, "}")
  370. return strings.Join(s, "")
  371. }
  372. func (this *LogContext) GoString() string {
  373. if this == nil {
  374. return "nil"
  375. }
  376. s := make([]string, 0, 7)
  377. s = append(s, "&api.LogContext{")
  378. s = append(s, "ServiceID: "+fmt.Sprintf("%#v", this.ServiceID)+",\n")
  379. s = append(s, "NodeID: "+fmt.Sprintf("%#v", this.NodeID)+",\n")
  380. s = append(s, "TaskID: "+fmt.Sprintf("%#v", this.TaskID)+",\n")
  381. s = append(s, "}")
  382. return strings.Join(s, "")
  383. }
  384. func (this *LogMessage) GoString() string {
  385. if this == nil {
  386. return "nil"
  387. }
  388. s := make([]string, 0, 8)
  389. s = append(s, "&api.LogMessage{")
  390. s = append(s, "Context: "+strings.Replace(this.Context.GoString(), `&`, ``, 1)+",\n")
  391. if this.Timestamp != nil {
  392. s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n")
  393. }
  394. s = append(s, "Stream: "+fmt.Sprintf("%#v", this.Stream)+",\n")
  395. s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n")
  396. s = append(s, "}")
  397. return strings.Join(s, "")
  398. }
  399. func (this *SubscribeLogsRequest) GoString() string {
  400. if this == nil {
  401. return "nil"
  402. }
  403. s := make([]string, 0, 6)
  404. s = append(s, "&api.SubscribeLogsRequest{")
  405. if this.Selector != nil {
  406. s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n")
  407. }
  408. if this.Options != nil {
  409. s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
  410. }
  411. s = append(s, "}")
  412. return strings.Join(s, "")
  413. }
  414. func (this *SubscribeLogsMessage) GoString() string {
  415. if this == nil {
  416. return "nil"
  417. }
  418. s := make([]string, 0, 5)
  419. s = append(s, "&api.SubscribeLogsMessage{")
  420. if this.Messages != nil {
  421. s = append(s, "Messages: "+fmt.Sprintf("%#v", this.Messages)+",\n")
  422. }
  423. s = append(s, "}")
  424. return strings.Join(s, "")
  425. }
  426. func (this *ListenSubscriptionsRequest) GoString() string {
  427. if this == nil {
  428. return "nil"
  429. }
  430. s := make([]string, 0, 4)
  431. s = append(s, "&api.ListenSubscriptionsRequest{")
  432. s = append(s, "}")
  433. return strings.Join(s, "")
  434. }
  435. func (this *SubscriptionMessage) GoString() string {
  436. if this == nil {
  437. return "nil"
  438. }
  439. s := make([]string, 0, 8)
  440. s = append(s, "&api.SubscriptionMessage{")
  441. s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n")
  442. if this.Selector != nil {
  443. s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n")
  444. }
  445. if this.Options != nil {
  446. s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
  447. }
  448. s = append(s, "Close: "+fmt.Sprintf("%#v", this.Close)+",\n")
  449. s = append(s, "}")
  450. return strings.Join(s, "")
  451. }
  452. func (this *PublishLogsMessage) GoString() string {
  453. if this == nil {
  454. return "nil"
  455. }
  456. s := make([]string, 0, 6)
  457. s = append(s, "&api.PublishLogsMessage{")
  458. s = append(s, "SubscriptionID: "+fmt.Sprintf("%#v", this.SubscriptionID)+",\n")
  459. if this.Messages != nil {
  460. s = append(s, "Messages: "+fmt.Sprintf("%#v", this.Messages)+",\n")
  461. }
  462. s = append(s, "}")
  463. return strings.Join(s, "")
  464. }
  465. func (this *PublishLogsResponse) GoString() string {
  466. if this == nil {
  467. return "nil"
  468. }
  469. s := make([]string, 0, 4)
  470. s = append(s, "&api.PublishLogsResponse{")
  471. s = append(s, "}")
  472. return strings.Join(s, "")
  473. }
  474. func valueToGoStringLogbroker(v interface{}, typ string) string {
  475. rv := reflect.ValueOf(v)
  476. if rv.IsNil() {
  477. return "nil"
  478. }
  479. pv := reflect.Indirect(rv).Interface()
  480. return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  481. }
  482. func extensionToGoStringLogbroker(m github_com_gogo_protobuf_proto.Message) string {
  483. e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
  484. if e == nil {
  485. return "nil"
  486. }
  487. s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
  488. keys := make([]int, 0, len(e))
  489. for k := range e {
  490. keys = append(keys, int(k))
  491. }
  492. sort.Ints(keys)
  493. ss := []string{}
  494. for _, k := range keys {
  495. ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
  496. }
  497. s += strings.Join(ss, ",") + "})"
  498. return s
  499. }
  500. // Reference imports to suppress errors if they are not otherwise used.
  501. var _ context.Context
  502. var _ grpc.ClientConn
  503. // This is a compile-time assertion to ensure that this generated file
  504. // is compatible with the grpc package it is being compiled against.
  505. const _ = grpc.SupportPackageIsVersion3
  506. // Client API for Logs service
  507. type LogsClient interface {
  508. // SubscribeLogs starts a subscription with the specified selector and options.
  509. //
  510. // The subscription will be distributed to relevant nodes and messages will
  511. // be collected and sent via the returned stream.
  512. //
  513. // The subscription will end with an EOF.
  514. SubscribeLogs(ctx context.Context, in *SubscribeLogsRequest, opts ...grpc.CallOption) (Logs_SubscribeLogsClient, error)
  515. }
  516. type logsClient struct {
  517. cc *grpc.ClientConn
  518. }
  519. func NewLogsClient(cc *grpc.ClientConn) LogsClient {
  520. return &logsClient{cc}
  521. }
  522. func (c *logsClient) SubscribeLogs(ctx context.Context, in *SubscribeLogsRequest, opts ...grpc.CallOption) (Logs_SubscribeLogsClient, error) {
  523. stream, err := grpc.NewClientStream(ctx, &_Logs_serviceDesc.Streams[0], c.cc, "/docker.swarmkit.v1.Logs/SubscribeLogs", opts...)
  524. if err != nil {
  525. return nil, err
  526. }
  527. x := &logsSubscribeLogsClient{stream}
  528. if err := x.ClientStream.SendMsg(in); err != nil {
  529. return nil, err
  530. }
  531. if err := x.ClientStream.CloseSend(); err != nil {
  532. return nil, err
  533. }
  534. return x, nil
  535. }
  536. type Logs_SubscribeLogsClient interface {
  537. Recv() (*SubscribeLogsMessage, error)
  538. grpc.ClientStream
  539. }
  540. type logsSubscribeLogsClient struct {
  541. grpc.ClientStream
  542. }
  543. func (x *logsSubscribeLogsClient) Recv() (*SubscribeLogsMessage, error) {
  544. m := new(SubscribeLogsMessage)
  545. if err := x.ClientStream.RecvMsg(m); err != nil {
  546. return nil, err
  547. }
  548. return m, nil
  549. }
  550. // Server API for Logs service
  551. type LogsServer interface {
  552. // SubscribeLogs starts a subscription with the specified selector and options.
  553. //
  554. // The subscription will be distributed to relevant nodes and messages will
  555. // be collected and sent via the returned stream.
  556. //
  557. // The subscription will end with an EOF.
  558. SubscribeLogs(*SubscribeLogsRequest, Logs_SubscribeLogsServer) error
  559. }
  560. func RegisterLogsServer(s *grpc.Server, srv LogsServer) {
  561. s.RegisterService(&_Logs_serviceDesc, srv)
  562. }
  563. func _Logs_SubscribeLogs_Handler(srv interface{}, stream grpc.ServerStream) error {
  564. m := new(SubscribeLogsRequest)
  565. if err := stream.RecvMsg(m); err != nil {
  566. return err
  567. }
  568. return srv.(LogsServer).SubscribeLogs(m, &logsSubscribeLogsServer{stream})
  569. }
  570. type Logs_SubscribeLogsServer interface {
  571. Send(*SubscribeLogsMessage) error
  572. grpc.ServerStream
  573. }
  574. type logsSubscribeLogsServer struct {
  575. grpc.ServerStream
  576. }
  577. func (x *logsSubscribeLogsServer) Send(m *SubscribeLogsMessage) error {
  578. return x.ServerStream.SendMsg(m)
  579. }
  580. var _Logs_serviceDesc = grpc.ServiceDesc{
  581. ServiceName: "docker.swarmkit.v1.Logs",
  582. HandlerType: (*LogsServer)(nil),
  583. Methods: []grpc.MethodDesc{},
  584. Streams: []grpc.StreamDesc{
  585. {
  586. StreamName: "SubscribeLogs",
  587. Handler: _Logs_SubscribeLogs_Handler,
  588. ServerStreams: true,
  589. },
  590. },
  591. Metadata: fileDescriptorLogbroker,
  592. }
  593. // Client API for LogBroker service
  594. type LogBrokerClient interface {
  595. // ListenSubscriptions starts a subscription stream for the node. For each
  596. // message received, the node should attempt to satisfy the subscription.
  597. //
  598. // Log messages that match the provided subscription should be sent via
  599. // PublishLogs.
  600. ListenSubscriptions(ctx context.Context, in *ListenSubscriptionsRequest, opts ...grpc.CallOption) (LogBroker_ListenSubscriptionsClient, error)
  601. // PublishLogs receives sets of log messages destined for a single
  602. // subscription identifier.
  603. PublishLogs(ctx context.Context, opts ...grpc.CallOption) (LogBroker_PublishLogsClient, error)
  604. }
  605. type logBrokerClient struct {
  606. cc *grpc.ClientConn
  607. }
  608. func NewLogBrokerClient(cc *grpc.ClientConn) LogBrokerClient {
  609. return &logBrokerClient{cc}
  610. }
  611. func (c *logBrokerClient) ListenSubscriptions(ctx context.Context, in *ListenSubscriptionsRequest, opts ...grpc.CallOption) (LogBroker_ListenSubscriptionsClient, error) {
  612. stream, err := grpc.NewClientStream(ctx, &_LogBroker_serviceDesc.Streams[0], c.cc, "/docker.swarmkit.v1.LogBroker/ListenSubscriptions", opts...)
  613. if err != nil {
  614. return nil, err
  615. }
  616. x := &logBrokerListenSubscriptionsClient{stream}
  617. if err := x.ClientStream.SendMsg(in); err != nil {
  618. return nil, err
  619. }
  620. if err := x.ClientStream.CloseSend(); err != nil {
  621. return nil, err
  622. }
  623. return x, nil
  624. }
  625. type LogBroker_ListenSubscriptionsClient interface {
  626. Recv() (*SubscriptionMessage, error)
  627. grpc.ClientStream
  628. }
  629. type logBrokerListenSubscriptionsClient struct {
  630. grpc.ClientStream
  631. }
  632. func (x *logBrokerListenSubscriptionsClient) Recv() (*SubscriptionMessage, error) {
  633. m := new(SubscriptionMessage)
  634. if err := x.ClientStream.RecvMsg(m); err != nil {
  635. return nil, err
  636. }
  637. return m, nil
  638. }
  639. func (c *logBrokerClient) PublishLogs(ctx context.Context, opts ...grpc.CallOption) (LogBroker_PublishLogsClient, error) {
  640. stream, err := grpc.NewClientStream(ctx, &_LogBroker_serviceDesc.Streams[1], c.cc, "/docker.swarmkit.v1.LogBroker/PublishLogs", opts...)
  641. if err != nil {
  642. return nil, err
  643. }
  644. x := &logBrokerPublishLogsClient{stream}
  645. return x, nil
  646. }
  647. type LogBroker_PublishLogsClient interface {
  648. Send(*PublishLogsMessage) error
  649. CloseAndRecv() (*PublishLogsResponse, error)
  650. grpc.ClientStream
  651. }
  652. type logBrokerPublishLogsClient struct {
  653. grpc.ClientStream
  654. }
  655. func (x *logBrokerPublishLogsClient) Send(m *PublishLogsMessage) error {
  656. return x.ClientStream.SendMsg(m)
  657. }
  658. func (x *logBrokerPublishLogsClient) CloseAndRecv() (*PublishLogsResponse, error) {
  659. if err := x.ClientStream.CloseSend(); err != nil {
  660. return nil, err
  661. }
  662. m := new(PublishLogsResponse)
  663. if err := x.ClientStream.RecvMsg(m); err != nil {
  664. return nil, err
  665. }
  666. return m, nil
  667. }
  668. // Server API for LogBroker service
  669. type LogBrokerServer interface {
  670. // ListenSubscriptions starts a subscription stream for the node. For each
  671. // message received, the node should attempt to satisfy the subscription.
  672. //
  673. // Log messages that match the provided subscription should be sent via
  674. // PublishLogs.
  675. ListenSubscriptions(*ListenSubscriptionsRequest, LogBroker_ListenSubscriptionsServer) error
  676. // PublishLogs receives sets of log messages destined for a single
  677. // subscription identifier.
  678. PublishLogs(LogBroker_PublishLogsServer) error
  679. }
  680. func RegisterLogBrokerServer(s *grpc.Server, srv LogBrokerServer) {
  681. s.RegisterService(&_LogBroker_serviceDesc, srv)
  682. }
  683. func _LogBroker_ListenSubscriptions_Handler(srv interface{}, stream grpc.ServerStream) error {
  684. m := new(ListenSubscriptionsRequest)
  685. if err := stream.RecvMsg(m); err != nil {
  686. return err
  687. }
  688. return srv.(LogBrokerServer).ListenSubscriptions(m, &logBrokerListenSubscriptionsServer{stream})
  689. }
  690. type LogBroker_ListenSubscriptionsServer interface {
  691. Send(*SubscriptionMessage) error
  692. grpc.ServerStream
  693. }
  694. type logBrokerListenSubscriptionsServer struct {
  695. grpc.ServerStream
  696. }
  697. func (x *logBrokerListenSubscriptionsServer) Send(m *SubscriptionMessage) error {
  698. return x.ServerStream.SendMsg(m)
  699. }
  700. func _LogBroker_PublishLogs_Handler(srv interface{}, stream grpc.ServerStream) error {
  701. return srv.(LogBrokerServer).PublishLogs(&logBrokerPublishLogsServer{stream})
  702. }
  703. type LogBroker_PublishLogsServer interface {
  704. SendAndClose(*PublishLogsResponse) error
  705. Recv() (*PublishLogsMessage, error)
  706. grpc.ServerStream
  707. }
  708. type logBrokerPublishLogsServer struct {
  709. grpc.ServerStream
  710. }
  711. func (x *logBrokerPublishLogsServer) SendAndClose(m *PublishLogsResponse) error {
  712. return x.ServerStream.SendMsg(m)
  713. }
  714. func (x *logBrokerPublishLogsServer) Recv() (*PublishLogsMessage, error) {
  715. m := new(PublishLogsMessage)
  716. if err := x.ServerStream.RecvMsg(m); err != nil {
  717. return nil, err
  718. }
  719. return m, nil
  720. }
  721. var _LogBroker_serviceDesc = grpc.ServiceDesc{
  722. ServiceName: "docker.swarmkit.v1.LogBroker",
  723. HandlerType: (*LogBrokerServer)(nil),
  724. Methods: []grpc.MethodDesc{},
  725. Streams: []grpc.StreamDesc{
  726. {
  727. StreamName: "ListenSubscriptions",
  728. Handler: _LogBroker_ListenSubscriptions_Handler,
  729. ServerStreams: true,
  730. },
  731. {
  732. StreamName: "PublishLogs",
  733. Handler: _LogBroker_PublishLogs_Handler,
  734. ClientStreams: true,
  735. },
  736. },
  737. Metadata: fileDescriptorLogbroker,
  738. }
  739. func (m *LogSubscriptionOptions) Marshal() (data []byte, err error) {
  740. size := m.Size()
  741. data = make([]byte, size)
  742. n, err := m.MarshalTo(data)
  743. if err != nil {
  744. return nil, err
  745. }
  746. return data[:n], nil
  747. }
  748. func (m *LogSubscriptionOptions) MarshalTo(data []byte) (int, error) {
  749. var i int
  750. _ = i
  751. var l int
  752. _ = l
  753. if len(m.Streams) > 0 {
  754. for _, num := range m.Streams {
  755. data[i] = 0x8
  756. i++
  757. i = encodeVarintLogbroker(data, i, uint64(num))
  758. }
  759. }
  760. if m.Follow {
  761. data[i] = 0x10
  762. i++
  763. if m.Follow {
  764. data[i] = 1
  765. } else {
  766. data[i] = 0
  767. }
  768. i++
  769. }
  770. if m.Tail != 0 {
  771. data[i] = 0x18
  772. i++
  773. i = encodeVarintLogbroker(data, i, uint64(m.Tail))
  774. }
  775. if m.Since != nil {
  776. data[i] = 0x22
  777. i++
  778. i = encodeVarintLogbroker(data, i, uint64(m.Since.Size()))
  779. n1, err := m.Since.MarshalTo(data[i:])
  780. if err != nil {
  781. return 0, err
  782. }
  783. i += n1
  784. }
  785. return i, nil
  786. }
  787. func (m *LogSelector) Marshal() (data []byte, err error) {
  788. size := m.Size()
  789. data = make([]byte, size)
  790. n, err := m.MarshalTo(data)
  791. if err != nil {
  792. return nil, err
  793. }
  794. return data[:n], nil
  795. }
  796. func (m *LogSelector) MarshalTo(data []byte) (int, error) {
  797. var i int
  798. _ = i
  799. var l int
  800. _ = l
  801. if len(m.ServiceIDs) > 0 {
  802. for _, s := range m.ServiceIDs {
  803. data[i] = 0xa
  804. i++
  805. l = len(s)
  806. for l >= 1<<7 {
  807. data[i] = uint8(uint64(l)&0x7f | 0x80)
  808. l >>= 7
  809. i++
  810. }
  811. data[i] = uint8(l)
  812. i++
  813. i += copy(data[i:], s)
  814. }
  815. }
  816. if len(m.NodeIDs) > 0 {
  817. for _, s := range m.NodeIDs {
  818. data[i] = 0x12
  819. i++
  820. l = len(s)
  821. for l >= 1<<7 {
  822. data[i] = uint8(uint64(l)&0x7f | 0x80)
  823. l >>= 7
  824. i++
  825. }
  826. data[i] = uint8(l)
  827. i++
  828. i += copy(data[i:], s)
  829. }
  830. }
  831. if len(m.TaskIDs) > 0 {
  832. for _, s := range m.TaskIDs {
  833. data[i] = 0x1a
  834. i++
  835. l = len(s)
  836. for l >= 1<<7 {
  837. data[i] = uint8(uint64(l)&0x7f | 0x80)
  838. l >>= 7
  839. i++
  840. }
  841. data[i] = uint8(l)
  842. i++
  843. i += copy(data[i:], s)
  844. }
  845. }
  846. return i, nil
  847. }
  848. func (m *LogContext) Marshal() (data []byte, err error) {
  849. size := m.Size()
  850. data = make([]byte, size)
  851. n, err := m.MarshalTo(data)
  852. if err != nil {
  853. return nil, err
  854. }
  855. return data[:n], nil
  856. }
  857. func (m *LogContext) MarshalTo(data []byte) (int, error) {
  858. var i int
  859. _ = i
  860. var l int
  861. _ = l
  862. if len(m.ServiceID) > 0 {
  863. data[i] = 0xa
  864. i++
  865. i = encodeVarintLogbroker(data, i, uint64(len(m.ServiceID)))
  866. i += copy(data[i:], m.ServiceID)
  867. }
  868. if len(m.NodeID) > 0 {
  869. data[i] = 0x12
  870. i++
  871. i = encodeVarintLogbroker(data, i, uint64(len(m.NodeID)))
  872. i += copy(data[i:], m.NodeID)
  873. }
  874. if len(m.TaskID) > 0 {
  875. data[i] = 0x1a
  876. i++
  877. i = encodeVarintLogbroker(data, i, uint64(len(m.TaskID)))
  878. i += copy(data[i:], m.TaskID)
  879. }
  880. return i, nil
  881. }
  882. func (m *LogMessage) Marshal() (data []byte, err error) {
  883. size := m.Size()
  884. data = make([]byte, size)
  885. n, err := m.MarshalTo(data)
  886. if err != nil {
  887. return nil, err
  888. }
  889. return data[:n], nil
  890. }
  891. func (m *LogMessage) MarshalTo(data []byte) (int, error) {
  892. var i int
  893. _ = i
  894. var l int
  895. _ = l
  896. data[i] = 0xa
  897. i++
  898. i = encodeVarintLogbroker(data, i, uint64(m.Context.Size()))
  899. n2, err := m.Context.MarshalTo(data[i:])
  900. if err != nil {
  901. return 0, err
  902. }
  903. i += n2
  904. if m.Timestamp != nil {
  905. data[i] = 0x12
  906. i++
  907. i = encodeVarintLogbroker(data, i, uint64(m.Timestamp.Size()))
  908. n3, err := m.Timestamp.MarshalTo(data[i:])
  909. if err != nil {
  910. return 0, err
  911. }
  912. i += n3
  913. }
  914. if m.Stream != 0 {
  915. data[i] = 0x18
  916. i++
  917. i = encodeVarintLogbroker(data, i, uint64(m.Stream))
  918. }
  919. if len(m.Data) > 0 {
  920. data[i] = 0x22
  921. i++
  922. i = encodeVarintLogbroker(data, i, uint64(len(m.Data)))
  923. i += copy(data[i:], m.Data)
  924. }
  925. return i, nil
  926. }
  927. func (m *SubscribeLogsRequest) Marshal() (data []byte, err error) {
  928. size := m.Size()
  929. data = make([]byte, size)
  930. n, err := m.MarshalTo(data)
  931. if err != nil {
  932. return nil, err
  933. }
  934. return data[:n], nil
  935. }
  936. func (m *SubscribeLogsRequest) MarshalTo(data []byte) (int, error) {
  937. var i int
  938. _ = i
  939. var l int
  940. _ = l
  941. if m.Selector != nil {
  942. data[i] = 0xa
  943. i++
  944. i = encodeVarintLogbroker(data, i, uint64(m.Selector.Size()))
  945. n4, err := m.Selector.MarshalTo(data[i:])
  946. if err != nil {
  947. return 0, err
  948. }
  949. i += n4
  950. }
  951. if m.Options != nil {
  952. data[i] = 0x12
  953. i++
  954. i = encodeVarintLogbroker(data, i, uint64(m.Options.Size()))
  955. n5, err := m.Options.MarshalTo(data[i:])
  956. if err != nil {
  957. return 0, err
  958. }
  959. i += n5
  960. }
  961. return i, nil
  962. }
  963. func (m *SubscribeLogsMessage) Marshal() (data []byte, err error) {
  964. size := m.Size()
  965. data = make([]byte, size)
  966. n, err := m.MarshalTo(data)
  967. if err != nil {
  968. return nil, err
  969. }
  970. return data[:n], nil
  971. }
  972. func (m *SubscribeLogsMessage) MarshalTo(data []byte) (int, error) {
  973. var i int
  974. _ = i
  975. var l int
  976. _ = l
  977. if len(m.Messages) > 0 {
  978. for _, msg := range m.Messages {
  979. data[i] = 0xa
  980. i++
  981. i = encodeVarintLogbroker(data, i, uint64(msg.Size()))
  982. n, err := msg.MarshalTo(data[i:])
  983. if err != nil {
  984. return 0, err
  985. }
  986. i += n
  987. }
  988. }
  989. return i, nil
  990. }
  991. func (m *ListenSubscriptionsRequest) Marshal() (data []byte, err error) {
  992. size := m.Size()
  993. data = make([]byte, size)
  994. n, err := m.MarshalTo(data)
  995. if err != nil {
  996. return nil, err
  997. }
  998. return data[:n], nil
  999. }
  1000. func (m *ListenSubscriptionsRequest) MarshalTo(data []byte) (int, error) {
  1001. var i int
  1002. _ = i
  1003. var l int
  1004. _ = l
  1005. return i, nil
  1006. }
  1007. func (m *SubscriptionMessage) Marshal() (data []byte, err error) {
  1008. size := m.Size()
  1009. data = make([]byte, size)
  1010. n, err := m.MarshalTo(data)
  1011. if err != nil {
  1012. return nil, err
  1013. }
  1014. return data[:n], nil
  1015. }
  1016. func (m *SubscriptionMessage) MarshalTo(data []byte) (int, error) {
  1017. var i int
  1018. _ = i
  1019. var l int
  1020. _ = l
  1021. if len(m.ID) > 0 {
  1022. data[i] = 0xa
  1023. i++
  1024. i = encodeVarintLogbroker(data, i, uint64(len(m.ID)))
  1025. i += copy(data[i:], m.ID)
  1026. }
  1027. if m.Selector != nil {
  1028. data[i] = 0x12
  1029. i++
  1030. i = encodeVarintLogbroker(data, i, uint64(m.Selector.Size()))
  1031. n6, err := m.Selector.MarshalTo(data[i:])
  1032. if err != nil {
  1033. return 0, err
  1034. }
  1035. i += n6
  1036. }
  1037. if m.Options != nil {
  1038. data[i] = 0x1a
  1039. i++
  1040. i = encodeVarintLogbroker(data, i, uint64(m.Options.Size()))
  1041. n7, err := m.Options.MarshalTo(data[i:])
  1042. if err != nil {
  1043. return 0, err
  1044. }
  1045. i += n7
  1046. }
  1047. if m.Close {
  1048. data[i] = 0x20
  1049. i++
  1050. if m.Close {
  1051. data[i] = 1
  1052. } else {
  1053. data[i] = 0
  1054. }
  1055. i++
  1056. }
  1057. return i, nil
  1058. }
  1059. func (m *PublishLogsMessage) Marshal() (data []byte, err error) {
  1060. size := m.Size()
  1061. data = make([]byte, size)
  1062. n, err := m.MarshalTo(data)
  1063. if err != nil {
  1064. return nil, err
  1065. }
  1066. return data[:n], nil
  1067. }
  1068. func (m *PublishLogsMessage) MarshalTo(data []byte) (int, error) {
  1069. var i int
  1070. _ = i
  1071. var l int
  1072. _ = l
  1073. if len(m.SubscriptionID) > 0 {
  1074. data[i] = 0xa
  1075. i++
  1076. i = encodeVarintLogbroker(data, i, uint64(len(m.SubscriptionID)))
  1077. i += copy(data[i:], m.SubscriptionID)
  1078. }
  1079. if len(m.Messages) > 0 {
  1080. for _, msg := range m.Messages {
  1081. data[i] = 0x12
  1082. i++
  1083. i = encodeVarintLogbroker(data, i, uint64(msg.Size()))
  1084. n, err := msg.MarshalTo(data[i:])
  1085. if err != nil {
  1086. return 0, err
  1087. }
  1088. i += n
  1089. }
  1090. }
  1091. return i, nil
  1092. }
  1093. func (m *PublishLogsResponse) Marshal() (data []byte, err error) {
  1094. size := m.Size()
  1095. data = make([]byte, size)
  1096. n, err := m.MarshalTo(data)
  1097. if err != nil {
  1098. return nil, err
  1099. }
  1100. return data[:n], nil
  1101. }
  1102. func (m *PublishLogsResponse) MarshalTo(data []byte) (int, error) {
  1103. var i int
  1104. _ = i
  1105. var l int
  1106. _ = l
  1107. return i, nil
  1108. }
  1109. func encodeFixed64Logbroker(data []byte, offset int, v uint64) int {
  1110. data[offset] = uint8(v)
  1111. data[offset+1] = uint8(v >> 8)
  1112. data[offset+2] = uint8(v >> 16)
  1113. data[offset+3] = uint8(v >> 24)
  1114. data[offset+4] = uint8(v >> 32)
  1115. data[offset+5] = uint8(v >> 40)
  1116. data[offset+6] = uint8(v >> 48)
  1117. data[offset+7] = uint8(v >> 56)
  1118. return offset + 8
  1119. }
  1120. func encodeFixed32Logbroker(data []byte, offset int, v uint32) int {
  1121. data[offset] = uint8(v)
  1122. data[offset+1] = uint8(v >> 8)
  1123. data[offset+2] = uint8(v >> 16)
  1124. data[offset+3] = uint8(v >> 24)
  1125. return offset + 4
  1126. }
  1127. func encodeVarintLogbroker(data []byte, offset int, v uint64) int {
  1128. for v >= 1<<7 {
  1129. data[offset] = uint8(v&0x7f | 0x80)
  1130. v >>= 7
  1131. offset++
  1132. }
  1133. data[offset] = uint8(v)
  1134. return offset + 1
  1135. }
  1136. type raftProxyLogsServer struct {
  1137. local LogsServer
  1138. connSelector raftselector.ConnProvider
  1139. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1140. }
  1141. func NewRaftProxyLogsServer(local LogsServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogsServer {
  1142. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1143. s, ok := transport.StreamFromContext(ctx)
  1144. if !ok {
  1145. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1146. }
  1147. addr := s.ServerTransport().RemoteAddr().String()
  1148. md, ok := metadata.FromContext(ctx)
  1149. if ok && len(md["redirect"]) != 0 {
  1150. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1151. }
  1152. if !ok {
  1153. md = metadata.New(map[string]string{})
  1154. }
  1155. md["redirect"] = append(md["redirect"], addr)
  1156. return metadata.NewContext(ctx, md), nil
  1157. }
  1158. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1159. remoteMods = append(remoteMods, remoteCtxMod)
  1160. var localMods []func(context.Context) (context.Context, error)
  1161. if localCtxMod != nil {
  1162. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1163. }
  1164. return &raftProxyLogsServer{
  1165. local: local,
  1166. connSelector: connSelector,
  1167. localCtxMods: localMods,
  1168. remoteCtxMods: remoteMods,
  1169. }
  1170. }
  1171. func (p *raftProxyLogsServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1172. var err error
  1173. for _, mod := range ctxMods {
  1174. ctx, err = mod(ctx)
  1175. if err != nil {
  1176. return ctx, err
  1177. }
  1178. }
  1179. return ctx, nil
  1180. }
  1181. func (p *raftProxyLogsServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1182. ticker := time.NewTicker(500 * time.Millisecond)
  1183. defer ticker.Stop()
  1184. for {
  1185. select {
  1186. case <-ticker.C:
  1187. conn, err := p.connSelector.LeaderConn(ctx)
  1188. if err != nil {
  1189. return nil, err
  1190. }
  1191. client := NewHealthClient(conn)
  1192. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1193. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1194. continue
  1195. }
  1196. return conn, nil
  1197. case <-ctx.Done():
  1198. return nil, ctx.Err()
  1199. }
  1200. }
  1201. }
  1202. type Logs_SubscribeLogsServerWrapper struct {
  1203. Logs_SubscribeLogsServer
  1204. ctx context.Context
  1205. }
  1206. func (s Logs_SubscribeLogsServerWrapper) Context() context.Context {
  1207. return s.ctx
  1208. }
  1209. func (p *raftProxyLogsServer) SubscribeLogs(r *SubscribeLogsRequest, stream Logs_SubscribeLogsServer) error {
  1210. ctx := stream.Context()
  1211. conn, err := p.connSelector.LeaderConn(ctx)
  1212. if err != nil {
  1213. if err == raftselector.ErrIsLeader {
  1214. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1215. if err != nil {
  1216. return err
  1217. }
  1218. streamWrapper := Logs_SubscribeLogsServerWrapper{
  1219. Logs_SubscribeLogsServer: stream,
  1220. ctx: ctx,
  1221. }
  1222. return p.local.SubscribeLogs(r, streamWrapper)
  1223. }
  1224. return err
  1225. }
  1226. ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
  1227. if err != nil {
  1228. return err
  1229. }
  1230. clientStream, err := NewLogsClient(conn).SubscribeLogs(ctx, r)
  1231. if err != nil {
  1232. return err
  1233. }
  1234. for {
  1235. msg, err := clientStream.Recv()
  1236. if err == io.EOF {
  1237. break
  1238. }
  1239. if err != nil {
  1240. return err
  1241. }
  1242. if err := stream.Send(msg); err != nil {
  1243. return err
  1244. }
  1245. }
  1246. return nil
  1247. }
  1248. type raftProxyLogBrokerServer struct {
  1249. local LogBrokerServer
  1250. connSelector raftselector.ConnProvider
  1251. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  1252. }
  1253. func NewRaftProxyLogBrokerServer(local LogBrokerServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogBrokerServer {
  1254. redirectChecker := func(ctx context.Context) (context.Context, error) {
  1255. s, ok := transport.StreamFromContext(ctx)
  1256. if !ok {
  1257. return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  1258. }
  1259. addr := s.ServerTransport().RemoteAddr().String()
  1260. md, ok := metadata.FromContext(ctx)
  1261. if ok && len(md["redirect"]) != 0 {
  1262. return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1263. }
  1264. if !ok {
  1265. md = metadata.New(map[string]string{})
  1266. }
  1267. md["redirect"] = append(md["redirect"], addr)
  1268. return metadata.NewContext(ctx, md), nil
  1269. }
  1270. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1271. remoteMods = append(remoteMods, remoteCtxMod)
  1272. var localMods []func(context.Context) (context.Context, error)
  1273. if localCtxMod != nil {
  1274. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1275. }
  1276. return &raftProxyLogBrokerServer{
  1277. local: local,
  1278. connSelector: connSelector,
  1279. localCtxMods: localMods,
  1280. remoteCtxMods: remoteMods,
  1281. }
  1282. }
  1283. func (p *raftProxyLogBrokerServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1284. var err error
  1285. for _, mod := range ctxMods {
  1286. ctx, err = mod(ctx)
  1287. if err != nil {
  1288. return ctx, err
  1289. }
  1290. }
  1291. return ctx, nil
  1292. }
  1293. func (p *raftProxyLogBrokerServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1294. ticker := time.NewTicker(500 * time.Millisecond)
  1295. defer ticker.Stop()
  1296. for {
  1297. select {
  1298. case <-ticker.C:
  1299. conn, err := p.connSelector.LeaderConn(ctx)
  1300. if err != nil {
  1301. return nil, err
  1302. }
  1303. client := NewHealthClient(conn)
  1304. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1305. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1306. continue
  1307. }
  1308. return conn, nil
  1309. case <-ctx.Done():
  1310. return nil, ctx.Err()
  1311. }
  1312. }
  1313. }
  1314. type LogBroker_ListenSubscriptionsServerWrapper struct {
  1315. LogBroker_ListenSubscriptionsServer
  1316. ctx context.Context
  1317. }
  1318. func (s LogBroker_ListenSubscriptionsServerWrapper) Context() context.Context {
  1319. return s.ctx
  1320. }
  1321. func (p *raftProxyLogBrokerServer) ListenSubscriptions(r *ListenSubscriptionsRequest, stream LogBroker_ListenSubscriptionsServer) error {
  1322. ctx := stream.Context()
  1323. conn, err := p.connSelector.LeaderConn(ctx)
  1324. if err != nil {
  1325. if err == raftselector.ErrIsLeader {
  1326. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1327. if err != nil {
  1328. return err
  1329. }
  1330. streamWrapper := LogBroker_ListenSubscriptionsServerWrapper{
  1331. LogBroker_ListenSubscriptionsServer: stream,
  1332. ctx: ctx,
  1333. }
  1334. return p.local.ListenSubscriptions(r, streamWrapper)
  1335. }
  1336. return err
  1337. }
  1338. ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
  1339. if err != nil {
  1340. return err
  1341. }
  1342. clientStream, err := NewLogBrokerClient(conn).ListenSubscriptions(ctx, r)
  1343. if err != nil {
  1344. return err
  1345. }
  1346. for {
  1347. msg, err := clientStream.Recv()
  1348. if err == io.EOF {
  1349. break
  1350. }
  1351. if err != nil {
  1352. return err
  1353. }
  1354. if err := stream.Send(msg); err != nil {
  1355. return err
  1356. }
  1357. }
  1358. return nil
  1359. }
  1360. type LogBroker_PublishLogsServerWrapper struct {
  1361. LogBroker_PublishLogsServer
  1362. ctx context.Context
  1363. }
  1364. func (s LogBroker_PublishLogsServerWrapper) Context() context.Context {
  1365. return s.ctx
  1366. }
  1367. func (p *raftProxyLogBrokerServer) PublishLogs(stream LogBroker_PublishLogsServer) error {
  1368. ctx := stream.Context()
  1369. conn, err := p.connSelector.LeaderConn(ctx)
  1370. if err != nil {
  1371. if err == raftselector.ErrIsLeader {
  1372. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1373. if err != nil {
  1374. return err
  1375. }
  1376. streamWrapper := LogBroker_PublishLogsServerWrapper{
  1377. LogBroker_PublishLogsServer: stream,
  1378. ctx: ctx,
  1379. }
  1380. return p.local.PublishLogs(streamWrapper)
  1381. }
  1382. return err
  1383. }
  1384. ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
  1385. if err != nil {
  1386. return err
  1387. }
  1388. clientStream, err := NewLogBrokerClient(conn).PublishLogs(ctx)
  1389. if err != nil {
  1390. return err
  1391. }
  1392. for {
  1393. msg, err := stream.Recv()
  1394. if err == io.EOF {
  1395. break
  1396. }
  1397. if err != nil {
  1398. return err
  1399. }
  1400. if err := clientStream.Send(msg); err != nil {
  1401. return err
  1402. }
  1403. }
  1404. reply, err := clientStream.CloseAndRecv()
  1405. if err != nil {
  1406. return err
  1407. }
  1408. return stream.SendAndClose(reply)
  1409. }
  1410. func (m *LogSubscriptionOptions) Size() (n int) {
  1411. var l int
  1412. _ = l
  1413. if len(m.Streams) > 0 {
  1414. for _, e := range m.Streams {
  1415. n += 1 + sovLogbroker(uint64(e))
  1416. }
  1417. }
  1418. if m.Follow {
  1419. n += 2
  1420. }
  1421. if m.Tail != 0 {
  1422. n += 1 + sovLogbroker(uint64(m.Tail))
  1423. }
  1424. if m.Since != nil {
  1425. l = m.Since.Size()
  1426. n += 1 + l + sovLogbroker(uint64(l))
  1427. }
  1428. return n
  1429. }
  1430. func (m *LogSelector) Size() (n int) {
  1431. var l int
  1432. _ = l
  1433. if len(m.ServiceIDs) > 0 {
  1434. for _, s := range m.ServiceIDs {
  1435. l = len(s)
  1436. n += 1 + l + sovLogbroker(uint64(l))
  1437. }
  1438. }
  1439. if len(m.NodeIDs) > 0 {
  1440. for _, s := range m.NodeIDs {
  1441. l = len(s)
  1442. n += 1 + l + sovLogbroker(uint64(l))
  1443. }
  1444. }
  1445. if len(m.TaskIDs) > 0 {
  1446. for _, s := range m.TaskIDs {
  1447. l = len(s)
  1448. n += 1 + l + sovLogbroker(uint64(l))
  1449. }
  1450. }
  1451. return n
  1452. }
  1453. func (m *LogContext) Size() (n int) {
  1454. var l int
  1455. _ = l
  1456. l = len(m.ServiceID)
  1457. if l > 0 {
  1458. n += 1 + l + sovLogbroker(uint64(l))
  1459. }
  1460. l = len(m.NodeID)
  1461. if l > 0 {
  1462. n += 1 + l + sovLogbroker(uint64(l))
  1463. }
  1464. l = len(m.TaskID)
  1465. if l > 0 {
  1466. n += 1 + l + sovLogbroker(uint64(l))
  1467. }
  1468. return n
  1469. }
  1470. func (m *LogMessage) Size() (n int) {
  1471. var l int
  1472. _ = l
  1473. l = m.Context.Size()
  1474. n += 1 + l + sovLogbroker(uint64(l))
  1475. if m.Timestamp != nil {
  1476. l = m.Timestamp.Size()
  1477. n += 1 + l + sovLogbroker(uint64(l))
  1478. }
  1479. if m.Stream != 0 {
  1480. n += 1 + sovLogbroker(uint64(m.Stream))
  1481. }
  1482. l = len(m.Data)
  1483. if l > 0 {
  1484. n += 1 + l + sovLogbroker(uint64(l))
  1485. }
  1486. return n
  1487. }
  1488. func (m *SubscribeLogsRequest) Size() (n int) {
  1489. var l int
  1490. _ = l
  1491. if m.Selector != nil {
  1492. l = m.Selector.Size()
  1493. n += 1 + l + sovLogbroker(uint64(l))
  1494. }
  1495. if m.Options != nil {
  1496. l = m.Options.Size()
  1497. n += 1 + l + sovLogbroker(uint64(l))
  1498. }
  1499. return n
  1500. }
  1501. func (m *SubscribeLogsMessage) Size() (n int) {
  1502. var l int
  1503. _ = l
  1504. if len(m.Messages) > 0 {
  1505. for _, e := range m.Messages {
  1506. l = e.Size()
  1507. n += 1 + l + sovLogbroker(uint64(l))
  1508. }
  1509. }
  1510. return n
  1511. }
  1512. func (m *ListenSubscriptionsRequest) Size() (n int) {
  1513. var l int
  1514. _ = l
  1515. return n
  1516. }
  1517. func (m *SubscriptionMessage) Size() (n int) {
  1518. var l int
  1519. _ = l
  1520. l = len(m.ID)
  1521. if l > 0 {
  1522. n += 1 + l + sovLogbroker(uint64(l))
  1523. }
  1524. if m.Selector != nil {
  1525. l = m.Selector.Size()
  1526. n += 1 + l + sovLogbroker(uint64(l))
  1527. }
  1528. if m.Options != nil {
  1529. l = m.Options.Size()
  1530. n += 1 + l + sovLogbroker(uint64(l))
  1531. }
  1532. if m.Close {
  1533. n += 2
  1534. }
  1535. return n
  1536. }
  1537. func (m *PublishLogsMessage) Size() (n int) {
  1538. var l int
  1539. _ = l
  1540. l = len(m.SubscriptionID)
  1541. if l > 0 {
  1542. n += 1 + l + sovLogbroker(uint64(l))
  1543. }
  1544. if len(m.Messages) > 0 {
  1545. for _, e := range m.Messages {
  1546. l = e.Size()
  1547. n += 1 + l + sovLogbroker(uint64(l))
  1548. }
  1549. }
  1550. return n
  1551. }
  1552. func (m *PublishLogsResponse) Size() (n int) {
  1553. var l int
  1554. _ = l
  1555. return n
  1556. }
  1557. func sovLogbroker(x uint64) (n int) {
  1558. for {
  1559. n++
  1560. x >>= 7
  1561. if x == 0 {
  1562. break
  1563. }
  1564. }
  1565. return n
  1566. }
  1567. func sozLogbroker(x uint64) (n int) {
  1568. return sovLogbroker(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1569. }
  1570. func (this *LogSubscriptionOptions) String() string {
  1571. if this == nil {
  1572. return "nil"
  1573. }
  1574. s := strings.Join([]string{`&LogSubscriptionOptions{`,
  1575. `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`,
  1576. `Follow:` + fmt.Sprintf("%v", this.Follow) + `,`,
  1577. `Tail:` + fmt.Sprintf("%v", this.Tail) + `,`,
  1578. `Since:` + strings.Replace(fmt.Sprintf("%v", this.Since), "Timestamp", "docker_swarmkit_v1.Timestamp", 1) + `,`,
  1579. `}`,
  1580. }, "")
  1581. return s
  1582. }
  1583. func (this *LogSelector) String() string {
  1584. if this == nil {
  1585. return "nil"
  1586. }
  1587. s := strings.Join([]string{`&LogSelector{`,
  1588. `ServiceIDs:` + fmt.Sprintf("%v", this.ServiceIDs) + `,`,
  1589. `NodeIDs:` + fmt.Sprintf("%v", this.NodeIDs) + `,`,
  1590. `TaskIDs:` + fmt.Sprintf("%v", this.TaskIDs) + `,`,
  1591. `}`,
  1592. }, "")
  1593. return s
  1594. }
  1595. func (this *LogContext) String() string {
  1596. if this == nil {
  1597. return "nil"
  1598. }
  1599. s := strings.Join([]string{`&LogContext{`,
  1600. `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
  1601. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  1602. `TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`,
  1603. `}`,
  1604. }, "")
  1605. return s
  1606. }
  1607. func (this *LogMessage) String() string {
  1608. if this == nil {
  1609. return "nil"
  1610. }
  1611. s := strings.Join([]string{`&LogMessage{`,
  1612. `Context:` + strings.Replace(strings.Replace(this.Context.String(), "LogContext", "LogContext", 1), `&`, ``, 1) + `,`,
  1613. `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "docker_swarmkit_v1.Timestamp", 1) + `,`,
  1614. `Stream:` + fmt.Sprintf("%v", this.Stream) + `,`,
  1615. `Data:` + fmt.Sprintf("%v", this.Data) + `,`,
  1616. `}`,
  1617. }, "")
  1618. return s
  1619. }
  1620. func (this *SubscribeLogsRequest) String() string {
  1621. if this == nil {
  1622. return "nil"
  1623. }
  1624. s := strings.Join([]string{`&SubscribeLogsRequest{`,
  1625. `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`,
  1626. `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`,
  1627. `}`,
  1628. }, "")
  1629. return s
  1630. }
  1631. func (this *SubscribeLogsMessage) String() string {
  1632. if this == nil {
  1633. return "nil"
  1634. }
  1635. s := strings.Join([]string{`&SubscribeLogsMessage{`,
  1636. `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`,
  1637. `}`,
  1638. }, "")
  1639. return s
  1640. }
  1641. func (this *ListenSubscriptionsRequest) String() string {
  1642. if this == nil {
  1643. return "nil"
  1644. }
  1645. s := strings.Join([]string{`&ListenSubscriptionsRequest{`,
  1646. `}`,
  1647. }, "")
  1648. return s
  1649. }
  1650. func (this *SubscriptionMessage) String() string {
  1651. if this == nil {
  1652. return "nil"
  1653. }
  1654. s := strings.Join([]string{`&SubscriptionMessage{`,
  1655. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  1656. `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`,
  1657. `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`,
  1658. `Close:` + fmt.Sprintf("%v", this.Close) + `,`,
  1659. `}`,
  1660. }, "")
  1661. return s
  1662. }
  1663. func (this *PublishLogsMessage) String() string {
  1664. if this == nil {
  1665. return "nil"
  1666. }
  1667. s := strings.Join([]string{`&PublishLogsMessage{`,
  1668. `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`,
  1669. `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`,
  1670. `}`,
  1671. }, "")
  1672. return s
  1673. }
  1674. func (this *PublishLogsResponse) String() string {
  1675. if this == nil {
  1676. return "nil"
  1677. }
  1678. s := strings.Join([]string{`&PublishLogsResponse{`,
  1679. `}`,
  1680. }, "")
  1681. return s
  1682. }
  1683. func valueToStringLogbroker(v interface{}) string {
  1684. rv := reflect.ValueOf(v)
  1685. if rv.IsNil() {
  1686. return "nil"
  1687. }
  1688. pv := reflect.Indirect(rv).Interface()
  1689. return fmt.Sprintf("*%v", pv)
  1690. }
  1691. func (m *LogSubscriptionOptions) Unmarshal(data []byte) error {
  1692. l := len(data)
  1693. iNdEx := 0
  1694. for iNdEx < l {
  1695. preIndex := iNdEx
  1696. var wire uint64
  1697. for shift := uint(0); ; shift += 7 {
  1698. if shift >= 64 {
  1699. return ErrIntOverflowLogbroker
  1700. }
  1701. if iNdEx >= l {
  1702. return io.ErrUnexpectedEOF
  1703. }
  1704. b := data[iNdEx]
  1705. iNdEx++
  1706. wire |= (uint64(b) & 0x7F) << shift
  1707. if b < 0x80 {
  1708. break
  1709. }
  1710. }
  1711. fieldNum := int32(wire >> 3)
  1712. wireType := int(wire & 0x7)
  1713. if wireType == 4 {
  1714. return fmt.Errorf("proto: LogSubscriptionOptions: wiretype end group for non-group")
  1715. }
  1716. if fieldNum <= 0 {
  1717. return fmt.Errorf("proto: LogSubscriptionOptions: illegal tag %d (wire type %d)", fieldNum, wire)
  1718. }
  1719. switch fieldNum {
  1720. case 1:
  1721. if wireType != 0 {
  1722. return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType)
  1723. }
  1724. var v LogStream
  1725. for shift := uint(0); ; shift += 7 {
  1726. if shift >= 64 {
  1727. return ErrIntOverflowLogbroker
  1728. }
  1729. if iNdEx >= l {
  1730. return io.ErrUnexpectedEOF
  1731. }
  1732. b := data[iNdEx]
  1733. iNdEx++
  1734. v |= (LogStream(b) & 0x7F) << shift
  1735. if b < 0x80 {
  1736. break
  1737. }
  1738. }
  1739. m.Streams = append(m.Streams, v)
  1740. case 2:
  1741. if wireType != 0 {
  1742. return fmt.Errorf("proto: wrong wireType = %d for field Follow", wireType)
  1743. }
  1744. var v int
  1745. for shift := uint(0); ; shift += 7 {
  1746. if shift >= 64 {
  1747. return ErrIntOverflowLogbroker
  1748. }
  1749. if iNdEx >= l {
  1750. return io.ErrUnexpectedEOF
  1751. }
  1752. b := data[iNdEx]
  1753. iNdEx++
  1754. v |= (int(b) & 0x7F) << shift
  1755. if b < 0x80 {
  1756. break
  1757. }
  1758. }
  1759. m.Follow = bool(v != 0)
  1760. case 3:
  1761. if wireType != 0 {
  1762. return fmt.Errorf("proto: wrong wireType = %d for field Tail", wireType)
  1763. }
  1764. m.Tail = 0
  1765. for shift := uint(0); ; shift += 7 {
  1766. if shift >= 64 {
  1767. return ErrIntOverflowLogbroker
  1768. }
  1769. if iNdEx >= l {
  1770. return io.ErrUnexpectedEOF
  1771. }
  1772. b := data[iNdEx]
  1773. iNdEx++
  1774. m.Tail |= (int64(b) & 0x7F) << shift
  1775. if b < 0x80 {
  1776. break
  1777. }
  1778. }
  1779. case 4:
  1780. if wireType != 2 {
  1781. return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType)
  1782. }
  1783. var msglen int
  1784. for shift := uint(0); ; shift += 7 {
  1785. if shift >= 64 {
  1786. return ErrIntOverflowLogbroker
  1787. }
  1788. if iNdEx >= l {
  1789. return io.ErrUnexpectedEOF
  1790. }
  1791. b := data[iNdEx]
  1792. iNdEx++
  1793. msglen |= (int(b) & 0x7F) << shift
  1794. if b < 0x80 {
  1795. break
  1796. }
  1797. }
  1798. if msglen < 0 {
  1799. return ErrInvalidLengthLogbroker
  1800. }
  1801. postIndex := iNdEx + msglen
  1802. if postIndex > l {
  1803. return io.ErrUnexpectedEOF
  1804. }
  1805. if m.Since == nil {
  1806. m.Since = &docker_swarmkit_v1.Timestamp{}
  1807. }
  1808. if err := m.Since.Unmarshal(data[iNdEx:postIndex]); err != nil {
  1809. return err
  1810. }
  1811. iNdEx = postIndex
  1812. default:
  1813. iNdEx = preIndex
  1814. skippy, err := skipLogbroker(data[iNdEx:])
  1815. if err != nil {
  1816. return err
  1817. }
  1818. if skippy < 0 {
  1819. return ErrInvalidLengthLogbroker
  1820. }
  1821. if (iNdEx + skippy) > l {
  1822. return io.ErrUnexpectedEOF
  1823. }
  1824. iNdEx += skippy
  1825. }
  1826. }
  1827. if iNdEx > l {
  1828. return io.ErrUnexpectedEOF
  1829. }
  1830. return nil
  1831. }
  1832. func (m *LogSelector) Unmarshal(data []byte) error {
  1833. l := len(data)
  1834. iNdEx := 0
  1835. for iNdEx < l {
  1836. preIndex := iNdEx
  1837. var wire uint64
  1838. for shift := uint(0); ; shift += 7 {
  1839. if shift >= 64 {
  1840. return ErrIntOverflowLogbroker
  1841. }
  1842. if iNdEx >= l {
  1843. return io.ErrUnexpectedEOF
  1844. }
  1845. b := data[iNdEx]
  1846. iNdEx++
  1847. wire |= (uint64(b) & 0x7F) << shift
  1848. if b < 0x80 {
  1849. break
  1850. }
  1851. }
  1852. fieldNum := int32(wire >> 3)
  1853. wireType := int(wire & 0x7)
  1854. if wireType == 4 {
  1855. return fmt.Errorf("proto: LogSelector: wiretype end group for non-group")
  1856. }
  1857. if fieldNum <= 0 {
  1858. return fmt.Errorf("proto: LogSelector: illegal tag %d (wire type %d)", fieldNum, wire)
  1859. }
  1860. switch fieldNum {
  1861. case 1:
  1862. if wireType != 2 {
  1863. return fmt.Errorf("proto: wrong wireType = %d for field ServiceIDs", wireType)
  1864. }
  1865. var stringLen uint64
  1866. for shift := uint(0); ; shift += 7 {
  1867. if shift >= 64 {
  1868. return ErrIntOverflowLogbroker
  1869. }
  1870. if iNdEx >= l {
  1871. return io.ErrUnexpectedEOF
  1872. }
  1873. b := data[iNdEx]
  1874. iNdEx++
  1875. stringLen |= (uint64(b) & 0x7F) << shift
  1876. if b < 0x80 {
  1877. break
  1878. }
  1879. }
  1880. intStringLen := int(stringLen)
  1881. if intStringLen < 0 {
  1882. return ErrInvalidLengthLogbroker
  1883. }
  1884. postIndex := iNdEx + intStringLen
  1885. if postIndex > l {
  1886. return io.ErrUnexpectedEOF
  1887. }
  1888. m.ServiceIDs = append(m.ServiceIDs, string(data[iNdEx:postIndex]))
  1889. iNdEx = postIndex
  1890. case 2:
  1891. if wireType != 2 {
  1892. return fmt.Errorf("proto: wrong wireType = %d for field NodeIDs", wireType)
  1893. }
  1894. var stringLen uint64
  1895. for shift := uint(0); ; shift += 7 {
  1896. if shift >= 64 {
  1897. return ErrIntOverflowLogbroker
  1898. }
  1899. if iNdEx >= l {
  1900. return io.ErrUnexpectedEOF
  1901. }
  1902. b := data[iNdEx]
  1903. iNdEx++
  1904. stringLen |= (uint64(b) & 0x7F) << shift
  1905. if b < 0x80 {
  1906. break
  1907. }
  1908. }
  1909. intStringLen := int(stringLen)
  1910. if intStringLen < 0 {
  1911. return ErrInvalidLengthLogbroker
  1912. }
  1913. postIndex := iNdEx + intStringLen
  1914. if postIndex > l {
  1915. return io.ErrUnexpectedEOF
  1916. }
  1917. m.NodeIDs = append(m.NodeIDs, string(data[iNdEx:postIndex]))
  1918. iNdEx = postIndex
  1919. case 3:
  1920. if wireType != 2 {
  1921. return fmt.Errorf("proto: wrong wireType = %d for field TaskIDs", wireType)
  1922. }
  1923. var stringLen uint64
  1924. for shift := uint(0); ; shift += 7 {
  1925. if shift >= 64 {
  1926. return ErrIntOverflowLogbroker
  1927. }
  1928. if iNdEx >= l {
  1929. return io.ErrUnexpectedEOF
  1930. }
  1931. b := data[iNdEx]
  1932. iNdEx++
  1933. stringLen |= (uint64(b) & 0x7F) << shift
  1934. if b < 0x80 {
  1935. break
  1936. }
  1937. }
  1938. intStringLen := int(stringLen)
  1939. if intStringLen < 0 {
  1940. return ErrInvalidLengthLogbroker
  1941. }
  1942. postIndex := iNdEx + intStringLen
  1943. if postIndex > l {
  1944. return io.ErrUnexpectedEOF
  1945. }
  1946. m.TaskIDs = append(m.TaskIDs, string(data[iNdEx:postIndex]))
  1947. iNdEx = postIndex
  1948. default:
  1949. iNdEx = preIndex
  1950. skippy, err := skipLogbroker(data[iNdEx:])
  1951. if err != nil {
  1952. return err
  1953. }
  1954. if skippy < 0 {
  1955. return ErrInvalidLengthLogbroker
  1956. }
  1957. if (iNdEx + skippy) > l {
  1958. return io.ErrUnexpectedEOF
  1959. }
  1960. iNdEx += skippy
  1961. }
  1962. }
  1963. if iNdEx > l {
  1964. return io.ErrUnexpectedEOF
  1965. }
  1966. return nil
  1967. }
  1968. func (m *LogContext) Unmarshal(data []byte) error {
  1969. l := len(data)
  1970. iNdEx := 0
  1971. for iNdEx < l {
  1972. preIndex := iNdEx
  1973. var wire uint64
  1974. for shift := uint(0); ; shift += 7 {
  1975. if shift >= 64 {
  1976. return ErrIntOverflowLogbroker
  1977. }
  1978. if iNdEx >= l {
  1979. return io.ErrUnexpectedEOF
  1980. }
  1981. b := data[iNdEx]
  1982. iNdEx++
  1983. wire |= (uint64(b) & 0x7F) << shift
  1984. if b < 0x80 {
  1985. break
  1986. }
  1987. }
  1988. fieldNum := int32(wire >> 3)
  1989. wireType := int(wire & 0x7)
  1990. if wireType == 4 {
  1991. return fmt.Errorf("proto: LogContext: wiretype end group for non-group")
  1992. }
  1993. if fieldNum <= 0 {
  1994. return fmt.Errorf("proto: LogContext: illegal tag %d (wire type %d)", fieldNum, wire)
  1995. }
  1996. switch fieldNum {
  1997. case 1:
  1998. if wireType != 2 {
  1999. return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
  2000. }
  2001. var stringLen uint64
  2002. for shift := uint(0); ; shift += 7 {
  2003. if shift >= 64 {
  2004. return ErrIntOverflowLogbroker
  2005. }
  2006. if iNdEx >= l {
  2007. return io.ErrUnexpectedEOF
  2008. }
  2009. b := data[iNdEx]
  2010. iNdEx++
  2011. stringLen |= (uint64(b) & 0x7F) << shift
  2012. if b < 0x80 {
  2013. break
  2014. }
  2015. }
  2016. intStringLen := int(stringLen)
  2017. if intStringLen < 0 {
  2018. return ErrInvalidLengthLogbroker
  2019. }
  2020. postIndex := iNdEx + intStringLen
  2021. if postIndex > l {
  2022. return io.ErrUnexpectedEOF
  2023. }
  2024. m.ServiceID = string(data[iNdEx:postIndex])
  2025. iNdEx = postIndex
  2026. case 2:
  2027. if wireType != 2 {
  2028. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2029. }
  2030. var stringLen uint64
  2031. for shift := uint(0); ; shift += 7 {
  2032. if shift >= 64 {
  2033. return ErrIntOverflowLogbroker
  2034. }
  2035. if iNdEx >= l {
  2036. return io.ErrUnexpectedEOF
  2037. }
  2038. b := data[iNdEx]
  2039. iNdEx++
  2040. stringLen |= (uint64(b) & 0x7F) << shift
  2041. if b < 0x80 {
  2042. break
  2043. }
  2044. }
  2045. intStringLen := int(stringLen)
  2046. if intStringLen < 0 {
  2047. return ErrInvalidLengthLogbroker
  2048. }
  2049. postIndex := iNdEx + intStringLen
  2050. if postIndex > l {
  2051. return io.ErrUnexpectedEOF
  2052. }
  2053. m.NodeID = string(data[iNdEx:postIndex])
  2054. iNdEx = postIndex
  2055. case 3:
  2056. if wireType != 2 {
  2057. return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType)
  2058. }
  2059. var stringLen uint64
  2060. for shift := uint(0); ; shift += 7 {
  2061. if shift >= 64 {
  2062. return ErrIntOverflowLogbroker
  2063. }
  2064. if iNdEx >= l {
  2065. return io.ErrUnexpectedEOF
  2066. }
  2067. b := data[iNdEx]
  2068. iNdEx++
  2069. stringLen |= (uint64(b) & 0x7F) << shift
  2070. if b < 0x80 {
  2071. break
  2072. }
  2073. }
  2074. intStringLen := int(stringLen)
  2075. if intStringLen < 0 {
  2076. return ErrInvalidLengthLogbroker
  2077. }
  2078. postIndex := iNdEx + intStringLen
  2079. if postIndex > l {
  2080. return io.ErrUnexpectedEOF
  2081. }
  2082. m.TaskID = string(data[iNdEx:postIndex])
  2083. iNdEx = postIndex
  2084. default:
  2085. iNdEx = preIndex
  2086. skippy, err := skipLogbroker(data[iNdEx:])
  2087. if err != nil {
  2088. return err
  2089. }
  2090. if skippy < 0 {
  2091. return ErrInvalidLengthLogbroker
  2092. }
  2093. if (iNdEx + skippy) > l {
  2094. return io.ErrUnexpectedEOF
  2095. }
  2096. iNdEx += skippy
  2097. }
  2098. }
  2099. if iNdEx > l {
  2100. return io.ErrUnexpectedEOF
  2101. }
  2102. return nil
  2103. }
  2104. func (m *LogMessage) Unmarshal(data []byte) error {
  2105. l := len(data)
  2106. iNdEx := 0
  2107. for iNdEx < l {
  2108. preIndex := iNdEx
  2109. var wire uint64
  2110. for shift := uint(0); ; shift += 7 {
  2111. if shift >= 64 {
  2112. return ErrIntOverflowLogbroker
  2113. }
  2114. if iNdEx >= l {
  2115. return io.ErrUnexpectedEOF
  2116. }
  2117. b := data[iNdEx]
  2118. iNdEx++
  2119. wire |= (uint64(b) & 0x7F) << shift
  2120. if b < 0x80 {
  2121. break
  2122. }
  2123. }
  2124. fieldNum := int32(wire >> 3)
  2125. wireType := int(wire & 0x7)
  2126. if wireType == 4 {
  2127. return fmt.Errorf("proto: LogMessage: wiretype end group for non-group")
  2128. }
  2129. if fieldNum <= 0 {
  2130. return fmt.Errorf("proto: LogMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  2131. }
  2132. switch fieldNum {
  2133. case 1:
  2134. if wireType != 2 {
  2135. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2136. }
  2137. var msglen int
  2138. for shift := uint(0); ; shift += 7 {
  2139. if shift >= 64 {
  2140. return ErrIntOverflowLogbroker
  2141. }
  2142. if iNdEx >= l {
  2143. return io.ErrUnexpectedEOF
  2144. }
  2145. b := data[iNdEx]
  2146. iNdEx++
  2147. msglen |= (int(b) & 0x7F) << shift
  2148. if b < 0x80 {
  2149. break
  2150. }
  2151. }
  2152. if msglen < 0 {
  2153. return ErrInvalidLengthLogbroker
  2154. }
  2155. postIndex := iNdEx + msglen
  2156. if postIndex > l {
  2157. return io.ErrUnexpectedEOF
  2158. }
  2159. if err := m.Context.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2160. return err
  2161. }
  2162. iNdEx = postIndex
  2163. case 2:
  2164. if wireType != 2 {
  2165. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  2166. }
  2167. var msglen int
  2168. for shift := uint(0); ; shift += 7 {
  2169. if shift >= 64 {
  2170. return ErrIntOverflowLogbroker
  2171. }
  2172. if iNdEx >= l {
  2173. return io.ErrUnexpectedEOF
  2174. }
  2175. b := data[iNdEx]
  2176. iNdEx++
  2177. msglen |= (int(b) & 0x7F) << shift
  2178. if b < 0x80 {
  2179. break
  2180. }
  2181. }
  2182. if msglen < 0 {
  2183. return ErrInvalidLengthLogbroker
  2184. }
  2185. postIndex := iNdEx + msglen
  2186. if postIndex > l {
  2187. return io.ErrUnexpectedEOF
  2188. }
  2189. if m.Timestamp == nil {
  2190. m.Timestamp = &docker_swarmkit_v1.Timestamp{}
  2191. }
  2192. if err := m.Timestamp.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2193. return err
  2194. }
  2195. iNdEx = postIndex
  2196. case 3:
  2197. if wireType != 0 {
  2198. return fmt.Errorf("proto: wrong wireType = %d for field Stream", wireType)
  2199. }
  2200. m.Stream = 0
  2201. for shift := uint(0); ; shift += 7 {
  2202. if shift >= 64 {
  2203. return ErrIntOverflowLogbroker
  2204. }
  2205. if iNdEx >= l {
  2206. return io.ErrUnexpectedEOF
  2207. }
  2208. b := data[iNdEx]
  2209. iNdEx++
  2210. m.Stream |= (LogStream(b) & 0x7F) << shift
  2211. if b < 0x80 {
  2212. break
  2213. }
  2214. }
  2215. case 4:
  2216. if wireType != 2 {
  2217. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  2218. }
  2219. var byteLen int
  2220. for shift := uint(0); ; shift += 7 {
  2221. if shift >= 64 {
  2222. return ErrIntOverflowLogbroker
  2223. }
  2224. if iNdEx >= l {
  2225. return io.ErrUnexpectedEOF
  2226. }
  2227. b := data[iNdEx]
  2228. iNdEx++
  2229. byteLen |= (int(b) & 0x7F) << shift
  2230. if b < 0x80 {
  2231. break
  2232. }
  2233. }
  2234. if byteLen < 0 {
  2235. return ErrInvalidLengthLogbroker
  2236. }
  2237. postIndex := iNdEx + byteLen
  2238. if postIndex > l {
  2239. return io.ErrUnexpectedEOF
  2240. }
  2241. m.Data = append(m.Data[:0], data[iNdEx:postIndex]...)
  2242. if m.Data == nil {
  2243. m.Data = []byte{}
  2244. }
  2245. iNdEx = postIndex
  2246. default:
  2247. iNdEx = preIndex
  2248. skippy, err := skipLogbroker(data[iNdEx:])
  2249. if err != nil {
  2250. return err
  2251. }
  2252. if skippy < 0 {
  2253. return ErrInvalidLengthLogbroker
  2254. }
  2255. if (iNdEx + skippy) > l {
  2256. return io.ErrUnexpectedEOF
  2257. }
  2258. iNdEx += skippy
  2259. }
  2260. }
  2261. if iNdEx > l {
  2262. return io.ErrUnexpectedEOF
  2263. }
  2264. return nil
  2265. }
  2266. func (m *SubscribeLogsRequest) Unmarshal(data []byte) error {
  2267. l := len(data)
  2268. iNdEx := 0
  2269. for iNdEx < l {
  2270. preIndex := iNdEx
  2271. var wire uint64
  2272. for shift := uint(0); ; shift += 7 {
  2273. if shift >= 64 {
  2274. return ErrIntOverflowLogbroker
  2275. }
  2276. if iNdEx >= l {
  2277. return io.ErrUnexpectedEOF
  2278. }
  2279. b := data[iNdEx]
  2280. iNdEx++
  2281. wire |= (uint64(b) & 0x7F) << shift
  2282. if b < 0x80 {
  2283. break
  2284. }
  2285. }
  2286. fieldNum := int32(wire >> 3)
  2287. wireType := int(wire & 0x7)
  2288. if wireType == 4 {
  2289. return fmt.Errorf("proto: SubscribeLogsRequest: wiretype end group for non-group")
  2290. }
  2291. if fieldNum <= 0 {
  2292. return fmt.Errorf("proto: SubscribeLogsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2293. }
  2294. switch fieldNum {
  2295. case 1:
  2296. if wireType != 2 {
  2297. return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
  2298. }
  2299. var msglen int
  2300. for shift := uint(0); ; shift += 7 {
  2301. if shift >= 64 {
  2302. return ErrIntOverflowLogbroker
  2303. }
  2304. if iNdEx >= l {
  2305. return io.ErrUnexpectedEOF
  2306. }
  2307. b := data[iNdEx]
  2308. iNdEx++
  2309. msglen |= (int(b) & 0x7F) << shift
  2310. if b < 0x80 {
  2311. break
  2312. }
  2313. }
  2314. if msglen < 0 {
  2315. return ErrInvalidLengthLogbroker
  2316. }
  2317. postIndex := iNdEx + msglen
  2318. if postIndex > l {
  2319. return io.ErrUnexpectedEOF
  2320. }
  2321. if m.Selector == nil {
  2322. m.Selector = &LogSelector{}
  2323. }
  2324. if err := m.Selector.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2325. return err
  2326. }
  2327. iNdEx = postIndex
  2328. case 2:
  2329. if wireType != 2 {
  2330. return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
  2331. }
  2332. var msglen int
  2333. for shift := uint(0); ; shift += 7 {
  2334. if shift >= 64 {
  2335. return ErrIntOverflowLogbroker
  2336. }
  2337. if iNdEx >= l {
  2338. return io.ErrUnexpectedEOF
  2339. }
  2340. b := data[iNdEx]
  2341. iNdEx++
  2342. msglen |= (int(b) & 0x7F) << shift
  2343. if b < 0x80 {
  2344. break
  2345. }
  2346. }
  2347. if msglen < 0 {
  2348. return ErrInvalidLengthLogbroker
  2349. }
  2350. postIndex := iNdEx + msglen
  2351. if postIndex > l {
  2352. return io.ErrUnexpectedEOF
  2353. }
  2354. if m.Options == nil {
  2355. m.Options = &LogSubscriptionOptions{}
  2356. }
  2357. if err := m.Options.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2358. return err
  2359. }
  2360. iNdEx = postIndex
  2361. default:
  2362. iNdEx = preIndex
  2363. skippy, err := skipLogbroker(data[iNdEx:])
  2364. if err != nil {
  2365. return err
  2366. }
  2367. if skippy < 0 {
  2368. return ErrInvalidLengthLogbroker
  2369. }
  2370. if (iNdEx + skippy) > l {
  2371. return io.ErrUnexpectedEOF
  2372. }
  2373. iNdEx += skippy
  2374. }
  2375. }
  2376. if iNdEx > l {
  2377. return io.ErrUnexpectedEOF
  2378. }
  2379. return nil
  2380. }
  2381. func (m *SubscribeLogsMessage) Unmarshal(data []byte) error {
  2382. l := len(data)
  2383. iNdEx := 0
  2384. for iNdEx < l {
  2385. preIndex := iNdEx
  2386. var wire uint64
  2387. for shift := uint(0); ; shift += 7 {
  2388. if shift >= 64 {
  2389. return ErrIntOverflowLogbroker
  2390. }
  2391. if iNdEx >= l {
  2392. return io.ErrUnexpectedEOF
  2393. }
  2394. b := data[iNdEx]
  2395. iNdEx++
  2396. wire |= (uint64(b) & 0x7F) << shift
  2397. if b < 0x80 {
  2398. break
  2399. }
  2400. }
  2401. fieldNum := int32(wire >> 3)
  2402. wireType := int(wire & 0x7)
  2403. if wireType == 4 {
  2404. return fmt.Errorf("proto: SubscribeLogsMessage: wiretype end group for non-group")
  2405. }
  2406. if fieldNum <= 0 {
  2407. return fmt.Errorf("proto: SubscribeLogsMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  2408. }
  2409. switch fieldNum {
  2410. case 1:
  2411. if wireType != 2 {
  2412. return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType)
  2413. }
  2414. var msglen int
  2415. for shift := uint(0); ; shift += 7 {
  2416. if shift >= 64 {
  2417. return ErrIntOverflowLogbroker
  2418. }
  2419. if iNdEx >= l {
  2420. return io.ErrUnexpectedEOF
  2421. }
  2422. b := data[iNdEx]
  2423. iNdEx++
  2424. msglen |= (int(b) & 0x7F) << shift
  2425. if b < 0x80 {
  2426. break
  2427. }
  2428. }
  2429. if msglen < 0 {
  2430. return ErrInvalidLengthLogbroker
  2431. }
  2432. postIndex := iNdEx + msglen
  2433. if postIndex > l {
  2434. return io.ErrUnexpectedEOF
  2435. }
  2436. m.Messages = append(m.Messages, LogMessage{})
  2437. if err := m.Messages[len(m.Messages)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2438. return err
  2439. }
  2440. iNdEx = postIndex
  2441. default:
  2442. iNdEx = preIndex
  2443. skippy, err := skipLogbroker(data[iNdEx:])
  2444. if err != nil {
  2445. return err
  2446. }
  2447. if skippy < 0 {
  2448. return ErrInvalidLengthLogbroker
  2449. }
  2450. if (iNdEx + skippy) > l {
  2451. return io.ErrUnexpectedEOF
  2452. }
  2453. iNdEx += skippy
  2454. }
  2455. }
  2456. if iNdEx > l {
  2457. return io.ErrUnexpectedEOF
  2458. }
  2459. return nil
  2460. }
  2461. func (m *ListenSubscriptionsRequest) Unmarshal(data []byte) error {
  2462. l := len(data)
  2463. iNdEx := 0
  2464. for iNdEx < l {
  2465. preIndex := iNdEx
  2466. var wire uint64
  2467. for shift := uint(0); ; shift += 7 {
  2468. if shift >= 64 {
  2469. return ErrIntOverflowLogbroker
  2470. }
  2471. if iNdEx >= l {
  2472. return io.ErrUnexpectedEOF
  2473. }
  2474. b := data[iNdEx]
  2475. iNdEx++
  2476. wire |= (uint64(b) & 0x7F) << shift
  2477. if b < 0x80 {
  2478. break
  2479. }
  2480. }
  2481. fieldNum := int32(wire >> 3)
  2482. wireType := int(wire & 0x7)
  2483. if wireType == 4 {
  2484. return fmt.Errorf("proto: ListenSubscriptionsRequest: wiretype end group for non-group")
  2485. }
  2486. if fieldNum <= 0 {
  2487. return fmt.Errorf("proto: ListenSubscriptionsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2488. }
  2489. switch fieldNum {
  2490. default:
  2491. iNdEx = preIndex
  2492. skippy, err := skipLogbroker(data[iNdEx:])
  2493. if err != nil {
  2494. return err
  2495. }
  2496. if skippy < 0 {
  2497. return ErrInvalidLengthLogbroker
  2498. }
  2499. if (iNdEx + skippy) > l {
  2500. return io.ErrUnexpectedEOF
  2501. }
  2502. iNdEx += skippy
  2503. }
  2504. }
  2505. if iNdEx > l {
  2506. return io.ErrUnexpectedEOF
  2507. }
  2508. return nil
  2509. }
  2510. func (m *SubscriptionMessage) Unmarshal(data []byte) error {
  2511. l := len(data)
  2512. iNdEx := 0
  2513. for iNdEx < l {
  2514. preIndex := iNdEx
  2515. var wire uint64
  2516. for shift := uint(0); ; shift += 7 {
  2517. if shift >= 64 {
  2518. return ErrIntOverflowLogbroker
  2519. }
  2520. if iNdEx >= l {
  2521. return io.ErrUnexpectedEOF
  2522. }
  2523. b := data[iNdEx]
  2524. iNdEx++
  2525. wire |= (uint64(b) & 0x7F) << shift
  2526. if b < 0x80 {
  2527. break
  2528. }
  2529. }
  2530. fieldNum := int32(wire >> 3)
  2531. wireType := int(wire & 0x7)
  2532. if wireType == 4 {
  2533. return fmt.Errorf("proto: SubscriptionMessage: wiretype end group for non-group")
  2534. }
  2535. if fieldNum <= 0 {
  2536. return fmt.Errorf("proto: SubscriptionMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  2537. }
  2538. switch fieldNum {
  2539. case 1:
  2540. if wireType != 2 {
  2541. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2542. }
  2543. var stringLen uint64
  2544. for shift := uint(0); ; shift += 7 {
  2545. if shift >= 64 {
  2546. return ErrIntOverflowLogbroker
  2547. }
  2548. if iNdEx >= l {
  2549. return io.ErrUnexpectedEOF
  2550. }
  2551. b := data[iNdEx]
  2552. iNdEx++
  2553. stringLen |= (uint64(b) & 0x7F) << shift
  2554. if b < 0x80 {
  2555. break
  2556. }
  2557. }
  2558. intStringLen := int(stringLen)
  2559. if intStringLen < 0 {
  2560. return ErrInvalidLengthLogbroker
  2561. }
  2562. postIndex := iNdEx + intStringLen
  2563. if postIndex > l {
  2564. return io.ErrUnexpectedEOF
  2565. }
  2566. m.ID = string(data[iNdEx:postIndex])
  2567. iNdEx = postIndex
  2568. case 2:
  2569. if wireType != 2 {
  2570. return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
  2571. }
  2572. var msglen int
  2573. for shift := uint(0); ; shift += 7 {
  2574. if shift >= 64 {
  2575. return ErrIntOverflowLogbroker
  2576. }
  2577. if iNdEx >= l {
  2578. return io.ErrUnexpectedEOF
  2579. }
  2580. b := data[iNdEx]
  2581. iNdEx++
  2582. msglen |= (int(b) & 0x7F) << shift
  2583. if b < 0x80 {
  2584. break
  2585. }
  2586. }
  2587. if msglen < 0 {
  2588. return ErrInvalidLengthLogbroker
  2589. }
  2590. postIndex := iNdEx + msglen
  2591. if postIndex > l {
  2592. return io.ErrUnexpectedEOF
  2593. }
  2594. if m.Selector == nil {
  2595. m.Selector = &LogSelector{}
  2596. }
  2597. if err := m.Selector.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2598. return err
  2599. }
  2600. iNdEx = postIndex
  2601. case 3:
  2602. if wireType != 2 {
  2603. return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
  2604. }
  2605. var msglen int
  2606. for shift := uint(0); ; shift += 7 {
  2607. if shift >= 64 {
  2608. return ErrIntOverflowLogbroker
  2609. }
  2610. if iNdEx >= l {
  2611. return io.ErrUnexpectedEOF
  2612. }
  2613. b := data[iNdEx]
  2614. iNdEx++
  2615. msglen |= (int(b) & 0x7F) << shift
  2616. if b < 0x80 {
  2617. break
  2618. }
  2619. }
  2620. if msglen < 0 {
  2621. return ErrInvalidLengthLogbroker
  2622. }
  2623. postIndex := iNdEx + msglen
  2624. if postIndex > l {
  2625. return io.ErrUnexpectedEOF
  2626. }
  2627. if m.Options == nil {
  2628. m.Options = &LogSubscriptionOptions{}
  2629. }
  2630. if err := m.Options.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2631. return err
  2632. }
  2633. iNdEx = postIndex
  2634. case 4:
  2635. if wireType != 0 {
  2636. return fmt.Errorf("proto: wrong wireType = %d for field Close", wireType)
  2637. }
  2638. var v int
  2639. for shift := uint(0); ; shift += 7 {
  2640. if shift >= 64 {
  2641. return ErrIntOverflowLogbroker
  2642. }
  2643. if iNdEx >= l {
  2644. return io.ErrUnexpectedEOF
  2645. }
  2646. b := data[iNdEx]
  2647. iNdEx++
  2648. v |= (int(b) & 0x7F) << shift
  2649. if b < 0x80 {
  2650. break
  2651. }
  2652. }
  2653. m.Close = bool(v != 0)
  2654. default:
  2655. iNdEx = preIndex
  2656. skippy, err := skipLogbroker(data[iNdEx:])
  2657. if err != nil {
  2658. return err
  2659. }
  2660. if skippy < 0 {
  2661. return ErrInvalidLengthLogbroker
  2662. }
  2663. if (iNdEx + skippy) > l {
  2664. return io.ErrUnexpectedEOF
  2665. }
  2666. iNdEx += skippy
  2667. }
  2668. }
  2669. if iNdEx > l {
  2670. return io.ErrUnexpectedEOF
  2671. }
  2672. return nil
  2673. }
  2674. func (m *PublishLogsMessage) Unmarshal(data []byte) error {
  2675. l := len(data)
  2676. iNdEx := 0
  2677. for iNdEx < l {
  2678. preIndex := iNdEx
  2679. var wire uint64
  2680. for shift := uint(0); ; shift += 7 {
  2681. if shift >= 64 {
  2682. return ErrIntOverflowLogbroker
  2683. }
  2684. if iNdEx >= l {
  2685. return io.ErrUnexpectedEOF
  2686. }
  2687. b := data[iNdEx]
  2688. iNdEx++
  2689. wire |= (uint64(b) & 0x7F) << shift
  2690. if b < 0x80 {
  2691. break
  2692. }
  2693. }
  2694. fieldNum := int32(wire >> 3)
  2695. wireType := int(wire & 0x7)
  2696. if wireType == 4 {
  2697. return fmt.Errorf("proto: PublishLogsMessage: wiretype end group for non-group")
  2698. }
  2699. if fieldNum <= 0 {
  2700. return fmt.Errorf("proto: PublishLogsMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  2701. }
  2702. switch fieldNum {
  2703. case 1:
  2704. if wireType != 2 {
  2705. return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionID", wireType)
  2706. }
  2707. var stringLen uint64
  2708. for shift := uint(0); ; shift += 7 {
  2709. if shift >= 64 {
  2710. return ErrIntOverflowLogbroker
  2711. }
  2712. if iNdEx >= l {
  2713. return io.ErrUnexpectedEOF
  2714. }
  2715. b := data[iNdEx]
  2716. iNdEx++
  2717. stringLen |= (uint64(b) & 0x7F) << shift
  2718. if b < 0x80 {
  2719. break
  2720. }
  2721. }
  2722. intStringLen := int(stringLen)
  2723. if intStringLen < 0 {
  2724. return ErrInvalidLengthLogbroker
  2725. }
  2726. postIndex := iNdEx + intStringLen
  2727. if postIndex > l {
  2728. return io.ErrUnexpectedEOF
  2729. }
  2730. m.SubscriptionID = string(data[iNdEx:postIndex])
  2731. iNdEx = postIndex
  2732. case 2:
  2733. if wireType != 2 {
  2734. return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType)
  2735. }
  2736. var msglen int
  2737. for shift := uint(0); ; shift += 7 {
  2738. if shift >= 64 {
  2739. return ErrIntOverflowLogbroker
  2740. }
  2741. if iNdEx >= l {
  2742. return io.ErrUnexpectedEOF
  2743. }
  2744. b := data[iNdEx]
  2745. iNdEx++
  2746. msglen |= (int(b) & 0x7F) << shift
  2747. if b < 0x80 {
  2748. break
  2749. }
  2750. }
  2751. if msglen < 0 {
  2752. return ErrInvalidLengthLogbroker
  2753. }
  2754. postIndex := iNdEx + msglen
  2755. if postIndex > l {
  2756. return io.ErrUnexpectedEOF
  2757. }
  2758. m.Messages = append(m.Messages, LogMessage{})
  2759. if err := m.Messages[len(m.Messages)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2760. return err
  2761. }
  2762. iNdEx = postIndex
  2763. default:
  2764. iNdEx = preIndex
  2765. skippy, err := skipLogbroker(data[iNdEx:])
  2766. if err != nil {
  2767. return err
  2768. }
  2769. if skippy < 0 {
  2770. return ErrInvalidLengthLogbroker
  2771. }
  2772. if (iNdEx + skippy) > l {
  2773. return io.ErrUnexpectedEOF
  2774. }
  2775. iNdEx += skippy
  2776. }
  2777. }
  2778. if iNdEx > l {
  2779. return io.ErrUnexpectedEOF
  2780. }
  2781. return nil
  2782. }
  2783. func (m *PublishLogsResponse) Unmarshal(data []byte) error {
  2784. l := len(data)
  2785. iNdEx := 0
  2786. for iNdEx < l {
  2787. preIndex := iNdEx
  2788. var wire uint64
  2789. for shift := uint(0); ; shift += 7 {
  2790. if shift >= 64 {
  2791. return ErrIntOverflowLogbroker
  2792. }
  2793. if iNdEx >= l {
  2794. return io.ErrUnexpectedEOF
  2795. }
  2796. b := data[iNdEx]
  2797. iNdEx++
  2798. wire |= (uint64(b) & 0x7F) << shift
  2799. if b < 0x80 {
  2800. break
  2801. }
  2802. }
  2803. fieldNum := int32(wire >> 3)
  2804. wireType := int(wire & 0x7)
  2805. if wireType == 4 {
  2806. return fmt.Errorf("proto: PublishLogsResponse: wiretype end group for non-group")
  2807. }
  2808. if fieldNum <= 0 {
  2809. return fmt.Errorf("proto: PublishLogsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2810. }
  2811. switch fieldNum {
  2812. default:
  2813. iNdEx = preIndex
  2814. skippy, err := skipLogbroker(data[iNdEx:])
  2815. if err != nil {
  2816. return err
  2817. }
  2818. if skippy < 0 {
  2819. return ErrInvalidLengthLogbroker
  2820. }
  2821. if (iNdEx + skippy) > l {
  2822. return io.ErrUnexpectedEOF
  2823. }
  2824. iNdEx += skippy
  2825. }
  2826. }
  2827. if iNdEx > l {
  2828. return io.ErrUnexpectedEOF
  2829. }
  2830. return nil
  2831. }
  2832. func skipLogbroker(data []byte) (n int, err error) {
  2833. l := len(data)
  2834. iNdEx := 0
  2835. for iNdEx < l {
  2836. var wire uint64
  2837. for shift := uint(0); ; shift += 7 {
  2838. if shift >= 64 {
  2839. return 0, ErrIntOverflowLogbroker
  2840. }
  2841. if iNdEx >= l {
  2842. return 0, io.ErrUnexpectedEOF
  2843. }
  2844. b := data[iNdEx]
  2845. iNdEx++
  2846. wire |= (uint64(b) & 0x7F) << shift
  2847. if b < 0x80 {
  2848. break
  2849. }
  2850. }
  2851. wireType := int(wire & 0x7)
  2852. switch wireType {
  2853. case 0:
  2854. for shift := uint(0); ; shift += 7 {
  2855. if shift >= 64 {
  2856. return 0, ErrIntOverflowLogbroker
  2857. }
  2858. if iNdEx >= l {
  2859. return 0, io.ErrUnexpectedEOF
  2860. }
  2861. iNdEx++
  2862. if data[iNdEx-1] < 0x80 {
  2863. break
  2864. }
  2865. }
  2866. return iNdEx, nil
  2867. case 1:
  2868. iNdEx += 8
  2869. return iNdEx, nil
  2870. case 2:
  2871. var length int
  2872. for shift := uint(0); ; shift += 7 {
  2873. if shift >= 64 {
  2874. return 0, ErrIntOverflowLogbroker
  2875. }
  2876. if iNdEx >= l {
  2877. return 0, io.ErrUnexpectedEOF
  2878. }
  2879. b := data[iNdEx]
  2880. iNdEx++
  2881. length |= (int(b) & 0x7F) << shift
  2882. if b < 0x80 {
  2883. break
  2884. }
  2885. }
  2886. iNdEx += length
  2887. if length < 0 {
  2888. return 0, ErrInvalidLengthLogbroker
  2889. }
  2890. return iNdEx, nil
  2891. case 3:
  2892. for {
  2893. var innerWire uint64
  2894. var start int = iNdEx
  2895. for shift := uint(0); ; shift += 7 {
  2896. if shift >= 64 {
  2897. return 0, ErrIntOverflowLogbroker
  2898. }
  2899. if iNdEx >= l {
  2900. return 0, io.ErrUnexpectedEOF
  2901. }
  2902. b := data[iNdEx]
  2903. iNdEx++
  2904. innerWire |= (uint64(b) & 0x7F) << shift
  2905. if b < 0x80 {
  2906. break
  2907. }
  2908. }
  2909. innerWireType := int(innerWire & 0x7)
  2910. if innerWireType == 4 {
  2911. break
  2912. }
  2913. next, err := skipLogbroker(data[start:])
  2914. if err != nil {
  2915. return 0, err
  2916. }
  2917. iNdEx = start + next
  2918. }
  2919. return iNdEx, nil
  2920. case 4:
  2921. return iNdEx, nil
  2922. case 5:
  2923. iNdEx += 4
  2924. return iNdEx, nil
  2925. default:
  2926. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2927. }
  2928. }
  2929. panic("unreachable")
  2930. }
  2931. var (
  2932. ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling")
  2933. ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow")
  2934. )
  2935. func init() { proto.RegisterFile("logbroker.proto", fileDescriptorLogbroker) }
  2936. var fileDescriptorLogbroker = []byte{
  2937. // 872 bytes of a gzipped FileDescriptorProto
  2938. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x95, 0x4f, 0x8f, 0xdb, 0x44,
  2939. 0x18, 0xc6, 0x33, 0xce, 0x36, 0x7f, 0xde, 0x74, 0xff, 0x74, 0xb2, 0x5d, 0x85, 0xa8, 0x75, 0x22,
  2940. 0x57, 0x2a, 0xd1, 0xaa, 0x64, 0x61, 0x2b, 0xc4, 0xa1, 0x12, 0x82, 0x90, 0x0a, 0x45, 0xa4, 0xbb,
  2941. 0x68, 0x92, 0x15, 0xdc, 0x56, 0x4e, 0x3c, 0x18, 0x2b, 0x8e, 0x27, 0x78, 0x9c, 0x86, 0x03, 0x07,
  2942. 0x0e, 0x45, 0x42, 0x3d, 0x70, 0x41, 0x48, 0x70, 0xe8, 0x89, 0xde, 0x90, 0x38, 0x70, 0xe4, 0x03,
  2943. 0xa0, 0x15, 0x27, 0x0e, 0x1c, 0x38, 0x45, 0xac, 0x3f, 0x00, 0xe2, 0x23, 0x20, 0xcf, 0x4c, 0x1c,
  2944. 0x2f, 0x71, 0x58, 0xb4, 0xbd, 0x24, 0x33, 0x9e, 0xe7, 0xf5, 0xfb, 0x9b, 0x67, 0x9e, 0x91, 0x61,
  2945. 0xdb, 0x65, 0xf6, 0xc0, 0x67, 0x23, 0xea, 0x37, 0x27, 0x3e, 0x0b, 0x18, 0xc6, 0x16, 0x1b, 0x46,
  2946. 0x33, 0x3e, 0x33, 0xfd, 0xf1, 0xc8, 0x09, 0x9a, 0x8f, 0x5f, 0xab, 0xee, 0xda, 0xcc, 0x66, 0x62,
  2947. 0xf9, 0x20, 0x1a, 0x49, 0x65, 0xf5, 0xa5, 0xc0, 0x19, 0x53, 0x1e, 0x98, 0xe3, 0xc9, 0x41, 0x3c,
  2948. 0x52, 0x4b, 0xe5, 0x89, 0x3b, 0xb5, 0x1d, 0xef, 0x40, 0xfe, 0xc9, 0x87, 0xc6, 0x4f, 0x08, 0xf6,
  2949. 0xba, 0xcc, 0xee, 0x4d, 0x07, 0x7c, 0xe8, 0x3b, 0x93, 0xc0, 0x61, 0xde, 0xb1, 0xf8, 0xe5, 0xf8,
  2950. 0x0d, 0xc8, 0xf3, 0xc0, 0xa7, 0xe6, 0x98, 0x57, 0x50, 0x3d, 0xdb, 0xd8, 0x3a, 0xbc, 0xdd, 0x5c,
  2951. 0xc5, 0x68, 0x46, 0xc5, 0x42, 0x45, 0x16, 0x6a, 0xbc, 0x07, 0xb9, 0x8f, 0x98, 0xeb, 0xb2, 0x59,
  2952. 0x45, 0xab, 0xa3, 0x46, 0x81, 0xa8, 0x19, 0xc6, 0xb0, 0x11, 0x98, 0x8e, 0x5b, 0xc9, 0xd6, 0x51,
  2953. 0x23, 0x4b, 0xc4, 0x18, 0xdf, 0x87, 0x6b, 0xdc, 0xf1, 0x86, 0xb4, 0xb2, 0x51, 0x47, 0x8d, 0x52,
  2954. 0x7a, 0x8b, 0xfe, 0x62, 0x23, 0x44, 0x6a, 0x8d, 0xaf, 0x10, 0x94, 0xa2, 0xbe, 0xd4, 0xa5, 0xc3,
  2955. 0x80, 0xf9, 0xf8, 0x00, 0x4a, 0x9c, 0xfa, 0x8f, 0x9d, 0x21, 0x3d, 0x75, 0x2c, 0x49, 0x5b, 0x6c,
  2956. 0x6d, 0x85, 0xf3, 0x1a, 0xf4, 0xe4, 0xe3, 0x4e, 0x9b, 0x13, 0x50, 0x92, 0x8e, 0xc5, 0xf1, 0x5d,
  2957. 0x28, 0x78, 0xcc, 0x92, 0x6a, 0x4d, 0xa8, 0x4b, 0xe1, 0xbc, 0x96, 0x3f, 0x62, 0x96, 0x90, 0xe6,
  2958. 0xa3, 0x45, 0xa5, 0x0b, 0x4c, 0x3e, 0x12, 0xba, 0xec, 0x52, 0xd7, 0x37, 0xf9, 0x48, 0xe8, 0xa2,
  2959. 0xc5, 0x8e, 0xc5, 0x8d, 0x27, 0x08, 0xa0, 0xcb, 0xec, 0x77, 0x98, 0x17, 0xd0, 0x4f, 0x03, 0x7c,
  2960. 0x0f, 0x60, 0xc9, 0x53, 0x41, 0x75, 0xd4, 0x28, 0xb6, 0x36, 0xc3, 0x79, 0xad, 0x18, 0xe3, 0x90,
  2961. 0x62, 0x4c, 0x83, 0xef, 0x40, 0x5e, 0xc1, 0x08, 0xbf, 0x8a, 0x2d, 0x08, 0xe7, 0xb5, 0x9c, 0x64,
  2962. 0x21, 0x39, 0x89, 0x12, 0x89, 0x14, 0x89, 0xb0, 0x4f, 0x89, 0x24, 0x08, 0xc9, 0x49, 0x0e, 0xe3,
  2963. 0x77, 0x89, 0xf1, 0x88, 0x72, 0x6e, 0xda, 0x14, 0xbf, 0x09, 0xf9, 0xa1, 0x24, 0x12, 0x0c, 0xa5,
  2964. 0x43, 0x7d, 0xcd, 0x01, 0x2a, 0xee, 0xd6, 0xc6, 0xd9, 0xbc, 0x96, 0x21, 0x8b, 0x22, 0xfc, 0x00,
  2965. 0x8a, 0x71, 0x86, 0x04, 0xda, 0xa5, 0xe7, 0xb3, 0xd4, 0xe3, 0xd7, 0x21, 0x27, 0xf3, 0x20, 0x78,
  2966. 0x2f, 0x0d, 0x8f, 0x12, 0x47, 0x19, 0xb1, 0xcc, 0xc0, 0x14, 0x71, 0xb8, 0x4e, 0xc4, 0xd8, 0xf8,
  2967. 0x0e, 0xc1, 0xae, 0x0a, 0xe8, 0x80, 0x76, 0x99, 0xcd, 0x09, 0xfd, 0x64, 0x4a, 0x79, 0x04, 0x58,
  2968. 0xe0, 0x2a, 0x03, 0x6a, 0x87, 0xb5, 0x75, 0x5d, 0x94, 0x8c, 0xc4, 0x05, 0xb8, 0x0d, 0x79, 0x26,
  2969. 0x93, 0xae, 0xf6, 0xb6, 0xbf, 0xae, 0x76, 0xf5, 0x6e, 0x90, 0x45, 0xa9, 0xf1, 0xe1, 0xbf, 0xd0,
  2970. 0x16, 0xde, 0xbf, 0x05, 0x85, 0xb1, 0x1c, 0xca, 0x3c, 0xae, 0x37, 0x5f, 0x55, 0x28, 0xf3, 0xe3,
  2971. 0x2a, 0xe3, 0x16, 0x54, 0xbb, 0x0e, 0x0f, 0xa8, 0x97, 0xec, 0xbf, 0xd8, 0xba, 0xf1, 0x0b, 0x82,
  2972. 0x72, 0x72, 0x61, 0xd1, 0x77, 0x0f, 0xb4, 0x38, 0x72, 0xb9, 0x70, 0x5e, 0xd3, 0x3a, 0x6d, 0xa2,
  2973. 0x39, 0xd6, 0x05, 0xab, 0xb4, 0x17, 0xb0, 0x2a, 0x7b, 0x65, 0xab, 0xf0, 0x2e, 0x5c, 0x1b, 0xba,
  2974. 0x8c, 0xcb, 0xab, 0x5e, 0x20, 0x72, 0x62, 0x7c, 0x8d, 0x00, 0xbf, 0x3f, 0x1d, 0xb8, 0x0e, 0xff,
  2975. 0x38, 0xe9, 0xdf, 0x03, 0xd8, 0xe6, 0x89, 0x97, 0x2d, 0xef, 0x11, 0x0e, 0xe7, 0xb5, 0xad, 0x64,
  2976. 0x9f, 0x4e, 0x9b, 0x6c, 0x25, 0xa5, 0x1d, 0xeb, 0x82, 0xf9, 0xda, 0x95, 0xcc, 0xbf, 0x09, 0xe5,
  2977. 0x04, 0x14, 0xa1, 0x7c, 0xc2, 0x3c, 0x4e, 0xf7, 0x9f, 0x23, 0x28, 0xc6, 0x99, 0xc5, 0xf7, 0x00,
  2978. 0x77, 0x8f, 0xdf, 0x3d, 0xed, 0xf5, 0xc9, 0xc3, 0xb7, 0x1f, 0x9d, 0x9e, 0x1c, 0xbd, 0x77, 0x74,
  2979. 0xfc, 0xc1, 0xd1, 0x4e, 0xa6, 0xba, 0xfb, 0xf4, 0x59, 0x7d, 0x27, 0x96, 0x9d, 0x78, 0x23, 0x8f,
  2980. 0xcd, 0x3c, 0xbc, 0x0f, 0x37, 0x12, 0xea, 0x5e, 0xbf, 0x7d, 0x7c, 0xd2, 0xdf, 0x41, 0xd5, 0xf2,
  2981. 0xd3, 0x67, 0xf5, 0xed, 0x58, 0xdc, 0x0b, 0x2c, 0x36, 0x0d, 0x56, 0xb5, 0x0f, 0x09, 0xd9, 0xd1,
  2982. 0x56, 0xb5, 0xd4, 0xf7, 0xab, 0x37, 0xbe, 0xfc, 0x5e, 0xcf, 0xfc, 0xfc, 0x5c, 0x5f, 0x82, 0x1d,
  2983. 0x3e, 0x41, 0xb0, 0x11, 0x71, 0xe3, 0xcf, 0x60, 0xf3, 0x42, 0x3a, 0x71, 0x23, 0xcd, 0x87, 0xb4,
  2984. 0xbb, 0x55, 0xbd, 0x5c, 0xa9, 0xbc, 0x33, 0x6e, 0xfe, 0xfa, 0xe3, 0x5f, 0xdf, 0x6a, 0xdb, 0xb0,
  2985. 0x29, 0x94, 0xaf, 0x8c, 0x4d, 0xcf, 0xb4, 0xa9, 0xff, 0x2a, 0x3a, 0xfc, 0x41, 0x13, 0x6e, 0xb5,
  2986. 0xc4, 0x97, 0x0c, 0x7f, 0x83, 0xa0, 0x9c, 0x12, 0x68, 0xdc, 0x4c, 0x3d, 0x9a, 0xb5, 0xc9, 0xaf,
  2987. 0xbe, 0xfc, 0x1f, 0x60, 0xc9, 0xab, 0x60, 0xdc, 0x11, 0x5c, 0xb7, 0xe1, 0xba, 0xe4, 0x9a, 0x31,
  2988. 0x7f, 0x44, 0xfd, 0x15, 0x4a, 0xfc, 0x05, 0x82, 0x52, 0xe2, 0xac, 0xf1, 0xdd, 0xb4, 0xf7, 0xaf,
  2989. 0x26, 0x34, 0x9d, 0x23, 0x25, 0x34, 0xff, 0x8b, 0xa3, 0x81, 0x5a, 0xb7, 0xce, 0xce, 0xf5, 0xcc,
  2990. 0x1f, 0xe7, 0x7a, 0xe6, 0xef, 0x73, 0x1d, 0x7d, 0x1e, 0xea, 0xe8, 0x2c, 0xd4, 0xd1, 0x6f, 0xa1,
  2991. 0x8e, 0xfe, 0x0c, 0x75, 0x34, 0xc8, 0x89, 0xcf, 0xf5, 0xfd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff,
  2992. 0x8b, 0xff, 0xc0, 0x45, 0x1b, 0x08, 0x00, 0x00,
  2993. }