nameservers

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NSDomainStateEnabled  = 1 // 已启用
	NSDomainStateDisabled = 0 // 已禁用
)
View Source
const (
	NSKeyStateEnabled  = 1 // 已启用
	NSKeyStateDisabled = 0 // 已禁用
)
View Source
const (
	NSRecordStateEnabled  = 1 // 已启用
	NSRecordStateDisabled = 0 // 已禁用
)
View Source
const (
	NSRouteStateEnabled  = 1 // 已启用
	NSRouteStateDisabled = 0 // 已禁用
)
View Source
const (
	NSZoneStateEnabled  = 1 // 已启用
	NSZoneStateDisabled = 0 // 已禁用
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NSDomain

type NSDomain struct {
	Id        uint32   `field:"id"`        // ID
	ClusterId uint32   `field:"clusterId"` // 集群ID
	UserId    uint32   `field:"userId"`    // 用户ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	Name      string   `field:"name"`      // 域名
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Version   uint64   `field:"version"`   // 版本
	State     uint8    `field:"state"`     // 状态
	Tsig      dbs.JSON `field:"tsig"`      // TSIG配置
}

NSDomain DNS域名

type NSDomainDAO

type NSDomainDAO dbs.DAO
var SharedNSDomainDAO *NSDomainDAO

func NewNSDomainDAO

func NewNSDomainDAO() *NSDomainDAO

func (*NSDomainDAO) CountAllEnabledDomains

func (this *NSDomainDAO) CountAllEnabledDomains(tx *dbs.Tx, clusterId int64, userId int64, keyword string) (int64, error)

CountAllEnabledDomains 计算域名数量

func (*NSDomainDAO) CreateDomain

func (this *NSDomainDAO) CreateDomain(tx *dbs.Tx, clusterId int64, userId int64, name string) (int64, error)

CreateDomain 创建域名

func (*NSDomainDAO) DisableNSDomain

func (this *NSDomainDAO) DisableNSDomain(tx *dbs.Tx, domainId int64) error

DisableNSDomain 禁用条目

func (*NSDomainDAO) EnableNSDomain

func (this *NSDomainDAO) EnableNSDomain(tx *dbs.Tx, domainId int64) error

EnableNSDomain 启用条目

func (*NSDomainDAO) FindDomainIdWithName

func (this *NSDomainDAO) FindDomainIdWithName(tx *dbs.Tx, clusterId int64, name string) (int64, error)

FindDomainIdWithName 根据名称查找域名

func (*NSDomainDAO) FindEnabledDomainClusterId

func (this *NSDomainDAO) FindEnabledDomainClusterId(tx *dbs.Tx, domainId int64) (int64, error)

FindEnabledDomainClusterId 获取域名的集群ID

func (*NSDomainDAO) FindEnabledDomainTSIG

func (this *NSDomainDAO) FindEnabledDomainTSIG(tx *dbs.Tx, domainId int64) ([]byte, error)

FindEnabledDomainTSIG 获取TSIG配置

func (*NSDomainDAO) FindEnabledNSDomain

func (this *NSDomainDAO) FindEnabledNSDomain(tx *dbs.Tx, id int64) (*NSDomain, error)

FindEnabledNSDomain 查找启用中的条目

func (*NSDomainDAO) FindNSDomainName

func (this *NSDomainDAO) FindNSDomainName(tx *dbs.Tx, id int64) (string, error)

FindNSDomainName 根据主键查找名称

func (*NSDomainDAO) IncreaseVersion

func (this *NSDomainDAO) IncreaseVersion(tx *dbs.Tx) (int64, error)

IncreaseVersion 增加版本

func (*NSDomainDAO) ListDomainsAfterVersion

func (this *NSDomainDAO) ListDomainsAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*NSDomain, err error)

ListDomainsAfterVersion 列出某个版本后的域名

func (*NSDomainDAO) ListEnabledDomains

func (this *NSDomainDAO) ListEnabledDomains(tx *dbs.Tx, clusterId int64, userId int64, keyword string, offset int64, size int64) (result []*NSDomain, err error)

ListEnabledDomains 列出单页域名

