From 6efd6fbe083076ef438cac2ba2eb1d5ba52e60fc Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Mon, 16 Sep 2019 19:32:45 +0000 Subject: [PATCH] chore: move gRPC API to public In order for other projects to make use of our APIs, they must not reside underneath the internal directory. This moves the protobuf definitions to a top-level "api" directory and scopes them according to their domain. This change also removes generated code from the gitignore file so that users don't have to generate the code themseleves. Signed-off-by: Andrew Rynhard --- .dockerignore | 1 + .gitignore | 3 - Dockerfile | 21 +- api/machine/api.pb.go | 1943 +++++++++++++++++ .../machined/proto => api/machine}/api.proto | 0 api/network/api.pb.go | 617 ++++++ .../networkd/proto => api/network}/api.proto | 0 api/os/api.pb.go | 1136 ++++++++++ {internal/app/osd/proto => api/os}/api.proto | 20 +- api/security/api.pb.go | 475 ++++ .../trustd/proto => api/security}/api.proto | 0 api/time/api.pb.go | 262 +++ .../app/ntpd/proto => api/time}/api.proto | 0 cmd/osctl/cmd/df.go | 2 +- cmd/osctl/cmd/interfaces.go | 2 +- cmd/osctl/cmd/logs.go | 2 +- cmd/osctl/cmd/ls.go | 2 +- cmd/osctl/cmd/ps.go | 2 +- cmd/osctl/cmd/restart.go | 2 +- cmd/osctl/cmd/routes.go | 2 +- cmd/osctl/cmd/service.go | 2 +- cmd/osctl/cmd/stats.go | 2 +- cmd/osctl/cmd/time.go | 2 +- cmd/osctl/pkg/client/client.go | 8 +- go.sum | 1 + hack/golang/golangci-lint.yaml | 7 + internal/app/machined/internal/api/reg/reg.go | 2 +- .../internal/phase/upgrade/upgrade.go | 2 +- .../machined/internal/sequencer/sequencer.go | 2 +- .../internal/sequencer/v1alpha1/types.go | 2 +- internal/app/machined/main.go | 2 +- .../app/machined/pkg/system/events/events.go | 2 +- .../app/machined/pkg/system/health/status.go | 2 +- .../app/machined/pkg/system/service_runner.go | 2 +- .../machined/pkg/system/services/kubeadm.go | 2 +- .../pkg/system/services/kubeadm/kubeadm.go | 2 +- .../system/services/kubeadm/kubeadm_test.go | 2 +- internal/app/networkd/pkg/reg/reg.go | 2 +- internal/app/networkd/pkg/reg/reg_test.go | 2 +- internal/app/networkd/proto/api.pb.go | 617 ++++++ internal/app/ntpd/pkg/reg/reg.go | 2 +- internal/app/ntpd/pkg/reg/reg_test.go | 2 +- internal/app/ntpd/proto/api.pb.go | 262 +++ internal/app/osd/internal/reg/init_client.go | 2 +- .../app/osd/internal/reg/networkd_client.go | 2 +- internal/app/osd/internal/reg/ntp_client.go | 2 +- internal/app/osd/internal/reg/reg.go | 8 +- internal/app/proxyd/proto/api.pb.go | 226 ++ internal/app/trustd/internal/reg/reg.go | 2 +- internal/app/trustd/proto/api.pb.go | 475 ++++ pkg/grpc/gen/gen.go | 2 +- 51 files changed, 6076 insertions(+), 66 deletions(-) create mode 100644 api/machine/api.pb.go rename {internal/app/machined/proto => api/machine}/api.proto (100%) create mode 100644 api/network/api.pb.go rename {internal/app/networkd/proto => api/network}/api.proto (100%) create mode 100644 api/os/api.pb.go rename {internal/app/osd/proto => api/os}/api.proto (90%) create mode 100644 api/security/api.pb.go rename {internal/app/trustd/proto => api/security}/api.proto (100%) create mode 100644 api/time/api.pb.go rename {internal/app/ntpd/proto => api/time}/api.proto (100%) create mode 100644 internal/app/networkd/proto/api.pb.go create mode 100644 internal/app/ntpd/proto/api.pb.go create mode 100644 internal/app/proxyd/proto/api.pb.go create mode 100644 internal/app/trustd/proto/api.pb.go diff --git a/.dockerignore b/.dockerignore index 3ad2d37ea..2520f64c4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ ** +!api !cmd !docs !hack diff --git a/.gitignore b/.gitignore index 99410947c..56e35e4c5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,6 @@ kubeconfig [._]ss[a-gi-z] [._]sw[a-p] -# protoc-generated files -*.pb.go - # Go coverage.txt .artifacts/ diff --git a/Dockerfile b/Dockerfile index 22c1ecb2d..e7d5f625e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,32 +35,32 @@ WORKDIR /src FROM build AS generate-build WORKDIR /osd -COPY ./internal/app/osd/proto ./proto +COPY ./api/os ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto WORKDIR /trustd -COPY ./internal/app/trustd/proto ./proto +COPY ./api/security ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto WORKDIR /machined -COPY ./internal/app/machined/proto ./proto +COPY ./api/machine ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto WORKDIR /proxyd COPY ./internal/app/proxyd/proto ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto WORKDIR /ntpd -COPY ./internal/app/ntpd/proto ./proto +COPY ./api/time ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto WORKDIR /networkd -COPY ./internal/app/networkd/proto ./proto +COPY ./api/network ./proto RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto FROM scratch AS generate -COPY --from=generate-build /osd/proto/api.pb.go /internal/app/osd/proto/ -COPY --from=generate-build /trustd/proto/api.pb.go /internal/app/trustd/proto/ -COPY --from=generate-build /machined/proto/api.pb.go /internal/app/machined/proto/ +COPY --from=generate-build /osd/proto/api.pb.go /api/os/ +COPY --from=generate-build /trustd/proto/api.pb.go /api/security/ +COPY --from=generate-build /machined/proto/api.pb.go /api/machine/ COPY --from=generate-build /proxyd/proto/api.pb.go /internal/app/proxyd/proto/ -COPY --from=generate-build /ntpd/proto/api.pb.go /internal/app/ntpd/proto/ -COPY --from=generate-build /networkd/proto/api.pb.go /internal/app/networkd/proto/ +COPY --from=generate-build /ntpd/proto/api.pb.go /api/time/ +COPY --from=generate-build /networkd/proto/api.pb.go /api/network/ # The base target provides a container that can be used to build all Talos # assets. @@ -73,6 +73,7 @@ RUN go mod verify COPY ./cmd ./cmd COPY ./pkg ./pkg COPY ./internal ./internal +COPY --from=generate /api ./api COPY --from=generate /internal/app ./internal/app RUN go list -mod=readonly all >/dev/null RUN ! go mod tidy -v 2>&1 | grep . diff --git a/api/machine/api.pb.go b/api/machine/api.pb.go new file mode 100644 index 000000000..5cf47f871 --- /dev/null +++ b/api/machine/api.pb.go @@ -0,0 +1,1943 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The response message containing the reboot status. +type RebootReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RebootReply) Reset() { *m = RebootReply{} } +func (m *RebootReply) String() string { return proto.CompactTextString(m) } +func (*RebootReply) ProtoMessage() {} +func (*RebootReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *RebootReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RebootReply.Unmarshal(m, b) +} + +func (m *RebootReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RebootReply.Marshal(b, m, deterministic) +} + +func (m *RebootReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_RebootReply.Merge(m, src) +} + +func (m *RebootReply) XXX_Size() int { + return xxx_messageInfo_RebootReply.Size(m) +} + +func (m *RebootReply) XXX_DiscardUnknown() { + xxx_messageInfo_RebootReply.DiscardUnknown(m) +} + +var xxx_messageInfo_RebootReply proto.InternalMessageInfo + +// The response message containing the restart status. +type ResetReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResetReply) Reset() { *m = ResetReply{} } +func (m *ResetReply) String() string { return proto.CompactTextString(m) } +func (*ResetReply) ProtoMessage() {} +func (*ResetReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *ResetReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ResetReply.Unmarshal(m, b) +} + +func (m *ResetReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ResetReply.Marshal(b, m, deterministic) +} + +func (m *ResetReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResetReply.Merge(m, src) +} + +func (m *ResetReply) XXX_Size() int { + return xxx_messageInfo_ResetReply.Size(m) +} + +func (m *ResetReply) XXX_DiscardUnknown() { + xxx_messageInfo_ResetReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ResetReply proto.InternalMessageInfo + +// The response message containing the shutdown status. +type ShutdownReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ShutdownReply) Reset() { *m = ShutdownReply{} } +func (m *ShutdownReply) String() string { return proto.CompactTextString(m) } +func (*ShutdownReply) ProtoMessage() {} +func (*ShutdownReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *ShutdownReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ShutdownReply.Unmarshal(m, b) +} + +func (m *ShutdownReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ShutdownReply.Marshal(b, m, deterministic) +} + +func (m *ShutdownReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ShutdownReply.Merge(m, src) +} + +func (m *ShutdownReply) XXX_Size() int { + return xxx_messageInfo_ShutdownReply.Size(m) +} + +func (m *ShutdownReply) XXX_DiscardUnknown() { + xxx_messageInfo_ShutdownReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ShutdownReply proto.InternalMessageInfo + +type UpgradeRequest struct { + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpgradeRequest) Reset() { *m = UpgradeRequest{} } +func (m *UpgradeRequest) String() string { return proto.CompactTextString(m) } +func (*UpgradeRequest) ProtoMessage() {} +func (*UpgradeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *UpgradeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpgradeRequest.Unmarshal(m, b) +} + +func (m *UpgradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpgradeRequest.Marshal(b, m, deterministic) +} + +func (m *UpgradeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpgradeRequest.Merge(m, src) +} + +func (m *UpgradeRequest) XXX_Size() int { + return xxx_messageInfo_UpgradeRequest.Size(m) +} + +func (m *UpgradeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpgradeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpgradeRequest proto.InternalMessageInfo + +func (m *UpgradeRequest) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +type UpgradeReply struct { + Ack string `protobuf:"bytes,1,opt,name=ack,proto3" json:"ack,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpgradeReply) Reset() { *m = UpgradeReply{} } +func (m *UpgradeReply) String() string { return proto.CompactTextString(m) } +func (*UpgradeReply) ProtoMessage() {} +func (*UpgradeReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{4} +} + +func (m *UpgradeReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpgradeReply.Unmarshal(m, b) +} + +func (m *UpgradeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpgradeReply.Marshal(b, m, deterministic) +} + +func (m *UpgradeReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpgradeReply.Merge(m, src) +} + +func (m *UpgradeReply) XXX_Size() int { + return xxx_messageInfo_UpgradeReply.Size(m) +} + +func (m *UpgradeReply) XXX_DiscardUnknown() { + xxx_messageInfo_UpgradeReply.DiscardUnknown(m) +} + +var xxx_messageInfo_UpgradeReply proto.InternalMessageInfo + +func (m *UpgradeReply) GetAck() string { + if m != nil { + return m.Ack + } + return "" +} + +type ServiceListReply struct { + Services []*ServiceInfo `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceListReply) Reset() { *m = ServiceListReply{} } +func (m *ServiceListReply) String() string { return proto.CompactTextString(m) } +func (*ServiceListReply) ProtoMessage() {} +func (*ServiceListReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{5} +} + +func (m *ServiceListReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceListReply.Unmarshal(m, b) +} + +func (m *ServiceListReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceListReply.Marshal(b, m, deterministic) +} + +func (m *ServiceListReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceListReply.Merge(m, src) +} + +func (m *ServiceListReply) XXX_Size() int { + return xxx_messageInfo_ServiceListReply.Size(m) +} + +func (m *ServiceListReply) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceListReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceListReply proto.InternalMessageInfo + +func (m *ServiceListReply) GetServices() []*ServiceInfo { + if m != nil { + return m.Services + } + return nil +} + +type ServiceInfo struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Events *ServiceEvents `protobuf:"bytes,3,opt,name=events,proto3" json:"events,omitempty"` + Health *ServiceHealth `protobuf:"bytes,4,opt,name=health,proto3" json:"health,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceInfo) Reset() { *m = ServiceInfo{} } +func (m *ServiceInfo) String() string { return proto.CompactTextString(m) } +func (*ServiceInfo) ProtoMessage() {} +func (*ServiceInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{6} +} + +func (m *ServiceInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceInfo.Unmarshal(m, b) +} + +func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceInfo.Marshal(b, m, deterministic) +} + +func (m *ServiceInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceInfo.Merge(m, src) +} + +func (m *ServiceInfo) XXX_Size() int { + return xxx_messageInfo_ServiceInfo.Size(m) +} + +func (m *ServiceInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo + +func (m *ServiceInfo) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ServiceInfo) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *ServiceInfo) GetEvents() *ServiceEvents { + if m != nil { + return m.Events + } + return nil +} + +func (m *ServiceInfo) GetHealth() *ServiceHealth { + if m != nil { + return m.Health + } + return nil +} + +type ServiceEvents struct { + Events []*ServiceEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceEvents) Reset() { *m = ServiceEvents{} } +func (m *ServiceEvents) String() string { return proto.CompactTextString(m) } +func (*ServiceEvents) ProtoMessage() {} +func (*ServiceEvents) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{7} +} + +func (m *ServiceEvents) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceEvents.Unmarshal(m, b) +} + +func (m *ServiceEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceEvents.Marshal(b, m, deterministic) +} + +func (m *ServiceEvents) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceEvents.Merge(m, src) +} + +func (m *ServiceEvents) XXX_Size() int { + return xxx_messageInfo_ServiceEvents.Size(m) +} + +func (m *ServiceEvents) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceEvents.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceEvents proto.InternalMessageInfo + +func (m *ServiceEvents) GetEvents() []*ServiceEvent { + if m != nil { + return m.Events + } + return nil +} + +type ServiceEvent struct { + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Ts *timestamp.Timestamp `protobuf:"bytes,3,opt,name=ts,proto3" json:"ts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceEvent) Reset() { *m = ServiceEvent{} } +func (m *ServiceEvent) String() string { return proto.CompactTextString(m) } +func (*ServiceEvent) ProtoMessage() {} +func (*ServiceEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{8} +} + +func (m *ServiceEvent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceEvent.Unmarshal(m, b) +} + +func (m *ServiceEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceEvent.Marshal(b, m, deterministic) +} + +func (m *ServiceEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceEvent.Merge(m, src) +} + +func (m *ServiceEvent) XXX_Size() int { + return xxx_messageInfo_ServiceEvent.Size(m) +} + +func (m *ServiceEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceEvent proto.InternalMessageInfo + +func (m *ServiceEvent) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *ServiceEvent) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *ServiceEvent) GetTs() *timestamp.Timestamp { + if m != nil { + return m.Ts + } + return nil +} + +type ServiceHealth struct { + Unknown bool `protobuf:"varint,1,opt,name=unknown,proto3" json:"unknown,omitempty"` + Healthy bool `protobuf:"varint,2,opt,name=healthy,proto3" json:"healthy,omitempty"` + LastMessage string `protobuf:"bytes,3,opt,name=last_message,json=lastMessage,proto3" json:"last_message,omitempty"` + LastChange *timestamp.Timestamp `protobuf:"bytes,4,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceHealth) Reset() { *m = ServiceHealth{} } +func (m *ServiceHealth) String() string { return proto.CompactTextString(m) } +func (*ServiceHealth) ProtoMessage() {} +func (*ServiceHealth) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{9} +} + +func (m *ServiceHealth) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceHealth.Unmarshal(m, b) +} + +func (m *ServiceHealth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceHealth.Marshal(b, m, deterministic) +} + +func (m *ServiceHealth) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceHealth.Merge(m, src) +} + +func (m *ServiceHealth) XXX_Size() int { + return xxx_messageInfo_ServiceHealth.Size(m) +} + +func (m *ServiceHealth) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceHealth.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceHealth proto.InternalMessageInfo + +func (m *ServiceHealth) GetUnknown() bool { + if m != nil { + return m.Unknown + } + return false +} + +func (m *ServiceHealth) GetHealthy() bool { + if m != nil { + return m.Healthy + } + return false +} + +func (m *ServiceHealth) GetLastMessage() string { + if m != nil { + return m.LastMessage + } + return "" +} + +func (m *ServiceHealth) GetLastChange() *timestamp.Timestamp { + if m != nil { + return m.LastChange + } + return nil +} + +type ServiceStartRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceStartRequest) Reset() { *m = ServiceStartRequest{} } +func (m *ServiceStartRequest) String() string { return proto.CompactTextString(m) } +func (*ServiceStartRequest) ProtoMessage() {} +func (*ServiceStartRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{10} +} + +func (m *ServiceStartRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceStartRequest.Unmarshal(m, b) +} + +func (m *ServiceStartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceStartRequest.Marshal(b, m, deterministic) +} + +func (m *ServiceStartRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceStartRequest.Merge(m, src) +} + +func (m *ServiceStartRequest) XXX_Size() int { + return xxx_messageInfo_ServiceStartRequest.Size(m) +} + +func (m *ServiceStartRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceStartRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceStartRequest proto.InternalMessageInfo + +func (m *ServiceStartRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type ServiceStartReply struct { + Resp string `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceStartReply) Reset() { *m = ServiceStartReply{} } +func (m *ServiceStartReply) String() string { return proto.CompactTextString(m) } +func (*ServiceStartReply) ProtoMessage() {} +func (*ServiceStartReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{11} +} + +func (m *ServiceStartReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceStartReply.Unmarshal(m, b) +} + +func (m *ServiceStartReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceStartReply.Marshal(b, m, deterministic) +} + +func (m *ServiceStartReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceStartReply.Merge(m, src) +} + +func (m *ServiceStartReply) XXX_Size() int { + return xxx_messageInfo_ServiceStartReply.Size(m) +} + +func (m *ServiceStartReply) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceStartReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceStartReply proto.InternalMessageInfo + +func (m *ServiceStartReply) GetResp() string { + if m != nil { + return m.Resp + } + return "" +} + +type ServiceStopRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceStopRequest) Reset() { *m = ServiceStopRequest{} } +func (m *ServiceStopRequest) String() string { return proto.CompactTextString(m) } +func (*ServiceStopRequest) ProtoMessage() {} +func (*ServiceStopRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{12} +} + +func (m *ServiceStopRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceStopRequest.Unmarshal(m, b) +} + +func (m *ServiceStopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceStopRequest.Marshal(b, m, deterministic) +} + +func (m *ServiceStopRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceStopRequest.Merge(m, src) +} + +func (m *ServiceStopRequest) XXX_Size() int { + return xxx_messageInfo_ServiceStopRequest.Size(m) +} + +func (m *ServiceStopRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceStopRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceStopRequest proto.InternalMessageInfo + +func (m *ServiceStopRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type ServiceStopReply struct { + Resp string `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceStopReply) Reset() { *m = ServiceStopReply{} } +func (m *ServiceStopReply) String() string { return proto.CompactTextString(m) } +func (*ServiceStopReply) ProtoMessage() {} +func (*ServiceStopReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{13} +} + +func (m *ServiceStopReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceStopReply.Unmarshal(m, b) +} + +func (m *ServiceStopReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceStopReply.Marshal(b, m, deterministic) +} + +func (m *ServiceStopReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceStopReply.Merge(m, src) +} + +func (m *ServiceStopReply) XXX_Size() int { + return xxx_messageInfo_ServiceStopReply.Size(m) +} + +func (m *ServiceStopReply) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceStopReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceStopReply proto.InternalMessageInfo + +func (m *ServiceStopReply) GetResp() string { + if m != nil { + return m.Resp + } + return "" +} + +type ServiceRestartRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceRestartRequest) Reset() { *m = ServiceRestartRequest{} } +func (m *ServiceRestartRequest) String() string { return proto.CompactTextString(m) } +func (*ServiceRestartRequest) ProtoMessage() {} +func (*ServiceRestartRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{14} +} + +func (m *ServiceRestartRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceRestartRequest.Unmarshal(m, b) +} + +func (m *ServiceRestartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceRestartRequest.Marshal(b, m, deterministic) +} + +func (m *ServiceRestartRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceRestartRequest.Merge(m, src) +} + +func (m *ServiceRestartRequest) XXX_Size() int { + return xxx_messageInfo_ServiceRestartRequest.Size(m) +} + +func (m *ServiceRestartRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceRestartRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceRestartRequest proto.InternalMessageInfo + +func (m *ServiceRestartRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type ServiceRestartReply struct { + Resp string `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceRestartReply) Reset() { *m = ServiceRestartReply{} } +func (m *ServiceRestartReply) String() string { return proto.CompactTextString(m) } +func (*ServiceRestartReply) ProtoMessage() {} +func (*ServiceRestartReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{15} +} + +func (m *ServiceRestartReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServiceRestartReply.Unmarshal(m, b) +} + +func (m *ServiceRestartReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServiceRestartReply.Marshal(b, m, deterministic) +} + +func (m *ServiceRestartReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceRestartReply.Merge(m, src) +} + +func (m *ServiceRestartReply) XXX_Size() int { + return xxx_messageInfo_ServiceRestartReply.Size(m) +} + +func (m *ServiceRestartReply) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceRestartReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceRestartReply proto.InternalMessageInfo + +func (m *ServiceRestartReply) GetResp() string { + if m != nil { + return m.Resp + } + return "" +} + +// Deprecated: Do not use. +type StartRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartRequest) Reset() { *m = StartRequest{} } +func (m *StartRequest) String() string { return proto.CompactTextString(m) } +func (*StartRequest) ProtoMessage() {} +func (*StartRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{16} +} + +func (m *StartRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StartRequest.Unmarshal(m, b) +} + +func (m *StartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StartRequest.Marshal(b, m, deterministic) +} + +func (m *StartRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartRequest.Merge(m, src) +} + +func (m *StartRequest) XXX_Size() int { + return xxx_messageInfo_StartRequest.Size(m) +} + +func (m *StartRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StartRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StartRequest proto.InternalMessageInfo + +func (m *StartRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// Deprecated: Do not use. +type StartReply struct { + Resp string `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartReply) Reset() { *m = StartReply{} } +func (m *StartReply) String() string { return proto.CompactTextString(m) } +func (*StartReply) ProtoMessage() {} +func (*StartReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{17} +} + +func (m *StartReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StartReply.Unmarshal(m, b) +} + +func (m *StartReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StartReply.Marshal(b, m, deterministic) +} + +func (m *StartReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartReply.Merge(m, src) +} + +func (m *StartReply) XXX_Size() int { + return xxx_messageInfo_StartReply.Size(m) +} + +func (m *StartReply) XXX_DiscardUnknown() { + xxx_messageInfo_StartReply.DiscardUnknown(m) +} + +var xxx_messageInfo_StartReply proto.InternalMessageInfo + +func (m *StartReply) GetResp() string { + if m != nil { + return m.Resp + } + return "" +} + +// Deprecated: Do not use. +type StopRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopRequest) Reset() { *m = StopRequest{} } +func (m *StopRequest) String() string { return proto.CompactTextString(m) } +func (*StopRequest) ProtoMessage() {} +func (*StopRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{18} +} + +func (m *StopRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StopRequest.Unmarshal(m, b) +} + +func (m *StopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StopRequest.Marshal(b, m, deterministic) +} + +func (m *StopRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopRequest.Merge(m, src) +} + +func (m *StopRequest) XXX_Size() int { + return xxx_messageInfo_StopRequest.Size(m) +} + +func (m *StopRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StopRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StopRequest proto.InternalMessageInfo + +func (m *StopRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// Deprecated: Do not use. +type StopReply struct { + Resp string `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopReply) Reset() { *m = StopReply{} } +func (m *StopReply) String() string { return proto.CompactTextString(m) } +func (*StopReply) ProtoMessage() {} +func (*StopReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{19} +} + +func (m *StopReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StopReply.Unmarshal(m, b) +} + +func (m *StopReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StopReply.Marshal(b, m, deterministic) +} + +func (m *StopReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopReply.Merge(m, src) +} + +func (m *StopReply) XXX_Size() int { + return xxx_messageInfo_StopReply.Size(m) +} + +func (m *StopReply) XXX_DiscardUnknown() { + xxx_messageInfo_StopReply.DiscardUnknown(m) +} + +var xxx_messageInfo_StopReply proto.InternalMessageInfo + +func (m *StopReply) GetResp() string { + if m != nil { + return m.Resp + } + return "" +} + +// StreamingData is used to stream back responses +type StreamingData struct { + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` + Errors string `protobuf:"bytes,2,opt,name=errors,proto3" json:"errors,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StreamingData) Reset() { *m = StreamingData{} } +func (m *StreamingData) String() string { return proto.CompactTextString(m) } +func (*StreamingData) ProtoMessage() {} +func (*StreamingData) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{20} +} + +func (m *StreamingData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StreamingData.Unmarshal(m, b) +} + +func (m *StreamingData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StreamingData.Marshal(b, m, deterministic) +} + +func (m *StreamingData) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamingData.Merge(m, src) +} + +func (m *StreamingData) XXX_Size() int { + return xxx_messageInfo_StreamingData.Size(m) +} + +func (m *StreamingData) XXX_DiscardUnknown() { + xxx_messageInfo_StreamingData.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamingData proto.InternalMessageInfo + +func (m *StreamingData) GetBytes() []byte { + if m != nil { + return m.Bytes + } + return nil +} + +func (m *StreamingData) GetErrors() string { + if m != nil { + return m.Errors + } + return "" +} + +// CopyOutRequest describes a request to copy data out of Talos node +// +// CopyOut produces .tar.gz archive which is streamed back to the caller +type CopyOutRequest struct { + // Root path to start copying data out, it might be either a file or directory + RootPath string `protobuf:"bytes,1,opt,name=root_path,json=rootPath,proto3" json:"root_path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CopyOutRequest) Reset() { *m = CopyOutRequest{} } +func (m *CopyOutRequest) String() string { return proto.CompactTextString(m) } +func (*CopyOutRequest) ProtoMessage() {} +func (*CopyOutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{21} +} + +func (m *CopyOutRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CopyOutRequest.Unmarshal(m, b) +} + +func (m *CopyOutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CopyOutRequest.Marshal(b, m, deterministic) +} + +func (m *CopyOutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CopyOutRequest.Merge(m, src) +} + +func (m *CopyOutRequest) XXX_Size() int { + return xxx_messageInfo_CopyOutRequest.Size(m) +} + +func (m *CopyOutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CopyOutRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CopyOutRequest proto.InternalMessageInfo + +func (m *CopyOutRequest) GetRootPath() string { + if m != nil { + return m.RootPath + } + return "" +} + +// LSRequest describes a request to list the contents of a directory +type LSRequest struct { + // Root indicates the root directory for the list. If not indicated, '/' is + // presumed. + Root string `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` + // Recurse indicates that subdirectories should be recursed. + Recurse bool `protobuf:"varint,2,opt,name=recurse,proto3" json:"recurse,omitempty"` + // RecursionDepth indicates how many levels of subdirectories should be + // recursed. The default (0) indicates that no limit should be enforced. + RecursionDepth int32 `protobuf:"varint,3,opt,name=recursion_depth,json=recursionDepth,proto3" json:"recursion_depth,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LSRequest) Reset() { *m = LSRequest{} } +func (m *LSRequest) String() string { return proto.CompactTextString(m) } +func (*LSRequest) ProtoMessage() {} +func (*LSRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{22} +} + +func (m *LSRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LSRequest.Unmarshal(m, b) +} + +func (m *LSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LSRequest.Marshal(b, m, deterministic) +} + +func (m *LSRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LSRequest.Merge(m, src) +} + +func (m *LSRequest) XXX_Size() int { + return xxx_messageInfo_LSRequest.Size(m) +} + +func (m *LSRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LSRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LSRequest proto.InternalMessageInfo + +func (m *LSRequest) GetRoot() string { + if m != nil { + return m.Root + } + return "" +} + +func (m *LSRequest) GetRecurse() bool { + if m != nil { + return m.Recurse + } + return false +} + +func (m *LSRequest) GetRecursionDepth() int32 { + if m != nil { + return m.RecursionDepth + } + return 0 +} + +// FileInfo describes a file or directory's information +type FileInfo struct { + // Name is the name (including prefixed path) of the file or directory + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Size indicates the number of bytes contained within the file + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + // Mode is the bitmap of UNIX mode/permission flags of the file + Mode uint32 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"` + // Modified indicates the UNIX timestamp at which the file was last modified + Modified int64 `protobuf:"varint,4,opt,name=modified,proto3" json:"modified,omitempty"` + // IsDir indicates that the file is a directory + IsDir bool `protobuf:"varint,5,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` + // Error describes any error encountered while trying to read the file + // information. + Error string `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"` + // Link is filled with symlink target + Link string `protobuf:"bytes,7,opt,name=link,proto3" json:"link,omitempty"` + // RelativeName is the name of the file or directory relative to the RootPath + RelativeName string `protobuf:"bytes,8,opt,name=relative_name,json=relativeName,proto3" json:"relative_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FileInfo) Reset() { *m = FileInfo{} } +func (m *FileInfo) String() string { return proto.CompactTextString(m) } +func (*FileInfo) ProtoMessage() {} +func (*FileInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{23} +} + +func (m *FileInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FileInfo.Unmarshal(m, b) +} + +func (m *FileInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FileInfo.Marshal(b, m, deterministic) +} + +func (m *FileInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileInfo.Merge(m, src) +} + +func (m *FileInfo) XXX_Size() int { + return xxx_messageInfo_FileInfo.Size(m) +} + +func (m *FileInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FileInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FileInfo proto.InternalMessageInfo + +func (m *FileInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FileInfo) GetSize() int64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *FileInfo) GetMode() uint32 { + if m != nil { + return m.Mode + } + return 0 +} + +func (m *FileInfo) GetModified() int64 { + if m != nil { + return m.Modified + } + return 0 +} + +func (m *FileInfo) GetIsDir() bool { + if m != nil { + return m.IsDir + } + return false +} + +func (m *FileInfo) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *FileInfo) GetLink() string { + if m != nil { + return m.Link + } + return "" +} + +func (m *FileInfo) GetRelativeName() string { + if m != nil { + return m.RelativeName + } + return "" +} + +// The response message containing the requested df stats. +type DFReply struct { + Stats []*DFStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DFReply) Reset() { *m = DFReply{} } +func (m *DFReply) String() string { return proto.CompactTextString(m) } +func (*DFReply) ProtoMessage() {} +func (*DFReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{24} +} + +func (m *DFReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DFReply.Unmarshal(m, b) +} + +func (m *DFReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DFReply.Marshal(b, m, deterministic) +} + +func (m *DFReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_DFReply.Merge(m, src) +} + +func (m *DFReply) XXX_Size() int { + return xxx_messageInfo_DFReply.Size(m) +} + +func (m *DFReply) XXX_DiscardUnknown() { + xxx_messageInfo_DFReply.DiscardUnknown(m) +} + +var xxx_messageInfo_DFReply proto.InternalMessageInfo + +func (m *DFReply) GetStats() []*DFStat { + if m != nil { + return m.Stats + } + return nil +} + +// The response message containing the requested processes. +type DFStat struct { + Filesystem string `protobuf:"bytes,1,opt,name=filesystem,proto3" json:"filesystem,omitempty"` + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Available uint64 `protobuf:"varint,3,opt,name=available,proto3" json:"available,omitempty"` + MountedOn string `protobuf:"bytes,4,opt,name=mounted_on,json=mountedOn,proto3" json:"mounted_on,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DFStat) Reset() { *m = DFStat{} } +func (m *DFStat) String() string { return proto.CompactTextString(m) } +func (*DFStat) ProtoMessage() {} +func (*DFStat) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{25} +} + +func (m *DFStat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DFStat.Unmarshal(m, b) +} + +func (m *DFStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DFStat.Marshal(b, m, deterministic) +} + +func (m *DFStat) XXX_Merge(src proto.Message) { + xxx_messageInfo_DFStat.Merge(m, src) +} + +func (m *DFStat) XXX_Size() int { + return xxx_messageInfo_DFStat.Size(m) +} + +func (m *DFStat) XXX_DiscardUnknown() { + xxx_messageInfo_DFStat.DiscardUnknown(m) +} + +var xxx_messageInfo_DFStat proto.InternalMessageInfo + +func (m *DFStat) GetFilesystem() string { + if m != nil { + return m.Filesystem + } + return "" +} + +func (m *DFStat) GetSize() uint64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *DFStat) GetAvailable() uint64 { + if m != nil { + return m.Available + } + return 0 +} + +func (m *DFStat) GetMountedOn() string { + if m != nil { + return m.MountedOn + } + return "" +} + +func init() { + proto.RegisterType((*RebootReply)(nil), "proto.RebootReply") + proto.RegisterType((*ResetReply)(nil), "proto.ResetReply") + proto.RegisterType((*ShutdownReply)(nil), "proto.ShutdownReply") + proto.RegisterType((*UpgradeRequest)(nil), "proto.UpgradeRequest") + proto.RegisterType((*UpgradeReply)(nil), "proto.UpgradeReply") + proto.RegisterType((*ServiceListReply)(nil), "proto.ServiceListReply") + proto.RegisterType((*ServiceInfo)(nil), "proto.ServiceInfo") + proto.RegisterType((*ServiceEvents)(nil), "proto.ServiceEvents") + proto.RegisterType((*ServiceEvent)(nil), "proto.ServiceEvent") + proto.RegisterType((*ServiceHealth)(nil), "proto.ServiceHealth") + proto.RegisterType((*ServiceStartRequest)(nil), "proto.ServiceStartRequest") + proto.RegisterType((*ServiceStartReply)(nil), "proto.ServiceStartReply") + proto.RegisterType((*ServiceStopRequest)(nil), "proto.ServiceStopRequest") + proto.RegisterType((*ServiceStopReply)(nil), "proto.ServiceStopReply") + proto.RegisterType((*ServiceRestartRequest)(nil), "proto.ServiceRestartRequest") + proto.RegisterType((*ServiceRestartReply)(nil), "proto.ServiceRestartReply") + proto.RegisterType((*StartRequest)(nil), "proto.StartRequest") + proto.RegisterType((*StartReply)(nil), "proto.StartReply") + proto.RegisterType((*StopRequest)(nil), "proto.StopRequest") + proto.RegisterType((*StopReply)(nil), "proto.StopReply") + proto.RegisterType((*StreamingData)(nil), "proto.StreamingData") + proto.RegisterType((*CopyOutRequest)(nil), "proto.CopyOutRequest") + proto.RegisterType((*LSRequest)(nil), "proto.LSRequest") + proto.RegisterType((*FileInfo)(nil), "proto.FileInfo") + proto.RegisterType((*DFReply)(nil), "proto.DFReply") + proto.RegisterType((*DFStat)(nil), "proto.DFStat") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 1029 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0xdb, 0x72, 0xdb, 0x36, + 0x10, 0x1d, 0xea, 0x66, 0x69, 0x75, 0xb1, 0x0d, 0xc7, 0x29, 0xcb, 0xa4, 0xa9, 0x43, 0xa7, 0xb1, + 0xd3, 0xa6, 0x4a, 0xea, 0xa6, 0x33, 0x99, 0xde, 0x66, 0xe2, 0x28, 0x9e, 0xa6, 0xe3, 0x36, 0x1e, + 0xa8, 0x7d, 0xe9, 0x8b, 0x06, 0x32, 0x61, 0x09, 0x63, 0x92, 0x60, 0x09, 0xc8, 0x19, 0xf5, 0x0b, + 0xfa, 0xd6, 0x8f, 0xe8, 0xcf, 0xf4, 0x7b, 0xfa, 0x05, 0x1d, 0x5c, 0x08, 0x8b, 0xae, 0xa9, 0x27, + 0x61, 0x0f, 0x0e, 0xb0, 0x67, 0x17, 0xab, 0x5d, 0x42, 0x87, 0x64, 0x6c, 0x98, 0xe5, 0x5c, 0x72, + 0xd4, 0xd4, 0x3f, 0xc1, 0xbd, 0x19, 0xe7, 0xb3, 0x98, 0x3e, 0xd3, 0xd6, 0x74, 0x71, 0xf1, 0x8c, + 0x26, 0x99, 0x5c, 0x1a, 0x4e, 0xf0, 0xf1, 0xcd, 0x4d, 0xc9, 0x12, 0x2a, 0x24, 0x49, 0x32, 0x43, + 0x08, 0xfb, 0xd0, 0xc5, 0x74, 0xca, 0xb9, 0xc4, 0x34, 0x8b, 0x97, 0x61, 0x0f, 0x00, 0x53, 0x41, + 0xad, 0xb5, 0x09, 0xfd, 0xf1, 0x7c, 0x21, 0x23, 0xfe, 0x3e, 0x35, 0xc0, 0x63, 0x18, 0xfc, 0x9a, + 0xcd, 0x72, 0x12, 0x51, 0x4c, 0x7f, 0x5f, 0x50, 0x21, 0xd1, 0x1d, 0x68, 0xb2, 0x84, 0xcc, 0xa8, + 0xef, 0xed, 0x79, 0x87, 0x1d, 0x6c, 0x8c, 0x70, 0x0f, 0x7a, 0x8e, 0x97, 0xc5, 0x4b, 0xb4, 0x05, + 0x75, 0x72, 0x7e, 0x69, 0x39, 0x6a, 0x19, 0x1e, 0xc3, 0xd6, 0x98, 0xe6, 0x57, 0xec, 0x9c, 0x9e, + 0x32, 0x61, 0xdc, 0xa1, 0x21, 0xb4, 0x85, 0xc1, 0x84, 0xef, 0xed, 0xd5, 0x0f, 0xbb, 0x47, 0xc8, + 0xa8, 0x1c, 0x5a, 0xea, 0xdb, 0xf4, 0x82, 0x63, 0xc7, 0x09, 0xff, 0xf2, 0xa0, 0xbb, 0xb2, 0x83, + 0x06, 0x50, 0x63, 0x91, 0x75, 0x52, 0x63, 0x91, 0xd2, 0x26, 0x24, 0x91, 0xd4, 0xaf, 0x19, 0x6d, + 0xda, 0x40, 0x4f, 0xa1, 0x45, 0xaf, 0x68, 0x2a, 0x85, 0x5f, 0xdf, 0xf3, 0x0e, 0xbb, 0x47, 0x77, + 0xca, 0x3e, 0xde, 0xe8, 0x3d, 0x6c, 0x39, 0x8a, 0x3d, 0xa7, 0x24, 0x96, 0x73, 0xbf, 0x71, 0x1b, + 0xfb, 0x07, 0xbd, 0x87, 0x2d, 0x27, 0xfc, 0x16, 0xfa, 0xa5, 0x6b, 0xd0, 0x67, 0xce, 0x99, 0x09, + 0x68, 0xe7, 0x16, 0x67, 0x85, 0xaf, 0x70, 0x0a, 0xbd, 0x55, 0x5c, 0x65, 0x2d, 0x11, 0xb3, 0x22, + 0x6b, 0x89, 0x98, 0x55, 0x44, 0xf4, 0x29, 0xd4, 0x5c, 0x34, 0xc1, 0xd0, 0xbc, 0xf8, 0xb0, 0x78, + 0xf1, 0xe1, 0x2f, 0xc5, 0x8b, 0xe3, 0x9a, 0x14, 0xe1, 0xdf, 0x9e, 0x93, 0x68, 0xb4, 0x23, 0x1f, + 0x36, 0x16, 0xe9, 0x65, 0xca, 0xdf, 0xa7, 0xda, 0x53, 0x1b, 0x17, 0xa6, 0xda, 0x31, 0x71, 0x2d, + 0xb5, 0xbf, 0x36, 0x2e, 0x4c, 0xf4, 0x10, 0x7a, 0x31, 0x11, 0x72, 0x92, 0x50, 0x21, 0xd4, 0xe3, + 0xd7, 0xb5, 0x9c, 0xae, 0xc2, 0x7e, 0x32, 0x10, 0xfa, 0x06, 0xb4, 0x39, 0x39, 0x9f, 0x93, 0x74, + 0x46, 0x6d, 0xf6, 0xd6, 0xa9, 0x03, 0x45, 0x7f, 0xad, 0xd9, 0xe1, 0x27, 0xb0, 0x63, 0x45, 0x8e, + 0x25, 0xc9, 0x65, 0x51, 0x6c, 0x37, 0x1e, 0x38, 0x3c, 0x80, 0xed, 0x32, 0x4d, 0x55, 0x11, 0x82, + 0x46, 0x4e, 0x45, 0x66, 0x69, 0x7a, 0x1d, 0x3e, 0x02, 0xe4, 0x88, 0x3c, 0xab, 0xba, 0xee, 0xb1, + 0xab, 0x49, 0xc3, 0xaa, 0xba, 0xed, 0x00, 0x76, 0x2d, 0x0f, 0x2b, 0xed, 0xd5, 0xfa, 0x9e, 0xb8, + 0x30, 0x1c, 0xb1, 0xea, 0xce, 0x10, 0x7a, 0xeb, 0x42, 0xfd, 0xba, 0xe6, 0x7b, 0xe1, 0x23, 0x80, + 0xf5, 0x71, 0x6a, 0xd6, 0x43, 0xe8, 0xae, 0x09, 0x52, 0x53, 0xf6, 0xa1, 0xb3, 0x36, 0x42, 0x4d, + 0xfa, 0x0e, 0xfa, 0x63, 0x99, 0x53, 0x92, 0xb0, 0x74, 0x36, 0x22, 0x92, 0xa8, 0xe2, 0x9b, 0x2e, + 0xa5, 0xfe, 0x6f, 0x7a, 0x87, 0x3d, 0x6c, 0x0c, 0x74, 0x17, 0x5a, 0x34, 0xcf, 0x79, 0x2e, 0x6c, + 0x4d, 0x5a, 0x2b, 0xfc, 0x1c, 0x06, 0xaf, 0x79, 0xb6, 0x7c, 0xb7, 0x70, 0x21, 0xdd, 0x83, 0x4e, + 0xce, 0xb9, 0x9c, 0x64, 0x44, 0xce, 0xad, 0xb7, 0xb6, 0x02, 0xce, 0x88, 0x9c, 0x87, 0x53, 0xe8, + 0x9c, 0x8e, 0x0b, 0xa6, 0x92, 0xc4, 0xb9, 0x74, 0x92, 0x38, 0x97, 0xaa, 0x18, 0x73, 0x7a, 0xbe, + 0xc8, 0x05, 0x2d, 0x8a, 0xd1, 0x9a, 0xe8, 0x00, 0x36, 0xcd, 0x92, 0xf1, 0x74, 0x12, 0xd1, 0x4c, + 0xce, 0x75, 0x3d, 0x36, 0xf1, 0xc0, 0xc1, 0x23, 0x85, 0x86, 0xff, 0x78, 0xd0, 0x3e, 0x61, 0xb1, + 0x69, 0x16, 0x08, 0x1a, 0x29, 0x49, 0x8a, 0xbe, 0xa5, 0xd7, 0x0a, 0x13, 0xec, 0x0f, 0xe3, 0xa0, + 0x8e, 0xf5, 0x5a, 0x61, 0x09, 0x8f, 0x4c, 0x89, 0xf7, 0xb1, 0x5e, 0xa3, 0x00, 0xda, 0x09, 0x8f, + 0xd8, 0x05, 0xa3, 0x91, 0x2e, 0xec, 0x3a, 0x76, 0x36, 0xda, 0x85, 0x16, 0x13, 0x93, 0x88, 0xe5, + 0x7e, 0x53, 0xcb, 0x6c, 0x32, 0x31, 0x62, 0xb9, 0x4a, 0x9e, 0x4e, 0x8c, 0xdf, 0x32, 0xff, 0x5c, + 0x6d, 0xa8, 0xcb, 0x63, 0x96, 0x5e, 0xfa, 0x1b, 0x46, 0x84, 0x5a, 0xa3, 0x7d, 0xe8, 0xe7, 0x34, + 0x26, 0x92, 0x5d, 0xd1, 0x89, 0x56, 0xd8, 0xd6, 0x9b, 0xbd, 0x02, 0xfc, 0x99, 0x24, 0x34, 0x1c, + 0xc2, 0xc6, 0xe8, 0xc4, 0xbc, 0xdf, 0xbe, 0xe9, 0x09, 0x45, 0x87, 0xe9, 0xdb, 0x0e, 0x33, 0x3a, + 0x19, 0x4b, 0x22, 0x4d, 0x8b, 0x10, 0xe1, 0x12, 0x5a, 0x06, 0x40, 0x0f, 0x00, 0x2e, 0x58, 0x4c, + 0xc5, 0x52, 0x48, 0x9a, 0xd8, 0xe8, 0x57, 0x90, 0x52, 0x0e, 0x1a, 0x36, 0x07, 0xf7, 0xa1, 0x43, + 0xae, 0x08, 0x8b, 0xc9, 0x34, 0x36, 0x89, 0x68, 0xe0, 0x6b, 0x00, 0x7d, 0x04, 0x90, 0xf0, 0x45, + 0x2a, 0x69, 0x34, 0xe1, 0xa9, 0xce, 0x47, 0x07, 0x77, 0x2c, 0xf2, 0x2e, 0x3d, 0xfa, 0xb7, 0x09, + 0x8d, 0xb7, 0x29, 0x93, 0xe8, 0x25, 0x6c, 0xd8, 0x8a, 0x40, 0xbb, 0x56, 0x64, 0xb9, 0x42, 0x02, + 0xd7, 0x5c, 0x57, 0xeb, 0xee, 0xb9, 0x87, 0x9e, 0x42, 0x6d, 0x74, 0x82, 0xee, 0xfe, 0xaf, 0x79, + 0xbc, 0x51, 0x93, 0x2e, 0x18, 0xb8, 0x88, 0x4d, 0x42, 0x9e, 0x40, 0xed, 0x74, 0x8c, 0xb6, 0x2c, + 0xea, 0xaa, 0x2a, 0xd8, 0xb4, 0x48, 0x51, 0x02, 0xcf, 0x3d, 0xf4, 0x02, 0x5a, 0x66, 0xfa, 0x55, + 0x5e, 0x5e, 0x4c, 0xa0, 0x95, 0x21, 0x89, 0x8e, 0xa0, 0xa9, 0x87, 0x64, 0xe5, 0xa1, 0x6d, 0x77, + 0xa8, 0x18, 0xa5, 0xe8, 0x25, 0xb4, 0x8b, 0x51, 0x5a, 0x79, 0xcc, 0x85, 0xbf, 0x3a, 0x73, 0xd1, + 0x57, 0xb0, 0x61, 0x67, 0xa9, 0x4b, 0x5b, 0x79, 0x06, 0x07, 0x3b, 0x37, 0x61, 0x75, 0xec, 0x7b, + 0x37, 0x1b, 0xd5, 0x80, 0xad, 0xf4, 0xf9, 0x41, 0x79, 0x20, 0x5d, 0x0f, 0xe3, 0x91, 0x1b, 0x46, + 0xba, 0xe7, 0xa0, 0xa0, 0x4c, 0x5c, 0x6d, 0x56, 0x81, 0x7f, 0xeb, 0x9e, 0xba, 0xe5, 0x95, 0x53, + 0xa1, 0x1a, 0x0e, 0xfa, 0xf0, 0x26, 0xd1, 0xf5, 0xa9, 0x9b, 0x42, 0xae, 0xfb, 0xd3, 0x8f, 0x30, + 0x28, 0x37, 0x51, 0x74, 0xbf, 0x4c, 0x2d, 0x37, 0xe1, 0x20, 0xa8, 0xd8, 0x55, 0x77, 0xbd, 0x80, + 0xa6, 0x89, 0xc6, 0xcd, 0xe1, 0xd5, 0x93, 0xdb, 0x65, 0x50, 0x7d, 0xf0, 0xd4, 0xff, 0xac, 0x79, + 0xe8, 0x0b, 0x68, 0x68, 0xf5, 0xee, 0x6b, 0x64, 0x45, 0xf6, 0x56, 0x09, 0x2b, 0x8e, 0x1c, 0x3f, + 0x80, 0xce, 0x39, 0x4f, 0xcc, 0xde, 0x71, 0xfb, 0x55, 0xc6, 0xce, 0xd4, 0xea, 0xcc, 0xfb, 0xcd, + 0x7c, 0xb4, 0x4d, 0x5b, 0xfa, 0xe7, 0xcb, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x6e, 0x74, + 0xd5, 0xcf, 0x09, 0x00, 0x00, +} + +// 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 + +// InitClient is the client API for Init service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type InitClient interface { + CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Init_CopyOutClient, error) + DF(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DFReply, error) + LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Init_LSClient, error) + Reboot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RebootReply, error) + Reset(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ResetReply, error) + Shutdown(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ShutdownReply, error) + Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeReply, error) + ServiceList(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServiceListReply, error) + ServiceStart(ctx context.Context, in *ServiceStartRequest, opts ...grpc.CallOption) (*ServiceStartReply, error) + ServiceStop(ctx context.Context, in *ServiceStopRequest, opts ...grpc.CallOption) (*ServiceStopReply, error) + ServiceRestart(ctx context.Context, in *ServiceRestartRequest, opts ...grpc.CallOption) (*ServiceRestartReply, error) + Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartReply, error) + Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopReply, error) +} + +type initClient struct { + cc *grpc.ClientConn +} + +func NewInitClient(cc *grpc.ClientConn) InitClient { + return &initClient{cc} +} + +func (c *initClient) CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Init_CopyOutClient, error) { + stream, err := c.cc.NewStream(ctx, &_Init_serviceDesc.Streams[0], "/proto.Init/CopyOut", opts...) + if err != nil { + return nil, err + } + x := &initCopyOutClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Init_CopyOutClient interface { + Recv() (*StreamingData, error) + grpc.ClientStream +} + +type initCopyOutClient struct { + grpc.ClientStream +} + +func (x *initCopyOutClient) Recv() (*StreamingData, error) { + m := new(StreamingData) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *initClient) DF(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DFReply, error) { + out := new(DFReply) + err := c.cc.Invoke(ctx, "/proto.Init/DF", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Init_LSClient, error) { + stream, err := c.cc.NewStream(ctx, &_Init_serviceDesc.Streams[1], "/proto.Init/LS", opts...) + if err != nil { + return nil, err + } + x := &initLSClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Init_LSClient interface { + Recv() (*FileInfo, error) + grpc.ClientStream +} + +type initLSClient struct { + grpc.ClientStream +} + +func (x *initLSClient) Recv() (*FileInfo, error) { + m := new(FileInfo) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *initClient) Reboot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RebootReply, error) { + out := new(RebootReply) + err := c.cc.Invoke(ctx, "/proto.Init/Reboot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) Reset(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ResetReply, error) { + out := new(ResetReply) + err := c.cc.Invoke(ctx, "/proto.Init/Reset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) Shutdown(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ShutdownReply, error) { + out := new(ShutdownReply) + err := c.cc.Invoke(ctx, "/proto.Init/Shutdown", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeReply, error) { + out := new(UpgradeReply) + err := c.cc.Invoke(ctx, "/proto.Init/Upgrade", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) ServiceList(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServiceListReply, error) { + out := new(ServiceListReply) + err := c.cc.Invoke(ctx, "/proto.Init/ServiceList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) ServiceStart(ctx context.Context, in *ServiceStartRequest, opts ...grpc.CallOption) (*ServiceStartReply, error) { + out := new(ServiceStartReply) + err := c.cc.Invoke(ctx, "/proto.Init/ServiceStart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) ServiceStop(ctx context.Context, in *ServiceStopRequest, opts ...grpc.CallOption) (*ServiceStopReply, error) { + out := new(ServiceStopReply) + err := c.cc.Invoke(ctx, "/proto.Init/ServiceStop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *initClient) ServiceRestart(ctx context.Context, in *ServiceRestartRequest, opts ...grpc.CallOption) (*ServiceRestartReply, error) { + out := new(ServiceRestartReply) + err := c.cc.Invoke(ctx, "/proto.Init/ServiceRestart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *initClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartReply, error) { + out := new(StartReply) + err := c.cc.Invoke(ctx, "/proto.Init/Start", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *initClient) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopReply, error) { + out := new(StopReply) + err := c.cc.Invoke(ctx, "/proto.Init/Stop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InitServer is the server API for Init service. +type InitServer interface { + CopyOut(*CopyOutRequest, Init_CopyOutServer) error + DF(context.Context, *empty.Empty) (*DFReply, error) + LS(*LSRequest, Init_LSServer) error + Reboot(context.Context, *empty.Empty) (*RebootReply, error) + Reset(context.Context, *empty.Empty) (*ResetReply, error) + Shutdown(context.Context, *empty.Empty) (*ShutdownReply, error) + Upgrade(context.Context, *UpgradeRequest) (*UpgradeReply, error) + ServiceList(context.Context, *empty.Empty) (*ServiceListReply, error) + ServiceStart(context.Context, *ServiceStartRequest) (*ServiceStartReply, error) + ServiceStop(context.Context, *ServiceStopRequest) (*ServiceStopReply, error) + ServiceRestart(context.Context, *ServiceRestartRequest) (*ServiceRestartReply, error) + Start(context.Context, *StartRequest) (*StartReply, error) + Stop(context.Context, *StopRequest) (*StopReply, error) +} + +func RegisterInitServer(s *grpc.Server, srv InitServer) { + s.RegisterService(&_Init_serviceDesc, srv) +} + +func _Init_CopyOut_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(CopyOutRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(InitServer).CopyOut(m, &initCopyOutServer{stream}) +} + +type Init_CopyOutServer interface { + Send(*StreamingData) error + grpc.ServerStream +} + +type initCopyOutServer struct { + grpc.ServerStream +} + +func (x *initCopyOutServer) Send(m *StreamingData) error { + return x.ServerStream.SendMsg(m) +} + +func _Init_DF_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).DF(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/DF", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).DF(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_LS_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(LSRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(InitServer).LS(m, &initLSServer{stream}) +} + +type Init_LSServer interface { + Send(*FileInfo) error + grpc.ServerStream +} + +type initLSServer struct { + grpc.ServerStream +} + +func (x *initLSServer) Send(m *FileInfo) error { + return x.ServerStream.SendMsg(m) +} + +func _Init_Reboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Reboot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Reboot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Reboot(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Reset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Reset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Reset(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Shutdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Shutdown", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Shutdown(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_Upgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpgradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Upgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Upgrade", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Upgrade(ctx, req.(*UpgradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_ServiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).ServiceList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/ServiceList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).ServiceList(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_ServiceStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ServiceStartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).ServiceStart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/ServiceStart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).ServiceStart(ctx, req.(*ServiceStartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_ServiceStop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ServiceStopRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).ServiceStop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/ServiceStop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).ServiceStop(ctx, req.(*ServiceStopRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_ServiceRestart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ServiceRestartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).ServiceRestart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/ServiceRestart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).ServiceRestart(ctx, req.(*ServiceRestartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Start", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Start(ctx, req.(*StartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Init_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InitServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Init/Stop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InitServer).Stop(ctx, req.(*StopRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Init_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Init", + HandlerType: (*InitServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DF", + Handler: _Init_DF_Handler, + }, + { + MethodName: "Reboot", + Handler: _Init_Reboot_Handler, + }, + { + MethodName: "Reset", + Handler: _Init_Reset_Handler, + }, + { + MethodName: "Shutdown", + Handler: _Init_Shutdown_Handler, + }, + { + MethodName: "Upgrade", + Handler: _Init_Upgrade_Handler, + }, + { + MethodName: "ServiceList", + Handler: _Init_ServiceList_Handler, + }, + { + MethodName: "ServiceStart", + Handler: _Init_ServiceStart_Handler, + }, + { + MethodName: "ServiceStop", + Handler: _Init_ServiceStop_Handler, + }, + { + MethodName: "ServiceRestart", + Handler: _Init_ServiceRestart_Handler, + }, + { + MethodName: "Start", + Handler: _Init_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _Init_Stop_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "CopyOut", + Handler: _Init_CopyOut_Handler, + ServerStreams: true, + }, + { + StreamName: "LS", + Handler: _Init_LS_Handler, + ServerStreams: true, + }, + }, + Metadata: "api.proto", +} diff --git a/internal/app/machined/proto/api.proto b/api/machine/api.proto similarity index 100% rename from internal/app/machined/proto/api.proto rename to api/machine/api.proto diff --git a/api/network/api.pb.go b/api/network/api.pb.go new file mode 100644 index 000000000..e4171f752 --- /dev/null +++ b/api/network/api.pb.go @@ -0,0 +1,617 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type AddressFamily int32 + +const ( + AddressFamily_AF_UNSPEC AddressFamily = 0 + AddressFamily_AF_INET AddressFamily = 2 + AddressFamily_IPV4 AddressFamily = 2 + AddressFamily_AF_INET6 AddressFamily = 10 + AddressFamily_IPV6 AddressFamily = 10 +) + +var AddressFamily_name = map[int32]string{ + 0: "AF_UNSPEC", + 2: "AF_INET", + // Duplicate value: 2: "IPV4", + 10: "AF_INET6", + // Duplicate value: 10: "IPV6", +} + +var AddressFamily_value = map[string]int32{ + "AF_UNSPEC": 0, + "AF_INET": 2, + "IPV4": 2, + "AF_INET6": 10, + "IPV6": 10, +} + +func (x AddressFamily) String() string { + return proto.EnumName(AddressFamily_name, int32(x)) +} + +func (AddressFamily) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +type RouteProtocol int32 + +const ( + RouteProtocol_RTPROT_UNSPEC RouteProtocol = 0 + RouteProtocol_RTPROT_REDIRECT RouteProtocol = 1 + RouteProtocol_RTPROT_KERNEL RouteProtocol = 2 + RouteProtocol_RTPROT_BOOT RouteProtocol = 3 + RouteProtocol_RTPROT_STATIC RouteProtocol = 4 + RouteProtocol_RTPROT_GATED RouteProtocol = 8 + RouteProtocol_RTPROT_RA RouteProtocol = 9 + RouteProtocol_RTPROT_MRT RouteProtocol = 10 + RouteProtocol_RTPROT_ZEBRA RouteProtocol = 11 + RouteProtocol_RTPROT_BIRD RouteProtocol = 12 + RouteProtocol_RTPROT_DNROUTED RouteProtocol = 13 + RouteProtocol_RTPROT_XORP RouteProtocol = 14 + RouteProtocol_RTPROT_NTK RouteProtocol = 15 + RouteProtocol_RTPROT_DHCP RouteProtocol = 16 + RouteProtocol_RTPROT_MROUTED RouteProtocol = 17 + RouteProtocol_RTPROT_BABEL RouteProtocol = 42 +) + +var RouteProtocol_name = map[int32]string{ + 0: "RTPROT_UNSPEC", + 1: "RTPROT_REDIRECT", + 2: "RTPROT_KERNEL", + 3: "RTPROT_BOOT", + 4: "RTPROT_STATIC", + 8: "RTPROT_GATED", + 9: "RTPROT_RA", + 10: "RTPROT_MRT", + 11: "RTPROT_ZEBRA", + 12: "RTPROT_BIRD", + 13: "RTPROT_DNROUTED", + 14: "RTPROT_XORP", + 15: "RTPROT_NTK", + 16: "RTPROT_DHCP", + 17: "RTPROT_MROUTED", + 42: "RTPROT_BABEL", +} + +var RouteProtocol_value = map[string]int32{ + "RTPROT_UNSPEC": 0, + "RTPROT_REDIRECT": 1, + "RTPROT_KERNEL": 2, + "RTPROT_BOOT": 3, + "RTPROT_STATIC": 4, + "RTPROT_GATED": 8, + "RTPROT_RA": 9, + "RTPROT_MRT": 10, + "RTPROT_ZEBRA": 11, + "RTPROT_BIRD": 12, + "RTPROT_DNROUTED": 13, + "RTPROT_XORP": 14, + "RTPROT_NTK": 15, + "RTPROT_DHCP": 16, + "RTPROT_MROUTED": 17, + "RTPROT_BABEL": 42, +} + +func (x RouteProtocol) String() string { + return proto.EnumName(RouteProtocol_name, int32(x)) +} + +func (RouteProtocol) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +type InterfaceFlags int32 + +const ( + InterfaceFlags_FLAG_UNKNOWN InterfaceFlags = 0 + InterfaceFlags_FLAG_UP InterfaceFlags = 1 + InterfaceFlags_FLAG_BROADCAST InterfaceFlags = 2 + InterfaceFlags_FLAG_LOOPBACK InterfaceFlags = 3 + InterfaceFlags_FLAG_POINT_TO_POINT InterfaceFlags = 4 + InterfaceFlags_FLAG_MULTICAST InterfaceFlags = 5 +) + +var InterfaceFlags_name = map[int32]string{ + 0: "FLAG_UNKNOWN", + 1: "FLAG_UP", + 2: "FLAG_BROADCAST", + 3: "FLAG_LOOPBACK", + 4: "FLAG_POINT_TO_POINT", + 5: "FLAG_MULTICAST", +} + +var InterfaceFlags_value = map[string]int32{ + "FLAG_UNKNOWN": 0, + "FLAG_UP": 1, + "FLAG_BROADCAST": 2, + "FLAG_LOOPBACK": 3, + "FLAG_POINT_TO_POINT": 4, + "FLAG_MULTICAST": 5, +} + +func (x InterfaceFlags) String() string { + return proto.EnumName(InterfaceFlags_name, int32(x)) +} + +func (InterfaceFlags) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +// The response message containing the routes. +type RoutesReply struct { + Routes []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RoutesReply) Reset() { *m = RoutesReply{} } +func (m *RoutesReply) String() string { return proto.CompactTextString(m) } +func (*RoutesReply) ProtoMessage() {} +func (*RoutesReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *RoutesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RoutesReply.Unmarshal(m, b) +} + +func (m *RoutesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RoutesReply.Marshal(b, m, deterministic) +} + +func (m *RoutesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_RoutesReply.Merge(m, src) +} + +func (m *RoutesReply) XXX_Size() int { + return xxx_messageInfo_RoutesReply.Size(m) +} + +func (m *RoutesReply) XXX_DiscardUnknown() { + xxx_messageInfo_RoutesReply.DiscardUnknown(m) +} + +var xxx_messageInfo_RoutesReply proto.InternalMessageInfo + +func (m *RoutesReply) GetRoutes() []*Route { + if m != nil { + return m.Routes + } + return nil +} + +// The response message containing a route. +type Route struct { + // Interface is the interface over which traffic to this destination should be sent + Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + // Destination is the network prefix CIDR which this route provides + Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` + // Gateway is the gateway address to which traffic to this destination should be sent + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + // Metric is the priority of the route, where lower metrics have higher priorities + Metric uint32 `protobuf:"varint,4,opt,name=metric,proto3" json:"metric,omitempty"` + // Scope desribes the scope of this route + Scope uint32 `protobuf:"varint,5,opt,name=scope,proto3" json:"scope,omitempty"` + // Source is the source prefix CIDR for the route, if one is defined + Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` + // Family is the address family of the route. Currently, the only options are AF_INET (IPV4) and AF_INET6 (IPV6). + Family AddressFamily `protobuf:"varint,7,opt,name=family,proto3,enum=proto.AddressFamily" json:"family,omitempty"` + // Protocol is the protocol by which this route came to be in place + Protocol RouteProtocol `protobuf:"varint,8,opt,name=protocol,proto3,enum=proto.RouteProtocol" json:"protocol,omitempty"` + // Flags indicate any special flags on the route + Flags uint32 `protobuf:"varint,9,opt,name=flags,proto3" json:"flags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Route) Reset() { *m = Route{} } +func (m *Route) String() string { return proto.CompactTextString(m) } +func (*Route) ProtoMessage() {} +func (*Route) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *Route) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Route.Unmarshal(m, b) +} + +func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Route.Marshal(b, m, deterministic) +} + +func (m *Route) XXX_Merge(src proto.Message) { + xxx_messageInfo_Route.Merge(m, src) +} + +func (m *Route) XXX_Size() int { + return xxx_messageInfo_Route.Size(m) +} + +func (m *Route) XXX_DiscardUnknown() { + xxx_messageInfo_Route.DiscardUnknown(m) +} + +var xxx_messageInfo_Route proto.InternalMessageInfo + +func (m *Route) GetInterface() string { + if m != nil { + return m.Interface + } + return "" +} + +func (m *Route) GetDestination() string { + if m != nil { + return m.Destination + } + return "" +} + +func (m *Route) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *Route) GetMetric() uint32 { + if m != nil { + return m.Metric + } + return 0 +} + +func (m *Route) GetScope() uint32 { + if m != nil { + return m.Scope + } + return 0 +} + +func (m *Route) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *Route) GetFamily() AddressFamily { + if m != nil { + return m.Family + } + return AddressFamily_AF_UNSPEC +} + +func (m *Route) GetProtocol() RouteProtocol { + if m != nil { + return m.Protocol + } + return RouteProtocol_RTPROT_UNSPEC +} + +func (m *Route) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +type InterfacesReply struct { + Interfaces []*Interface `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InterfacesReply) Reset() { *m = InterfacesReply{} } +func (m *InterfacesReply) String() string { return proto.CompactTextString(m) } +func (*InterfacesReply) ProtoMessage() {} +func (*InterfacesReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *InterfacesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InterfacesReply.Unmarshal(m, b) +} + +func (m *InterfacesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InterfacesReply.Marshal(b, m, deterministic) +} + +func (m *InterfacesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfacesReply.Merge(m, src) +} + +func (m *InterfacesReply) XXX_Size() int { + return xxx_messageInfo_InterfacesReply.Size(m) +} + +func (m *InterfacesReply) XXX_DiscardUnknown() { + xxx_messageInfo_InterfacesReply.DiscardUnknown(m) +} + +var xxx_messageInfo_InterfacesReply proto.InternalMessageInfo + +func (m *InterfacesReply) GetInterfaces() []*Interface { + if m != nil { + return m.Interfaces + } + return nil +} + +// Interface represents a net.Interface +type Interface struct { + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Mtu uint32 `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Hardwareaddr string `protobuf:"bytes,4,opt,name=hardwareaddr,proto3" json:"hardwareaddr,omitempty"` + Flags InterfaceFlags `protobuf:"varint,5,opt,name=flags,proto3,enum=proto.InterfaceFlags" json:"flags,omitempty"` + Ipaddress []string `protobuf:"bytes,6,rep,name=ipaddress,proto3" json:"ipaddress,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Interface) Reset() { *m = Interface{} } +func (m *Interface) String() string { return proto.CompactTextString(m) } +func (*Interface) ProtoMessage() {} +func (*Interface) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *Interface) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Interface.Unmarshal(m, b) +} + +func (m *Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Interface.Marshal(b, m, deterministic) +} + +func (m *Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_Interface.Merge(m, src) +} + +func (m *Interface) XXX_Size() int { + return xxx_messageInfo_Interface.Size(m) +} + +func (m *Interface) XXX_DiscardUnknown() { + xxx_messageInfo_Interface.DiscardUnknown(m) +} + +var xxx_messageInfo_Interface proto.InternalMessageInfo + +func (m *Interface) GetIndex() uint32 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *Interface) GetMtu() uint32 { + if m != nil { + return m.Mtu + } + return 0 +} + +func (m *Interface) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Interface) GetHardwareaddr() string { + if m != nil { + return m.Hardwareaddr + } + return "" +} + +func (m *Interface) GetFlags() InterfaceFlags { + if m != nil { + return m.Flags + } + return InterfaceFlags_FLAG_UNKNOWN +} + +func (m *Interface) GetIpaddress() []string { + if m != nil { + return m.Ipaddress + } + return nil +} + +func init() { + proto.RegisterEnum("proto.AddressFamily", AddressFamily_name, AddressFamily_value) + proto.RegisterEnum("proto.RouteProtocol", RouteProtocol_name, RouteProtocol_value) + proto.RegisterEnum("proto.InterfaceFlags", InterfaceFlags_name, InterfaceFlags_value) + proto.RegisterType((*RoutesReply)(nil), "proto.RoutesReply") + proto.RegisterType((*Route)(nil), "proto.Route") + proto.RegisterType((*InterfacesReply)(nil), "proto.InterfacesReply") + proto.RegisterType((*Interface)(nil), "proto.Interface") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4f, 0x6f, 0xda, 0x4e, + 0x10, 0xfd, 0x99, 0x7f, 0xc1, 0x03, 0x86, 0xcd, 0x26, 0xbf, 0xd4, 0x4a, 0xab, 0x0a, 0xa1, 0x1e, + 0x10, 0xad, 0x48, 0x94, 0x44, 0x39, 0xf5, 0x62, 0x83, 0x49, 0x2d, 0x88, 0xed, 0x6e, 0x4c, 0x5b, + 0xe5, 0x82, 0x1c, 0xbc, 0x50, 0xab, 0x80, 0x91, 0x31, 0x4a, 0xb9, 0xf4, 0xd2, 0xcf, 0xd1, 0xcf, + 0xd0, 0x5b, 0x3f, 0x5f, 0xe5, 0xdd, 0x35, 0x31, 0x91, 0x7a, 0xf2, 0xbe, 0x37, 0x6f, 0x67, 0x77, + 0xde, 0x78, 0x07, 0x64, 0x6f, 0x15, 0x74, 0x56, 0x51, 0x18, 0x87, 0xb8, 0xc8, 0x3e, 0xa7, 0x2f, + 0x67, 0x61, 0x38, 0x9b, 0xd3, 0x33, 0x86, 0x1e, 0x36, 0xd3, 0x33, 0xba, 0x58, 0xc5, 0x5b, 0xae, + 0x69, 0x5e, 0x42, 0x85, 0x84, 0x9b, 0x98, 0xae, 0x09, 0x5d, 0xcd, 0xb7, 0xf8, 0x0d, 0x94, 0x22, + 0x06, 0x55, 0xa9, 0x91, 0x6f, 0x55, 0x2e, 0xaa, 0x5c, 0xd6, 0x61, 0x1a, 0x22, 0x62, 0xcd, 0x5f, + 0x39, 0x28, 0x32, 0x06, 0xbf, 0x02, 0x39, 0x58, 0xc6, 0x34, 0x9a, 0x7a, 0x13, 0xaa, 0x4a, 0x0d, + 0xa9, 0x25, 0x93, 0x27, 0x02, 0x37, 0xa0, 0xe2, 0xd3, 0x75, 0x1c, 0x2c, 0xbd, 0x38, 0x08, 0x97, + 0x6a, 0x8e, 0xc5, 0xb3, 0x14, 0x56, 0xe1, 0x60, 0xe6, 0xc5, 0xf4, 0xd1, 0xdb, 0xaa, 0x79, 0x16, + 0x4d, 0x21, 0x3e, 0x81, 0xd2, 0x82, 0xc6, 0x51, 0x30, 0x51, 0x0b, 0x0d, 0xa9, 0xa5, 0x10, 0x81, + 0xf0, 0x31, 0x14, 0xd7, 0x93, 0x70, 0x45, 0xd5, 0x22, 0xa3, 0x39, 0x48, 0xd4, 0xeb, 0x70, 0x13, + 0x4d, 0xa8, 0x5a, 0x62, 0x69, 0x04, 0xc2, 0xef, 0xa0, 0x34, 0xf5, 0x16, 0xc1, 0x7c, 0xab, 0x1e, + 0x34, 0xa4, 0x56, 0xed, 0xe2, 0x58, 0xd4, 0xa3, 0xf9, 0x7e, 0x44, 0xd7, 0xeb, 0x3e, 0x8b, 0x11, + 0xa1, 0xc1, 0xe7, 0x50, 0x66, 0xe1, 0x49, 0x38, 0x57, 0xcb, 0x7b, 0x7a, 0x56, 0xad, 0x23, 0x62, + 0x64, 0xa7, 0x4a, 0x6e, 0x33, 0x9d, 0x7b, 0xb3, 0xb5, 0x2a, 0xf3, 0xdb, 0x30, 0xd0, 0xec, 0x42, + 0xdd, 0x4c, 0x4d, 0x10, 0xc6, 0x9e, 0x03, 0xec, 0x7c, 0x49, 0xcd, 0x45, 0x22, 0xf9, 0x4e, 0x4b, + 0x32, 0x9a, 0xe6, 0x1f, 0x09, 0xe4, 0x5d, 0x24, 0x39, 0x28, 0x58, 0xfa, 0xf4, 0x3b, 0x33, 0x59, + 0x21, 0x1c, 0x60, 0x04, 0xf9, 0x45, 0xbc, 0x61, 0xc6, 0x2a, 0x24, 0x59, 0x62, 0x0c, 0x85, 0xa5, + 0xb7, 0xa0, 0xc2, 0x4d, 0xb6, 0xc6, 0x4d, 0xa8, 0x7e, 0xf5, 0x22, 0xff, 0xd1, 0x8b, 0xa8, 0xe7, + 0xfb, 0x11, 0x33, 0x54, 0x26, 0x7b, 0x1c, 0x7e, 0x9b, 0x16, 0x52, 0x64, 0x75, 0xff, 0xff, 0xfc, + 0x6a, 0xfd, 0x24, 0x28, 0xea, 0x63, 0x5d, 0x5f, 0x79, 0xdc, 0x42, 0xb5, 0xd4, 0xc8, 0xb3, 0xae, + 0xa7, 0x44, 0xfb, 0x23, 0x28, 0x7b, 0xf6, 0x62, 0x05, 0x64, 0xad, 0x3f, 0x1e, 0x59, 0x77, 0x8e, + 0xd1, 0x45, 0xff, 0xe1, 0x0a, 0x1c, 0x68, 0xfd, 0xb1, 0x69, 0x19, 0x2e, 0xca, 0xe1, 0x32, 0x14, + 0x4c, 0xe7, 0xd3, 0x15, 0xca, 0xe1, 0x2a, 0x94, 0x05, 0x7d, 0x8d, 0x40, 0xf0, 0xd7, 0x08, 0x4e, + 0x73, 0x48, 0x6a, 0xff, 0xce, 0x81, 0xb2, 0xd7, 0x02, 0x7c, 0x08, 0x0a, 0x71, 0x1d, 0x62, 0xbb, + 0x4f, 0x79, 0x8f, 0xa0, 0x2e, 0x28, 0x62, 0xf4, 0x4c, 0x62, 0x74, 0x5d, 0x24, 0x65, 0x74, 0x03, + 0x83, 0x58, 0xc6, 0x10, 0xe5, 0x70, 0x1d, 0x2a, 0x82, 0xd2, 0x6d, 0xdb, 0x45, 0xf9, 0x8c, 0xe6, + 0xce, 0xd5, 0x5c, 0xb3, 0x8b, 0x0a, 0x18, 0x41, 0x55, 0x50, 0x37, 0x9a, 0x6b, 0xf4, 0x50, 0x39, + 0x29, 0x22, 0xcd, 0xae, 0x21, 0x19, 0xd7, 0x00, 0x04, 0xbc, 0x25, 0x2e, 0x82, 0xcc, 0x86, 0x7b, + 0x43, 0x27, 0x1a, 0xaa, 0x64, 0x8f, 0x31, 0x49, 0x0f, 0x55, 0x33, 0xf7, 0xeb, 0x59, 0xc4, 0x1e, + 0x25, 0x69, 0x95, 0x8c, 0xea, 0x8b, 0x4d, 0x1c, 0x54, 0xcb, 0x24, 0xb6, 0xdc, 0x01, 0xaa, 0x67, + 0x04, 0xbd, 0x0f, 0x5d, 0x07, 0x21, 0x8c, 0xa1, 0xb6, 0x3b, 0x99, 0x67, 0x39, 0xcc, 0x9c, 0xae, + 0x6b, 0xba, 0x31, 0x44, 0xed, 0xf6, 0x4f, 0x09, 0x6a, 0xfb, 0xcd, 0x4b, 0x44, 0xfd, 0xa1, 0x76, + 0x33, 0x1e, 0x59, 0x03, 0xcb, 0xfe, 0x6c, 0xf1, 0x4e, 0x70, 0xc6, 0x41, 0x52, 0x92, 0x97, 0x01, + 0x9d, 0xd8, 0x5a, 0xaf, 0xab, 0xdd, 0x25, 0xdd, 0x39, 0x04, 0x85, 0x71, 0x43, 0xdb, 0x76, 0x74, + 0xad, 0x3b, 0x40, 0x79, 0xfc, 0x02, 0x8e, 0x18, 0xe5, 0xd8, 0xa6, 0xe5, 0x8e, 0x5d, 0x9b, 0x2f, + 0x50, 0x61, 0xb7, 0xff, 0x76, 0x34, 0x74, 0x4d, 0xb6, 0xbf, 0x78, 0xf1, 0x03, 0xca, 0x16, 0x8d, + 0x1f, 0xc3, 0xe8, 0x9b, 0x8f, 0xaf, 0xa0, 0xc4, 0x27, 0x0d, 0x3e, 0xe9, 0xf0, 0x89, 0xd4, 0x49, + 0x27, 0x52, 0xc7, 0x48, 0x26, 0xd2, 0x29, 0xce, 0x3e, 0x36, 0xf1, 0x6e, 0xde, 0x03, 0x3c, 0x3d, + 0xa5, 0x7f, 0xee, 0x3c, 0x79, 0xfe, 0xbb, 0xf2, 0xdd, 0xfa, 0x6b, 0x90, 0x27, 0xe1, 0x82, 0x07, + 0xf5, 0xb2, 0xb6, 0x0a, 0xd8, 0xff, 0xe3, 0x48, 0xf7, 0x7c, 0x34, 0x3e, 0x94, 0xd8, 0xe7, 0xf2, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xb7, 0x4b, 0x85, 0x35, 0x05, 0x00, 0x00, +} + +// 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 + +// NetworkdClient is the client API for Networkd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NetworkdClient interface { + Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) + Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) +} + +type networkdClient struct { + cc *grpc.ClientConn +} + +func NewNetworkdClient(cc *grpc.ClientConn) NetworkdClient { + return &networkdClient{cc} +} + +func (c *networkdClient) Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) { + out := new(RoutesReply) + err := c.cc.Invoke(ctx, "/proto.Networkd/Routes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkdClient) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) { + out := new(InterfacesReply) + err := c.cc.Invoke(ctx, "/proto.Networkd/Interfaces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetworkdServer is the server API for Networkd service. +type NetworkdServer interface { + Routes(context.Context, *empty.Empty) (*RoutesReply, error) + Interfaces(context.Context, *empty.Empty) (*InterfacesReply, error) +} + +func RegisterNetworkdServer(s *grpc.Server, srv NetworkdServer) { + s.RegisterService(&_Networkd_serviceDesc, srv) +} + +func _Networkd_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkdServer).Routes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Networkd/Routes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkdServer).Routes(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Networkd_Interfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkdServer).Interfaces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Networkd/Interfaces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkdServer).Interfaces(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _Networkd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Networkd", + HandlerType: (*NetworkdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Routes", + Handler: _Networkd_Routes_Handler, + }, + { + MethodName: "Interfaces", + Handler: _Networkd_Interfaces_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/networkd/proto/api.proto b/api/network/api.proto similarity index 100% rename from internal/app/networkd/proto/api.proto rename to api/network/api.proto diff --git a/api/os/api.pb.go b/api/os/api.pb.go new file mode 100644 index 000000000..389ce142a --- /dev/null +++ b/api/os/api.pb.go @@ -0,0 +1,1136 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type ContainerDriver int32 + +const ( + ContainerDriver_CONTAINERD ContainerDriver = 0 + ContainerDriver_CRI ContainerDriver = 1 +) + +var ContainerDriver_name = map[int32]string{ + 0: "CONTAINERD", + 1: "CRI", +} + +var ContainerDriver_value = map[string]int32{ + "CONTAINERD": 0, + "CRI": 1, +} + +func (x ContainerDriver) String() string { + return proto.EnumName(ContainerDriver_name, int32(x)) +} + +func (ContainerDriver) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +// The request message containing the containerd namespace. +type ProcessesRequest struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + // driver might be default "containerd" or "cri" + Driver ContainerDriver `protobuf:"varint,2,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} } +func (m *ProcessesRequest) String() string { return proto.CompactTextString(m) } +func (*ProcessesRequest) ProtoMessage() {} +func (*ProcessesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *ProcessesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessesRequest.Unmarshal(m, b) +} + +func (m *ProcessesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessesRequest.Marshal(b, m, deterministic) +} + +func (m *ProcessesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessesRequest.Merge(m, src) +} + +func (m *ProcessesRequest) XXX_Size() int { + return xxx_messageInfo_ProcessesRequest.Size(m) +} + +func (m *ProcessesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessesRequest proto.InternalMessageInfo + +func (m *ProcessesRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *ProcessesRequest) GetDriver() ContainerDriver { + if m != nil { + return m.Driver + } + return ContainerDriver_CONTAINERD +} + +// The response message containing the requested processes. +type ProcessesReply struct { + Processes []*Process `protobuf:"bytes,1,rep,name=processes,proto3" json:"processes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessesReply) Reset() { *m = ProcessesReply{} } +func (m *ProcessesReply) String() string { return proto.CompactTextString(m) } +func (*ProcessesReply) ProtoMessage() {} +func (*ProcessesReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *ProcessesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessesReply.Unmarshal(m, b) +} + +func (m *ProcessesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessesReply.Marshal(b, m, deterministic) +} + +func (m *ProcessesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessesReply.Merge(m, src) +} + +func (m *ProcessesReply) XXX_Size() int { + return xxx_messageInfo_ProcessesReply.Size(m) +} + +func (m *ProcessesReply) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessesReply.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessesReply proto.InternalMessageInfo + +func (m *ProcessesReply) GetProcesses() []*Process { + if m != nil { + return m.Processes + } + return nil +} + +// The response message containing the requested processes. +type Process struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` + Pid uint32 `protobuf:"varint,4,opt,name=pid,proto3" json:"pid,omitempty"` + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + PodId string `protobuf:"bytes,6,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"` + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Process) Reset() { *m = Process{} } +func (m *Process) String() string { return proto.CompactTextString(m) } +func (*Process) ProtoMessage() {} +func (*Process) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *Process) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Process.Unmarshal(m, b) +} + +func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Process.Marshal(b, m, deterministic) +} + +func (m *Process) XXX_Merge(src proto.Message) { + xxx_messageInfo_Process.Merge(m, src) +} + +func (m *Process) XXX_Size() int { + return xxx_messageInfo_Process.Size(m) +} + +func (m *Process) XXX_DiscardUnknown() { + xxx_messageInfo_Process.DiscardUnknown(m) +} + +var xxx_messageInfo_Process proto.InternalMessageInfo + +func (m *Process) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *Process) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Process) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *Process) GetPid() uint32 { + if m != nil { + return m.Pid + } + return 0 +} + +func (m *Process) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *Process) GetPodId() string { + if m != nil { + return m.PodId + } + return "" +} + +func (m *Process) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message containing the containerd namespace. +type StatsRequest struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + // driver might be default "containerd" or "cri" + Driver ContainerDriver `protobuf:"varint,2,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StatsRequest) Reset() { *m = StatsRequest{} } +func (m *StatsRequest) String() string { return proto.CompactTextString(m) } +func (*StatsRequest) ProtoMessage() {} +func (*StatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *StatsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StatsRequest.Unmarshal(m, b) +} + +func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic) +} + +func (m *StatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatsRequest.Merge(m, src) +} + +func (m *StatsRequest) XXX_Size() int { + return xxx_messageInfo_StatsRequest.Size(m) +} + +func (m *StatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatsRequest proto.InternalMessageInfo + +func (m *StatsRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *StatsRequest) GetDriver() ContainerDriver { + if m != nil { + return m.Driver + } + return ContainerDriver_CONTAINERD +} + +// The response message containing the requested stats. +type StatsReply struct { + Stats []*Stat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StatsReply) Reset() { *m = StatsReply{} } +func (m *StatsReply) String() string { return proto.CompactTextString(m) } +func (*StatsReply) ProtoMessage() {} +func (*StatsReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{4} +} + +func (m *StatsReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StatsReply.Unmarshal(m, b) +} + +func (m *StatsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StatsReply.Marshal(b, m, deterministic) +} + +func (m *StatsReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatsReply.Merge(m, src) +} + +func (m *StatsReply) XXX_Size() int { + return xxx_messageInfo_StatsReply.Size(m) +} + +func (m *StatsReply) XXX_DiscardUnknown() { + xxx_messageInfo_StatsReply.DiscardUnknown(m) +} + +var xxx_messageInfo_StatsReply proto.InternalMessageInfo + +func (m *StatsReply) GetStats() []*Stat { + if m != nil { + return m.Stats + } + return nil +} + +// The response message containing the requested stat. +type Stat struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + MemoryUsage uint64 `protobuf:"varint,4,opt,name=memory_usage,json=memoryUsage,proto3" json:"memory_usage,omitempty"` + CpuUsage uint64 `protobuf:"varint,5,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"` + PodId string `protobuf:"bytes,6,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"` + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Stat) Reset() { *m = Stat{} } +func (m *Stat) String() string { return proto.CompactTextString(m) } +func (*Stat) ProtoMessage() {} +func (*Stat) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{5} +} + +func (m *Stat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Stat.Unmarshal(m, b) +} + +func (m *Stat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Stat.Marshal(b, m, deterministic) +} + +func (m *Stat) XXX_Merge(src proto.Message) { + xxx_messageInfo_Stat.Merge(m, src) +} + +func (m *Stat) XXX_Size() int { + return xxx_messageInfo_Stat.Size(m) +} + +func (m *Stat) XXX_DiscardUnknown() { + xxx_messageInfo_Stat.DiscardUnknown(m) +} + +var xxx_messageInfo_Stat proto.InternalMessageInfo + +func (m *Stat) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *Stat) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Stat) GetMemoryUsage() uint64 { + if m != nil { + return m.MemoryUsage + } + return 0 +} + +func (m *Stat) GetCpuUsage() uint64 { + if m != nil { + return m.CpuUsage + } + return 0 +} + +func (m *Stat) GetPodId() string { + if m != nil { + return m.PodId + } + return "" +} + +func (m *Stat) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message containing the process to restart. +type RestartRequest struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // driver might be default "containerd" or "cri" + Driver ContainerDriver `protobuf:"varint,3,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RestartRequest) Reset() { *m = RestartRequest{} } +func (m *RestartRequest) String() string { return proto.CompactTextString(m) } +func (*RestartRequest) ProtoMessage() {} +func (*RestartRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{6} +} + +func (m *RestartRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RestartRequest.Unmarshal(m, b) +} + +func (m *RestartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RestartRequest.Marshal(b, m, deterministic) +} + +func (m *RestartRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RestartRequest.Merge(m, src) +} + +func (m *RestartRequest) XXX_Size() int { + return xxx_messageInfo_RestartRequest.Size(m) +} + +func (m *RestartRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RestartRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RestartRequest proto.InternalMessageInfo + +func (m *RestartRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *RestartRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *RestartRequest) GetDriver() ContainerDriver { + if m != nil { + return m.Driver + } + return ContainerDriver_CONTAINERD +} + +// The response message containing the restart status. +type RestartReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RestartReply) Reset() { *m = RestartReply{} } +func (m *RestartReply) String() string { return proto.CompactTextString(m) } +func (*RestartReply) ProtoMessage() {} +func (*RestartReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{7} +} + +func (m *RestartReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RestartReply.Unmarshal(m, b) +} + +func (m *RestartReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RestartReply.Marshal(b, m, deterministic) +} + +func (m *RestartReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_RestartReply.Merge(m, src) +} + +func (m *RestartReply) XXX_Size() int { + return xxx_messageInfo_RestartReply.Size(m) +} + +func (m *RestartReply) XXX_DiscardUnknown() { + xxx_messageInfo_RestartReply.DiscardUnknown(m) +} + +var xxx_messageInfo_RestartReply proto.InternalMessageInfo + +// The request message containing the process name. +type LogsRequest struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // driver might be default "containerd" or "cri" + Driver ContainerDriver `protobuf:"varint,3,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogsRequest) Reset() { *m = LogsRequest{} } +func (m *LogsRequest) String() string { return proto.CompactTextString(m) } +func (*LogsRequest) ProtoMessage() {} +func (*LogsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{8} +} + +func (m *LogsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogsRequest.Unmarshal(m, b) +} + +func (m *LogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogsRequest.Marshal(b, m, deterministic) +} + +func (m *LogsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogsRequest.Merge(m, src) +} + +func (m *LogsRequest) XXX_Size() int { + return xxx_messageInfo_LogsRequest.Size(m) +} + +func (m *LogsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LogsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LogsRequest proto.InternalMessageInfo + +func (m *LogsRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *LogsRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *LogsRequest) GetDriver() ContainerDriver { + if m != nil { + return m.Driver + } + return ContainerDriver_CONTAINERD +} + +// The response message containing the requested logs. +type Data struct { + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{9} +} + +func (m *Data) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Data.Unmarshal(m, b) +} + +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) +} + +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} + +func (m *Data) XXX_Size() int { + return xxx_messageInfo_Data.Size(m) +} + +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +func (m *Data) GetBytes() []byte { + if m != nil { + return m.Bytes + } + return nil +} + +type TopRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TopRequest) Reset() { *m = TopRequest{} } +func (m *TopRequest) String() string { return proto.CompactTextString(m) } +func (*TopRequest) ProtoMessage() {} +func (*TopRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{10} +} + +func (m *TopRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TopRequest.Unmarshal(m, b) +} + +func (m *TopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TopRequest.Marshal(b, m, deterministic) +} + +func (m *TopRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TopRequest.Merge(m, src) +} + +func (m *TopRequest) XXX_Size() int { + return xxx_messageInfo_TopRequest.Size(m) +} + +func (m *TopRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TopRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TopRequest proto.InternalMessageInfo + +type TopReply struct { + ProcessList *ProcessList `protobuf:"bytes,1,opt,name=process_list,json=processList,proto3" json:"process_list,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TopReply) Reset() { *m = TopReply{} } +func (m *TopReply) String() string { return proto.CompactTextString(m) } +func (*TopReply) ProtoMessage() {} +func (*TopReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{11} +} + +func (m *TopReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TopReply.Unmarshal(m, b) +} + +func (m *TopReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TopReply.Marshal(b, m, deterministic) +} + +func (m *TopReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_TopReply.Merge(m, src) +} + +func (m *TopReply) XXX_Size() int { + return xxx_messageInfo_TopReply.Size(m) +} + +func (m *TopReply) XXX_DiscardUnknown() { + xxx_messageInfo_TopReply.DiscardUnknown(m) +} + +var xxx_messageInfo_TopReply proto.InternalMessageInfo + +func (m *TopReply) GetProcessList() *ProcessList { + if m != nil { + return m.ProcessList + } + return nil +} + +type ProcessList struct { + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessList) Reset() { *m = ProcessList{} } +func (m *ProcessList) String() string { return proto.CompactTextString(m) } +func (*ProcessList) ProtoMessage() {} +func (*ProcessList) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{12} +} + +func (m *ProcessList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessList.Unmarshal(m, b) +} + +func (m *ProcessList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessList.Marshal(b, m, deterministic) +} + +func (m *ProcessList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessList.Merge(m, src) +} + +func (m *ProcessList) XXX_Size() int { + return xxx_messageInfo_ProcessList.Size(m) +} + +func (m *ProcessList) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessList.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessList proto.InternalMessageInfo + +func (m *ProcessList) GetBytes() []byte { + if m != nil { + return m.Bytes + } + return nil +} + +func init() { + proto.RegisterEnum("proto.ContainerDriver", ContainerDriver_name, ContainerDriver_value) + proto.RegisterType((*ProcessesRequest)(nil), "proto.ProcessesRequest") + proto.RegisterType((*ProcessesReply)(nil), "proto.ProcessesReply") + proto.RegisterType((*Process)(nil), "proto.Process") + proto.RegisterType((*StatsRequest)(nil), "proto.StatsRequest") + proto.RegisterType((*StatsReply)(nil), "proto.StatsReply") + proto.RegisterType((*Stat)(nil), "proto.Stat") + proto.RegisterType((*RestartRequest)(nil), "proto.RestartRequest") + proto.RegisterType((*RestartReply)(nil), "proto.RestartReply") + proto.RegisterType((*LogsRequest)(nil), "proto.LogsRequest") + proto.RegisterType((*Data)(nil), "proto.Data") + proto.RegisterType((*TopRequest)(nil), "proto.TopRequest") + proto.RegisterType((*TopReply)(nil), "proto.TopReply") + proto.RegisterType((*ProcessList)(nil), "proto.ProcessList") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 619 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x6f, 0x13, 0x3d, + 0x10, 0x7e, 0xb7, 0x9b, 0x4d, 0xba, 0xb3, 0x79, 0xb7, 0xc1, 0xa5, 0x65, 0x95, 0x56, 0x28, 0x5d, + 0x2e, 0xa1, 0xaa, 0x36, 0x10, 0xc4, 0x09, 0x09, 0xa9, 0x6d, 0x7a, 0xa8, 0xa8, 0xda, 0xca, 0x2d, + 0x1c, 0x10, 0x52, 0xd9, 0x64, 0xdd, 0xc8, 0x22, 0x1b, 0x9b, 0xb5, 0x17, 0x29, 0x7f, 0x84, 0x2b, + 0x12, 0xbf, 0x14, 0xf9, 0x23, 0x5f, 0x05, 0x44, 0x7a, 0x80, 0x93, 0x3d, 0xcf, 0x3c, 0xe3, 0x19, + 0x3f, 0x1e, 0x0f, 0xf8, 0x29, 0xa7, 0x09, 0x2f, 0x98, 0x64, 0xc8, 0xd3, 0x4b, 0x73, 0x67, 0xc8, + 0xd8, 0x70, 0x44, 0x3a, 0xda, 0xea, 0x97, 0xb7, 0x1d, 0x92, 0x73, 0x39, 0x31, 0x9c, 0xf8, 0x23, + 0x34, 0x2e, 0x0b, 0x36, 0x20, 0x42, 0x10, 0x81, 0xc9, 0xe7, 0x92, 0x08, 0x89, 0x76, 0xc1, 0x1f, + 0xa7, 0x39, 0x11, 0x3c, 0x1d, 0x90, 0xc8, 0x69, 0x39, 0x6d, 0x1f, 0xcf, 0x01, 0x94, 0x40, 0x35, + 0x2b, 0xe8, 0x17, 0x52, 0x44, 0x6b, 0x2d, 0xa7, 0x1d, 0x76, 0xb7, 0xcd, 0x49, 0xc9, 0x31, 0x1b, + 0xcb, 0x94, 0x8e, 0x49, 0xd1, 0xd3, 0x5e, 0x6c, 0x59, 0xf1, 0x6b, 0x08, 0x17, 0x32, 0xf0, 0xd1, + 0x04, 0x1d, 0x80, 0xcf, 0xa7, 0x48, 0xe4, 0xb4, 0xdc, 0x76, 0xd0, 0x0d, 0xed, 0x21, 0x96, 0x89, + 0xe7, 0x84, 0xf8, 0xbb, 0x03, 0x35, 0x0b, 0xff, 0xa1, 0xb2, 0x10, 0xd6, 0x68, 0xa6, 0xab, 0xf2, + 0xf1, 0x1a, 0xcd, 0xd0, 0x43, 0xf0, 0x68, 0x9e, 0x0e, 0x49, 0xe4, 0x6a, 0xc8, 0x18, 0xa8, 0x01, + 0x2e, 0xa7, 0x59, 0x54, 0x69, 0x39, 0xed, 0xff, 0xb1, 0xda, 0xa2, 0x6d, 0xa8, 0x0a, 0x99, 0xca, + 0x52, 0x44, 0x9e, 0x26, 0x5a, 0x0b, 0x6d, 0x41, 0x95, 0xb3, 0xec, 0x86, 0x66, 0x51, 0xd5, 0x1c, + 0xc0, 0x59, 0x76, 0x9a, 0x21, 0x04, 0x15, 0x95, 0x33, 0xaa, 0x69, 0x50, 0xef, 0xe3, 0x0f, 0x50, + 0xbf, 0x92, 0xa9, 0xfc, 0x4b, 0x12, 0x76, 0x00, 0xec, 0xe9, 0x4a, 0xbe, 0x3d, 0xf0, 0x54, 0x81, + 0x53, 0xe9, 0x02, 0x1b, 0xac, 0x18, 0xd8, 0x78, 0xe2, 0x6f, 0x0e, 0x54, 0x94, 0x7d, 0x4f, 0xc1, + 0xf6, 0xa0, 0x9e, 0x93, 0x9c, 0x15, 0x93, 0x9b, 0x52, 0x28, 0xdd, 0x94, 0x46, 0x15, 0x1c, 0x18, + 0xec, 0xad, 0x82, 0xd0, 0x0e, 0xf8, 0x03, 0x5e, 0x5a, 0xbf, 0xa7, 0xfd, 0xeb, 0x03, 0x5e, 0x1a, + 0xe7, 0x3d, 0x04, 0x1b, 0x43, 0x88, 0x89, 0x90, 0x69, 0x21, 0x57, 0x93, 0xec, 0x6e, 0xa9, 0x73, + 0x09, 0xdd, 0x95, 0x24, 0x0c, 0xa1, 0x3e, 0xcb, 0xc7, 0x47, 0x93, 0xf8, 0x13, 0x04, 0x67, 0x6c, + 0x28, 0xfe, 0x4d, 0xf2, 0x5d, 0xa8, 0xf4, 0x52, 0x99, 0xaa, 0x86, 0xec, 0x4f, 0xa4, 0x6e, 0x7a, + 0xa7, 0x5d, 0xc7, 0xc6, 0x88, 0xeb, 0x00, 0xd7, 0x8c, 0xdb, 0x4a, 0xe2, 0x43, 0x58, 0xd7, 0x96, + 0x7a, 0xe9, 0x97, 0x50, 0xb7, 0xff, 0xe0, 0x66, 0x44, 0x85, 0xd4, 0x61, 0x41, 0x17, 0x2d, 0xff, + 0x95, 0x33, 0x2a, 0x24, 0x0e, 0xf8, 0xdc, 0x88, 0x9f, 0x40, 0xb0, 0xe0, 0xfb, 0x75, 0xd6, 0xfd, + 0x7d, 0xd8, 0xb8, 0x53, 0x2e, 0x0a, 0x01, 0x8e, 0x2f, 0xce, 0xaf, 0x0f, 0x4f, 0xcf, 0x4f, 0x70, + 0xaf, 0xf1, 0x1f, 0xaa, 0x81, 0x7b, 0x8c, 0x4f, 0x1b, 0x4e, 0xf7, 0xab, 0x0b, 0xee, 0xc5, 0x55, + 0x0f, 0x1d, 0x80, 0xd7, 0xcb, 0x89, 0x18, 0xa2, 0xed, 0xc4, 0xcc, 0x94, 0x64, 0x3a, 0x53, 0x92, + 0x13, 0x35, 0x53, 0x9a, 0xd3, 0x5e, 0xd4, 0xb7, 0x7d, 0x0e, 0xf0, 0xa6, 0xec, 0x93, 0x01, 0x1b, + 0xdf, 0xd2, 0x15, 0x43, 0x9e, 0x42, 0x45, 0xbd, 0x0a, 0x9a, 0x5e, 0x71, 0xe1, 0x89, 0x96, 0x88, + 0xcf, 0x1c, 0xf4, 0x0a, 0xfc, 0xd9, 0x58, 0x41, 0x8f, 0x96, 0x25, 0x99, 0x8d, 0xb2, 0xe6, 0xd6, + 0xcf, 0x0e, 0x23, 0x6c, 0xcd, 0x76, 0x03, 0x9a, 0x32, 0x96, 0xbb, 0xb1, 0xb9, 0x79, 0x17, 0x56, + 0x61, 0x1d, 0xf0, 0xf4, 0x3f, 0x44, 0x9b, 0x0b, 0x7f, 0x6e, 0x96, 0xeb, 0xc1, 0x32, 0xa8, 0x02, + 0x12, 0x70, 0xaf, 0x19, 0xff, 0xed, 0xdd, 0x37, 0x6c, 0xc4, 0xec, 0xc1, 0x13, 0xa8, 0xbd, 0x23, + 0x85, 0xa0, 0x6c, 0xbc, 0x92, 0x5e, 0x47, 0x8f, 0xc1, 0x1f, 0xb0, 0xdc, 0x20, 0x47, 0xeb, 0x87, + 0x9c, 0x5e, 0xaa, 0xdd, 0xa5, 0xf3, 0xde, 0x8c, 0xfe, 0x7e, 0x55, 0x2f, 0x2f, 0x7e, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x1e, 0xa4, 0xd5, 0x5d, 0x15, 0x06, 0x00, 0x00, +} + +// 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 + +// OSDClient is the client API for OSD service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type OSDClient interface { + Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) + Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) + Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OSD_LogsClient, error) + Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesReply, error) + Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) + Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) + Top(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TopReply, error) + Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) +} + +type oSDClient struct { + cc *grpc.ClientConn +} + +func NewOSDClient(cc *grpc.ClientConn) OSDClient { + return &oSDClient{cc} +} + +func (c *oSDClient) Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/proto.OSD/Dmesg", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/proto.OSD/Kubeconfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OSD_LogsClient, error) { + stream, err := c.cc.NewStream(ctx, &_OSD_serviceDesc.Streams[0], "/proto.OSD/Logs", opts...) + if err != nil { + return nil, err + } + x := &oSDLogsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type OSD_LogsClient interface { + Recv() (*Data, error) + grpc.ClientStream +} + +type oSDLogsClient struct { + grpc.ClientStream +} + +func (x *oSDLogsClient) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *oSDClient) Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesReply, error) { + out := new(ProcessesReply) + err := c.cc.Invoke(ctx, "/proto.OSD/Processes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) { + out := new(RestartReply) + err := c.cc.Invoke(ctx, "/proto.OSD/Restart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) { + out := new(StatsReply) + err := c.cc.Invoke(ctx, "/proto.OSD/Stats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Top(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TopReply, error) { + out := new(TopReply) + err := c.cc.Invoke(ctx, "/proto.OSD/Top", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSDClient) Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/proto.OSD/Version", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OSDServer is the server API for OSD service. +type OSDServer interface { + Dmesg(context.Context, *empty.Empty) (*Data, error) + Kubeconfig(context.Context, *empty.Empty) (*Data, error) + Logs(*LogsRequest, OSD_LogsServer) error + Processes(context.Context, *ProcessesRequest) (*ProcessesReply, error) + Restart(context.Context, *RestartRequest) (*RestartReply, error) + Stats(context.Context, *StatsRequest) (*StatsReply, error) + Top(context.Context, *empty.Empty) (*TopReply, error) + Version(context.Context, *empty.Empty) (*Data, error) +} + +func RegisterOSDServer(s *grpc.Server, srv OSDServer) { + s.RegisterService(&_OSD_serviceDesc, srv) +} + +func _OSD_Dmesg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Dmesg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Dmesg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Dmesg(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Kubeconfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Kubeconfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Kubeconfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Kubeconfig(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Logs_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(LogsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(OSDServer).Logs(m, &oSDLogsServer{stream}) +} + +type OSD_LogsServer interface { + Send(*Data) error + grpc.ServerStream +} + +type oSDLogsServer struct { + grpc.ServerStream +} + +func (x *oSDLogsServer) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func _OSD_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProcessesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Processes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Processes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Processes(ctx, req.(*ProcessesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RestartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Restart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Restart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Restart(ctx, req.(*RestartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Stats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Stats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Stats(ctx, req.(*StatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Top_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Top(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Top", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Top(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _OSD_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSDServer).Version(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.OSD/Version", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSDServer).Version(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _OSD_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.OSD", + HandlerType: (*OSDServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Dmesg", + Handler: _OSD_Dmesg_Handler, + }, + { + MethodName: "Kubeconfig", + Handler: _OSD_Kubeconfig_Handler, + }, + { + MethodName: "Processes", + Handler: _OSD_Processes_Handler, + }, + { + MethodName: "Restart", + Handler: _OSD_Restart_Handler, + }, + { + MethodName: "Stats", + Handler: _OSD_Stats_Handler, + }, + { + MethodName: "Top", + Handler: _OSD_Top_Handler, + }, + { + MethodName: "Version", + Handler: _OSD_Version_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Logs", + Handler: _OSD_Logs_Handler, + ServerStreams: true, + }, + }, + Metadata: "api.proto", +} diff --git a/internal/app/osd/proto/api.proto b/api/os/api.proto similarity index 90% rename from internal/app/osd/proto/api.proto rename to api/os/api.proto index 783cc5939..15266b386 100644 --- a/internal/app/osd/proto/api.proto +++ b/api/os/api.proto @@ -36,9 +36,7 @@ message ProcessesRequest { } // The response message containing the requested processes. -message ProcessesReply { - repeated Process processes = 1; -} +message ProcessesReply { repeated Process processes = 1; } // The response message containing the requested processes. message Process { @@ -59,9 +57,7 @@ message StatsRequest { } // The response message containing the requested stats. -message StatsReply { - repeated Stat stats = 1; -} +message StatsReply { repeated Stat stats = 1; } // The response message containing the requested stat. message Stat { @@ -93,16 +89,10 @@ message LogsRequest { } // The response message containing the requested logs. -message Data { - bytes bytes = 1; -} +message Data { bytes bytes = 1; } message TopRequest {} -message TopReply { - ProcessList process_list = 1; -} +message TopReply { ProcessList process_list = 1; } -message ProcessList { - bytes bytes = 1; -} +message ProcessList { bytes bytes = 1; } diff --git a/api/security/api.pb.go b/api/security/api.pb.go new file mode 100644 index 000000000..6ee4dbabd --- /dev/null +++ b/api/security/api.pb.go @@ -0,0 +1,475 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The request message containing the process name. +type CertificateRequest struct { + Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CertificateRequest) Reset() { *m = CertificateRequest{} } +func (m *CertificateRequest) String() string { return proto.CompactTextString(m) } +func (*CertificateRequest) ProtoMessage() {} +func (*CertificateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *CertificateRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CertificateRequest.Unmarshal(m, b) +} + +func (m *CertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CertificateRequest.Marshal(b, m, deterministic) +} + +func (m *CertificateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CertificateRequest.Merge(m, src) +} + +func (m *CertificateRequest) XXX_Size() int { + return xxx_messageInfo_CertificateRequest.Size(m) +} + +func (m *CertificateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CertificateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CertificateRequest proto.InternalMessageInfo + +func (m *CertificateRequest) GetCsr() []byte { + if m != nil { + return m.Csr + } + return nil +} + +// The response message containing the requested logs. +type CertificateResponse struct { + Ca []byte `protobuf:"bytes,1,opt,name=ca,proto3" json:"ca,omitempty"` + Crt []byte `protobuf:"bytes,2,opt,name=crt,proto3" json:"crt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CertificateResponse) Reset() { *m = CertificateResponse{} } +func (m *CertificateResponse) String() string { return proto.CompactTextString(m) } +func (*CertificateResponse) ProtoMessage() {} +func (*CertificateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *CertificateResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CertificateResponse.Unmarshal(m, b) +} + +func (m *CertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CertificateResponse.Marshal(b, m, deterministic) +} + +func (m *CertificateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CertificateResponse.Merge(m, src) +} + +func (m *CertificateResponse) XXX_Size() int { + return xxx_messageInfo_CertificateResponse.Size(m) +} + +func (m *CertificateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CertificateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CertificateResponse proto.InternalMessageInfo + +func (m *CertificateResponse) GetCa() []byte { + if m != nil { + return m.Ca + } + return nil +} + +func (m *CertificateResponse) GetCrt() []byte { + if m != nil { + return m.Crt + } + return nil +} + +// The request message for reading a file on disk. +type ReadFileRequest struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadFileRequest) Reset() { *m = ReadFileRequest{} } +func (m *ReadFileRequest) String() string { return proto.CompactTextString(m) } +func (*ReadFileRequest) ProtoMessage() {} +func (*ReadFileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *ReadFileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadFileRequest.Unmarshal(m, b) +} + +func (m *ReadFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadFileRequest.Marshal(b, m, deterministic) +} + +func (m *ReadFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileRequest.Merge(m, src) +} + +func (m *ReadFileRequest) XXX_Size() int { + return xxx_messageInfo_ReadFileRequest.Size(m) +} + +func (m *ReadFileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadFileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadFileRequest proto.InternalMessageInfo + +func (m *ReadFileRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +// The response message for reading a file on disk. +type ReadFileResponse struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadFileResponse) Reset() { *m = ReadFileResponse{} } +func (m *ReadFileResponse) String() string { return proto.CompactTextString(m) } +func (*ReadFileResponse) ProtoMessage() {} +func (*ReadFileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *ReadFileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadFileResponse.Unmarshal(m, b) +} + +func (m *ReadFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadFileResponse.Marshal(b, m, deterministic) +} + +func (m *ReadFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileResponse.Merge(m, src) +} + +func (m *ReadFileResponse) XXX_Size() int { + return xxx_messageInfo_ReadFileResponse.Size(m) +} + +func (m *ReadFileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadFileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadFileResponse proto.InternalMessageInfo + +func (m *ReadFileResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// The request message containing the process name. +type WriteFileRequest struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Perm int32 `protobuf:"varint,3,opt,name=perm,proto3" json:"perm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WriteFileRequest) Reset() { *m = WriteFileRequest{} } +func (m *WriteFileRequest) String() string { return proto.CompactTextString(m) } +func (*WriteFileRequest) ProtoMessage() {} +func (*WriteFileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{4} +} + +func (m *WriteFileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WriteFileRequest.Unmarshal(m, b) +} + +func (m *WriteFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WriteFileRequest.Marshal(b, m, deterministic) +} + +func (m *WriteFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteFileRequest.Merge(m, src) +} + +func (m *WriteFileRequest) XXX_Size() int { + return xxx_messageInfo_WriteFileRequest.Size(m) +} + +func (m *WriteFileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WriteFileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteFileRequest proto.InternalMessageInfo + +func (m *WriteFileRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *WriteFileRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *WriteFileRequest) GetPerm() int32 { + if m != nil { + return m.Perm + } + return 0 +} + +// The response message containing the requested logs. +type WriteFileResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WriteFileResponse) Reset() { *m = WriteFileResponse{} } +func (m *WriteFileResponse) String() string { return proto.CompactTextString(m) } +func (*WriteFileResponse) ProtoMessage() {} +func (*WriteFileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{5} +} + +func (m *WriteFileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WriteFileResponse.Unmarshal(m, b) +} + +func (m *WriteFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WriteFileResponse.Marshal(b, m, deterministic) +} + +func (m *WriteFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteFileResponse.Merge(m, src) +} + +func (m *WriteFileResponse) XXX_Size() int { + return xxx_messageInfo_WriteFileResponse.Size(m) +} + +func (m *WriteFileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WriteFileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteFileResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*CertificateRequest)(nil), "proto.CertificateRequest") + proto.RegisterType((*CertificateResponse)(nil), "proto.CertificateResponse") + proto.RegisterType((*ReadFileRequest)(nil), "proto.ReadFileRequest") + proto.RegisterType((*ReadFileResponse)(nil), "proto.ReadFileResponse") + proto.RegisterType((*WriteFileRequest)(nil), "proto.WriteFileRequest") + proto.RegisterType((*WriteFileResponse)(nil), "proto.WriteFileResponse") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x4b, 0xc3, 0x40, + 0x10, 0xc5, 0x49, 0xfa, 0x87, 0x66, 0x14, 0xad, 0x53, 0xd0, 0x98, 0x83, 0x94, 0x05, 0x4b, 0x4f, + 0x3d, 0xe8, 0xc1, 0x83, 0x20, 0x58, 0xc5, 0xa3, 0x94, 0x45, 0x10, 0xbc, 0xad, 0x9b, 0x15, 0x17, + 0xac, 0x59, 0x77, 0xa7, 0x9f, 0xd2, 0x2f, 0x25, 0xdd, 0xdd, 0xa4, 0xb5, 0x11, 0x3c, 0xcd, 0x23, + 0xf3, 0x7e, 0x2f, 0x99, 0x47, 0x20, 0x13, 0x46, 0xcf, 0x8c, 0xad, 0xa8, 0xc2, 0x9e, 0x1f, 0x6c, + 0x02, 0x78, 0xa7, 0x2c, 0xe9, 0x37, 0x2d, 0x05, 0x29, 0xae, 0xbe, 0x56, 0xca, 0x11, 0x0e, 0xa1, + 0x23, 0x9d, 0xcd, 0x93, 0x71, 0x32, 0xdd, 0xe7, 0x6b, 0xc9, 0xae, 0x60, 0xf4, 0xcb, 0xe7, 0x4c, + 0xf5, 0xe9, 0x14, 0x1e, 0x40, 0x2a, 0x45, 0xf4, 0xa5, 0x52, 0x78, 0xd0, 0x52, 0x9e, 0x46, 0xd0, + 0x12, 0x3b, 0x87, 0x43, 0xae, 0x44, 0xf9, 0xa0, 0x3f, 0x9a, 0x74, 0x84, 0xae, 0x11, 0xf4, 0xee, + 0xb1, 0x8c, 0x7b, 0xcd, 0x26, 0x30, 0xdc, 0xd8, 0x62, 0x38, 0x42, 0xb7, 0x14, 0x54, 0xc7, 0x7b, + 0xcd, 0x1e, 0x61, 0xf8, 0x6c, 0x35, 0xa9, 0x7f, 0xf2, 0x1a, 0x36, 0xdd, 0xb0, 0xde, 0xa7, 0xec, + 0x32, 0xef, 0x8c, 0x93, 0x69, 0x8f, 0x7b, 0xcd, 0x46, 0x70, 0xb4, 0x95, 0x17, 0x5e, 0x7c, 0xf1, + 0x9d, 0x40, 0xff, 0xc9, 0xae, 0x1c, 0x95, 0x78, 0x0f, 0x7b, 0x5b, 0x77, 0xe3, 0x69, 0x68, 0x6f, + 0xd6, 0xee, 0xac, 0x28, 0xfe, 0x5a, 0xc5, 0x4b, 0xae, 0x61, 0x50, 0x5f, 0x87, 0xc7, 0xd1, 0xb7, + 0xd3, 0x4a, 0x71, 0xd2, 0x7a, 0x1e, 0xe1, 0x1b, 0xc8, 0x9a, 0x4f, 0xc4, 0xda, 0xb5, 0x5b, 0x42, + 0x91, 0xb7, 0x17, 0x81, 0x9f, 0x9f, 0x41, 0x26, 0xab, 0x65, 0x58, 0xcf, 0x07, 0xb7, 0x46, 0x2f, + 0xd6, 0x6a, 0x91, 0xbc, 0x84, 0x5f, 0xe0, 0xb5, 0xef, 0xc7, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x59, 0x5a, 0x3f, 0x46, 0x1d, 0x02, 0x00, 0x00, +} + +// 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 + +// TrustdClient is the client API for Trustd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TrustdClient interface { + Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) + ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) + WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) +} + +type trustdClient struct { + cc *grpc.ClientConn +} + +func NewTrustdClient(cc *grpc.ClientConn) TrustdClient { + return &trustdClient{cc} +} + +func (c *trustdClient) Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { + out := new(CertificateResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/Certificate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *trustdClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) { + out := new(ReadFileResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/ReadFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *trustdClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) { + out := new(WriteFileResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/WriteFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TrustdServer is the server API for Trustd service. +type TrustdServer interface { + Certificate(context.Context, *CertificateRequest) (*CertificateResponse, error) + ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) + WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) +} + +func RegisterTrustdServer(s *grpc.Server, srv TrustdServer) { + s.RegisterService(&_Trustd_serviceDesc, srv) +} + +func _Trustd_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CertificateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).Certificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/Certificate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).Certificate(ctx, req.(*CertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Trustd_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).ReadFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/ReadFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).ReadFile(ctx, req.(*ReadFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Trustd_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).WriteFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/WriteFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).WriteFile(ctx, req.(*WriteFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Trustd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Trustd", + HandlerType: (*TrustdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Certificate", + Handler: _Trustd_Certificate_Handler, + }, + { + MethodName: "ReadFile", + Handler: _Trustd_ReadFile_Handler, + }, + { + MethodName: "WriteFile", + Handler: _Trustd_WriteFile_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/trustd/proto/api.proto b/api/security/api.proto similarity index 100% rename from internal/app/trustd/proto/api.proto rename to api/security/api.proto diff --git a/api/time/api.pb.go b/api/time/api.pb.go new file mode 100644 index 000000000..ba8468d8c --- /dev/null +++ b/api/time/api.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The response message containing the ntp server +type TimeRequest struct { + Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimeRequest) Reset() { *m = TimeRequest{} } +func (m *TimeRequest) String() string { return proto.CompactTextString(m) } +func (*TimeRequest) ProtoMessage() {} +func (*TimeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *TimeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TimeRequest.Unmarshal(m, b) +} + +func (m *TimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TimeRequest.Marshal(b, m, deterministic) +} + +func (m *TimeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeRequest.Merge(m, src) +} + +func (m *TimeRequest) XXX_Size() int { + return xxx_messageInfo_TimeRequest.Size(m) +} + +func (m *TimeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TimeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeRequest proto.InternalMessageInfo + +func (m *TimeRequest) GetServer() string { + if m != nil { + return m.Server + } + return "" +} + +// The response message containing the ntp server, time, and offset +type TimeReply struct { + Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + Localtime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=localtime,proto3" json:"localtime,omitempty"` + Remotetime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=remotetime,proto3" json:"remotetime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimeReply) Reset() { *m = TimeReply{} } +func (m *TimeReply) String() string { return proto.CompactTextString(m) } +func (*TimeReply) ProtoMessage() {} +func (*TimeReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *TimeReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TimeReply.Unmarshal(m, b) +} + +func (m *TimeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TimeReply.Marshal(b, m, deterministic) +} + +func (m *TimeReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeReply.Merge(m, src) +} + +func (m *TimeReply) XXX_Size() int { + return xxx_messageInfo_TimeReply.Size(m) +} + +func (m *TimeReply) XXX_DiscardUnknown() { + xxx_messageInfo_TimeReply.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeReply proto.InternalMessageInfo + +func (m *TimeReply) GetServer() string { + if m != nil { + return m.Server + } + return "" +} + +func (m *TimeReply) GetLocaltime() *timestamp.Timestamp { + if m != nil { + return m.Localtime + } + return nil +} + +func (m *TimeReply) GetRemotetime() *timestamp.Timestamp { + if m != nil { + return m.Remotetime + } + return nil +} + +func init() { + proto.RegisterType((*TimeRequest)(nil), "proto.TimeRequest") + proto.RegisterType((*TimeReply)(nil), "proto.TimeReply") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x52, 0xd2, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, + 0xa9, 0xfa, 0x60, 0x5e, 0x52, 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x8d, 0x94, + 0x3c, 0xba, 0x64, 0x49, 0x66, 0x6e, 0x6a, 0x71, 0x49, 0x62, 0x6e, 0x01, 0x44, 0x81, 0x92, 0x2a, + 0x17, 0x77, 0x48, 0x66, 0x6e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x90, 0x18, 0x17, + 0x5b, 0x71, 0x6a, 0x51, 0x59, 0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x94, 0xa7, + 0x34, 0x93, 0x91, 0x8b, 0x13, 0xa2, 0xae, 0x20, 0xa7, 0x12, 0x97, 0x2a, 0x21, 0x0b, 0x2e, 0xce, + 0x9c, 0xfc, 0xe4, 0xc4, 0x1c, 0x90, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, + 0x10, 0x17, 0xe8, 0xc1, 0x5c, 0xa0, 0x17, 0x02, 0x73, 0x41, 0x10, 0x42, 0xb1, 0x90, 0x15, 0x17, + 0x57, 0x51, 0x6a, 0x6e, 0x7e, 0x49, 0x2a, 0x58, 0x2b, 0x33, 0x41, 0xad, 0x48, 0xaa, 0x8d, 0xb2, + 0xb9, 0x58, 0xfc, 0x4a, 0x0a, 0x52, 0x84, 0x0c, 0xb8, 0x58, 0x40, 0x0a, 0x84, 0xc4, 0x30, 0xf4, + 0xb9, 0x82, 0x42, 0x44, 0x4a, 0x00, 0x22, 0xa0, 0x87, 0xf0, 0x87, 0x21, 0xc4, 0x53, 0xce, 0x19, + 0xa9, 0xc9, 0xd9, 0x42, 0x42, 0x28, 0xd2, 0xe0, 0xe0, 0xc0, 0xd4, 0xe2, 0x24, 0xc7, 0xc5, 0x99, + 0x9c, 0x9f, 0x0b, 0x11, 0x76, 0xe2, 0x70, 0x2c, 0xc8, 0x0c, 0x00, 0xb1, 0x02, 0x18, 0xa3, 0x20, + 0xb1, 0x91, 0xc4, 0x06, 0xa6, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0xd1, 0xa5, 0x14, + 0xa8, 0x01, 0x00, 0x00, +} + +// 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 + +// NtpdClient is the client API for Ntpd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NtpdClient interface { + Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) + TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) +} + +type ntpdClient struct { + cc *grpc.ClientConn +} + +func NewNtpdClient(cc *grpc.ClientConn) NtpdClient { + return &ntpdClient{cc} +} + +func (c *ntpdClient) Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) { + out := new(TimeReply) + err := c.cc.Invoke(ctx, "/proto.Ntpd/Time", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ntpdClient) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) { + out := new(TimeReply) + err := c.cc.Invoke(ctx, "/proto.Ntpd/TimeCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NtpdServer is the server API for Ntpd service. +type NtpdServer interface { + Time(context.Context, *empty.Empty) (*TimeReply, error) + TimeCheck(context.Context, *TimeRequest) (*TimeReply, error) +} + +func RegisterNtpdServer(s *grpc.Server, srv NtpdServer) { + s.RegisterService(&_Ntpd_serviceDesc, srv) +} + +func _Ntpd_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NtpdServer).Time(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Ntpd/Time", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NtpdServer).Time(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Ntpd_TimeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TimeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NtpdServer).TimeCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Ntpd/TimeCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NtpdServer).TimeCheck(ctx, req.(*TimeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Ntpd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Ntpd", + HandlerType: (*NtpdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Time", + Handler: _Ntpd_Time_Handler, + }, + { + MethodName: "TimeCheck", + Handler: _Ntpd_TimeCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/ntpd/proto/api.proto b/api/time/api.proto similarity index 100% rename from internal/app/ntpd/proto/api.proto rename to api/time/api.proto diff --git a/cmd/osctl/cmd/df.go b/cmd/osctl/cmd/df.go index 960a331e2..5c3c789b7 100644 --- a/cmd/osctl/cmd/df.go +++ b/cmd/osctl/cmd/df.go @@ -13,9 +13,9 @@ import ( "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/machined/proto" ) // dfCmd represents the df command. diff --git a/cmd/osctl/cmd/interfaces.go b/cmd/osctl/cmd/interfaces.go index f11dd3eae..a7103061c 100644 --- a/cmd/osctl/cmd/interfaces.go +++ b/cmd/osctl/cmd/interfaces.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/networkd/proto" ) // interfacesCmd represents the net interfaces command diff --git a/cmd/osctl/cmd/logs.go b/cmd/osctl/cmd/logs.go index 071ee3df3..0b4f55ec3 100644 --- a/cmd/osctl/cmd/logs.go +++ b/cmd/osctl/cmd/logs.go @@ -13,9 +13,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + proto "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/osd/proto" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/cmd/osctl/cmd/ls.go b/cmd/osctl/cmd/ls.go index b50287d54..85ca2e96f 100644 --- a/cmd/osctl/cmd/ls.go +++ b/cmd/osctl/cmd/ls.go @@ -15,9 +15,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + initproto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - initproto "github.com/talos-systems/talos/internal/app/machined/proto" ) // lsCmd represents the ls command diff --git a/cmd/osctl/cmd/ps.go b/cmd/osctl/cmd/ps.go index 96ce8f06d..4bf3655db 100644 --- a/cmd/osctl/cmd/ps.go +++ b/cmd/osctl/cmd/ps.go @@ -15,9 +15,9 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/osd/proto" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/cmd/osctl/cmd/restart.go b/cmd/osctl/cmd/restart.go index f32d294d2..022c0f1ff 100644 --- a/cmd/osctl/cmd/restart.go +++ b/cmd/osctl/cmd/restart.go @@ -11,9 +11,9 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/osd/proto" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/cmd/osctl/cmd/routes.go b/cmd/osctl/cmd/routes.go index 8953a5749..e7fade5d9 100644 --- a/cmd/osctl/cmd/routes.go +++ b/cmd/osctl/cmd/routes.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/networkd/proto" ) // routesCmd represents the net routes command diff --git a/cmd/osctl/cmd/service.go b/cmd/osctl/cmd/service.go index a512cc95d..3f506e1b0 100644 --- a/cmd/osctl/cmd/service.go +++ b/cmd/osctl/cmd/service.go @@ -13,9 +13,9 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/spf13/cobra" + initproto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - initproto "github.com/talos-systems/talos/internal/app/machined/proto" ) // serviceCmd represents the service command diff --git a/cmd/osctl/cmd/stats.go b/cmd/osctl/cmd/stats.go index c583af1be..41dd8208c 100644 --- a/cmd/osctl/cmd/stats.go +++ b/cmd/osctl/cmd/stats.go @@ -15,9 +15,9 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/osd/proto" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/cmd/osctl/cmd/time.go b/cmd/osctl/cmd/time.go index 63b00b85f..24518899f 100644 --- a/cmd/osctl/cmd/time.go +++ b/cmd/osctl/cmd/time.go @@ -13,9 +13,9 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/spf13/cobra" + proto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" - "github.com/talos-systems/talos/internal/app/ntpd/proto" ) // timeCmd represents the time command diff --git a/cmd/osctl/pkg/client/client.go b/cmd/osctl/pkg/client/client.go index 938ccb93b..d145857e4 100644 --- a/cmd/osctl/pkg/client/client.go +++ b/cmd/osctl/pkg/client/client.go @@ -21,11 +21,11 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/status" + initproto "github.com/talos-systems/talos/api/machine" + networkdproto "github.com/talos-systems/talos/api/network" + proto "github.com/talos-systems/talos/api/os" + ntpdproto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/cmd/osctl/pkg/client/config" - initproto "github.com/talos-systems/talos/internal/app/machined/proto" - networkdproto "github.com/talos-systems/talos/internal/app/networkd/proto" - ntpdproto "github.com/talos-systems/talos/internal/app/ntpd/proto" - "github.com/talos-systems/talos/internal/app/osd/proto" "github.com/talos-systems/talos/pkg/net" "github.com/talos-systems/talos/pkg/proc" ) diff --git a/go.sum b/go.sum index 9d9bf14a5..a537d32f3 100644 --- a/go.sum +++ b/go.sum @@ -423,6 +423,7 @@ github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= diff --git a/hack/golang/golangci-lint.yaml b/hack/golang/golangci-lint.yaml index ddc9d51e5..479f4f1b4 100644 --- a/hack/golang/golangci-lint.yaml +++ b/hack/golang/golangci-lint.yaml @@ -15,6 +15,13 @@ run: # include test files or not, default is true tests: true + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + skip-files: + - .*\\.pb\\.go$ + # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" diff --git a/internal/app/machined/internal/api/reg/reg.go b/internal/app/machined/internal/api/reg/reg.go index 34ab73077..5b28c22ae 100644 --- a/internal/app/machined/internal/api/reg/reg.go +++ b/internal/app/machined/internal/api/reg/reg.go @@ -20,9 +20,9 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/event" "github.com/talos-systems/talos/internal/app/machined/pkg/system" - "github.com/talos-systems/talos/internal/app/machined/proto" "github.com/talos-systems/talos/pkg/archiver" "github.com/talos-systems/talos/pkg/chunker/stream" "github.com/talos-systems/talos/pkg/constants" diff --git a/internal/app/machined/internal/phase/upgrade/upgrade.go b/internal/app/machined/internal/phase/upgrade/upgrade.go index 890153735..5733d1d30 100644 --- a/internal/app/machined/internal/phase/upgrade/upgrade.go +++ b/internal/app/machined/internal/phase/upgrade/upgrade.go @@ -9,11 +9,11 @@ import ( "github.com/pkg/errors" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/install" "github.com/talos-systems/talos/internal/app/machined/internal/phase" "github.com/talos-systems/talos/internal/app/machined/internal/platform" "github.com/talos-systems/talos/internal/app/machined/internal/runtime" - "github.com/talos-systems/talos/internal/app/machined/proto" "github.com/talos-systems/talos/internal/pkg/kernel" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/userdata" diff --git a/internal/app/machined/internal/sequencer/sequencer.go b/internal/app/machined/internal/sequencer/sequencer.go index eabbd1bbe..998d9fd1c 100644 --- a/internal/app/machined/internal/sequencer/sequencer.go +++ b/internal/app/machined/internal/sequencer/sequencer.go @@ -5,8 +5,8 @@ package sequencer import ( + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/sequencer/v1alpha1" - "github.com/talos-systems/talos/internal/app/machined/proto" ) // Sequencer describes the boot, shutdown, and upgrade events. diff --git a/internal/app/machined/internal/sequencer/v1alpha1/types.go b/internal/app/machined/internal/sequencer/v1alpha1/types.go index e47646280..eddff0037 100644 --- a/internal/app/machined/internal/sequencer/v1alpha1/types.go +++ b/internal/app/machined/internal/sequencer/v1alpha1/types.go @@ -5,6 +5,7 @@ package v1alpha1 import ( + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/phase" "github.com/talos-systems/talos/internal/app/machined/internal/phase/acpi" "github.com/talos-systems/talos/internal/app/machined/internal/phase/disk" @@ -18,7 +19,6 @@ import ( "github.com/talos-systems/talos/internal/app/machined/internal/phase/sysctls" "github.com/talos-systems/talos/internal/app/machined/internal/phase/upgrade" userdatatask "github.com/talos-systems/talos/internal/app/machined/internal/phase/userdata" - "github.com/talos-systems/talos/internal/app/machined/proto" "github.com/talos-systems/talos/pkg/blockdevice/probe" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/userdata" diff --git a/internal/app/machined/main.go b/internal/app/machined/main.go index 79dc93790..65544fb51 100644 --- a/internal/app/machined/main.go +++ b/internal/app/machined/main.go @@ -12,9 +12,9 @@ import ( "github.com/pkg/errors" "golang.org/x/sys/unix" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/event" "github.com/talos-systems/talos/internal/app/machined/internal/sequencer" - "github.com/talos-systems/talos/internal/app/machined/proto" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/proc/reaper" "github.com/talos-systems/talos/pkg/startup" diff --git a/internal/app/machined/pkg/system/events/events.go b/internal/app/machined/pkg/system/events/events.go index c43433ac9..04f2a627b 100644 --- a/internal/app/machined/pkg/system/events/events.go +++ b/internal/app/machined/pkg/system/events/events.go @@ -9,7 +9,7 @@ import ( "github.com/golang/protobuf/ptypes" - "github.com/talos-systems/talos/internal/app/machined/proto" + proto "github.com/talos-systems/talos/api/machine" ) // MaxEventsToKeep is maximum number of events to keep per service before dropping old entries diff --git a/internal/app/machined/pkg/system/health/status.go b/internal/app/machined/pkg/system/health/status.go index 3a7fee70c..8d42e468c 100644 --- a/internal/app/machined/pkg/system/health/status.go +++ b/internal/app/machined/pkg/system/health/status.go @@ -10,7 +10,7 @@ import ( "github.com/golang/protobuf/ptypes" - "github.com/talos-systems/talos/internal/app/machined/proto" + proto "github.com/talos-systems/talos/api/machine" ) // Status of the healthcheck diff --git a/internal/app/machined/pkg/system/service_runner.go b/internal/app/machined/pkg/system/service_runner.go index 08918200a..5e9681454 100644 --- a/internal/app/machined/pkg/system/service_runner.go +++ b/internal/app/machined/pkg/system/service_runner.go @@ -13,11 +13,11 @@ import ( "github.com/pkg/errors" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/pkg/system/conditions" "github.com/talos-systems/talos/internal/app/machined/pkg/system/events" "github.com/talos-systems/talos/internal/app/machined/pkg/system/health" "github.com/talos-systems/talos/internal/app/machined/pkg/system/runner" - "github.com/talos-systems/talos/internal/app/machined/proto" "github.com/talos-systems/talos/pkg/userdata" ) diff --git a/internal/app/machined/pkg/system/services/kubeadm.go b/internal/app/machined/pkg/system/services/kubeadm.go index 6d416fb65..1a1f00c9e 100644 --- a/internal/app/machined/pkg/system/services/kubeadm.go +++ b/internal/app/machined/pkg/system/services/kubeadm.go @@ -19,11 +19,11 @@ import ( specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" + proto "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/internal/app/machined/pkg/system/conditions" "github.com/talos-systems/talos/internal/app/machined/pkg/system/runner" "github.com/talos-systems/talos/internal/app/machined/pkg/system/runner/containerd" "github.com/talos-systems/talos/internal/app/machined/pkg/system/services/kubeadm" - "github.com/talos-systems/talos/internal/app/trustd/proto" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/userdata" ) diff --git a/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go b/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go index a94342490..cad344165 100644 --- a/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go +++ b/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go @@ -22,7 +22,7 @@ import ( "google.golang.org/grpc/status" kubeadmv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" - "github.com/talos-systems/talos/internal/app/trustd/proto" + proto "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/internal/pkg/cis" "github.com/talos-systems/talos/pkg/cmd" "github.com/talos-systems/talos/pkg/constants" diff --git a/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go b/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go index 6d6397b70..7749b17e0 100644 --- a/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go +++ b/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/suite" "gopkg.in/yaml.v2" - "github.com/talos-systems/talos/internal/app/trustd/proto" + proto "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/grpc/middleware/auth/basic" "github.com/talos-systems/talos/pkg/userdata" diff --git a/internal/app/networkd/pkg/reg/reg.go b/internal/app/networkd/pkg/reg/reg.go index e7b65f406..d972755db 100644 --- a/internal/app/networkd/pkg/reg/reg.go +++ b/internal/app/networkd/pkg/reg/reg.go @@ -14,8 +14,8 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" + proto "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/internal/app/networkd/pkg/networkd" - "github.com/talos-systems/talos/internal/app/networkd/proto" ) // Registrator is the concrete type that implements the factory.Registrator and diff --git a/internal/app/networkd/pkg/reg/reg_test.go b/internal/app/networkd/pkg/reg/reg_test.go index 629068241..efad6228d 100644 --- a/internal/app/networkd/pkg/reg/reg_test.go +++ b/internal/app/networkd/pkg/reg/reg_test.go @@ -17,8 +17,8 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" + proto "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/internal/app/networkd/pkg/networkd" - "github.com/talos-systems/talos/internal/app/networkd/proto" "github.com/talos-systems/talos/pkg/grpc/factory" ) diff --git a/internal/app/networkd/proto/api.pb.go b/internal/app/networkd/proto/api.pb.go new file mode 100644 index 000000000..e4171f752 --- /dev/null +++ b/internal/app/networkd/proto/api.pb.go @@ -0,0 +1,617 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type AddressFamily int32 + +const ( + AddressFamily_AF_UNSPEC AddressFamily = 0 + AddressFamily_AF_INET AddressFamily = 2 + AddressFamily_IPV4 AddressFamily = 2 + AddressFamily_AF_INET6 AddressFamily = 10 + AddressFamily_IPV6 AddressFamily = 10 +) + +var AddressFamily_name = map[int32]string{ + 0: "AF_UNSPEC", + 2: "AF_INET", + // Duplicate value: 2: "IPV4", + 10: "AF_INET6", + // Duplicate value: 10: "IPV6", +} + +var AddressFamily_value = map[string]int32{ + "AF_UNSPEC": 0, + "AF_INET": 2, + "IPV4": 2, + "AF_INET6": 10, + "IPV6": 10, +} + +func (x AddressFamily) String() string { + return proto.EnumName(AddressFamily_name, int32(x)) +} + +func (AddressFamily) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +type RouteProtocol int32 + +const ( + RouteProtocol_RTPROT_UNSPEC RouteProtocol = 0 + RouteProtocol_RTPROT_REDIRECT RouteProtocol = 1 + RouteProtocol_RTPROT_KERNEL RouteProtocol = 2 + RouteProtocol_RTPROT_BOOT RouteProtocol = 3 + RouteProtocol_RTPROT_STATIC RouteProtocol = 4 + RouteProtocol_RTPROT_GATED RouteProtocol = 8 + RouteProtocol_RTPROT_RA RouteProtocol = 9 + RouteProtocol_RTPROT_MRT RouteProtocol = 10 + RouteProtocol_RTPROT_ZEBRA RouteProtocol = 11 + RouteProtocol_RTPROT_BIRD RouteProtocol = 12 + RouteProtocol_RTPROT_DNROUTED RouteProtocol = 13 + RouteProtocol_RTPROT_XORP RouteProtocol = 14 + RouteProtocol_RTPROT_NTK RouteProtocol = 15 + RouteProtocol_RTPROT_DHCP RouteProtocol = 16 + RouteProtocol_RTPROT_MROUTED RouteProtocol = 17 + RouteProtocol_RTPROT_BABEL RouteProtocol = 42 +) + +var RouteProtocol_name = map[int32]string{ + 0: "RTPROT_UNSPEC", + 1: "RTPROT_REDIRECT", + 2: "RTPROT_KERNEL", + 3: "RTPROT_BOOT", + 4: "RTPROT_STATIC", + 8: "RTPROT_GATED", + 9: "RTPROT_RA", + 10: "RTPROT_MRT", + 11: "RTPROT_ZEBRA", + 12: "RTPROT_BIRD", + 13: "RTPROT_DNROUTED", + 14: "RTPROT_XORP", + 15: "RTPROT_NTK", + 16: "RTPROT_DHCP", + 17: "RTPROT_MROUTED", + 42: "RTPROT_BABEL", +} + +var RouteProtocol_value = map[string]int32{ + "RTPROT_UNSPEC": 0, + "RTPROT_REDIRECT": 1, + "RTPROT_KERNEL": 2, + "RTPROT_BOOT": 3, + "RTPROT_STATIC": 4, + "RTPROT_GATED": 8, + "RTPROT_RA": 9, + "RTPROT_MRT": 10, + "RTPROT_ZEBRA": 11, + "RTPROT_BIRD": 12, + "RTPROT_DNROUTED": 13, + "RTPROT_XORP": 14, + "RTPROT_NTK": 15, + "RTPROT_DHCP": 16, + "RTPROT_MROUTED": 17, + "RTPROT_BABEL": 42, +} + +func (x RouteProtocol) String() string { + return proto.EnumName(RouteProtocol_name, int32(x)) +} + +func (RouteProtocol) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +type InterfaceFlags int32 + +const ( + InterfaceFlags_FLAG_UNKNOWN InterfaceFlags = 0 + InterfaceFlags_FLAG_UP InterfaceFlags = 1 + InterfaceFlags_FLAG_BROADCAST InterfaceFlags = 2 + InterfaceFlags_FLAG_LOOPBACK InterfaceFlags = 3 + InterfaceFlags_FLAG_POINT_TO_POINT InterfaceFlags = 4 + InterfaceFlags_FLAG_MULTICAST InterfaceFlags = 5 +) + +var InterfaceFlags_name = map[int32]string{ + 0: "FLAG_UNKNOWN", + 1: "FLAG_UP", + 2: "FLAG_BROADCAST", + 3: "FLAG_LOOPBACK", + 4: "FLAG_POINT_TO_POINT", + 5: "FLAG_MULTICAST", +} + +var InterfaceFlags_value = map[string]int32{ + "FLAG_UNKNOWN": 0, + "FLAG_UP": 1, + "FLAG_BROADCAST": 2, + "FLAG_LOOPBACK": 3, + "FLAG_POINT_TO_POINT": 4, + "FLAG_MULTICAST": 5, +} + +func (x InterfaceFlags) String() string { + return proto.EnumName(InterfaceFlags_name, int32(x)) +} + +func (InterfaceFlags) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +// The response message containing the routes. +type RoutesReply struct { + Routes []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RoutesReply) Reset() { *m = RoutesReply{} } +func (m *RoutesReply) String() string { return proto.CompactTextString(m) } +func (*RoutesReply) ProtoMessage() {} +func (*RoutesReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *RoutesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RoutesReply.Unmarshal(m, b) +} + +func (m *RoutesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RoutesReply.Marshal(b, m, deterministic) +} + +func (m *RoutesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_RoutesReply.Merge(m, src) +} + +func (m *RoutesReply) XXX_Size() int { + return xxx_messageInfo_RoutesReply.Size(m) +} + +func (m *RoutesReply) XXX_DiscardUnknown() { + xxx_messageInfo_RoutesReply.DiscardUnknown(m) +} + +var xxx_messageInfo_RoutesReply proto.InternalMessageInfo + +func (m *RoutesReply) GetRoutes() []*Route { + if m != nil { + return m.Routes + } + return nil +} + +// The response message containing a route. +type Route struct { + // Interface is the interface over which traffic to this destination should be sent + Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + // Destination is the network prefix CIDR which this route provides + Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` + // Gateway is the gateway address to which traffic to this destination should be sent + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + // Metric is the priority of the route, where lower metrics have higher priorities + Metric uint32 `protobuf:"varint,4,opt,name=metric,proto3" json:"metric,omitempty"` + // Scope desribes the scope of this route + Scope uint32 `protobuf:"varint,5,opt,name=scope,proto3" json:"scope,omitempty"` + // Source is the source prefix CIDR for the route, if one is defined + Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` + // Family is the address family of the route. Currently, the only options are AF_INET (IPV4) and AF_INET6 (IPV6). + Family AddressFamily `protobuf:"varint,7,opt,name=family,proto3,enum=proto.AddressFamily" json:"family,omitempty"` + // Protocol is the protocol by which this route came to be in place + Protocol RouteProtocol `protobuf:"varint,8,opt,name=protocol,proto3,enum=proto.RouteProtocol" json:"protocol,omitempty"` + // Flags indicate any special flags on the route + Flags uint32 `protobuf:"varint,9,opt,name=flags,proto3" json:"flags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Route) Reset() { *m = Route{} } +func (m *Route) String() string { return proto.CompactTextString(m) } +func (*Route) ProtoMessage() {} +func (*Route) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *Route) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Route.Unmarshal(m, b) +} + +func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Route.Marshal(b, m, deterministic) +} + +func (m *Route) XXX_Merge(src proto.Message) { + xxx_messageInfo_Route.Merge(m, src) +} + +func (m *Route) XXX_Size() int { + return xxx_messageInfo_Route.Size(m) +} + +func (m *Route) XXX_DiscardUnknown() { + xxx_messageInfo_Route.DiscardUnknown(m) +} + +var xxx_messageInfo_Route proto.InternalMessageInfo + +func (m *Route) GetInterface() string { + if m != nil { + return m.Interface + } + return "" +} + +func (m *Route) GetDestination() string { + if m != nil { + return m.Destination + } + return "" +} + +func (m *Route) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *Route) GetMetric() uint32 { + if m != nil { + return m.Metric + } + return 0 +} + +func (m *Route) GetScope() uint32 { + if m != nil { + return m.Scope + } + return 0 +} + +func (m *Route) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *Route) GetFamily() AddressFamily { + if m != nil { + return m.Family + } + return AddressFamily_AF_UNSPEC +} + +func (m *Route) GetProtocol() RouteProtocol { + if m != nil { + return m.Protocol + } + return RouteProtocol_RTPROT_UNSPEC +} + +func (m *Route) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +type InterfacesReply struct { + Interfaces []*Interface `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InterfacesReply) Reset() { *m = InterfacesReply{} } +func (m *InterfacesReply) String() string { return proto.CompactTextString(m) } +func (*InterfacesReply) ProtoMessage() {} +func (*InterfacesReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *InterfacesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InterfacesReply.Unmarshal(m, b) +} + +func (m *InterfacesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InterfacesReply.Marshal(b, m, deterministic) +} + +func (m *InterfacesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfacesReply.Merge(m, src) +} + +func (m *InterfacesReply) XXX_Size() int { + return xxx_messageInfo_InterfacesReply.Size(m) +} + +func (m *InterfacesReply) XXX_DiscardUnknown() { + xxx_messageInfo_InterfacesReply.DiscardUnknown(m) +} + +var xxx_messageInfo_InterfacesReply proto.InternalMessageInfo + +func (m *InterfacesReply) GetInterfaces() []*Interface { + if m != nil { + return m.Interfaces + } + return nil +} + +// Interface represents a net.Interface +type Interface struct { + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Mtu uint32 `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Hardwareaddr string `protobuf:"bytes,4,opt,name=hardwareaddr,proto3" json:"hardwareaddr,omitempty"` + Flags InterfaceFlags `protobuf:"varint,5,opt,name=flags,proto3,enum=proto.InterfaceFlags" json:"flags,omitempty"` + Ipaddress []string `protobuf:"bytes,6,rep,name=ipaddress,proto3" json:"ipaddress,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Interface) Reset() { *m = Interface{} } +func (m *Interface) String() string { return proto.CompactTextString(m) } +func (*Interface) ProtoMessage() {} +func (*Interface) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *Interface) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Interface.Unmarshal(m, b) +} + +func (m *Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Interface.Marshal(b, m, deterministic) +} + +func (m *Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_Interface.Merge(m, src) +} + +func (m *Interface) XXX_Size() int { + return xxx_messageInfo_Interface.Size(m) +} + +func (m *Interface) XXX_DiscardUnknown() { + xxx_messageInfo_Interface.DiscardUnknown(m) +} + +var xxx_messageInfo_Interface proto.InternalMessageInfo + +func (m *Interface) GetIndex() uint32 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *Interface) GetMtu() uint32 { + if m != nil { + return m.Mtu + } + return 0 +} + +func (m *Interface) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Interface) GetHardwareaddr() string { + if m != nil { + return m.Hardwareaddr + } + return "" +} + +func (m *Interface) GetFlags() InterfaceFlags { + if m != nil { + return m.Flags + } + return InterfaceFlags_FLAG_UNKNOWN +} + +func (m *Interface) GetIpaddress() []string { + if m != nil { + return m.Ipaddress + } + return nil +} + +func init() { + proto.RegisterEnum("proto.AddressFamily", AddressFamily_name, AddressFamily_value) + proto.RegisterEnum("proto.RouteProtocol", RouteProtocol_name, RouteProtocol_value) + proto.RegisterEnum("proto.InterfaceFlags", InterfaceFlags_name, InterfaceFlags_value) + proto.RegisterType((*RoutesReply)(nil), "proto.RoutesReply") + proto.RegisterType((*Route)(nil), "proto.Route") + proto.RegisterType((*InterfacesReply)(nil), "proto.InterfacesReply") + proto.RegisterType((*Interface)(nil), "proto.Interface") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4f, 0x6f, 0xda, 0x4e, + 0x10, 0xfd, 0x99, 0x7f, 0xc1, 0x03, 0x86, 0xcd, 0x26, 0xbf, 0xd4, 0x4a, 0xab, 0x0a, 0xa1, 0x1e, + 0x10, 0xad, 0x48, 0x94, 0x44, 0x39, 0xf5, 0x62, 0x83, 0x49, 0x2d, 0x88, 0xed, 0x6e, 0x4c, 0x5b, + 0xe5, 0x82, 0x1c, 0xbc, 0x50, 0xab, 0x80, 0x91, 0x31, 0x4a, 0xb9, 0xf4, 0xd2, 0xcf, 0xd1, 0xcf, + 0xd0, 0x5b, 0x3f, 0x5f, 0xe5, 0xdd, 0x35, 0x31, 0x91, 0x7a, 0xf2, 0xbe, 0x37, 0x6f, 0x67, 0x77, + 0xde, 0x78, 0x07, 0x64, 0x6f, 0x15, 0x74, 0x56, 0x51, 0x18, 0x87, 0xb8, 0xc8, 0x3e, 0xa7, 0x2f, + 0x67, 0x61, 0x38, 0x9b, 0xd3, 0x33, 0x86, 0x1e, 0x36, 0xd3, 0x33, 0xba, 0x58, 0xc5, 0x5b, 0xae, + 0x69, 0x5e, 0x42, 0x85, 0x84, 0x9b, 0x98, 0xae, 0x09, 0x5d, 0xcd, 0xb7, 0xf8, 0x0d, 0x94, 0x22, + 0x06, 0x55, 0xa9, 0x91, 0x6f, 0x55, 0x2e, 0xaa, 0x5c, 0xd6, 0x61, 0x1a, 0x22, 0x62, 0xcd, 0x5f, + 0x39, 0x28, 0x32, 0x06, 0xbf, 0x02, 0x39, 0x58, 0xc6, 0x34, 0x9a, 0x7a, 0x13, 0xaa, 0x4a, 0x0d, + 0xa9, 0x25, 0x93, 0x27, 0x02, 0x37, 0xa0, 0xe2, 0xd3, 0x75, 0x1c, 0x2c, 0xbd, 0x38, 0x08, 0x97, + 0x6a, 0x8e, 0xc5, 0xb3, 0x14, 0x56, 0xe1, 0x60, 0xe6, 0xc5, 0xf4, 0xd1, 0xdb, 0xaa, 0x79, 0x16, + 0x4d, 0x21, 0x3e, 0x81, 0xd2, 0x82, 0xc6, 0x51, 0x30, 0x51, 0x0b, 0x0d, 0xa9, 0xa5, 0x10, 0x81, + 0xf0, 0x31, 0x14, 0xd7, 0x93, 0x70, 0x45, 0xd5, 0x22, 0xa3, 0x39, 0x48, 0xd4, 0xeb, 0x70, 0x13, + 0x4d, 0xa8, 0x5a, 0x62, 0x69, 0x04, 0xc2, 0xef, 0xa0, 0x34, 0xf5, 0x16, 0xc1, 0x7c, 0xab, 0x1e, + 0x34, 0xa4, 0x56, 0xed, 0xe2, 0x58, 0xd4, 0xa3, 0xf9, 0x7e, 0x44, 0xd7, 0xeb, 0x3e, 0x8b, 0x11, + 0xa1, 0xc1, 0xe7, 0x50, 0x66, 0xe1, 0x49, 0x38, 0x57, 0xcb, 0x7b, 0x7a, 0x56, 0xad, 0x23, 0x62, + 0x64, 0xa7, 0x4a, 0x6e, 0x33, 0x9d, 0x7b, 0xb3, 0xb5, 0x2a, 0xf3, 0xdb, 0x30, 0xd0, 0xec, 0x42, + 0xdd, 0x4c, 0x4d, 0x10, 0xc6, 0x9e, 0x03, 0xec, 0x7c, 0x49, 0xcd, 0x45, 0x22, 0xf9, 0x4e, 0x4b, + 0x32, 0x9a, 0xe6, 0x1f, 0x09, 0xe4, 0x5d, 0x24, 0x39, 0x28, 0x58, 0xfa, 0xf4, 0x3b, 0x33, 0x59, + 0x21, 0x1c, 0x60, 0x04, 0xf9, 0x45, 0xbc, 0x61, 0xc6, 0x2a, 0x24, 0x59, 0x62, 0x0c, 0x85, 0xa5, + 0xb7, 0xa0, 0xc2, 0x4d, 0xb6, 0xc6, 0x4d, 0xa8, 0x7e, 0xf5, 0x22, 0xff, 0xd1, 0x8b, 0xa8, 0xe7, + 0xfb, 0x11, 0x33, 0x54, 0x26, 0x7b, 0x1c, 0x7e, 0x9b, 0x16, 0x52, 0x64, 0x75, 0xff, 0xff, 0xfc, + 0x6a, 0xfd, 0x24, 0x28, 0xea, 0x63, 0x5d, 0x5f, 0x79, 0xdc, 0x42, 0xb5, 0xd4, 0xc8, 0xb3, 0xae, + 0xa7, 0x44, 0xfb, 0x23, 0x28, 0x7b, 0xf6, 0x62, 0x05, 0x64, 0xad, 0x3f, 0x1e, 0x59, 0x77, 0x8e, + 0xd1, 0x45, 0xff, 0xe1, 0x0a, 0x1c, 0x68, 0xfd, 0xb1, 0x69, 0x19, 0x2e, 0xca, 0xe1, 0x32, 0x14, + 0x4c, 0xe7, 0xd3, 0x15, 0xca, 0xe1, 0x2a, 0x94, 0x05, 0x7d, 0x8d, 0x40, 0xf0, 0xd7, 0x08, 0x4e, + 0x73, 0x48, 0x6a, 0xff, 0xce, 0x81, 0xb2, 0xd7, 0x02, 0x7c, 0x08, 0x0a, 0x71, 0x1d, 0x62, 0xbb, + 0x4f, 0x79, 0x8f, 0xa0, 0x2e, 0x28, 0x62, 0xf4, 0x4c, 0x62, 0x74, 0x5d, 0x24, 0x65, 0x74, 0x03, + 0x83, 0x58, 0xc6, 0x10, 0xe5, 0x70, 0x1d, 0x2a, 0x82, 0xd2, 0x6d, 0xdb, 0x45, 0xf9, 0x8c, 0xe6, + 0xce, 0xd5, 0x5c, 0xb3, 0x8b, 0x0a, 0x18, 0x41, 0x55, 0x50, 0x37, 0x9a, 0x6b, 0xf4, 0x50, 0x39, + 0x29, 0x22, 0xcd, 0xae, 0x21, 0x19, 0xd7, 0x00, 0x04, 0xbc, 0x25, 0x2e, 0x82, 0xcc, 0x86, 0x7b, + 0x43, 0x27, 0x1a, 0xaa, 0x64, 0x8f, 0x31, 0x49, 0x0f, 0x55, 0x33, 0xf7, 0xeb, 0x59, 0xc4, 0x1e, + 0x25, 0x69, 0x95, 0x8c, 0xea, 0x8b, 0x4d, 0x1c, 0x54, 0xcb, 0x24, 0xb6, 0xdc, 0x01, 0xaa, 0x67, + 0x04, 0xbd, 0x0f, 0x5d, 0x07, 0x21, 0x8c, 0xa1, 0xb6, 0x3b, 0x99, 0x67, 0x39, 0xcc, 0x9c, 0xae, + 0x6b, 0xba, 0x31, 0x44, 0xed, 0xf6, 0x4f, 0x09, 0x6a, 0xfb, 0xcd, 0x4b, 0x44, 0xfd, 0xa1, 0x76, + 0x33, 0x1e, 0x59, 0x03, 0xcb, 0xfe, 0x6c, 0xf1, 0x4e, 0x70, 0xc6, 0x41, 0x52, 0x92, 0x97, 0x01, + 0x9d, 0xd8, 0x5a, 0xaf, 0xab, 0xdd, 0x25, 0xdd, 0x39, 0x04, 0x85, 0x71, 0x43, 0xdb, 0x76, 0x74, + 0xad, 0x3b, 0x40, 0x79, 0xfc, 0x02, 0x8e, 0x18, 0xe5, 0xd8, 0xa6, 0xe5, 0x8e, 0x5d, 0x9b, 0x2f, + 0x50, 0x61, 0xb7, 0xff, 0x76, 0x34, 0x74, 0x4d, 0xb6, 0xbf, 0x78, 0xf1, 0x03, 0xca, 0x16, 0x8d, + 0x1f, 0xc3, 0xe8, 0x9b, 0x8f, 0xaf, 0xa0, 0xc4, 0x27, 0x0d, 0x3e, 0xe9, 0xf0, 0x89, 0xd4, 0x49, + 0x27, 0x52, 0xc7, 0x48, 0x26, 0xd2, 0x29, 0xce, 0x3e, 0x36, 0xf1, 0x6e, 0xde, 0x03, 0x3c, 0x3d, + 0xa5, 0x7f, 0xee, 0x3c, 0x79, 0xfe, 0xbb, 0xf2, 0xdd, 0xfa, 0x6b, 0x90, 0x27, 0xe1, 0x82, 0x07, + 0xf5, 0xb2, 0xb6, 0x0a, 0xd8, 0xff, 0xe3, 0x48, 0xf7, 0x7c, 0x34, 0x3e, 0x94, 0xd8, 0xe7, 0xf2, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xb7, 0x4b, 0x85, 0x35, 0x05, 0x00, 0x00, +} + +// 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 + +// NetworkdClient is the client API for Networkd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NetworkdClient interface { + Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) + Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) +} + +type networkdClient struct { + cc *grpc.ClientConn +} + +func NewNetworkdClient(cc *grpc.ClientConn) NetworkdClient { + return &networkdClient{cc} +} + +func (c *networkdClient) Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) { + out := new(RoutesReply) + err := c.cc.Invoke(ctx, "/proto.Networkd/Routes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkdClient) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) { + out := new(InterfacesReply) + err := c.cc.Invoke(ctx, "/proto.Networkd/Interfaces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetworkdServer is the server API for Networkd service. +type NetworkdServer interface { + Routes(context.Context, *empty.Empty) (*RoutesReply, error) + Interfaces(context.Context, *empty.Empty) (*InterfacesReply, error) +} + +func RegisterNetworkdServer(s *grpc.Server, srv NetworkdServer) { + s.RegisterService(&_Networkd_serviceDesc, srv) +} + +func _Networkd_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkdServer).Routes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Networkd/Routes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkdServer).Routes(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Networkd_Interfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkdServer).Interfaces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Networkd/Interfaces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkdServer).Interfaces(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _Networkd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Networkd", + HandlerType: (*NetworkdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Routes", + Handler: _Networkd_Routes_Handler, + }, + { + MethodName: "Interfaces", + Handler: _Networkd_Interfaces_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/ntpd/pkg/reg/reg.go b/internal/app/ntpd/pkg/reg/reg.go index ef3a1f6c0..718c16f4e 100644 --- a/internal/app/ntpd/pkg/reg/reg.go +++ b/internal/app/ntpd/pkg/reg/reg.go @@ -12,8 +12,8 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" + proto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/internal/app/ntpd/pkg/ntp" - "github.com/talos-systems/talos/internal/app/ntpd/proto" ) // Registrator is the concrete type that implements the factory.Registrator and diff --git a/internal/app/ntpd/pkg/reg/reg_test.go b/internal/app/ntpd/pkg/reg/reg_test.go index 4928e2da3..f171ed06a 100644 --- a/internal/app/ntpd/pkg/reg/reg_test.go +++ b/internal/app/ntpd/pkg/reg/reg_test.go @@ -16,8 +16,8 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/grpc" + proto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/internal/app/ntpd/pkg/ntp" - "github.com/talos-systems/talos/internal/app/ntpd/proto" "github.com/talos-systems/talos/pkg/grpc/factory" ) diff --git a/internal/app/ntpd/proto/api.pb.go b/internal/app/ntpd/proto/api.pb.go new file mode 100644 index 000000000..ba8468d8c --- /dev/null +++ b/internal/app/ntpd/proto/api.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The response message containing the ntp server +type TimeRequest struct { + Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimeRequest) Reset() { *m = TimeRequest{} } +func (m *TimeRequest) String() string { return proto.CompactTextString(m) } +func (*TimeRequest) ProtoMessage() {} +func (*TimeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *TimeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TimeRequest.Unmarshal(m, b) +} + +func (m *TimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TimeRequest.Marshal(b, m, deterministic) +} + +func (m *TimeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeRequest.Merge(m, src) +} + +func (m *TimeRequest) XXX_Size() int { + return xxx_messageInfo_TimeRequest.Size(m) +} + +func (m *TimeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TimeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeRequest proto.InternalMessageInfo + +func (m *TimeRequest) GetServer() string { + if m != nil { + return m.Server + } + return "" +} + +// The response message containing the ntp server, time, and offset +type TimeReply struct { + Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + Localtime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=localtime,proto3" json:"localtime,omitempty"` + Remotetime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=remotetime,proto3" json:"remotetime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimeReply) Reset() { *m = TimeReply{} } +func (m *TimeReply) String() string { return proto.CompactTextString(m) } +func (*TimeReply) ProtoMessage() {} +func (*TimeReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *TimeReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TimeReply.Unmarshal(m, b) +} + +func (m *TimeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TimeReply.Marshal(b, m, deterministic) +} + +func (m *TimeReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeReply.Merge(m, src) +} + +func (m *TimeReply) XXX_Size() int { + return xxx_messageInfo_TimeReply.Size(m) +} + +func (m *TimeReply) XXX_DiscardUnknown() { + xxx_messageInfo_TimeReply.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeReply proto.InternalMessageInfo + +func (m *TimeReply) GetServer() string { + if m != nil { + return m.Server + } + return "" +} + +func (m *TimeReply) GetLocaltime() *timestamp.Timestamp { + if m != nil { + return m.Localtime + } + return nil +} + +func (m *TimeReply) GetRemotetime() *timestamp.Timestamp { + if m != nil { + return m.Remotetime + } + return nil +} + +func init() { + proto.RegisterType((*TimeRequest)(nil), "proto.TimeRequest") + proto.RegisterType((*TimeReply)(nil), "proto.TimeReply") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x52, 0xd2, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, + 0xa9, 0xfa, 0x60, 0x5e, 0x52, 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x8d, 0x94, + 0x3c, 0xba, 0x64, 0x49, 0x66, 0x6e, 0x6a, 0x71, 0x49, 0x62, 0x6e, 0x01, 0x44, 0x81, 0x92, 0x2a, + 0x17, 0x77, 0x48, 0x66, 0x6e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x90, 0x18, 0x17, + 0x5b, 0x71, 0x6a, 0x51, 0x59, 0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x94, 0xa7, + 0x34, 0x93, 0x91, 0x8b, 0x13, 0xa2, 0xae, 0x20, 0xa7, 0x12, 0x97, 0x2a, 0x21, 0x0b, 0x2e, 0xce, + 0x9c, 0xfc, 0xe4, 0xc4, 0x1c, 0x90, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, + 0x10, 0x17, 0xe8, 0xc1, 0x5c, 0xa0, 0x17, 0x02, 0x73, 0x41, 0x10, 0x42, 0xb1, 0x90, 0x15, 0x17, + 0x57, 0x51, 0x6a, 0x6e, 0x7e, 0x49, 0x2a, 0x58, 0x2b, 0x33, 0x41, 0xad, 0x48, 0xaa, 0x8d, 0xb2, + 0xb9, 0x58, 0xfc, 0x4a, 0x0a, 0x52, 0x84, 0x0c, 0xb8, 0x58, 0x40, 0x0a, 0x84, 0xc4, 0x30, 0xf4, + 0xb9, 0x82, 0x42, 0x44, 0x4a, 0x00, 0x22, 0xa0, 0x87, 0xf0, 0x87, 0x21, 0xc4, 0x53, 0xce, 0x19, + 0xa9, 0xc9, 0xd9, 0x42, 0x42, 0x28, 0xd2, 0xe0, 0xe0, 0xc0, 0xd4, 0xe2, 0x24, 0xc7, 0xc5, 0x99, + 0x9c, 0x9f, 0x0b, 0x11, 0x76, 0xe2, 0x70, 0x2c, 0xc8, 0x0c, 0x00, 0xb1, 0x02, 0x18, 0xa3, 0x20, + 0xb1, 0x91, 0xc4, 0x06, 0xa6, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0xd1, 0xa5, 0x14, + 0xa8, 0x01, 0x00, 0x00, +} + +// 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 + +// NtpdClient is the client API for Ntpd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NtpdClient interface { + Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) + TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) +} + +type ntpdClient struct { + cc *grpc.ClientConn +} + +func NewNtpdClient(cc *grpc.ClientConn) NtpdClient { + return &ntpdClient{cc} +} + +func (c *ntpdClient) Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) { + out := new(TimeReply) + err := c.cc.Invoke(ctx, "/proto.Ntpd/Time", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ntpdClient) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) { + out := new(TimeReply) + err := c.cc.Invoke(ctx, "/proto.Ntpd/TimeCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NtpdServer is the server API for Ntpd service. +type NtpdServer interface { + Time(context.Context, *empty.Empty) (*TimeReply, error) + TimeCheck(context.Context, *TimeRequest) (*TimeReply, error) +} + +func RegisterNtpdServer(s *grpc.Server, srv NtpdServer) { + s.RegisterService(&_Ntpd_serviceDesc, srv) +} + +func _Ntpd_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NtpdServer).Time(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Ntpd/Time", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NtpdServer).Time(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Ntpd_TimeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TimeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NtpdServer).TimeCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Ntpd/TimeCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NtpdServer).TimeCheck(ctx, req.(*TimeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Ntpd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Ntpd", + HandlerType: (*NtpdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Time", + Handler: _Ntpd_Time_Handler, + }, + { + MethodName: "TimeCheck", + Handler: _Ntpd_TimeCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/osd/internal/reg/init_client.go b/internal/app/osd/internal/reg/init_client.go index 8340ab84b..8e0fd33ab 100644 --- a/internal/app/osd/internal/reg/init_client.go +++ b/internal/app/osd/internal/reg/init_client.go @@ -11,7 +11,7 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/talos-systems/talos/internal/app/machined/proto" + proto "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/internal/app/osd/internal/reg/networkd_client.go b/internal/app/osd/internal/reg/networkd_client.go index 9b1f09585..f1552584b 100644 --- a/internal/app/osd/internal/reg/networkd_client.go +++ b/internal/app/osd/internal/reg/networkd_client.go @@ -10,7 +10,7 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/talos-systems/talos/internal/app/networkd/proto" + proto "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/internal/app/osd/internal/reg/ntp_client.go b/internal/app/osd/internal/reg/ntp_client.go index 7e475104c..79cea0bbc 100644 --- a/internal/app/osd/internal/reg/ntp_client.go +++ b/internal/app/osd/internal/reg/ntp_client.go @@ -10,7 +10,7 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/talos-systems/talos/internal/app/ntpd/proto" + proto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/pkg/constants" ) diff --git a/internal/app/osd/internal/reg/reg.go b/internal/app/osd/internal/reg/reg.go index 2b97b9425..7b4a186ad 100644 --- a/internal/app/osd/internal/reg/reg.go +++ b/internal/app/osd/internal/reg/reg.go @@ -22,10 +22,10 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" - initproto "github.com/talos-systems/talos/internal/app/machined/proto" - networkdproto "github.com/talos-systems/talos/internal/app/networkd/proto" - ntpdproto "github.com/talos-systems/talos/internal/app/ntpd/proto" - "github.com/talos-systems/talos/internal/app/osd/proto" + initproto "github.com/talos-systems/talos/api/machine" + networkdproto "github.com/talos-systems/talos/api/network" + proto "github.com/talos-systems/talos/api/os" + ntpdproto "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/internal/pkg/containers" "github.com/talos-systems/talos/internal/pkg/containers/containerd" "github.com/talos-systems/talos/internal/pkg/containers/cri" diff --git a/internal/app/proxyd/proto/api.pb.go b/internal/app/proxyd/proto/api.pb.go new file mode 100644 index 000000000..61fe7dcfb --- /dev/null +++ b/internal/app/proxyd/proto/api.pb.go @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The response message containing the proxyd backend status. +type BackendsReply struct { + Backends []*Backend `protobuf:"bytes,1,rep,name=backends,proto3" json:"backends,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BackendsReply) Reset() { *m = BackendsReply{} } +func (m *BackendsReply) String() string { return proto.CompactTextString(m) } +func (*BackendsReply) ProtoMessage() {} +func (*BackendsReply) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *BackendsReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BackendsReply.Unmarshal(m, b) +} + +func (m *BackendsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BackendsReply.Marshal(b, m, deterministic) +} + +func (m *BackendsReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_BackendsReply.Merge(m, src) +} + +func (m *BackendsReply) XXX_Size() int { + return xxx_messageInfo_BackendsReply.Size(m) +} + +func (m *BackendsReply) XXX_DiscardUnknown() { + xxx_messageInfo_BackendsReply.DiscardUnknown(m) +} + +var xxx_messageInfo_BackendsReply proto.InternalMessageInfo + +func (m *BackendsReply) GetBackends() []*Backend { + if m != nil { + return m.Backends + } + return nil +} + +// Backend represents the proxyd backend +type Backend struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` + Connections uint32 `protobuf:"varint,3,opt,name=connections,proto3" json:"connections,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Backend) Reset() { *m = Backend{} } +func (m *Backend) String() string { return proto.CompactTextString(m) } +func (*Backend) ProtoMessage() {} +func (*Backend) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *Backend) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Backend.Unmarshal(m, b) +} + +func (m *Backend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Backend.Marshal(b, m, deterministic) +} + +func (m *Backend) XXX_Merge(src proto.Message) { + xxx_messageInfo_Backend.Merge(m, src) +} + +func (m *Backend) XXX_Size() int { + return xxx_messageInfo_Backend.Size(m) +} + +func (m *Backend) XXX_DiscardUnknown() { + xxx_messageInfo_Backend.DiscardUnknown(m) +} + +var xxx_messageInfo_Backend proto.InternalMessageInfo + +func (m *Backend) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Backend) GetAddr() string { + if m != nil { + return m.Addr + } + return "" +} + +func (m *Backend) GetConnections() uint32 { + if m != nil { + return m.Connections + } + return 0 +} + +func init() { + proto.RegisterType((*BackendsReply)(nil), "proto.BackendsReply") + proto.RegisterType((*Backend)(nil), "proto.Backend") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x52, 0xd2, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, + 0xa9, 0xfa, 0x60, 0x5e, 0x52, 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x8d, 0x92, + 0x35, 0x17, 0xaf, 0x53, 0x62, 0x72, 0x76, 0x6a, 0x5e, 0x4a, 0x71, 0x50, 0x6a, 0x41, 0x4e, 0xa5, + 0x90, 0x16, 0x17, 0x47, 0x12, 0x54, 0x40, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x88, 0x0f, 0xa2, + 0x54, 0x0f, 0xaa, 0x2e, 0x08, 0x2e, 0xaf, 0xe4, 0xcf, 0xc5, 0x0e, 0x15, 0x14, 0xe2, 0xe3, 0x62, + 0xca, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x62, 0xca, 0x4c, 0x11, 0x12, 0xe2, 0x62, + 0x49, 0x4c, 0x49, 0x29, 0x92, 0x60, 0x02, 0x8b, 0x80, 0xd9, 0x42, 0x0a, 0x5c, 0xdc, 0xc9, 0xf9, + 0x79, 0x79, 0xa9, 0xc9, 0x25, 0x99, 0xf9, 0x79, 0xc5, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xbc, 0x41, + 0xc8, 0x42, 0x46, 0x4e, 0x5c, 0x6c, 0x01, 0x45, 0xf9, 0x15, 0x95, 0x29, 0x42, 0x16, 0x5c, 0x1c, + 0x30, 0x77, 0x09, 0x89, 0xe9, 0x41, 0x7c, 0xa0, 0x07, 0xf3, 0x81, 0x9e, 0x2b, 0xc8, 0x07, 0x52, + 0x22, 0xa8, 0x0e, 0x83, 0x78, 0xc0, 0x49, 0x8e, 0x8b, 0x33, 0x39, 0x3f, 0x17, 0x22, 0xe5, 0xc4, + 0xe1, 0x58, 0x90, 0x19, 0x00, 0x62, 0x05, 0x30, 0x46, 0x41, 0x82, 0x23, 0x89, 0x0d, 0x4c, 0x19, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x1f, 0xc0, 0xf4, 0x29, 0x01, 0x00, 0x00, +} + +// 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 + +// ProxydClient is the client API for Proxyd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ProxydClient interface { + Backends(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*BackendsReply, error) +} + +type proxydClient struct { + cc *grpc.ClientConn +} + +func NewProxydClient(cc *grpc.ClientConn) ProxydClient { + return &proxydClient{cc} +} + +func (c *proxydClient) Backends(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*BackendsReply, error) { + out := new(BackendsReply) + err := c.cc.Invoke(ctx, "/proto.Proxyd/Backends", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProxydServer is the server API for Proxyd service. +type ProxydServer interface { + Backends(context.Context, *empty.Empty) (*BackendsReply, error) +} + +func RegisterProxydServer(s *grpc.Server, srv ProxydServer) { + s.RegisterService(&_Proxyd_serviceDesc, srv) +} + +func _Proxyd_Backends_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProxydServer).Backends(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Proxyd/Backends", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProxydServer).Backends(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _Proxyd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Proxyd", + HandlerType: (*ProxydServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Backends", + Handler: _Proxyd_Backends_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/internal/app/trustd/internal/reg/reg.go b/internal/app/trustd/internal/reg/reg.go index d709a4f07..b7fba9827 100644 --- a/internal/app/trustd/internal/reg/reg.go +++ b/internal/app/trustd/internal/reg/reg.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc" - "github.com/talos-systems/talos/internal/app/trustd/proto" + proto "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/crypto/x509" "github.com/talos-systems/talos/pkg/userdata" ) diff --git a/internal/app/trustd/proto/api.pb.go b/internal/app/trustd/proto/api.pb.go new file mode 100644 index 000000000..6ee4dbabd --- /dev/null +++ b/internal/app/trustd/proto/api.pb.go @@ -0,0 +1,475 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api.proto + +package proto + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// The request message containing the process name. +type CertificateRequest struct { + Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CertificateRequest) Reset() { *m = CertificateRequest{} } +func (m *CertificateRequest) String() string { return proto.CompactTextString(m) } +func (*CertificateRequest) ProtoMessage() {} +func (*CertificateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} + +func (m *CertificateRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CertificateRequest.Unmarshal(m, b) +} + +func (m *CertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CertificateRequest.Marshal(b, m, deterministic) +} + +func (m *CertificateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CertificateRequest.Merge(m, src) +} + +func (m *CertificateRequest) XXX_Size() int { + return xxx_messageInfo_CertificateRequest.Size(m) +} + +func (m *CertificateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CertificateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CertificateRequest proto.InternalMessageInfo + +func (m *CertificateRequest) GetCsr() []byte { + if m != nil { + return m.Csr + } + return nil +} + +// The response message containing the requested logs. +type CertificateResponse struct { + Ca []byte `protobuf:"bytes,1,opt,name=ca,proto3" json:"ca,omitempty"` + Crt []byte `protobuf:"bytes,2,opt,name=crt,proto3" json:"crt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CertificateResponse) Reset() { *m = CertificateResponse{} } +func (m *CertificateResponse) String() string { return proto.CompactTextString(m) } +func (*CertificateResponse) ProtoMessage() {} +func (*CertificateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} + +func (m *CertificateResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CertificateResponse.Unmarshal(m, b) +} + +func (m *CertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CertificateResponse.Marshal(b, m, deterministic) +} + +func (m *CertificateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CertificateResponse.Merge(m, src) +} + +func (m *CertificateResponse) XXX_Size() int { + return xxx_messageInfo_CertificateResponse.Size(m) +} + +func (m *CertificateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CertificateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CertificateResponse proto.InternalMessageInfo + +func (m *CertificateResponse) GetCa() []byte { + if m != nil { + return m.Ca + } + return nil +} + +func (m *CertificateResponse) GetCrt() []byte { + if m != nil { + return m.Crt + } + return nil +} + +// The request message for reading a file on disk. +type ReadFileRequest struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadFileRequest) Reset() { *m = ReadFileRequest{} } +func (m *ReadFileRequest) String() string { return proto.CompactTextString(m) } +func (*ReadFileRequest) ProtoMessage() {} +func (*ReadFileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{2} +} + +func (m *ReadFileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadFileRequest.Unmarshal(m, b) +} + +func (m *ReadFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadFileRequest.Marshal(b, m, deterministic) +} + +func (m *ReadFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileRequest.Merge(m, src) +} + +func (m *ReadFileRequest) XXX_Size() int { + return xxx_messageInfo_ReadFileRequest.Size(m) +} + +func (m *ReadFileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadFileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadFileRequest proto.InternalMessageInfo + +func (m *ReadFileRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +// The response message for reading a file on disk. +type ReadFileResponse struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadFileResponse) Reset() { *m = ReadFileResponse{} } +func (m *ReadFileResponse) String() string { return proto.CompactTextString(m) } +func (*ReadFileResponse) ProtoMessage() {} +func (*ReadFileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} + +func (m *ReadFileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadFileResponse.Unmarshal(m, b) +} + +func (m *ReadFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadFileResponse.Marshal(b, m, deterministic) +} + +func (m *ReadFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadFileResponse.Merge(m, src) +} + +func (m *ReadFileResponse) XXX_Size() int { + return xxx_messageInfo_ReadFileResponse.Size(m) +} + +func (m *ReadFileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadFileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadFileResponse proto.InternalMessageInfo + +func (m *ReadFileResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// The request message containing the process name. +type WriteFileRequest struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Perm int32 `protobuf:"varint,3,opt,name=perm,proto3" json:"perm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WriteFileRequest) Reset() { *m = WriteFileRequest{} } +func (m *WriteFileRequest) String() string { return proto.CompactTextString(m) } +func (*WriteFileRequest) ProtoMessage() {} +func (*WriteFileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{4} +} + +func (m *WriteFileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WriteFileRequest.Unmarshal(m, b) +} + +func (m *WriteFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WriteFileRequest.Marshal(b, m, deterministic) +} + +func (m *WriteFileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteFileRequest.Merge(m, src) +} + +func (m *WriteFileRequest) XXX_Size() int { + return xxx_messageInfo_WriteFileRequest.Size(m) +} + +func (m *WriteFileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WriteFileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteFileRequest proto.InternalMessageInfo + +func (m *WriteFileRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *WriteFileRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *WriteFileRequest) GetPerm() int32 { + if m != nil { + return m.Perm + } + return 0 +} + +// The response message containing the requested logs. +type WriteFileResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WriteFileResponse) Reset() { *m = WriteFileResponse{} } +func (m *WriteFileResponse) String() string { return proto.CompactTextString(m) } +func (*WriteFileResponse) ProtoMessage() {} +func (*WriteFileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{5} +} + +func (m *WriteFileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WriteFileResponse.Unmarshal(m, b) +} + +func (m *WriteFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WriteFileResponse.Marshal(b, m, deterministic) +} + +func (m *WriteFileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteFileResponse.Merge(m, src) +} + +func (m *WriteFileResponse) XXX_Size() int { + return xxx_messageInfo_WriteFileResponse.Size(m) +} + +func (m *WriteFileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WriteFileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteFileResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*CertificateRequest)(nil), "proto.CertificateRequest") + proto.RegisterType((*CertificateResponse)(nil), "proto.CertificateResponse") + proto.RegisterType((*ReadFileRequest)(nil), "proto.ReadFileRequest") + proto.RegisterType((*ReadFileResponse)(nil), "proto.ReadFileResponse") + proto.RegisterType((*WriteFileRequest)(nil), "proto.WriteFileRequest") + proto.RegisterType((*WriteFileResponse)(nil), "proto.WriteFileResponse") +} + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x4b, 0xc3, 0x40, + 0x10, 0xc5, 0x49, 0xfa, 0x87, 0x66, 0x14, 0xad, 0x53, 0xd0, 0x98, 0x83, 0x94, 0x05, 0x4b, 0x4f, + 0x3d, 0xe8, 0xc1, 0x83, 0x20, 0x58, 0xc5, 0xa3, 0x94, 0x45, 0x10, 0xbc, 0xad, 0x9b, 0x15, 0x17, + 0xac, 0x59, 0x77, 0xa7, 0x9f, 0xd2, 0x2f, 0x25, 0xdd, 0xdd, 0xa4, 0xb5, 0x11, 0x3c, 0xcd, 0x23, + 0xf3, 0x7e, 0x2f, 0x99, 0x47, 0x20, 0x13, 0x46, 0xcf, 0x8c, 0xad, 0xa8, 0xc2, 0x9e, 0x1f, 0x6c, + 0x02, 0x78, 0xa7, 0x2c, 0xe9, 0x37, 0x2d, 0x05, 0x29, 0xae, 0xbe, 0x56, 0xca, 0x11, 0x0e, 0xa1, + 0x23, 0x9d, 0xcd, 0x93, 0x71, 0x32, 0xdd, 0xe7, 0x6b, 0xc9, 0xae, 0x60, 0xf4, 0xcb, 0xe7, 0x4c, + 0xf5, 0xe9, 0x14, 0x1e, 0x40, 0x2a, 0x45, 0xf4, 0xa5, 0x52, 0x78, 0xd0, 0x52, 0x9e, 0x46, 0xd0, + 0x12, 0x3b, 0x87, 0x43, 0xae, 0x44, 0xf9, 0xa0, 0x3f, 0x9a, 0x74, 0x84, 0xae, 0x11, 0xf4, 0xee, + 0xb1, 0x8c, 0x7b, 0xcd, 0x26, 0x30, 0xdc, 0xd8, 0x62, 0x38, 0x42, 0xb7, 0x14, 0x54, 0xc7, 0x7b, + 0xcd, 0x1e, 0x61, 0xf8, 0x6c, 0x35, 0xa9, 0x7f, 0xf2, 0x1a, 0x36, 0xdd, 0xb0, 0xde, 0xa7, 0xec, + 0x32, 0xef, 0x8c, 0x93, 0x69, 0x8f, 0x7b, 0xcd, 0x46, 0x70, 0xb4, 0x95, 0x17, 0x5e, 0x7c, 0xf1, + 0x9d, 0x40, 0xff, 0xc9, 0xae, 0x1c, 0x95, 0x78, 0x0f, 0x7b, 0x5b, 0x77, 0xe3, 0x69, 0x68, 0x6f, + 0xd6, 0xee, 0xac, 0x28, 0xfe, 0x5a, 0xc5, 0x4b, 0xae, 0x61, 0x50, 0x5f, 0x87, 0xc7, 0xd1, 0xb7, + 0xd3, 0x4a, 0x71, 0xd2, 0x7a, 0x1e, 0xe1, 0x1b, 0xc8, 0x9a, 0x4f, 0xc4, 0xda, 0xb5, 0x5b, 0x42, + 0x91, 0xb7, 0x17, 0x81, 0x9f, 0x9f, 0x41, 0x26, 0xab, 0x65, 0x58, 0xcf, 0x07, 0xb7, 0x46, 0x2f, + 0xd6, 0x6a, 0x91, 0xbc, 0x84, 0x5f, 0xe0, 0xb5, 0xef, 0xc7, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x59, 0x5a, 0x3f, 0x46, 0x1d, 0x02, 0x00, 0x00, +} + +// 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 + +// TrustdClient is the client API for Trustd service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TrustdClient interface { + Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) + ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) + WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) +} + +type trustdClient struct { + cc *grpc.ClientConn +} + +func NewTrustdClient(cc *grpc.ClientConn) TrustdClient { + return &trustdClient{cc} +} + +func (c *trustdClient) Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { + out := new(CertificateResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/Certificate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *trustdClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) { + out := new(ReadFileResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/ReadFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *trustdClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) { + out := new(WriteFileResponse) + err := c.cc.Invoke(ctx, "/proto.Trustd/WriteFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TrustdServer is the server API for Trustd service. +type TrustdServer interface { + Certificate(context.Context, *CertificateRequest) (*CertificateResponse, error) + ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) + WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) +} + +func RegisterTrustdServer(s *grpc.Server, srv TrustdServer) { + s.RegisterService(&_Trustd_serviceDesc, srv) +} + +func _Trustd_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CertificateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).Certificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/Certificate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).Certificate(ctx, req.(*CertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Trustd_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).ReadFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/ReadFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).ReadFile(ctx, req.(*ReadFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Trustd_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrustdServer).WriteFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Trustd/WriteFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrustdServer).WriteFile(ctx, req.(*WriteFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Trustd_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Trustd", + HandlerType: (*TrustdServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Certificate", + Handler: _Trustd_Certificate_Handler, + }, + { + MethodName: "ReadFile", + Handler: _Trustd_ReadFile_Handler, + }, + { + MethodName: "WriteFile", + Handler: _Trustd_WriteFile_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/pkg/grpc/gen/gen.go b/pkg/grpc/gen/gen.go index 02e452a54..09da6c3a3 100644 --- a/pkg/grpc/gen/gen.go +++ b/pkg/grpc/gen/gen.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/go-multierror" "google.golang.org/grpc" - "github.com/talos-systems/talos/internal/app/trustd/proto" + proto "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/crypto/x509" "github.com/talos-systems/talos/pkg/grpc/middleware/auth/basic" "github.com/talos-systems/talos/pkg/userdata"