Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterDNSHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
- func RegisterDNSHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DNSClient) error
- func RegisterDNSHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDNSHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DNSServer) error
- func RegisterDNSServer(s grpc.ServiceRegistrar, srv DNSServer)
- type DNSClient
- type DNSServer
- type ListRequest
- type ListResponse
- type Record
- func (*Record) Descriptor() ([]byte, []int)deprecated
- func (x *Record) GetA() []*Record_A
- func (x *Record) GetAaaa() []*Record_AAAA
- func (x *Record) GetCname() []*Record_CNAME
- func (x *Record) GetTxt() []*Record_TXT
- func (*Record) ProtoMessage()
- func (x *Record) ProtoReflect() protoreflect.Message
- func (x *Record) Reset()
- func (x *Record) String() string
- type Record_A
- type Record_AAAA
- type Record_CNAME
- func (*Record_CNAME) Descriptor() ([]byte, []int)deprecated
- func (x *Record_CNAME) GetHost() string
- func (x *Record_CNAME) GetTtl() int32
- func (*Record_CNAME) ProtoMessage()
- func (x *Record_CNAME) ProtoReflect() protoreflect.Message
- func (x *Record_CNAME) Reset()
- func (x *Record_CNAME) String() string
- type Record_TXT
- type Result
- type UnimplementedDNSServer
- func (UnimplementedDNSServer) Delete(context.Context, *Zone) (*Result, error)
- func (UnimplementedDNSServer) Get(context.Context, *Zone) (*Zone, error)
- func (UnimplementedDNSServer) List(context.Context, *ListRequest) (*ListResponse, error)
- func (UnimplementedDNSServer) Put(context.Context, *Zone) (*Result, error)
- type UnsafeDNSServer
- type Zone
Constants ¶
This section is empty.
Variables ¶
var DNS_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nocloud.dns.DNS", HandlerType: (*DNSServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _DNS_Get_Handler, }, { MethodName: "List", Handler: _DNS_List_Handler, }, { MethodName: "Put", Handler: _DNS_Put_Handler, }, { MethodName: "Delete", Handler: _DNS_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/dns/proto/dns.proto", }
DNS_ServiceDesc is the grpc.ServiceDesc for DNS service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pkg_dns_proto_dns_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDNSHandler ¶
func RegisterDNSHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
RegisterDNSHandler registers the http handlers for service DNS to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDNSHandlerClient ¶
RegisterDNSHandlerClient registers the http handlers for service DNS to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DNSClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DNSClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DNSClient" to call the correct interceptors.
func RegisterDNSHandlerFromEndpoint ¶
func RegisterDNSHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDNSHandlerFromEndpoint is same as RegisterDNSHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDNSHandlerServer ¶
RegisterDNSHandlerServer registers the http handlers for service DNS to "mux". UnaryRPC :call DNSServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDNSHandlerFromEndpoint instead.
func RegisterDNSServer ¶
func RegisterDNSServer(s grpc.ServiceRegistrar, srv DNSServer)
Types ¶
type DNSClient ¶
type DNSClient interface { Get(ctx context.Context, in *Zone, opts ...grpc.CallOption) (*Zone, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Put(ctx context.Context, in *Zone, opts ...grpc.CallOption) (*Result, error) Delete(ctx context.Context, in *Zone, opts ...grpc.CallOption) (*Result, error) }
DNSClient is the client API for DNS service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDNSClient ¶
func NewDNSClient(cc grpc.ClientConnInterface) DNSClient
type DNSServer ¶
type DNSServer interface { Get(context.Context, *Zone) (*Zone, error) List(context.Context, *ListRequest) (*ListResponse, error) Put(context.Context, *Zone) (*Result, error) Delete(context.Context, *Zone) (*Result, error) // contains filtered or unexported methods }
DNSServer is the server API for DNS service. All implementations must embed UnimplementedDNSServer for forward compatibility
type ListRequest ¶
type ListRequest struct {
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct { Zones []string `protobuf:"bytes,1,rep,name=zones,proto3" json:"zones,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetZones ¶
func (x *ListResponse) GetZones() []string
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type Record ¶
type Record struct { A []*Record_A `protobuf:"bytes,1,rep,name=a,proto3" json:"a,omitempty"` Aaaa []*Record_AAAA `protobuf:"bytes,2,rep,name=aaaa,proto3" json:"aaaa,omitempty"` Cname []*Record_CNAME `protobuf:"bytes,3,rep,name=cname,proto3" json:"cname,omitempty"` Txt []*Record_TXT `protobuf:"bytes,4,rep,name=txt,proto3" json:"txt,omitempty"` // contains filtered or unexported fields }
func (*Record) Descriptor
deprecated
func (*Record) GetAaaa ¶
func (x *Record) GetAaaa() []*Record_AAAA
func (*Record) GetCname ¶
func (x *Record) GetCname() []*Record_CNAME
func (*Record) GetTxt ¶
func (x *Record) GetTxt() []*Record_TXT
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶
func (x *Record) ProtoReflect() protoreflect.Message
type Record_A ¶
type Record_A struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` // contains filtered or unexported fields }
func (*Record_A) Descriptor
deprecated
func (*Record_A) ProtoMessage ¶
func (*Record_A) ProtoMessage()
func (*Record_A) ProtoReflect ¶
func (x *Record_A) ProtoReflect() protoreflect.Message
type Record_AAAA ¶
type Record_AAAA struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` // contains filtered or unexported fields }
func (*Record_AAAA) Descriptor
deprecated
func (*Record_AAAA) Descriptor() ([]byte, []int)
Deprecated: Use Record_AAAA.ProtoReflect.Descriptor instead.
func (*Record_AAAA) GetIp ¶
func (x *Record_AAAA) GetIp() string
func (*Record_AAAA) GetTtl ¶
func (x *Record_AAAA) GetTtl() int32
func (*Record_AAAA) ProtoMessage ¶
func (*Record_AAAA) ProtoMessage()
func (*Record_AAAA) ProtoReflect ¶
func (x *Record_AAAA) ProtoReflect() protoreflect.Message
func (*Record_AAAA) Reset ¶
func (x *Record_AAAA) Reset()
func (*Record_AAAA) String ¶
func (x *Record_AAAA) String() string
type Record_CNAME ¶
type Record_CNAME struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` // contains filtered or unexported fields }
func (*Record_CNAME) Descriptor
deprecated
func (*Record_CNAME) Descriptor() ([]byte, []int)
Deprecated: Use Record_CNAME.ProtoReflect.Descriptor instead.
func (*Record_CNAME) GetHost ¶
func (x *Record_CNAME) GetHost() string
func (*Record_CNAME) GetTtl ¶
func (x *Record_CNAME) GetTtl() int32
func (*Record_CNAME) ProtoMessage ¶
func (*Record_CNAME) ProtoMessage()
func (*Record_CNAME) ProtoReflect ¶
func (x *Record_CNAME) ProtoReflect() protoreflect.Message
func (*Record_CNAME) Reset ¶
func (x *Record_CNAME) Reset()
func (*Record_CNAME) String ¶
func (x *Record_CNAME) String() string
type Record_TXT ¶
type Record_TXT struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` // contains filtered or unexported fields }
func (*Record_TXT) Descriptor
deprecated
func (*Record_TXT) Descriptor() ([]byte, []int)
Deprecated: Use Record_TXT.ProtoReflect.Descriptor instead.
func (*Record_TXT) GetText ¶
func (x *Record_TXT) GetText() string
func (*Record_TXT) GetTtl ¶
func (x *Record_TXT) GetTtl() int32
func (*Record_TXT) ProtoMessage ¶
func (*Record_TXT) ProtoMessage()
func (*Record_TXT) ProtoReflect ¶
func (x *Record_TXT) ProtoReflect() protoreflect.Message
func (*Record_TXT) Reset ¶
func (x *Record_TXT) Reset()
func (*Record_TXT) String ¶
func (x *Record_TXT) String() string
type Result ¶
type Result struct { Result int64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*Result) Descriptor
deprecated
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type UnimplementedDNSServer ¶
type UnimplementedDNSServer struct { }
UnimplementedDNSServer must be embedded to have forward compatible implementations.
func (UnimplementedDNSServer) List ¶
func (UnimplementedDNSServer) List(context.Context, *ListRequest) (*ListResponse, error)
type UnsafeDNSServer ¶
type UnsafeDNSServer interface {
// contains filtered or unexported methods
}
UnsafeDNSServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DNSServer will result in compilation errors.
type Zone ¶
type Zone struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Locations map[string]*Record `` /* 159-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Zone) Descriptor
deprecated
func (*Zone) GetLocations ¶
func (*Zone) ProtoMessage ¶
func (*Zone) ProtoMessage()
func (*Zone) ProtoReflect ¶
func (x *Zone) ProtoReflect() protoreflect.Message