func (*NSDomainDAO) NotifyUpdate

func (this *NSDomainDAO) NotifyUpdate(tx *dbs.Tx, domainId int64) error

NotifyUpdate 通知更改

func (*NSDomainDAO) UpdateDomain

func (this *NSDomainDAO) UpdateDomain(tx *dbs.Tx, domainId int64, clusterId int64, userId int64, isOn bool) error

UpdateDomain 修改域名

func (*NSDomainDAO) UpdateDomainTSIG

func (this *NSDomainDAO) UpdateDomainTSIG(tx *dbs.Tx, domainId int64, tsigJSON []byte) error

UpdateDomainTSIG 修改TSIG配置

type NSDomainOperator

type NSDomainOperator struct {
	Id        interface{} // ID
	ClusterId interface{} // 集群ID
	UserId    interface{} // 用户ID
	IsOn      interface{} // 是否启用
	Name      interface{} // 域名
	CreatedAt interface{} // 创建时间
	Version   interface{} // 版本
	State     interface{} // 状态
	Tsig      interface{} // TSIG配置
}

func NewNSDomainOperator

func NewNSDomainOperator() *NSDomainOperator

type NSKey

type NSKey struct {
	Id         uint64 `field:"id"`         // ID
	IsOn       bool   `field:"isOn"`       // 状态
	Name       string `field:"name"`       // 名称
	DomainId   uint64 `field:"domainId"`   // 域名ID
	ZoneId     uint64 `field:"zoneId"`     // 子域ID
	Algo       string `field:"algo"`       // 算法
	Secret     string `field:"secret"`     // 密码
	SecretType string `field:"secretType"` // 密码类型
	Version    uint64 `field:"version"`    // 版本号
	State      uint8  `field:"state"`      // 状态
}

NSKey 密钥管理

type NSKeyDAO

type NSKeyDAO dbs.DAO
var SharedNSKeyDAO *NSKeyDAO

func NewNSKeyDAO

func NewNSKeyDAO() *NSKeyDAO

func (*NSKeyDAO) CountEnabledKeys

func (this *NSKeyDAO) CountEnabledKeys(tx *dbs.Tx, domainId int64, zoneId int64) (int64, error)

CountEnabledKeys 计算Key的数量

func (*NSKeyDAO) CreateKey

func (this *NSKeyDAO) CreateKey(tx *dbs.Tx, domainId int64, zoneId int64, name string, algo dnsconfigs.KeyAlgorithmType, secret string, secretType string) (int64, error)

CreateKey 创建Key

func (*NSKeyDAO) DisableNSKey

func (this *NSKeyDAO) DisableNSKey(tx *dbs.Tx, keyId int64) error

DisableNSKey 禁用条目

func (*NSKeyDAO) EnableNSKey

func (this *NSKeyDAO) EnableNSKey(tx *dbs.Tx, id int64) error

EnableNSKey 启用条目

func (*NSKeyDAO) FindEnabledNSKey

func (this *NSKeyDAO) FindEnabledNSKey(tx *dbs.Tx, id int64) (*NSKey, error)

FindEnabledNSKey 查找启用中的条目

func (*NSKeyDAO) FindNSKeyName

func (this *NSKeyDAO) FindNSKeyName(tx *dbs.Tx, id int64) (string, error)

FindNSKeyName 根据主键查找名称

func (*NSKeyDAO) IncreaseVersion

func (this *NSKeyDAO) IncreaseVersion(tx *dbs.Tx) (int64, error)

IncreaseVersion 增加版本

func (*NSKeyDAO) ListEnabledKeys

func (this *NSKeyDAO) ListEnabledKeys(tx *dbs.Tx, domainId int64, zoneId int64, offset int64, size int64) (result []*NSKey, err error)

ListEnabledKeys 列出单页Key

func (*NSKeyDAO) ListKeysAfterVersion

func (this *NSKeyDAO) ListKeysAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*NSKey, err error)

ListKeysAfterVersion 列出某个版本后的密钥

func (*NSKeyDAO) NotifyUpdate

func (this *NSKeyDAO) NotifyUpdate(tx *dbs.Tx, keyId int64) error

