From 7f3a6eb17fd1c78e215a77742239a025048234d2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 29 Sep 2021 02:10:09 +0200 Subject: [PATCH] Update Generated Proto Code (#351) update generated code (definitions, client implementation & server interface) and add documentation how to generate --- cmd/server/server.go | 4 +- pipeline/rpc/client_grpc.go | 7 +- pipeline/rpc/proto/drone.pb.go | 958 ----------- pipeline/rpc/proto/generate.go | 22 + pipeline/rpc/proto/woodpecker.pb.go | 1468 +++++++++++++++++ .../proto/{drone.proto => woodpecker.proto} | 13 +- pipeline/rpc/proto/woodpecker_grpc.pb.go | 439 +++++ server/grpc/rpc.go | 25 +- 8 files changed, 1953 insertions(+), 983 deletions(-) delete mode 100644 pipeline/rpc/proto/drone.pb.go create mode 100644 pipeline/rpc/proto/generate.go create mode 100644 pipeline/rpc/proto/woodpecker.pb.go rename pipeline/rpc/proto/{drone.proto => woodpecker.proto} (90%) create mode 100644 pipeline/rpc/proto/woodpecker_grpc.pb.go diff --git a/cmd/server/server.go b/cmd/server/server.go index 5c8056c07..2d76a8ae9 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -143,7 +143,7 @@ func loop(c *cli.Context) error { MinTime: c.Duration("keepalive-min-time"), }), ) - droneServer := woodpeckerGrpcServer.NewDroneServer( + woodpeckerServer := woodpeckerGrpcServer.NewWoodpeckerServer( remote_, server.Config.Services.Queue, server.Config.Services.Logs, @@ -151,7 +151,7 @@ func loop(c *cli.Context) error { store_, server.Config.Server.Host, ) - proto.RegisterDroneServer(grpcServer, droneServer) + proto.RegisterWoodpeckerServer(grpcServer, woodpeckerServer) err = grpcServer.Serve(lis) if err != nil { diff --git a/pipeline/rpc/client_grpc.go b/pipeline/rpc/client_grpc.go index 716fbf232..74e0e9790 100644 --- a/pipeline/rpc/client_grpc.go +++ b/pipeline/rpc/client_grpc.go @@ -14,20 +14,17 @@ import ( "google.golang.org/grpc/status" ) -// generate protobuffs -// protoc --go_out=plugins=grpc,import_path=proto:. *.proto - var backoff = time.Second type client struct { - client proto.DroneClient + client proto.WoodpeckerClient conn *grpc.ClientConn } // NewGrpcClient returns a new grpc Client. func NewGrpcClient(conn *grpc.ClientConn) Peer { client := new(client) - client.client = proto.NewDroneClient(conn) + client.client = proto.NewWoodpeckerClient(conn) client.conn = conn return client } diff --git a/pipeline/rpc/proto/drone.pb.go b/pipeline/rpc/proto/drone.pb.go deleted file mode 100644 index b4dea7c17..000000000 --- a/pipeline/rpc/proto/drone.pb.go +++ /dev/null @@ -1,958 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: drone.proto - -/* -Package proto is a generated protocol buffer package. - -It is generated from these files: - drone.proto - -It has these top-level messages: - File - State - Line - Filter - Pipeline - HealthCheckRequest - HealthCheckResponse - NextRequest - NextReply - InitRequest - WaitRequest - DoneRequest - ExtendRequest - UploadRequest - UpdateRequest - LogRequest - Empty -*/ -package proto - -import proto1 "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto1.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 -) - -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", -} -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return proto1.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) -} -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{6, 0} -} - -type File struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Proc string `protobuf:"bytes,2,opt,name=proc" json:"proc,omitempty"` - Mime string `protobuf:"bytes,3,opt,name=mime" json:"mime,omitempty"` - Time int64 `protobuf:"varint,4,opt,name=time" json:"time,omitempty"` - Size int32 `protobuf:"varint,5,opt,name=size" json:"size,omitempty"` - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - Meta map[string]string `protobuf:"bytes,7,rep,name=meta" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` -} - -func (m *File) Reset() { *m = File{} } -func (m *File) String() string { return proto1.CompactTextString(m) } -func (*File) ProtoMessage() {} -func (*File) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *File) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *File) GetProc() string { - if m != nil { - return m.Proc - } - return "" -} - -func (m *File) GetMime() string { - if m != nil { - return m.Mime - } - return "" -} - -func (m *File) GetTime() int64 { - if m != nil { - return m.Time - } - return 0 -} - -func (m *File) GetSize() int32 { - if m != nil { - return m.Size - } - return 0 -} - -func (m *File) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *File) GetMeta() map[string]string { - if m != nil { - return m.Meta - } - return nil -} - -type State struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Exited bool `protobuf:"varint,2,opt,name=exited" json:"exited,omitempty"` - ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"` - Started int64 `protobuf:"varint,4,opt,name=started" json:"started,omitempty"` - Finished int64 `protobuf:"varint,5,opt,name=finished" json:"finished,omitempty"` - Error string `protobuf:"bytes,6,opt,name=error" json:"error,omitempty"` -} - -func (m *State) Reset() { *m = State{} } -func (m *State) String() string { return proto1.CompactTextString(m) } -func (*State) ProtoMessage() {} -func (*State) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *State) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *State) GetExited() bool { - if m != nil { - return m.Exited - } - return false -} - -func (m *State) GetExitCode() int32 { - if m != nil { - return m.ExitCode - } - return 0 -} - -func (m *State) GetStarted() int64 { - if m != nil { - return m.Started - } - return 0 -} - -func (m *State) GetFinished() int64 { - if m != nil { - return m.Finished - } - return 0 -} - -func (m *State) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type Line struct { - Proc string `protobuf:"bytes,1,opt,name=proc" json:"proc,omitempty"` - Time int64 `protobuf:"varint,2,opt,name=time" json:"time,omitempty"` - Pos int32 `protobuf:"varint,3,opt,name=pos" json:"pos,omitempty"` - Out string `protobuf:"bytes,4,opt,name=out" json:"out,omitempty"` -} - -func (m *Line) Reset() { *m = Line{} } -func (m *Line) String() string { return proto1.CompactTextString(m) } -func (*Line) ProtoMessage() {} -func (*Line) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *Line) GetProc() string { - if m != nil { - return m.Proc - } - return "" -} - -func (m *Line) GetTime() int64 { - if m != nil { - return m.Time - } - return 0 -} - -func (m *Line) GetPos() int32 { - if m != nil { - return m.Pos - } - return 0 -} - -func (m *Line) GetOut() string { - if m != nil { - return m.Out - } - return "" -} - -type Filter struct { - Labels map[string]string `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Expr string `protobuf:"bytes,2,opt,name=expr" json:"expr,omitempty"` -} - -func (m *Filter) Reset() { *m = Filter{} } -func (m *Filter) String() string { return proto1.CompactTextString(m) } -func (*Filter) ProtoMessage() {} -func (*Filter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *Filter) GetLabels() map[string]string { - if m != nil { - return m.Labels - } - return nil -} - -func (m *Filter) GetExpr() string { - if m != nil { - return m.Expr - } - return "" -} - -type Pipeline struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Timeout int64 `protobuf:"varint,2,opt,name=timeout" json:"timeout,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *Pipeline) Reset() { *m = Pipeline{} } -func (m *Pipeline) String() string { return proto1.CompactTextString(m) } -func (*Pipeline) ProtoMessage() {} -func (*Pipeline) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *Pipeline) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Pipeline) GetTimeout() int64 { - if m != nil { - return m.Timeout - } - return 0 -} - -func (m *Pipeline) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` -} - -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto1.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *HealthCheckRequest) GetService() string { - if m != nil { - return m.Service - } - return "" -} - -type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"` -} - -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto1.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if m != nil { - return m.Status - } - return HealthCheckResponse_UNKNOWN -} - -type NextRequest struct { - Filter *Filter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` -} - -func (m *NextRequest) Reset() { *m = NextRequest{} } -func (m *NextRequest) String() string { return proto1.CompactTextString(m) } -func (*NextRequest) ProtoMessage() {} -func (*NextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -func (m *NextRequest) GetFilter() *Filter { - if m != nil { - return m.Filter - } - return nil -} - -type NextReply struct { - Pipeline *Pipeline `protobuf:"bytes,1,opt,name=pipeline" json:"pipeline,omitempty"` -} - -func (m *NextReply) Reset() { *m = NextReply{} } -func (m *NextReply) String() string { return proto1.CompactTextString(m) } -func (*NextReply) ProtoMessage() {} -func (*NextReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *NextReply) GetPipeline() *Pipeline { - if m != nil { - return m.Pipeline - } - return nil -} - -type InitRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` -} - -func (m *InitRequest) Reset() { *m = InitRequest{} } -func (m *InitRequest) String() string { return proto1.CompactTextString(m) } -func (*InitRequest) ProtoMessage() {} -func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } - -func (m *InitRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *InitRequest) GetState() *State { - if m != nil { - return m.State - } - return nil -} - -type WaitRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` -} - -func (m *WaitRequest) Reset() { *m = WaitRequest{} } -func (m *WaitRequest) String() string { return proto1.CompactTextString(m) } -func (*WaitRequest) ProtoMessage() {} -func (*WaitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } - -func (m *WaitRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -type DoneRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` -} - -func (m *DoneRequest) Reset() { *m = DoneRequest{} } -func (m *DoneRequest) String() string { return proto1.CompactTextString(m) } -func (*DoneRequest) ProtoMessage() {} -func (*DoneRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } - -func (m *DoneRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *DoneRequest) GetState() *State { - if m != nil { - return m.State - } - return nil -} - -type ExtendRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` -} - -func (m *ExtendRequest) Reset() { *m = ExtendRequest{} } -func (m *ExtendRequest) String() string { return proto1.CompactTextString(m) } -func (*ExtendRequest) ProtoMessage() {} -func (*ExtendRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } - -func (m *ExtendRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -type UploadRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - File *File `protobuf:"bytes,2,opt,name=file" json:"file,omitempty"` -} - -func (m *UploadRequest) Reset() { *m = UploadRequest{} } -func (m *UploadRequest) String() string { return proto1.CompactTextString(m) } -func (*UploadRequest) ProtoMessage() {} -func (*UploadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } - -func (m *UploadRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *UploadRequest) GetFile() *File { - if m != nil { - return m.File - } - return nil -} - -type UpdateRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` -} - -func (m *UpdateRequest) Reset() { *m = UpdateRequest{} } -func (m *UpdateRequest) String() string { return proto1.CompactTextString(m) } -func (*UpdateRequest) ProtoMessage() {} -func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } - -func (m *UpdateRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *UpdateRequest) GetState() *State { - if m != nil { - return m.State - } - return nil -} - -type LogRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Line *Line `protobuf:"bytes,2,opt,name=line" json:"line,omitempty"` -} - -func (m *LogRequest) Reset() { *m = LogRequest{} } -func (m *LogRequest) String() string { return proto1.CompactTextString(m) } -func (*LogRequest) ProtoMessage() {} -func (*LogRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } - -func (m *LogRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *LogRequest) GetLine() *Line { - if m != nil { - return m.Line - } - return nil -} - -type Empty struct { -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto1.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } - -func init() { - proto1.RegisterType((*File)(nil), "proto.File") - proto1.RegisterType((*State)(nil), "proto.State") - proto1.RegisterType((*Line)(nil), "proto.Line") - proto1.RegisterType((*Filter)(nil), "proto.Filter") - proto1.RegisterType((*Pipeline)(nil), "proto.Pipeline") - proto1.RegisterType((*HealthCheckRequest)(nil), "proto.HealthCheckRequest") - proto1.RegisterType((*HealthCheckResponse)(nil), "proto.HealthCheckResponse") - proto1.RegisterType((*NextRequest)(nil), "proto.NextRequest") - proto1.RegisterType((*NextReply)(nil), "proto.NextReply") - proto1.RegisterType((*InitRequest)(nil), "proto.InitRequest") - proto1.RegisterType((*WaitRequest)(nil), "proto.WaitRequest") - proto1.RegisterType((*DoneRequest)(nil), "proto.DoneRequest") - proto1.RegisterType((*ExtendRequest)(nil), "proto.ExtendRequest") - proto1.RegisterType((*UploadRequest)(nil), "proto.UploadRequest") - proto1.RegisterType((*UpdateRequest)(nil), "proto.UpdateRequest") - proto1.RegisterType((*LogRequest)(nil), "proto.LogRequest") - proto1.RegisterType((*Empty)(nil), "proto.Empty") - proto1.RegisterEnum("proto.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Drone service - -type DroneClient interface { - Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error) - Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) - Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error) - Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) - Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) - Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) - Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) - Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) -} - -type droneClient struct { - cc *grpc.ClientConn -} - -func NewDroneClient(cc *grpc.ClientConn) DroneClient { - return &droneClient{cc} -} - -func (c *droneClient) Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error) { - out := new(NextReply) - err := grpc.Invoke(ctx, "/proto.Drone/Next", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Init", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Wait", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Done", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Extend", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Update", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Upload", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *droneClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/proto.Drone/Log", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Drone service - -type DroneServer interface { - Next(context.Context, *NextRequest) (*NextReply, error) - Init(context.Context, *InitRequest) (*Empty, error) - Wait(context.Context, *WaitRequest) (*Empty, error) - Done(context.Context, *DoneRequest) (*Empty, error) - Extend(context.Context, *ExtendRequest) (*Empty, error) - Update(context.Context, *UpdateRequest) (*Empty, error) - Upload(context.Context, *UploadRequest) (*Empty, error) - Log(context.Context, *LogRequest) (*Empty, error) -} - -func RegisterDroneServer(s *grpc.Server, srv DroneServer) { - s.RegisterService(&_Drone_serviceDesc, srv) -} - -func _Drone_Next_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NextRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Next(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Next", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Next(ctx, req.(*NextRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Init(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Init", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Init(ctx, req.(*InitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Wait(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Wait", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Wait(ctx, req.(*WaitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Done_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DoneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Done(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Done", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Done(ctx, req.(*DoneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Extend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExtendRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Extend(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Extend", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Extend(ctx, req.(*ExtendRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Update(ctx, req.(*UpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Upload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Upload", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Upload(ctx, req.(*UploadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drone_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LogRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DroneServer).Log(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Drone/Log", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DroneServer).Log(ctx, req.(*LogRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Drone_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Drone", - HandlerType: (*DroneServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Next", - Handler: _Drone_Next_Handler, - }, - { - MethodName: "Init", - Handler: _Drone_Init_Handler, - }, - { - MethodName: "Wait", - Handler: _Drone_Wait_Handler, - }, - { - MethodName: "Done", - Handler: _Drone_Done_Handler, - }, - { - MethodName: "Extend", - Handler: _Drone_Extend_Handler, - }, - { - MethodName: "Update", - Handler: _Drone_Update_Handler, - }, - { - MethodName: "Upload", - Handler: _Drone_Upload_Handler, - }, - { - MethodName: "Log", - Handler: _Drone_Log_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "drone.proto", -} - -// Client API for Health service - -type HealthClient interface { - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) -} - -type healthClient struct { - cc *grpc.ClientConn -} - -func NewHealthClient(cc *grpc.ClientConn) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := grpc.Invoke(ctx, "/proto.Health/Check", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Health service - -type HealthServer interface { - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) -} - -func RegisterHealthServer(s *grpc.Server, srv HealthServer) { - s.RegisterService(&_Health_serviceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Health/Check", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Health_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "drone.proto", -} - -func init() { proto1.RegisterFile("drone.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x4f, 0xd3, 0x50, - 0x14, 0xa7, 0x5b, 0xdb, 0x6d, 0xa7, 0x0c, 0xe6, 0x15, 0x4d, 0x99, 0x31, 0x2c, 0x4d, 0x4c, 0xa6, - 0x26, 0x4d, 0x9c, 0x26, 0x22, 0x89, 0x06, 0x03, 0x43, 0x88, 0x73, 0x98, 0x3b, 0x91, 0x47, 0x52, - 0xd6, 0x0b, 0x34, 0x74, 0x6d, 0x6d, 0xef, 0xc8, 0xe6, 0x47, 0xf0, 0xd5, 0x57, 0x3f, 0x9d, 0xdf, - 0xc1, 0x77, 0x73, 0xee, 0x6d, 0x4b, 0x07, 0x9b, 0x89, 0xe1, 0xa9, 0xe7, 0xcf, 0xef, 0xdc, 0x73, - 0xce, 0xef, 0xd7, 0x7b, 0xc1, 0x70, 0xe3, 0x30, 0x60, 0x76, 0x14, 0x87, 0x3c, 0x24, 0x9a, 0xf8, - 0x58, 0xbf, 0x15, 0x50, 0xf7, 0x3c, 0x9f, 0x11, 0x02, 0x6a, 0xe0, 0x8c, 0x98, 0xa9, 0xb4, 0x94, - 0x76, 0x8d, 0x0a, 0x1b, 0x63, 0x51, 0x1c, 0x0e, 0xcd, 0x92, 0x8c, 0xa1, 0x8d, 0xb1, 0x91, 0x37, - 0x62, 0x66, 0x59, 0xc6, 0xd0, 0xc6, 0x18, 0xc7, 0x98, 0xda, 0x52, 0xda, 0x65, 0x2a, 0x6c, 0x8c, - 0x25, 0xde, 0x77, 0x66, 0x6a, 0x2d, 0xa5, 0xad, 0x51, 0x61, 0x63, 0xcc, 0x75, 0xb8, 0x63, 0xea, - 0x2d, 0xa5, 0xbd, 0x4c, 0x85, 0x4d, 0x9e, 0x82, 0x3a, 0x62, 0xdc, 0x31, 0x2b, 0xad, 0x72, 0xdb, - 0xe8, 0x3c, 0x90, 0xd3, 0xd9, 0x38, 0x92, 0xfd, 0x89, 0x71, 0xa7, 0x1b, 0xf0, 0x78, 0x4a, 0x05, - 0xa4, 0xf9, 0x1a, 0x6a, 0x79, 0x88, 0x34, 0xa0, 0x7c, 0xc9, 0xa6, 0xe9, 0xb8, 0x68, 0x92, 0x35, - 0xd0, 0xae, 0x1c, 0x7f, 0xcc, 0xd2, 0x71, 0xa5, 0xb3, 0x55, 0xda, 0x54, 0xac, 0x5f, 0x0a, 0x68, - 0x03, 0xee, 0xf0, 0xf9, 0x5b, 0x3e, 0x04, 0x9d, 0x4d, 0x3c, 0xce, 0x5c, 0x51, 0x58, 0xa5, 0xa9, - 0x47, 0x1e, 0x41, 0x0d, 0xad, 0x93, 0x61, 0xe8, 0xca, 0x75, 0x35, 0x5a, 0xc5, 0xc0, 0x4e, 0xe8, - 0x32, 0x62, 0x42, 0x25, 0xe1, 0x4e, 0x8c, 0x55, 0x72, 0xeb, 0xcc, 0x25, 0x4d, 0xa8, 0x9e, 0x79, - 0x81, 0x97, 0x5c, 0x30, 0x57, 0x2c, 0x5f, 0xa6, 0xb9, 0x8f, 0x23, 0xb2, 0x38, 0x0e, 0x63, 0xc1, - 0x40, 0x8d, 0x4a, 0xc7, 0xa2, 0xa0, 0xf6, 0xbc, 0xe0, 0x9a, 0x6e, 0x65, 0x96, 0x6e, 0x41, 0x6d, - 0xa9, 0x40, 0x6d, 0x03, 0xca, 0x51, 0x98, 0xa4, 0x23, 0xa1, 0x89, 0x91, 0x70, 0xcc, 0xc5, 0x24, - 0x35, 0x8a, 0xa6, 0xf5, 0x43, 0x01, 0x7d, 0xcf, 0xf3, 0x39, 0x8b, 0xc9, 0x0b, 0xd0, 0x7d, 0xe7, - 0x94, 0xf9, 0x89, 0xa9, 0x08, 0x8e, 0xd7, 0xaf, 0x39, 0xe6, 0x2c, 0xb6, 0x7b, 0x22, 0x27, 0x79, - 0x4e, 0x81, 0xd8, 0x95, 0x4d, 0xa2, 0x38, 0x13, 0x1e, 0xed, 0xe6, 0x1b, 0x30, 0x0a, 0xd0, 0xff, - 0xe2, 0xbf, 0x0f, 0xd5, 0xcf, 0x5e, 0xc4, 0x7c, 0x5c, 0x72, 0x05, 0x4a, 0x9e, 0x9b, 0x96, 0x95, - 0x3c, 0x17, 0x89, 0xc4, 0xa5, 0x70, 0x7c, 0xb9, 0x63, 0xe6, 0x62, 0x26, 0x72, 0xa6, 0x7e, 0xe8, - 0xb8, 0x62, 0xd5, 0x65, 0x9a, 0xb9, 0x96, 0x0d, 0x64, 0x9f, 0x39, 0x3e, 0xbf, 0xd8, 0xb9, 0x60, - 0xc3, 0x4b, 0xca, 0xbe, 0x8d, 0x59, 0x22, 0xf0, 0x09, 0x8b, 0xaf, 0xbc, 0x61, 0x26, 0x6f, 0xe6, - 0x5a, 0x3f, 0x15, 0xb8, 0x3f, 0x53, 0x90, 0x44, 0x61, 0x90, 0x30, 0xb2, 0x0d, 0x7a, 0xc2, 0x1d, - 0x3e, 0x4e, 0x44, 0xc1, 0x4a, 0xa7, 0x9d, 0x32, 0x33, 0x07, 0x6b, 0x0f, 0xf0, 0xac, 0xe0, 0x7c, - 0x20, 0xf0, 0x34, 0xad, 0xb3, 0xb6, 0xa0, 0x3e, 0x93, 0x20, 0x06, 0x54, 0x8e, 0xfa, 0x1f, 0xfb, - 0x87, 0xc7, 0xfd, 0xc6, 0x12, 0x3a, 0x83, 0x2e, 0xfd, 0x7a, 0xd0, 0xff, 0xd0, 0x50, 0xc8, 0x2a, - 0x18, 0xfd, 0xc3, 0x2f, 0x27, 0x59, 0xa0, 0x64, 0xbd, 0x02, 0xa3, 0xcf, 0x26, 0x3c, 0x1b, 0xff, - 0x09, 0xe8, 0x67, 0x42, 0x11, 0x31, 0x8c, 0xd1, 0xa9, 0xcf, 0xc8, 0x44, 0xd3, 0xa4, 0xb5, 0x09, - 0x35, 0x59, 0x15, 0xf9, 0x53, 0xf2, 0x1c, 0xaa, 0x51, 0x4a, 0x6c, 0x5a, 0xb5, 0x9a, 0x56, 0x65, - 0x7c, 0xd3, 0x1c, 0x60, 0xbd, 0x07, 0xe3, 0x20, 0xf0, 0xf2, 0x7e, 0x37, 0x85, 0xb0, 0x40, 0xc3, - 0xa5, 0xa4, 0x7c, 0x46, 0x67, 0x39, 0x3d, 0x48, 0xdc, 0x1b, 0x2a, 0x53, 0xd6, 0x63, 0x30, 0x8e, - 0x9d, 0x85, 0x47, 0x60, 0x87, 0xdd, 0x30, 0x60, 0x77, 0xe9, 0xb0, 0x01, 0xf5, 0xee, 0x84, 0xb3, - 0xc0, 0x5d, 0xd4, 0x63, 0x1b, 0xea, 0x47, 0x11, 0xfe, 0x05, 0x8b, 0xba, 0x6c, 0x80, 0x7a, 0xe6, - 0xf9, 0x59, 0x13, 0xa3, 0xf0, 0xa0, 0x50, 0x91, 0xb0, 0x76, 0xf0, 0x04, 0x17, 0x7b, 0xde, 0x61, - 0xce, 0xb7, 0x00, 0xbd, 0xf0, 0xfc, 0x1f, 0x33, 0x08, 0x4d, 0x66, 0x67, 0xc0, 0x4b, 0x4e, 0x45, - 0xc2, 0xaa, 0x80, 0xd6, 0x1d, 0x45, 0x7c, 0xda, 0xf9, 0x53, 0x02, 0x6d, 0x17, 0x9f, 0x65, 0x62, - 0x83, 0x8a, 0xc2, 0x12, 0x92, 0xa2, 0x0b, 0xff, 0x46, 0xb3, 0x31, 0x13, 0x8b, 0xfc, 0xa9, 0xb5, - 0x44, 0x9e, 0x81, 0x8a, 0x72, 0xe6, 0xf8, 0x82, 0xb6, 0xcd, 0x6c, 0x64, 0xd1, 0x43, 0x62, 0x51, - 0xb7, 0x1c, 0x5b, 0x10, 0x71, 0x1e, 0x16, 0x45, 0xcc, 0xb1, 0x05, 0x45, 0x6f, 0x61, 0x6d, 0xd0, - 0xa5, 0x5a, 0x64, 0x2d, 0xcb, 0x14, 0xc5, 0x9b, 0x87, 0x97, 0xd4, 0xe7, 0xf8, 0x19, 0x25, 0xe6, - 0xe3, 0x51, 0xec, 0x02, 0xbe, 0xa0, 0xfd, 0x2d, 0x7c, 0x1b, 0xca, 0xbd, 0xf0, 0x9c, 0xdc, 0xcb, - 0x08, 0xcf, 0x15, 0xba, 0x89, 0xec, 0xec, 0x83, 0x2e, 0x6f, 0x39, 0x79, 0x07, 0x9a, 0xb8, 0xe9, - 0x64, 0x7d, 0xde, 0xed, 0x97, 0xd5, 0xcd, 0xc5, 0x0f, 0xc3, 0xa9, 0x2e, 0x52, 0x2f, 0xff, 0x06, - 0x00, 0x00, 0xff, 0xff, 0x59, 0x78, 0xda, 0x5d, 0x5e, 0x07, 0x00, 0x00, -} diff --git a/pipeline/rpc/proto/generate.go b/pipeline/rpc/proto/generate.go new file mode 100644 index 000000000..5e4fe3c86 --- /dev/null +++ b/pipeline/rpc/proto/generate.go @@ -0,0 +1,22 @@ +// Copyright 2021 Woodpecker Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package proto + +//go:generate protoc --go_out=paths=source_relative:. woodpecker.proto +//go:generate protoc --go-grpc_out=paths=source_relative:. woodpecker.proto + +// get needed binary's: +// go install google.golang.org/protobuf/cmd/protoc-gen-go +// go install google.golang.org/grpc/cmd/protoc-gen-go-grpc diff --git a/pipeline/rpc/proto/woodpecker.pb.go b/pipeline/rpc/proto/woodpecker.pb.go new file mode 100644 index 000000000..391b13ef8 --- /dev/null +++ b/pipeline/rpc/proto/woodpecker.pb.go @@ -0,0 +1,1468 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: woodpecker.proto + +package proto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type HealthCheckResponse_ServingStatus int32 + +const ( + HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 + HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 + HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 +) + +// Enum value maps for HealthCheckResponse_ServingStatus. +var ( + HealthCheckResponse_ServingStatus_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SERVING", + 2: "NOT_SERVING", + } + HealthCheckResponse_ServingStatus_value = map[string]int32{ + "UNKNOWN": 0, + "SERVING": 1, + "NOT_SERVING": 2, + } +) + +func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus { + p := new(HealthCheckResponse_ServingStatus) + *p = x + return p +} + +func (x HealthCheckResponse_ServingStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { + return file_woodpecker_proto_enumTypes[0].Descriptor() +} + +func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { + return &file_woodpecker_proto_enumTypes[0] +} + +func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead. +func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{6, 0} +} + +type File struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Proc string `protobuf:"bytes,2,opt,name=proc,proto3" json:"proc,omitempty"` + Mime string `protobuf:"bytes,3,opt,name=mime,proto3" json:"mime,omitempty"` + Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` + Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` + Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + Meta map[string]string `protobuf:"bytes,7,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *File) Reset() { + *x = File{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *File) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*File) ProtoMessage() {} + +func (x *File) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use File.ProtoReflect.Descriptor instead. +func (*File) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{0} +} + +func (x *File) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *File) GetProc() string { + if x != nil { + return x.Proc + } + return "" +} + +func (x *File) GetMime() string { + if x != nil { + return x.Mime + } + return "" +} + +func (x *File) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *File) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *File) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *File) GetMeta() map[string]string { + if x != nil { + return x.Meta + } + return nil +} + +type State struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Exited bool `protobuf:"varint,2,opt,name=exited,proto3" json:"exited,omitempty"` + ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` + Started int64 `protobuf:"varint,4,opt,name=started,proto3" json:"started,omitempty"` + Finished int64 `protobuf:"varint,5,opt,name=finished,proto3" json:"finished,omitempty"` + Error string `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *State) Reset() { + *x = State{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *State) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*State) ProtoMessage() {} + +func (x *State) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use State.ProtoReflect.Descriptor instead. +func (*State) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{1} +} + +func (x *State) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *State) GetExited() bool { + if x != nil { + return x.Exited + } + return false +} + +func (x *State) GetExitCode() int32 { + if x != nil { + return x.ExitCode + } + return 0 +} + +func (x *State) GetStarted() int64 { + if x != nil { + return x.Started + } + return 0 +} + +func (x *State) GetFinished() int64 { + if x != nil { + return x.Finished + } + return 0 +} + +func (x *State) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type Line struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proc string `protobuf:"bytes,1,opt,name=proc,proto3" json:"proc,omitempty"` + Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` + Pos int32 `protobuf:"varint,3,opt,name=pos,proto3" json:"pos,omitempty"` + Out string `protobuf:"bytes,4,opt,name=out,proto3" json:"out,omitempty"` +} + +func (x *Line) Reset() { + *x = Line{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Line) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Line) ProtoMessage() {} + +func (x *Line) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Line.ProtoReflect.Descriptor instead. +func (*Line) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{2} +} + +func (x *Line) GetProc() string { + if x != nil { + return x.Proc + } + return "" +} + +func (x *Line) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *Line) GetPos() int32 { + if x != nil { + return x.Pos + } + return 0 +} + +func (x *Line) GetOut() string { + if x != nil { + return x.Out + } + return "" +} + +type Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Expr string `protobuf:"bytes,2,opt,name=expr,proto3" json:"expr,omitempty"` +} + +func (x *Filter) Reset() { + *x = Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filter) ProtoMessage() {} + +func (x *Filter) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Filter.ProtoReflect.Descriptor instead. +func (*Filter) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{3} +} + +func (x *Filter) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Filter) GetExpr() string { + if x != nil { + return x.Expr + } + return "" +} + +type Pipeline struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Timeout int64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Pipeline) Reset() { + *x = Pipeline{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pipeline) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pipeline) ProtoMessage() {} + +func (x *Pipeline) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pipeline.ProtoReflect.Descriptor instead. +func (*Pipeline) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{4} +} + +func (x *Pipeline) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Pipeline) GetTimeout() int64 { + if x != nil { + return x.Timeout + } + return 0 +} + +func (x *Pipeline) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +type HealthCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` +} + +func (x *HealthCheckRequest) Reset() { + *x = HealthCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckRequest) ProtoMessage() {} + +func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{5} +} + +func (x *HealthCheckRequest) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +type HealthCheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"` +} + +func (x *HealthCheckResponse) Reset() { + *x = HealthCheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckResponse) ProtoMessage() {} + +func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{6} +} + +func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { + if x != nil { + return x.Status + } + return HealthCheckResponse_UNKNOWN +} + +type NextRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *NextRequest) Reset() { + *x = NextRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NextRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NextRequest) ProtoMessage() {} + +func (x *NextRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NextRequest.ProtoReflect.Descriptor instead. +func (*NextRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{7} +} + +func (x *NextRequest) GetFilter() *Filter { + if x != nil { + return x.Filter + } + return nil +} + +type NextReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pipeline *Pipeline `protobuf:"bytes,1,opt,name=pipeline,proto3" json:"pipeline,omitempty"` +} + +func (x *NextReply) Reset() { + *x = NextReply{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NextReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NextReply) ProtoMessage() {} + +func (x *NextReply) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NextReply.ProtoReflect.Descriptor instead. +func (*NextReply) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{8} +} + +func (x *NextReply) GetPipeline() *Pipeline { + if x != nil { + return x.Pipeline + } + return nil +} + +type InitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State *State `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *InitRequest) Reset() { + *x = InitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitRequest) ProtoMessage() {} + +func (x *InitRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitRequest.ProtoReflect.Descriptor instead. +func (*InitRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{9} +} + +func (x *InitRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *InitRequest) GetState() *State { + if x != nil { + return x.State + } + return nil +} + +type WaitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *WaitRequest) Reset() { + *x = WaitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WaitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WaitRequest) ProtoMessage() {} + +func (x *WaitRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WaitRequest.ProtoReflect.Descriptor instead. +func (*WaitRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{10} +} + +func (x *WaitRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DoneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State *State `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *DoneRequest) Reset() { + *x = DoneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoneRequest) ProtoMessage() {} + +func (x *DoneRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoneRequest.ProtoReflect.Descriptor instead. +func (*DoneRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{11} +} + +func (x *DoneRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DoneRequest) GetState() *State { + if x != nil { + return x.State + } + return nil +} + +type ExtendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ExtendRequest) Reset() { + *x = ExtendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtendRequest) ProtoMessage() {} + +func (x *ExtendRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtendRequest.ProtoReflect.Descriptor instead. +func (*ExtendRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{12} +} + +func (x *ExtendRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type UploadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + File *File `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` +} + +func (x *UploadRequest) Reset() { + *x = UploadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadRequest) ProtoMessage() {} + +func (x *UploadRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. +func (*UploadRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{13} +} + +func (x *UploadRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UploadRequest) GetFile() *File { + if x != nil { + return x.File + } + return nil +} + +type UpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State *State `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *UpdateRequest) Reset() { + *x = UpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRequest) ProtoMessage() {} + +func (x *UpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. +func (*UpdateRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{14} +} + +func (x *UpdateRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateRequest) GetState() *State { + if x != nil { + return x.State + } + return nil +} + +type LogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Line *Line `protobuf:"bytes,2,opt,name=line,proto3" json:"line,omitempty"` +} + +func (x *LogRequest) Reset() { + *x = LogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRequest) ProtoMessage() {} + +func (x *LogRequest) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogRequest.ProtoReflect.Descriptor instead. +func (*LogRequest) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{15} +} + +func (x *LogRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *LogRequest) GetLine() *Line { + if x != nil { + return x.Line + } + return nil +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_woodpecker_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_woodpecker_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_woodpecker_proto_rawDescGZIP(), []int{16} +} + +var File_woodpecker_proto protoreflect.FileDescriptor + +var file_woodpecker_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x77, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x04, 0x46, 0x69, + 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x69, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9c, + 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, + 0x69, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x52, 0x0a, + 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, + 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, + 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, + 0x78, 0x70, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4e, + 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x2e, + 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x93, + 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, + 0x4e, 0x47, 0x10, 0x02, 0x22, 0x34, 0x0a, 0x0b, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x38, 0x0a, 0x09, 0x4e, 0x65, + 0x78, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, + 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x70, 0x69, 0x70, 0x65, + 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x41, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x1d, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x0b, 0x44, 0x6f, 0x6e, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x40, 0x0a, 0x0d, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x66, + 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x43, 0x0a, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x22, 0x3d, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, + 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0xfa, 0x02, 0x0a, 0x0a, 0x57, 0x6f, + 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x4e, 0x65, 0x78, 0x74, + 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x65, 0x78, + 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, + 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x12, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, + 0x12, 0x2a, 0x0a, 0x04, 0x44, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x06, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x06, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x06, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x03, + 0x4c, 0x6f, 0x67, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x32, 0x48, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x12, 0x3e, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, + 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2d, 0x63, 0x69, 0x2f, 0x77, 0x6f, 0x6f, + 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_woodpecker_proto_rawDescOnce sync.Once + file_woodpecker_proto_rawDescData = file_woodpecker_proto_rawDesc +) + +func file_woodpecker_proto_rawDescGZIP() []byte { + file_woodpecker_proto_rawDescOnce.Do(func() { + file_woodpecker_proto_rawDescData = protoimpl.X.CompressGZIP(file_woodpecker_proto_rawDescData) + }) + return file_woodpecker_proto_rawDescData +} + +var file_woodpecker_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_woodpecker_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_woodpecker_proto_goTypes = []interface{}{ + (HealthCheckResponse_ServingStatus)(0), // 0: proto.HealthCheckResponse.ServingStatus + (*File)(nil), // 1: proto.File + (*State)(nil), // 2: proto.State + (*Line)(nil), // 3: proto.Line + (*Filter)(nil), // 4: proto.Filter + (*Pipeline)(nil), // 5: proto.Pipeline + (*HealthCheckRequest)(nil), // 6: proto.HealthCheckRequest + (*HealthCheckResponse)(nil), // 7: proto.HealthCheckResponse + (*NextRequest)(nil), // 8: proto.NextRequest + (*NextReply)(nil), // 9: proto.NextReply + (*InitRequest)(nil), // 10: proto.InitRequest + (*WaitRequest)(nil), // 11: proto.WaitRequest + (*DoneRequest)(nil), // 12: proto.DoneRequest + (*ExtendRequest)(nil), // 13: proto.ExtendRequest + (*UploadRequest)(nil), // 14: proto.UploadRequest + (*UpdateRequest)(nil), // 15: proto.UpdateRequest + (*LogRequest)(nil), // 16: proto.LogRequest + (*Empty)(nil), // 17: proto.Empty + nil, // 18: proto.File.MetaEntry + nil, // 19: proto.Filter.LabelsEntry +} +var file_woodpecker_proto_depIdxs = []int32{ + 18, // 0: proto.File.meta:type_name -> proto.File.MetaEntry + 19, // 1: proto.Filter.labels:type_name -> proto.Filter.LabelsEntry + 0, // 2: proto.HealthCheckResponse.status:type_name -> proto.HealthCheckResponse.ServingStatus + 4, // 3: proto.NextRequest.filter:type_name -> proto.Filter + 5, // 4: proto.NextReply.pipeline:type_name -> proto.Pipeline + 2, // 5: proto.InitRequest.state:type_name -> proto.State + 2, // 6: proto.DoneRequest.state:type_name -> proto.State + 1, // 7: proto.UploadRequest.file:type_name -> proto.File + 2, // 8: proto.UpdateRequest.state:type_name -> proto.State + 3, // 9: proto.LogRequest.line:type_name -> proto.Line + 8, // 10: proto.Woodpecker.Next:input_type -> proto.NextRequest + 10, // 11: proto.Woodpecker.Init:input_type -> proto.InitRequest + 11, // 12: proto.Woodpecker.Wait:input_type -> proto.WaitRequest + 12, // 13: proto.Woodpecker.Done:input_type -> proto.DoneRequest + 13, // 14: proto.Woodpecker.Extend:input_type -> proto.ExtendRequest + 15, // 15: proto.Woodpecker.Update:input_type -> proto.UpdateRequest + 14, // 16: proto.Woodpecker.Upload:input_type -> proto.UploadRequest + 16, // 17: proto.Woodpecker.Log:input_type -> proto.LogRequest + 6, // 18: proto.Health.Check:input_type -> proto.HealthCheckRequest + 9, // 19: proto.Woodpecker.Next:output_type -> proto.NextReply + 17, // 20: proto.Woodpecker.Init:output_type -> proto.Empty + 17, // 21: proto.Woodpecker.Wait:output_type -> proto.Empty + 17, // 22: proto.Woodpecker.Done:output_type -> proto.Empty + 17, // 23: proto.Woodpecker.Extend:output_type -> proto.Empty + 17, // 24: proto.Woodpecker.Update:output_type -> proto.Empty + 17, // 25: proto.Woodpecker.Upload:output_type -> proto.Empty + 17, // 26: proto.Woodpecker.Log:output_type -> proto.Empty + 7, // 27: proto.Health.Check:output_type -> proto.HealthCheckResponse + 19, // [19:28] is the sub-list for method output_type + 10, // [10:19] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_woodpecker_proto_init() } +func file_woodpecker_proto_init() { + if File_woodpecker_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_woodpecker_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*File); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*State); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Line); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pipeline); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NextRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NextReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WaitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtendRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_woodpecker_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_woodpecker_proto_rawDesc, + NumEnums: 1, + NumMessages: 19, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_woodpecker_proto_goTypes, + DependencyIndexes: file_woodpecker_proto_depIdxs, + EnumInfos: file_woodpecker_proto_enumTypes, + MessageInfos: file_woodpecker_proto_msgTypes, + }.Build() + File_woodpecker_proto = out.File + file_woodpecker_proto_rawDesc = nil + file_woodpecker_proto_goTypes = nil + file_woodpecker_proto_depIdxs = nil +} diff --git a/pipeline/rpc/proto/drone.proto b/pipeline/rpc/proto/woodpecker.proto similarity index 90% rename from pipeline/rpc/proto/drone.proto rename to pipeline/rpc/proto/woodpecker.proto index 97345e291..cc6ce4b06 100644 --- a/pipeline/rpc/proto/drone.proto +++ b/pipeline/rpc/proto/woodpecker.proto @@ -1,5 +1,6 @@ syntax = "proto3"; +option go_package = "github.com/woodpecker-ci/woodpecker/pipeline/rpc/proto"; package proto; message File { @@ -52,7 +53,7 @@ message HealthCheckResponse { ServingStatus status = 1; } -service Drone { +service Woodpecker { rpc Next (NextRequest) returns (NextReply) {} rpc Init (InitRequest) returns (Empty) {} rpc Wait (WaitRequest) returns (Empty) {} @@ -80,7 +81,7 @@ message NextReply { } message InitRequest { - string id = 1; + string id = 1; State state = 2; } @@ -89,7 +90,7 @@ message WaitRequest { } message DoneRequest { - string id = 1; + string id = 1; State state = 2; } @@ -98,17 +99,17 @@ message ExtendRequest { } message UploadRequest { - string id = 1; + string id = 1; File file = 2; } message UpdateRequest { - string id = 1; + string id = 1; State state = 2; } message LogRequest { - string id = 1; + string id = 1; Line line = 2; } diff --git a/pipeline/rpc/proto/woodpecker_grpc.pb.go b/pipeline/rpc/proto/woodpecker_grpc.pb.go new file mode 100644 index 000000000..83c69d4d5 --- /dev/null +++ b/pipeline/rpc/proto/woodpecker_grpc.pb.go @@ -0,0 +1,439 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WoodpeckerClient is the client API for Woodpecker service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type WoodpeckerClient interface { + Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error) + Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) + Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error) + Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) + Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) + Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) + Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) + Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) +} + +type woodpeckerClient struct { + cc grpc.ClientConnInterface +} + +func NewWoodpeckerClient(cc grpc.ClientConnInterface) WoodpeckerClient { + return &woodpeckerClient{cc} +} + +func (c *woodpeckerClient) Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error) { + out := new(NextReply) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Next", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Init", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Wait", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Done", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Extend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Update", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Upload", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *woodpeckerClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/proto.Woodpecker/Log", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WoodpeckerServer is the server API for Woodpecker service. +// All implementations must embed UnimplementedWoodpeckerServer +// for forward compatibility +type WoodpeckerServer interface { + Next(context.Context, *NextRequest) (*NextReply, error) + Init(context.Context, *InitRequest) (*Empty, error) + Wait(context.Context, *WaitRequest) (*Empty, error) + Done(context.Context, *DoneRequest) (*Empty, error) + Extend(context.Context, *ExtendRequest) (*Empty, error) + Update(context.Context, *UpdateRequest) (*Empty, error) + Upload(context.Context, *UploadRequest) (*Empty, error) + Log(context.Context, *LogRequest) (*Empty, error) + mustEmbedUnimplementedWoodpeckerServer() +} + +// UnimplementedWoodpeckerServer must be embedded to have forward compatible implementations. +type UnimplementedWoodpeckerServer struct { +} + +func (UnimplementedWoodpeckerServer) Next(context.Context, *NextRequest) (*NextReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Next not implemented") +} +func (UnimplementedWoodpeckerServer) Init(context.Context, *InitRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Init not implemented") +} +func (UnimplementedWoodpeckerServer) Wait(context.Context, *WaitRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented") +} +func (UnimplementedWoodpeckerServer) Done(context.Context, *DoneRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Done not implemented") +} +func (UnimplementedWoodpeckerServer) Extend(context.Context, *ExtendRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Extend not implemented") +} +func (UnimplementedWoodpeckerServer) Update(context.Context, *UpdateRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedWoodpeckerServer) Upload(context.Context, *UploadRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") +} +func (UnimplementedWoodpeckerServer) Log(context.Context, *LogRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Log not implemented") +} +func (UnimplementedWoodpeckerServer) mustEmbedUnimplementedWoodpeckerServer() {} + +// UnsafeWoodpeckerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WoodpeckerServer will +// result in compilation errors. +type UnsafeWoodpeckerServer interface { + mustEmbedUnimplementedWoodpeckerServer() +} + +func RegisterWoodpeckerServer(s grpc.ServiceRegistrar, srv WoodpeckerServer) { + s.RegisterService(&Woodpecker_ServiceDesc, srv) +} + +func _Woodpecker_Next_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Next(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Next", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Next(ctx, req.(*NextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Init(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Init", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Init(ctx, req.(*InitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WaitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Wait(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Wait", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Wait(ctx, req.(*WaitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Done_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DoneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Done(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Done", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Done(ctx, req.(*DoneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Extend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExtendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Extend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Extend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Extend(ctx, req.(*ExtendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Update", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Update(ctx, req.(*UpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Upload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Upload", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Upload(ctx, req.(*UploadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Woodpecker_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WoodpeckerServer).Log(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Woodpecker/Log", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WoodpeckerServer).Log(ctx, req.(*LogRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Woodpecker_ServiceDesc is the grpc.ServiceDesc for Woodpecker service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Woodpecker_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Woodpecker", + HandlerType: (*WoodpeckerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Next", + Handler: _Woodpecker_Next_Handler, + }, + { + MethodName: "Init", + Handler: _Woodpecker_Init_Handler, + }, + { + MethodName: "Wait", + Handler: _Woodpecker_Wait_Handler, + }, + { + MethodName: "Done", + Handler: _Woodpecker_Done_Handler, + }, + { + MethodName: "Extend", + Handler: _Woodpecker_Extend_Handler, + }, + { + MethodName: "Update", + Handler: _Woodpecker_Update_Handler, + }, + { + MethodName: "Upload", + Handler: _Woodpecker_Upload_Handler, + }, + { + MethodName: "Log", + Handler: _Woodpecker_Log_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "woodpecker.proto", +} + +// HealthClient is the client API for Health service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type HealthClient interface { + Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) +} + +type healthClient struct { + cc grpc.ClientConnInterface +} + +func NewHealthClient(cc grpc.ClientConnInterface) HealthClient { + return &healthClient{cc} +} + +func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { + out := new(HealthCheckResponse) + err := c.cc.Invoke(ctx, "/proto.Health/Check", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HealthServer is the server API for Health service. +// All implementations must embed UnimplementedHealthServer +// for forward compatibility +type HealthServer interface { + Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) + mustEmbedUnimplementedHealthServer() +} + +// UnimplementedHealthServer must be embedded to have forward compatible implementations. +type UnimplementedHealthServer struct { +} + +func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} +func (UnimplementedHealthServer) mustEmbedUnimplementedHealthServer() {} + +// UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HealthServer will +// result in compilation errors. +type UnsafeHealthServer interface { + mustEmbedUnimplementedHealthServer() +} + +func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) { + s.RegisterService(&Health_ServiceDesc, srv) +} + +func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Health/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Health_ServiceDesc is the grpc.ServiceDesc for Health service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Health_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Health", + HandlerType: (*HealthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _Health_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "woodpecker.proto", +} diff --git a/server/grpc/rpc.go b/server/grpc/rpc.go index 7c126cb62..f817cd935 100644 --- a/server/grpc/rpc.go +++ b/server/grpc/rpc.go @@ -478,12 +478,13 @@ func createFilterFunc(filter rpc.Filter) (queue.Filter, error) { // // -// DroneServer is a grpc server implementation. -type DroneServer struct { +// WoodpeckerServer is a grpc server implementation. +type WoodpeckerServer struct { + proto.UnimplementedWoodpeckerServer peer RPC } -func NewDroneServer(remote remote.Remote, queue queue.Queue, logger logging.Log, pubsub pubsub.Publisher, store store.Store, host string) *DroneServer { +func NewWoodpeckerServer(remote remote.Remote, queue queue.Queue, logger logging.Log, pubsub pubsub.Publisher, store store.Store, host string) *WoodpeckerServer { buildTime := promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "drone", Name: "build_time", @@ -504,10 +505,10 @@ func NewDroneServer(remote remote.Remote, queue queue.Queue, logger logging.Log, buildTime: buildTime, buildCount: buildCount, } - return &DroneServer{peer: peer} + return &WoodpeckerServer{peer: peer} } -func (s *DroneServer) Next(c oldcontext.Context, req *proto.NextRequest) (*proto.NextReply, error) { +func (s *WoodpeckerServer) Next(c oldcontext.Context, req *proto.NextRequest) (*proto.NextReply, error) { filter := rpc.Filter{ Labels: req.GetFilter().GetLabels(), Expr: req.GetFilter().GetExpr(), @@ -530,7 +531,7 @@ func (s *DroneServer) Next(c oldcontext.Context, req *proto.NextRequest) (*proto return res, err } -func (s *DroneServer) Init(c oldcontext.Context, req *proto.InitRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Init(c oldcontext.Context, req *proto.InitRequest) (*proto.Empty, error) { state := rpc.State{ Error: req.GetState().GetError(), ExitCode: int(req.GetState().GetExitCode()), @@ -544,7 +545,7 @@ func (s *DroneServer) Init(c oldcontext.Context, req *proto.InitRequest) (*proto return res, err } -func (s *DroneServer) Update(c oldcontext.Context, req *proto.UpdateRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Update(c oldcontext.Context, req *proto.UpdateRequest) (*proto.Empty, error) { state := rpc.State{ Error: req.GetState().GetError(), ExitCode: int(req.GetState().GetExitCode()), @@ -558,7 +559,7 @@ func (s *DroneServer) Update(c oldcontext.Context, req *proto.UpdateRequest) (*p return res, err } -func (s *DroneServer) Upload(c oldcontext.Context, req *proto.UploadRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Upload(c oldcontext.Context, req *proto.UploadRequest) (*proto.Empty, error) { file := &rpc.File{ Data: req.GetFile().GetData(), Mime: req.GetFile().GetMime(), @@ -574,7 +575,7 @@ func (s *DroneServer) Upload(c oldcontext.Context, req *proto.UploadRequest) (*p return res, err } -func (s *DroneServer) Done(c oldcontext.Context, req *proto.DoneRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Done(c oldcontext.Context, req *proto.DoneRequest) (*proto.Empty, error) { state := rpc.State{ Error: req.GetState().GetError(), ExitCode: int(req.GetState().GetExitCode()), @@ -588,19 +589,19 @@ func (s *DroneServer) Done(c oldcontext.Context, req *proto.DoneRequest) (*proto return res, err } -func (s *DroneServer) Wait(c oldcontext.Context, req *proto.WaitRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Wait(c oldcontext.Context, req *proto.WaitRequest) (*proto.Empty, error) { res := new(proto.Empty) err := s.peer.Wait(c, req.GetId()) return res, err } -func (s *DroneServer) Extend(c oldcontext.Context, req *proto.ExtendRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Extend(c oldcontext.Context, req *proto.ExtendRequest) (*proto.Empty, error) { res := new(proto.Empty) err := s.peer.Extend(c, req.GetId()) return res, err } -func (s *DroneServer) Log(c oldcontext.Context, req *proto.LogRequest) (*proto.Empty, error) { +func (s *WoodpeckerServer) Log(c oldcontext.Context, req *proto.LogRequest) (*proto.Empty, error) { line := &rpc.Line{ Out: req.GetLine().GetOut(), Pos: int(req.GetLine().GetPos()),