mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-11 09:07:05 +02:00
This replaces codegen version of apid proxying with talos-systems/grpc-proxy based version. Proxying is transparent, it doesn't require exact information about methods and response types. It requires some common layout response to enhance it properly with node metadata or errors. There should be no signifcant changes to the API with the previous version, but it's worth mentioning a few changes: 1. grpc.ClientConn is established just once per upstream (either local service or remote apid instance). 2. When called without `-t` (`targets`), apid proxies immediately down to local service skipping proxying to itself (as before), which results in empty node metadata in response (before it had local node IP). Might revert this later to proxy to itself (?). 3. Streaming APIs are now fully supported with multiple targets, but message definition doesn't contain `ResponseMetadata`, so streaming APIs are broken now with targets (needs a fix). 4. Errors are now returned as responses with `Error` field set in `ResponseMetadata`, this requires client library update and `osctl` to handle it properly. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
317 lines
10 KiB
Go
317 lines
10 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: common/common.proto
|
|
|
|
package common
|
|
|
|
import (
|
|
fmt "fmt"
|
|
math "math"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var (
|
|
_ = proto.Marshal
|
|
_ = fmt.Errorf
|
|
_ = 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_8f954d82c0b891f6, []int{0}
|
|
}
|
|
|
|
// Common metadata message nested in all reply message types
|
|
type ResponseMetadata struct {
|
|
// hostname of the server response comes from (injected by proxy)
|
|
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
|
|
// error is set if request failed to the upstream (rest of response is undefined)
|
|
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ResponseMetadata) Reset() { *m = ResponseMetadata{} }
|
|
func (m *ResponseMetadata) String() string { return proto.CompactTextString(m) }
|
|
func (*ResponseMetadata) ProtoMessage() {}
|
|
func (*ResponseMetadata) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_8f954d82c0b891f6, []int{0}
|
|
}
|
|
|
|
func (m *ResponseMetadata) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ResponseMetadata.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ResponseMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ResponseMetadata.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ResponseMetadata) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ResponseMetadata.Merge(m, src)
|
|
}
|
|
|
|
func (m *ResponseMetadata) XXX_Size() int {
|
|
return xxx_messageInfo_ResponseMetadata.Size(m)
|
|
}
|
|
|
|
func (m *ResponseMetadata) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ResponseMetadata.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ResponseMetadata proto.InternalMessageInfo
|
|
|
|
func (m *ResponseMetadata) GetHostname() string {
|
|
if m != nil {
|
|
return m.Hostname
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ResponseMetadata) GetError() string {
|
|
if m != nil {
|
|
return m.Error
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type DataResponse struct {
|
|
Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DataResponse) Reset() { *m = DataResponse{} }
|
|
func (m *DataResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*DataResponse) ProtoMessage() {}
|
|
func (*DataResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_8f954d82c0b891f6, []int{1}
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DataResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DataResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DataResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Size() int {
|
|
return xxx_messageInfo_DataResponse.Size(m)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DataResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DataResponse proto.InternalMessageInfo
|
|
|
|
func (m *DataResponse) GetMetadata() *ResponseMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DataResponse) GetBytes() []byte {
|
|
if m != nil {
|
|
return m.Bytes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DataReply struct {
|
|
Response []*DataResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DataReply) Reset() { *m = DataReply{} }
|
|
func (m *DataReply) String() string { return proto.CompactTextString(m) }
|
|
func (*DataReply) ProtoMessage() {}
|
|
func (*DataReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_8f954d82c0b891f6, []int{2}
|
|
}
|
|
|
|
func (m *DataReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DataReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DataReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DataReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Size() int {
|
|
return xxx_messageInfo_DataReply.Size(m)
|
|
}
|
|
|
|
func (m *DataReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DataReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DataReply proto.InternalMessageInfo
|
|
|
|
func (m *DataReply) GetResponse() []*DataResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type EmptyResponse struct {
|
|
Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
|
|
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*EmptyResponse) ProtoMessage() {}
|
|
func (*EmptyResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_8f954d82c0b891f6, []int{3}
|
|
}
|
|
|
|
func (m *EmptyResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_EmptyResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_EmptyResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *EmptyResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EmptyResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *EmptyResponse) XXX_Size() int {
|
|
return xxx_messageInfo_EmptyResponse.Size(m)
|
|
}
|
|
|
|
func (m *EmptyResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EmptyResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EmptyResponse proto.InternalMessageInfo
|
|
|
|
func (m *EmptyResponse) GetMetadata() *ResponseMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type EmptyReply struct {
|
|
Response []*EmptyResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *EmptyReply) Reset() { *m = EmptyReply{} }
|
|
func (m *EmptyReply) String() string { return proto.CompactTextString(m) }
|
|
func (*EmptyReply) ProtoMessage() {}
|
|
func (*EmptyReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_8f954d82c0b891f6, []int{4}
|
|
}
|
|
|
|
func (m *EmptyReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_EmptyReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *EmptyReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_EmptyReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *EmptyReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EmptyReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *EmptyReply) XXX_Size() int {
|
|
return xxx_messageInfo_EmptyReply.Size(m)
|
|
}
|
|
|
|
func (m *EmptyReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EmptyReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EmptyReply proto.InternalMessageInfo
|
|
|
|
func (m *EmptyReply) GetResponse() []*EmptyResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("common.ContainerDriver", ContainerDriver_name, ContainerDriver_value)
|
|
proto.RegisterType((*ResponseMetadata)(nil), "common.ResponseMetadata")
|
|
proto.RegisterType((*DataResponse)(nil), "common.DataResponse")
|
|
proto.RegisterType((*DataReply)(nil), "common.DataReply")
|
|
proto.RegisterType((*EmptyResponse)(nil), "common.EmptyResponse")
|
|
proto.RegisterType((*EmptyReply)(nil), "common.EmptyReply")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("common/common.proto", fileDescriptor_8f954d82c0b891f6) }
|
|
|
|
var fileDescriptor_8f954d82c0b891f6 = []byte{
|
|
// 279 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd1, 0xcf, 0x4b, 0xc3, 0x30,
|
|
0x14, 0x07, 0x70, 0xeb, 0x70, 0x76, 0x6f, 0x53, 0x4b, 0x9c, 0x50, 0x3c, 0x8d, 0x9e, 0xe6, 0xc4,
|
|
0x55, 0xa7, 0x57, 0x11, 0x6d, 0x7b, 0xd8, 0xc1, 0x09, 0xc1, 0xd3, 0x6e, 0xa9, 0x06, 0x57, 0x58,
|
|
0x9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