NotifyUpdate 通知更新

func (*NSKeyDAO) UpdateKey

func (this *NSKeyDAO) UpdateKey(tx *dbs.Tx, keyId int64, name string, algo dnsconfigs.KeyAlgorithmType, secret string, secretType string, isOn bool) error

UpdateKey 修改Key

type NSKeyOperator

type NSKeyOperator struct {
	Id         interface{} // ID
	IsOn       interface{} // 状态
	Name       interface{} // 名称
	DomainId   interface{} // 域名ID
	ZoneId     interface{} // 子域ID
	Algo       interface{} // 算法
	Secret     interface{} // 密码
	SecretType interface{} // 密码类型
	Version    interface{} // 版本号
	State      interface{} // 状态
}

func NewNSKeyOperator

func NewNSKeyOperator() *NSKeyOperator

type NSQuestionOption

type NSQuestionOption struct {
	Id        uint64   `field:"id"`        // ID
	Name      string   `field:"name"`      // 选项名
	Values    dbs.JSON `field:"values"`    // 选项值
	CreatedAt uint64   `field:"createdAt"` // 创建时间
}

NSQuestionOption DNS请求选项

type NSQuestionOptionDAO

type NSQuestionOptionDAO dbs.DAO
var SharedNSQuestionOptionDAO *NSQuestionOptionDAO

func NewNSQuestionOptionDAO

func NewNSQuestionOptionDAO() *NSQuestionOptionDAO

func (*NSQuestionOptionDAO) CreateOption

func (this *NSQuestionOptionDAO) CreateOption(tx *dbs.Tx, name string, values maps.Map) (int64, error)

CreateOption 创建选项

func (*NSQuestionOptionDAO) DeleteOption

func (this *NSQuestionOptionDAO) DeleteOption(tx *dbs.Tx, optionId int64) error

DeleteOption 删除选项

func (*NSQuestionOptionDAO) FindNSQuestionOptionName

func (this *NSQuestionOptionDAO) FindNSQuestionOptionName(tx *dbs.Tx, id uint64) (string, error)

FindNSQuestionOptionName 根据主键查找名称

func (*NSQuestionOptionDAO) FindOption

func (this *NSQuestionOptionDAO) FindOption(tx *dbs.Tx, optionId int64) (*NSQuestionOption, error)

FindOption 读取选项

type NSQuestionOptionOperator

type NSQuestionOptionOperator struct {
	Id        interface{} // ID
	Name      interface{} // 选项名
	Values    interface{} // 选项值
	CreatedAt interface{} // 创建时间
}

func NewNSQuestionOptionOperator

func NewNSQuestionOptionOperator() *NSQuestionOptionOperator

type NSRecord

type NSRecord struct {
	Id          uint64   `field:"id"`          // ID
	DomainId    uint32   `field:"domainId"`    // 域名ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	Description string   `field:"description"` // 备注
	Name        string   `field:"name"`        // 记录名
	Type        string   `field:"type"`        // 类型
	Value       string   `field:"value"`       // 值
	Ttl         uint32   `field:"ttl"`         // TTL(秒)
	Weight      uint32   `field:"weight"`      // 权重
	RouteIds    dbs.JSON `field:"routeIds"`    // 线路
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	Version     uint64   `field:"version"`     //
	State       uint8    `field:"state"`       // 状态
}

NSRecord DNS记录

func (*NSRecord) DecodeRouteIds

func (this *NSRecord) DecodeRouteIds() []string

type NSRecordDAO

type NSRecordDAO dbs.DAO
var SharedNSRecordDAO *NSRecordDAO

func NewNSRecordDAO

func NewNSRecordDAO() *NSRecordDAO

func (*NSRecordDAO) CountAllEnabledDomainRecords

func (this *NSRecordDAO) CountAllEnabledDomainRecords(tx *dbs.Tx, domainId int64, dnsType dnsconfigs.RecordType, keyword string, routeCode string) (int64, error)

CountAllEnabledDomainRecords 计算域名中记录数量

func (*NSRecordDAO) CountAllEnabledRecords

func (this *NSRecordDAO) CountAllEnabledRecords(tx *dbs.Tx) (int64, error)

