api

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 20 Imported by: 2

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

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 Run

func Run(iface string) error

Run start the server

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 DDNSServiceServer interface {
	// Echo method receives a simple message and returns it.
	// The message posted as the id parameter will also be returned.
	SaveRecord(context.Context, *Record) (*Record, error)
	DeleteRecord(context.Context, *Record) (*Record, error)
}

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) Descriptor() ([]byte, []int)

func (*Record) GetDomain

func (m *Record) GetDomain() string

func (*Record) GetExpires

func (m *Record) GetExpires() int32

func (*Record) GetId

func (m *Record) GetId() string

func (*Record) GetIp

func (m *Record) GetIp() string

func (*Record) GetPTR

func (m *Record) GetPTR() bool

func (*Record) GetTTL

func (m *Record) GetTTL() int32

func (*Record) GetType

func (m *Record) GetType() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) String

func (m *Record) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL