Documentation
¶
Overview ¶
Package api is a generated protocol buffer package.
API Service ¶
It is generated from these files:
api/api.proto
It has these top-level messages:
Record
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterDDNSServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDDNSServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDDNSServiceServer(s *grpc.Server, srv DDNSServiceServer)
- func Run(iface string) error
- func RunEndPoint(grpcAddress string, address string, opts ...runtime.ServeMuxOption) error
- type DDNSServiceClient
- type DDNSServiceServer
- type Record
- func (*Record) Descriptor() ([]byte, []int)
- func (m *Record) GetDomain() string
- func (m *Record) GetExpires() int32
- func (m *Record) GetId() string
- func (m *Record) GetIp() string
- func (m *Record) GetPTR() bool
- func (m *Record) GetTTL() int32
- func (m *Record) GetType() string
- func (*Record) ProtoMessage()
- func (m *Record) Reset()
- func (m *Record) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDDNSServiceHandler ¶
func RegisterDDNSServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDDNSServiceHandler registers the http handlers for service DDNSService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDDNSServiceHandlerFromEndpoint ¶
func RegisterDDNSServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDDNSServiceHandlerFromEndpoint is same as RegisterDDNSServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDDNSServiceServer ¶
func RegisterDDNSServiceServer(s *grpc.Server, srv DDNSServiceServer)
func RunEndPoint ¶
func RunEndPoint(grpcAddress string, address string, opts ...runtime.ServeMuxOption) error
RunEndPoint start the JSON restful api
Types ¶
type DDNSServiceClient ¶
type DDNSServiceClient interface {
// Echo method receives a simple message and returns it.
// The message posted as the id parameter will also be returned.
SaveRecord(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Record, error)
DeleteRecord(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Record, error)
}
func NewDDNSServiceClient ¶
func NewDDNSServiceClient(cc *grpc.ClientConn) DDNSServiceClient
type DDNSServiceServer ¶
type Record ¶
type Record struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
// Record IP address
Ip string `protobuf:"bytes,2,opt,name=ip" json:"ip,omitempty"`
// Record Name
Domain string `protobuf:"bytes,3,opt,name=domain" json:"domain,omitempty"`
// Record Type see https://github.com/miekg/dns/blob/master/types.go#L27
Type string `protobuf:"bytes,4,opt,name=type" json:"type,omitempty"`
// Expiration of the record, after which will be removed.
// Default is 0 for not expiring
Expires int32 `protobuf:"varint,5,opt,name=expires" json:"expires,omitempty"`
// TTL time to live of the record
TTL int32 `protobuf:"varint,6,opt,name=TTL" json:"TTL,omitempty"`
// Add a PTR (reverse) record
PTR bool `protobuf:"varint,7,opt,name=PTR" json:"PTR,omitempty"`
}
Message represents a simple message sent to the Echo service.
func (*Record) Descriptor ¶
func (*Record) GetExpires ¶
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.