CountAllEnabledRecords 计算所有记录数量

func (*NSRecordDAO) CreateRecord

func (this *NSRecordDAO) CreateRecord(tx *dbs.Tx, domainId int64, description string, name string, dnsType dnsconfigs.RecordType, value string, ttl int32, routeIds []string) (int64, error)

CreateRecord 创建记录

func (*NSRecordDAO) DisableNSRecord

func (this *NSRecordDAO) DisableNSRecord(tx *dbs.Tx, recordId int64) error

DisableNSRecord 禁用条目

func (*NSRecordDAO) EnableNSRecord

func (this *NSRecordDAO) EnableNSRecord(tx *dbs.Tx, recordId int64) error

EnableNSRecord 启用条目

func (*NSRecordDAO) FindEnabledNSRecord

func (this *NSRecordDAO) FindEnabledNSRecord(tx *dbs.Tx, id int64) (*NSRecord, error)

FindEnabledNSRecord 查找启用中的条目

func (*NSRecordDAO) FindEnabledRecordWithName

func (this *NSRecordDAO) FindEnabledRecordWithName(tx *dbs.Tx, domainId int64, recordName string, recordType dnsconfigs.RecordType) (*NSRecord, error)

FindEnabledRecordWithName 查询单条记录

func (*NSRecordDAO) FindNSRecordName

func (this *NSRecordDAO) FindNSRecordName(tx *dbs.Tx, id int64) (string, error)

FindNSRecordName 根据主键查找名称

func (*NSRecordDAO) IncreaseVersion

func (this *NSRecordDAO) IncreaseVersion(tx *dbs.Tx) (int64, error)

IncreaseVersion 增加版本

func (*NSRecordDAO) ListEnabledRecords

func (this *NSRecordDAO) ListEnabledRecords(tx *dbs.Tx, domainId int64, dnsType dnsconfigs.RecordType, keyword string, routeCode string, offset int64, size int64) (result []*NSRecord, err error)

ListEnabledRecords 列出单页记录

func (*NSRecordDAO) ListRecordsAfterVersion

func (this *NSRecordDAO) ListRecordsAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*NSRecord, err error)

ListRecordsAfterVersion 列出某个版本后的记录

func (*NSRecordDAO) NotifyUpdate

func (this *NSRecordDAO) NotifyUpdate(tx *dbs.Tx, recordId int64) error

NotifyUpdate 通知更新

func (*NSRecordDAO) UpdateRecord

func (this *NSRecordDAO) UpdateRecord(tx *dbs.Tx, recordId int64, description string, name string, dnsType dnsconfigs.RecordType, value string, ttl int32, routeIds []string, isOn bool) error

UpdateRecord 修改记录

type NSRecordHourlyStat

type NSRecordHourlyStat struct {
	Id            uint64 `field:"id"`            // ID
	ClusterId     uint32 `field:"clusterId"`     // 集群ID
	NodeId        uint32 `field:"nodeId"`        // 节点ID
	DomainId      uint32 `field:"domainId"`      // 域名ID
	RecordId      uint64 `field:"recordId"`      // 记录ID
	Day           string `field:"day"`           // YYYYMMDD
	Hour          string `field:"hour"`          // YYYYMMDDHH
	CountRequests uint32 `field:"countRequests"` // 请求数
	Bytes         uint64 `field:"bytes"`         // 流量
}

NSRecordHourlyStat NS记录统计

type NSRecordHourlyStatDAO

type NSRecordHourlyStatDAO dbs.DAO
var SharedNSRecordHourlyStatDAO *NSRecordHourlyStatDAO

func NewNSRecordHourlyStatDAO

func NewNSRecordHourlyStatDAO() *NSRecordHourlyStatDAO

func (*NSRecordHourlyStatDAO) Clean

func (this *NSRecordHourlyStatDAO) Clean(tx *dbs.Tx, days int) error

Clean 清理历史数据

func (*NSRecordHourlyStatDAO) FindDailyStats

func (this *NSRecordHourlyStatDAO) FindDailyStats(tx *dbs.Tx, dayFrom string, dayTo string) (result []*NSRecordHourlyStat, err error)

