dns

package
v0.0.0-...-7aae7b9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "domain"
)

Variables

View Source
var File_apps_dns_pb_domain_proto protoreflect.FileDescriptor
View Source
var File_apps_dns_pb_rpc_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "infraboard.cmdb.domain.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SyncDomain",
			Handler:    _Service_SyncDomain_Handler,
		},
		{
			MethodName: "QueryDomain",
			Handler:    _Service_QueryDomain_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/dns/pb/rpc.proto",
}

Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type Describe

type Describe struct {

	// 域名的等级
	// @gotags: json:"grade"
	Grade string `protobuf:"bytes,1,opt,name=grade,proto3" json:"grade"`
	// 域名的 ID
	// @gotags: json:"id"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"`
	// 当前域名允许的最小的 TTL
	// @gotags: json:"min_ttl"
	MinTtl int64 `protobuf:"varint,3,opt,name=min_ttl,json=minTtl,proto3" json:"min_ttl"`
	// 域名
	// @gotags: json:"name"
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name"`
	// 域名所有者的邮箱帐号
	// @gotags: json:"owner"
	Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner"`
	// punycode编码后的域名
	// @gotags: json:"punycode"
	Punycode string `protobuf:"bytes,6,opt,name=punycode,proto3" json:"punycode"`
	// 域名下的解析记录默认的 TTL 值
	// @gotags: json:"ttl"
	Ttl int64 `protobuf:"varint,7,opt,name=ttl,proto3" json:"ttl"`
	// contains filtered or unexported fields
}

func (*Describe) Descriptor deprecated

func (*Describe) Descriptor() ([]byte, []int)

Deprecated: Use Describe.ProtoReflect.Descriptor instead.

func (*Describe) GetGrade

func (x *Describe) GetGrade() string

func (*Describe) GetId

func (x *Describe) GetId() string

func (*Describe) GetMinTtl

func (x *Describe) GetMinTtl() int64

func (*Describe) GetName

func (x *Describe) GetName() string

func (*Describe) GetOwner

func (x *Describe) GetOwner() string

func (*Describe) GetPunycode

func (x *Describe) GetPunycode() string

func (*Describe) GetTtl

func (x *Describe) GetTtl() int64

func (*Describe) ProtoMessage

func (*Describe) ProtoMessage()

func (*Describe) ProtoReflect

func (x *Describe) ProtoReflect() protoreflect.Message

func (*Describe) Reset

func (x *Describe) Reset()

func (*Describe) String

func (x *Describe) String() string

type Domain

type Domain struct {

	// @gotags: json:"resource"
	Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"`
	// @gotags: json:"describe"
	Records *RecordSet `protobuf:"bytes,2,opt,name=records,proto3" json:"describe"`
	// contains filtered or unexported fields
}

func NewDefaultDomain

func NewDefaultDomain() *Domain

func (*Domain) Descriptor deprecated

func (*Domain) Descriptor() ([]byte, []int)

Deprecated: Use Domain.ProtoReflect.Descriptor instead.

func (*Domain) GetRecords

func (x *Domain) GetRecords() *RecordSet

func (*Domain) GetResource

func (x *Domain) GetResource() *resource.Resource

func (*Domain) ProtoMessage

func (*Domain) ProtoMessage()

func (*Domain) ProtoReflect

func (x *Domain) ProtoReflect() protoreflect.Message

func (*Domain) Reset

func (x *Domain) Reset()

func (*Domain) String

func (x *Domain) String() string

type DomainSet

type DomainSet struct {

	// 总数量
	// @gotags: json:"total"
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
	// 列表项
	// @gotags: json:"items"
	Items []*Domain `protobuf:"bytes,2,rep,name=items,proto3" json:"items"`
	// contains filtered or unexported fields
}

func NewDomainSet

func NewDomainSet() *DomainSet

func (*DomainSet) Add

func (s *DomainSet) Add(items ...any)

func (*DomainSet) Descriptor deprecated

func (*DomainSet) Descriptor() ([]byte, []int)

Deprecated: Use DomainSet.ProtoReflect.Descriptor instead.

func (*DomainSet) GetItems

func (x *DomainSet) GetItems() []*Domain

func (*DomainSet) GetLast

func (s *DomainSet) GetLast() *Domain

func (*DomainSet) GetTotal

func (x *DomainSet) GetTotal() int64

func (*DomainSet) Length

func (s *DomainSet) Length() int64

func (*DomainSet) ProtoMessage

func (*DomainSet) ProtoMessage()

func (*DomainSet) ProtoReflect

func (x *DomainSet) ProtoReflect() protoreflect.Message

func (*DomainSet) Reset

func (x *DomainSet) Reset()

func (*DomainSet) ResourceIds

func (s *DomainSet) ResourceIds() (ids []string)

func (*DomainSet) String

func (x *DomainSet) String() string

func (*DomainSet) ToAny

func (s *DomainSet) ToAny() (items []any)

func (*DomainSet) ToJsonString

func (s *DomainSet) ToJsonString() string