FindDailyStats 按天统计

func (*NSRecordHourlyStatDAO) FindHourlyStats

func (this *NSRecordHourlyStatDAO) FindHourlyStats(tx *dbs.Tx, hourFrom string, hourTo string) (result []*NSRecordHourlyStat, err error)

FindHourlyStats 按小时统计

func (*NSRecordHourlyStatDAO) IncreaseHourlyStat

func (this *NSRecordHourlyStatDAO) IncreaseHourlyStat(tx *dbs.Tx, clusterId int64, nodeId int64, hour string, domainId int64, recordId int64, countRequests int64, bytes int64) error

IncreaseHourlyStat 增加统计数据

func (*NSRecordHourlyStatDAO) ListTopDomains

func (this *NSRecordHourlyStatDAO) ListTopDomains(tx *dbs.Tx, hourFrom string, hourTo string, size int64) (result []*NSRecordHourlyStat, err error)

ListTopDomains 域名排行

func (*NSRecordHourlyStatDAO) ListTopNodes

func (this *NSRecordHourlyStatDAO) ListTopNodes(tx *dbs.Tx, hourFrom string, hourTo string, size int64) (result []*NSRecordHourlyStat, err error)

ListTopNodes 节点排行

type NSRecordHourlyStatOperator

type NSRecordHourlyStatOperator struct {
	Id            interface{} // ID
	ClusterId     interface{} // 集群ID
	NodeId        interface{} // 节点ID
	DomainId      interface{} // 域名ID
	RecordId      interface{} // 记录ID
	Day           interface{} // YYYYMMDD
	Hour          interface{} // YYYYMMDDHH
	CountRequests interface{} // 请求数
	Bytes         interface{} // 流量
}

func NewNSRecordHourlyStatOperator

func NewNSRecordHourlyStatOperator() *NSRecordHourlyStatOperator

type NSRecordOperator

type NSRecordOperator struct {
	Id          interface{} // ID
	DomainId    interface{} // 域名ID
	IsOn        interface{} // 是否启用
	Description interface{} // 备注
	Name        interface{} // 记录名
	Type        interface{} // 类型
	Value       interface{} // 值
	Ttl         interface{} // TTL(秒)
	Weight      interface{} // 权重
	RouteIds    interface{} // 线路
	CreatedAt   interface{} // 创建时间
	Version     interface{} //
	State       interface{} // 状态
}

func NewNSRecordOperator

func NewNSRecordOperator() *NSRecordOperator

type NSRoute

type NSRoute struct {
	Id        uint32   `field:"id"`        // ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	ClusterId uint32   `field:"clusterId"` // 集群ID
	DomainId  uint32   `field:"domainId"`  // 域名ID
	UserId    uint32   `field:"userId"`    // 用户ID
	Name      string   `field:"name"`      // 名称
	Ranges    dbs.JSON `field:"ranges"`    // 范围
	Order     uint32   `field:"order"`     // 排序
	Version   uint64   `field:"version"`   // 版本号
	Code      string   `field:"code"`      // 代号
	State     uint8    `field:"state"`     // 状态
}

NSRoute DNS线路

type NSRouteDAO

type NSRouteDAO dbs.DAO
var SharedNSRouteDAO *NSRouteDAO

func NewNSRouteDAO

func NewNSRouteDAO() *NSRouteDAO

func (*NSRouteDAO) CreateRoute

func (this *NSRouteDAO) CreateRoute(tx *dbs.Tx, clusterId int64, domainId int64, userId int64, name string, rangesJSON []byte) (int64, error)

CreateRoute 创建线路

func (*NSRouteDAO) DisableNSRoute

func (this *NSRouteDAO) DisableNSRoute(tx *dbs.Tx, routeId int64) error

DisableNSRoute 禁用条目

func (*NSRouteDAO) EnableNSRoute

func (this *NSRouteDAO) EnableNSRoute(tx *dbs.Tx, routeId int64) error

EnableNSRoute 启用条目

func (*NSRouteDAO) FindAllEnabledRoutes

func (this *NSRouteDAO) FindAllEnabledRoutes(tx *dbs.Tx, clusterId int64, domainId int64, userId int64) (result []*NSRoute, err error)

FindAllEnabledRoutes 列出所有线路

func (*NSRouteDAO) FindEnabledNSRoute

func (this *NSRouteDAO) FindEnabledNSRoute(tx *dbs.Tx, id int64) (*NSRoute, error)

FindEnabledNSRoute 查找启用中的条目

func (*NSRouteDAO) FindEnabledRouteWithCode

func (this *NSRouteDAO) FindEnabledRouteWithCode(tx *dbs.Tx, code string) (*NSRoute, error)

FindEnabledRouteWithCode 根据代号获取线路信息

func (*NSRouteDAO) FindNSRouteName

func (this *NSRouteDAO) FindNSRouteName(tx *dbs.Tx, id int64) (string, error)

FindNSRouteName 根据主键查找名称

func (*NSRouteDAO) IncreaseVersion

func (this *NSRouteDAO) IncreaseVersion(tx *dbs.Tx) (int64, error)

IncreaseVersion 增加版本

func (*NSRouteDAO) ListRoutesAfterVersion

func (this *NSRouteDAO) ListRoutesAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*NSRoute, err error)

ListRoutesAfterVersion 列出某个版本后的域名

func (*NSRouteDAO) NotifyUpdate

func (this *NSRouteDAO) NotifyUpdate(tx *dbs.Tx) error

NotifyUpdate 通知更新

func (*NSRouteDAO) UpdateRoute

func (this *NSRouteDAO) UpdateRoute(tx *dbs.Tx, routeId int64, name string, rangesJSON []byte) error

UpdateRoute 修改线路

func (*NSRouteDAO) UpdateRouteOrders

func (this *NSRouteDAO) UpdateRouteOrders(tx *dbs.Tx, routeIds []int64) error

UpdateRouteOrders 修改线路排序

type NSRouteOperator

type NSRouteOperator struct {
	Id        interface{} // ID
	IsOn      interface{} // 是否启用
	ClusterId interface{} // 集群ID
	DomainId  interface{} // 域名ID
	UserId    interface{} // 用户ID
	Name      interface{} // 名称
	Ranges    interface{} // 范围
	Order     interface{} // 排序
	Version   interface{} // 版本号
	Code      interface{} // 代号
	State     interface{} // 状态
}

func NewNSRouteOperator

func NewNSRouteOperator() *NSRouteOperator

type NSZone

type NSZone struct {
	Id       uint64   `field:"id"`       // ID
	DomainId uint64   `field:"domainId"` // 域名ID
	IsOn     bool     `field:"isOn"`     // 是否启用
	Order    uint32   `field:"order"`    // 排序
	Version  uint64   `field:"version"`  // 版本
	Tsig     dbs.JSON `field:"tsig"`     // TSIG配置
	State    uint8    `field:"state"`    // 状态
}

NSZone 域名子域

type NSZoneDAO

type NSZoneDAO dbs.DAO
var SharedNSZoneDAO *NSZoneDAO

func NewNSZoneDAO

func NewNSZoneDAO() *NSZoneDAO

func (*NSZoneDAO) DisableNSZone

func (this *NSZoneDAO) DisableNSZone(tx *dbs.Tx, id uint64) error

DisableNSZone 禁用条目

func (*NSZoneDAO) EnableNSZone

func (this *NSZoneDAO) EnableNSZone(tx *dbs.Tx, id uint64) error

EnableNSZone 启用条目

func (*NSZoneDAO) FindEnabledNSZone

func (this *NSZoneDAO) FindEnabledNSZone(tx *dbs.Tx, id uint64) (*NSZone, error)

FindEnabledNSZone 查找启用中的条目

type NSZoneOperator

type NSZoneOperator struct {
	Id       interface{} // ID
	DomainId interface{} // 域名ID
	IsOn     interface{} // 是否启用
	Order    interface{} // 排序
	Version  interface{} // 版本
	Tsig     interface{} // TSIG配置
	State    interface{} // 状态
}

func NewNSZoneOperator

func NewNSZoneOperator() *NSZoneOperator

Jump to

Keyboard shortcuts

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