type QueryDomainRequest

type QueryDomainRequest struct {

	// 分页参数
	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// contains filtered or unexported fields
}

func (*QueryDomainRequest) Descriptor deprecated

func (*QueryDomainRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryDomainRequest.ProtoReflect.Descriptor instead.

func (*QueryDomainRequest) GetPage

func (x *QueryDomainRequest) GetPage() *request.PageRequest

func (*QueryDomainRequest) ProtoMessage

func (*QueryDomainRequest) ProtoMessage()

func (*QueryDomainRequest) ProtoReflect

func (x *QueryDomainRequest) ProtoReflect() protoreflect.Message

func (*QueryDomainRequest) Reset

func (x *QueryDomainRequest) Reset()

func (*QueryDomainRequest) String

func (x *QueryDomainRequest) String() string

type Record

type Record struct {

	// 记录的暂停、启用状态,1和0分别代表启用和暂停
	// @gotags: json:"status"
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status"`
	// 解析记录的ID
	// @gotags: json:"id"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"`
	// 解析记录的线路编号
	// @gotags: json:"line"
	Line string `protobuf:"bytes,3,opt,name=line,proto3" json:"line"`
	// 记录的优先级,非 MX 记录的话,该值为0
	// @gotags: json:"mx"
	Mx int64 `protobuf:"varint,4,opt,name=mx,proto3" json:"mx"`
	// 子域名
	// @gotags: json:"name"
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
	// 解析记录的备注信息
	// @gotags: json:"remark"
	Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark"`
	// 记录的 TTL 值
	// @gotags: json:"ttl"
	Ttl int64 `protobuf:"varint,7,opt,name=ttl,proto3" json:"ttl"`
	// 解析记录的类型
	// @gotags: json:"type"
	Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type"`
	// 解析记录的最后修改时间
	// @gotags: json:"updated_on"
	UpdatedOn int64 `protobuf:"varint,9,opt,name=updated_on,json=updatedOn,proto3" json:"updated_on"`
	// 记录的值
	// @gotags: json:"value"
	Value string `protobuf:"bytes,10,opt,name=value,proto3" json:"value"`
	// contains filtered or unexported fields
}

func NewDefaultRecord

func NewDefaultRecord() *Record

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetId

func (x *Record) GetId() string

func (*Record) GetLine

func (x *Record) GetLine() string

func (*Record) GetMx

func (x *Record) GetMx() int64

func (*Record) GetName

func (x *Record) GetName() string

func (*Record) GetRemark

func (x *Record) GetRemark() string

func (*Record) GetStatus

func (x *Record) GetStatus() string

func (*Record) GetTtl

func (x *Record) GetTtl() int64

func (*Record) GetType

func (x *Record) GetType() string

func (*Record) GetUpdatedOn

func (x *Record) GetUpdatedOn() int64

func (*Record) GetValue

func (x *Record) GetValue() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

type RecordSet

type RecordSet struct {

	// 列表项
	// @gotags: json:"items"
	Items []*Record `protobuf:"bytes,1,rep,name=items,proto3" json:"items"`
	// 总数量
	// @gotags: json:"total"
	Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
	// contains filtered or unexported fields
}

func NewRecordSet

func NewRecordSet() *RecordSet

func (*RecordSet) Add

func (s *RecordSet) Add(items ...any)

func (*RecordSet) Descriptor deprecated

func (*RecordSet) Descriptor() ([]byte, []int)

Deprecated: Use RecordSet.ProtoReflect.Descriptor instead.

func (*RecordSet) GetItems

func (x *RecordSet) GetItems() []*Record

func (*RecordSet) GetLast

func (s *RecordSet) GetLast() *Record

func (*RecordSet) GetTotal

func (x *RecordSet) GetTotal() int64

func (*RecordSet) Length

func (s *RecordSet) Length() int64

func (*RecordSet) ProtoMessage

func (*RecordSet) ProtoMessage()

func (*RecordSet) ProtoReflect

func (x *RecordSet) ProtoReflect() protoreflect.Message

func (*RecordSet) Reset

func (x *RecordSet) Reset()

func (*RecordSet) ResourceIds

func (s *RecordSet) ResourceIds() (ids []string)

func (*RecordSet) String

func (x *RecordSet) String() string

func (*RecordSet) ToAny

func (s *RecordSet) ToAny() (items []any)

func (*RecordSet) ToJsonString

func (s *RecordSet) ToJsonString() string

type ServiceClient

type ServiceClient interface {
	SyncDomain(ctx context.Context, in *Domain, opts ...grpc.CallOption) (*Domain, error)
	QueryDomain(ctx context.Context, in *QueryDomainRequest, opts ...grpc.CallOption) (*DomainSet, error)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	SyncDomain(context.Context, *Domain) (*Domain, error)
	QueryDomain(context.Context, *QueryDomainRequest) (*DomainSet, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) QueryDomain

func (UnimplementedServiceServer) SyncDomain

type UnsafeServiceServer

type UnsafeServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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