idl

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventZoneUpdate     string = "ZoneUpdateEvent"
	EventZoneFullUpdate string = "ZoneFullUpdateEvent"
	OpcodeSet           uint8  = 0 //create or update
	OpcodeDelete        uint8  = 1 //delete
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AAAA_Record

type AAAA_Record struct {
	Ttl uint32 `json:"ttl,omitempty"`
	Ip  net.IP `json:"ip"`
}

type A_Record

type A_Record struct {
	Ttl uint32 `json:"ttl,omitempty"`
	Ip  net.IP `json:"ip"`
}

type AllZonesResponse

type AllZonesResponse struct {
	Zones []string `json:"zones"`
}

name_server api

type ApiAuthConfRequest

type ApiAuthConfRequest struct {
	DataDoi           string            `json:"data_doi,omitempty"`
	Authorization     DataAuthorization `json:"authorization,omitempty"` // 授权信息数组
	Fields            map[string]string `json:"fields,omitempty"`        //扩展字段,用于发送通知
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

授权确认

type ApiAuthDOOfDURequest added in v1.0.3

type ApiAuthDOOfDURequest struct {
	DuDoi string `json:"du_doi,omitempty"`
}

type ApiAuthInitRequest

type ApiAuthInitRequest struct {
	DataDoi           string            `json:"data_doi,omitempty"`
	Authorization     DataAuthorization `json:"authorization,omitempty"` // 授权信息数组
	Fields            map[string]string `json:"fields,omitempty"`        // 扩展字段,用于发送通知
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

授权发起

type ApiAuthRevRequest

type ApiAuthRevRequest struct {
	DataDoi           string            `json:"data_doi,omitempty"`
	DuDoi             string            `json:"du_doi,omitempty"` // 数据使用者DOI
	Fields            map[string]string `json:"fields,omitempty"` //扩展字段,用于发送通知
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

授权撤销

type ApiDOAuthQueryRequest

type ApiDOAuthQueryRequest struct {
	Doi         string       `json:"doi,omitempty"`
	DuDoi       string       `json:"dudoi,omitempty"`
	Type        []SearchType `json:"type,omitempty"` // 查询类型,只包括auth
	DirectQuery bool         `json:"directquery,omitempty"`
}

数据对象权属查询

type ApiDOCreateBatchRequest

type ApiDOCreateBatchRequest struct {
	BatchData         []*CreateRequestData `json:"batch_data,omitempty"`
	IDL.SignatureData                      //统一共用的加签验签结构,字段均为必填项
}

数据对象属性批量注册

type ApiDOCreateRequest

type ApiDOCreateRequest struct {
	Doi               string            `json:"doi,omitempty"`
	DwDoi             string            `json:"dw_doi,omitempty"`
	PubKey            string            `json:"pub_key,omitempty"`
	WhoisData         *RegistrationData `json:"whois_data,omitempty"` // 类WHOIS注册数据
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

数据对象属性注册

type ApiDODeleteRequest

type ApiDODeleteRequest struct {
	Doi               string `json:"doi,omitempty"`
	IDL.SignatureData        //统一共用的加签验签结构,字段均为必填项
}

数据对象属性删除

type ApiDOQueryRequest

type ApiDOQueryRequest struct {
	Doi         string       `json:"doi,omitempty"`
	Type        []SearchType `json:"type,omitempty"` // 查询类型
	DirectQuery bool         `json:"directquery,omitempty"`
}

func (*ApiDOQueryRequest) ToString

func (s *ApiDOQueryRequest) ToString() string

type ApiDOQueryResponse

type ApiDOQueryResponse struct {
	Errno  IDL.RespCodeType        `json:"errno"`
	Errmsg string                  `json:"errmsg"`
	Data   *ApiDOQueryResponseData `json:"data"`
}

权地址查询响应

type ApiDOQueryResponseData

type ApiDOQueryResponseData struct {
	PubKey                   string                       `json:"pub_key"`
	Owner                    string                       `json:"owner"`
	Dar                      string                       `json:"dar"`                    // DOI地址
	Auth                     map[string]DataAuthorization `json:"authorization"`          // 权属,key的内容也为权属对象
	Digest                   *DataDigest                  `json:"digest"`                 // 数据内容摘要
	ClassificationAndGrading *ClassificationAndGrading    `json:"classification_grading"` // 数据分类分级信息
}

type ApiDOUpdateBatchRequest

type ApiDOUpdateBatchRequest struct {
	BatchData         []*UpdateRequestData `json:"batch_data,omitempty"`
	IDL.SignatureData                      //统一共用的加签验签结构,字段均为必填项
}

数据对象属性批量更新

type ApiDOUpdateRequest

type ApiDOUpdateRequest struct {
	Doi                      string                    `json:"doi,omitempty"`
	NewDoi                   string                    `json:"new_doi,omitempty"` // 更新后的DO标识
	DwDoi                    string                    `json:"dw_doi,omitempty"`  //更新所有者
	PubKey                   string                    `json:"pub_key,omitempty"`
	Dar                      string                    `json:"dar,omitempty"`                    // DOI地址
	Digest                   *DataDigest               `json:"digest,omitempty"`                 // 数据内容摘要
	Authorization            *DataAuthorization        `json:"authorization,omitempty"`          // 授权信息数组
	ClassificationAndGrading *ClassificationAndGrading `json:"classification_grading,omitempty"` // 数据分类分级信息
	WhoisData                *RegistrationData         `json:"whois_data,omitempty"`             // WHOIS注册数据	IDL.SignatureData //统一共用的加签验签结构,字段均为必填项
	IDL.SignatureData                                  //统一共用的加签验签结构,字段均为必填项
}

数据对象属性更新

type ApiDataOwnerRequest

type ApiDataOwnerRequest struct {
	Doi string `json:"data_doi,omitempty"`
}

type ApiDisResponse

type ApiDisResponse struct {
	Errno  IDL.RespCodeType `json:"errno"`
	Errmsg string           `json:"errmsg"`
}

通用响应(无返回data)。在没有特别定义时,用这种响应格式

type ApiExchangeOwnershipRequest

type ApiExchangeOwnershipRequest struct {
	DataDoi           string            `json:"data_doi,omitempty"`
	DuDoi             string            `json:"du_doi,omitempty"`
	DwDoi             string            `json:"dw_doi,omitempty"`
	Authorization     DataAuthorization `json:"authorization,omitempty"` // 授权信息数组
	DuDar             string            `json:"du_dar,omitempty"`        // 数据在DAO中的存储地址
	Fields            map[string]string `json:"fields,omitempty"`        // 扩展字段,用于发送通知
	Content           string            `json:"content"`                 //数据内容
	SecretKey         string            `json:"secret_key"`              //文件内容的加密秘钥,当为空时,代表文件内容没有加密
	FilePath          string            `json:"file_path"`               //保存的文件路径
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

交换所有权发起

type ApiHashManageRequest

type ApiHashManageRequest struct {
}

type ApiPublicKeyRequest

type ApiPublicKeyRequest struct {
	Doi string `json:"data_doi,omitempty"`
}

type ApiRegDataQueryResponse

type ApiRegDataQueryResponse struct {
	Errno  IDL.RespCodeType  `json:"errno"`
	Errmsg string            `json:"errmsg"`
	Data   *RegistrationData `json:"data,omitempty"`
}

type ApiRegDataRequest

type ApiRegDataRequest struct {
	DataDoi           string `json:"data_doi,omitempty"`
	IDL.SignatureData        //统一共用的加签验签结构,字段均为必填项
}

type ApiTransactionInfoRequest

type ApiTransactionInfoRequest struct {
	DataDoi           string `json:"data_doi"`
	IDL.SignatureData        //统一共用的加签验签结构,字段均为必填项
}

数据对象TX ID查询

type ApiWhoisByOrgRequest

type ApiWhoisByOrgRequest struct {
	Organization string `json:"organization,omitempty"`
}

Whois数据查询接口(by org)

type ApiWhoisManageRequest

type ApiWhoisManageRequest struct {
}

type ApiWhoisQueryResponse

type ApiWhoisQueryResponse struct {
	Results []*RegistrationData
}

type ApiWhoisUpdateRequest

type ApiWhoisUpdateRequest struct {
	WhoisData         *RegistrationData `json:"whois_data,omitempty"` // WHOIS注册数据
	IDL.SignatureData                   //统一共用的加签验签结构,字段均为必填项
}

WHOIS数据更新

type AuthorizationType

type AuthorizationType uint8
const (
	OwnerAuthType AuthorizationType = 0   //所有者
	UserAuthType  AuthorizationType = 128 //使用者
)

func (AuthorizationType) IsController

func (s AuthorizationType) IsController() bool

func (AuthorizationType) IsOwner

func (s AuthorizationType) IsOwner() bool

func (AuthorizationType) IsUser

func (s AuthorizationType) IsUser() bool

func (AuthorizationType) ToInt

func (s AuthorizationType) ToInt() int

func (AuthorizationType) ToInt16

func (s AuthorizationType) ToInt16() int16

func (AuthorizationType) ToInt32

func (s AuthorizationType) ToInt32() int32

func (AuthorizationType) ToInt64

func (s AuthorizationType) ToInt64() int64

func (AuthorizationType) ToString

func (s AuthorizationType) ToString() string

func (AuthorizationType) ToUInt8

func (s AuthorizationType) ToUInt8() uint8

func (*AuthorizationType) UnmarshalJSON

func (s *AuthorizationType) UnmarshalJSON(b []byte) error

type CAA_Record

type CAA_Record struct {
	Flag  uint8  `json:"flag"`
	Tag   string `json:"tag"`
	Value string `json:"value"`
}

type CERT_Record

type CERT_Record struct {
	Ttl         uint32 `json:"ttl,omitempty"`
	Type        uint16 `json:"type"`
	KeyTag      uint16 `json:"keytag"`
	Algorithm   uint8  `json:"algorithm"`
	Certificate string `json:"certificate"`
}

type CNAME_Record

type CNAME_Record struct {
	Ttl  uint32 `json:"ttl,omitempty"`
	Host string `json:"host"`
}

type CallbackData

type CallbackData struct {
	FromDoi    string            `json:"from_doi,omitempty"`    //消息发起者
	ToDoi      string            `json:"to_doi,omitempty"`      //消息通知者
	DataDoi    string            `json:"data_doi,omitempty"`    //数据对象
	DataOwner  string            `json:"data_owner,omitempty"`  //数据所有者
	NotifyType IDL.NotifyType    `json:"notify_type,omitempty"` //消息类型
	Params     interface{}       `json:"params,omitempty"`      //消息参数
	Fields     map[string]string `json:"fields,omitempty"`      //扩展字段
}

func (*CallbackData) Send

func (r *CallbackData) Send(ctx *gin.Context, url string) (*ApiDisResponse, error)

func (*CallbackData) ToString

func (r *CallbackData) ToString() string

type ClassificationAndGrading

type ClassificationAndGrading struct {
	Class uint16 `json:"class"` // 数据分类
	Grade uint16 `json:"grade"` // 数据分级。如果是加密数据,第1位是1。
}

分类分级

type CreateRequestData

type CreateRequestData struct {
	Doi       string            `json:"doi,omitempty"`
	DwDoi     string            `json:"dw_doi,omitempty"`
	PubKey    string            `json:"pub_key,omitempty"`
	WhoisData *RegistrationData `json:"whois_data,omitempty"` // 类WHOIS注册数据
}

type DO

type DO struct {
	Doi                      string                       `json:"doi,omitempty"`
	PubKey                   string                       `json:"pub_key,omitempty"`                //公钥
	Dar                      string                       `json:"dar,omitempty"`                    // 数据在DAO中的存储地址
	Digest                   *DataDigest                  `json:"digest,omitempty"`                 // 数据内容摘要
	Authorization            map[string]DataAuthorization `json:"authorization,omitempty"`          // 权属信息
	ClassificationAndGrading *ClassificationAndGrading    `json:"classification_grading,omitempty"` // 数据分类分级信息
}

数据对象

type DataAuthorization

type DataAuthorization struct {
	Doi          string                 `json:"doi"`          //权属对象。
	Type         AuthorizationType      `json:"type"`         // 权属类型。0开头表示所有者,1开头表示使用者
	Confirmation string                 `json:"confirmation"` // 确权信息。DW私钥对数据摘要的签名
	Description  *PermissionDescription `json:"description"`  // 权益特征。json格式,包括权限定义DOI(permission),权限创建者DOI(creator),及解密密钥(key)
}

权属信息

type DataDigest

type DataDigest struct {
	Algorithm string `json:"algorithm,omitempty"` // 摘要算法
	Result    string `json:"result,omitempty"`    // 摘要计算结果
}

数据摘要

type GetSOAIncreKeysRequest

type GetSOAIncreKeysRequest struct {
	Zone string `json:"zone,omitempty"`
}

type GetSOARequest

type GetSOARequest struct {
	Zone string `json:"zone,omitempty"`
}

type GetServiceZonesRequest

type GetServiceZonesRequest struct {
}

type GetZoneRedisRequest

type GetZoneRedisRequest struct {
	Zone string `json:"zone,omitempty"`
}

type GetZoneRequest

type GetZoneRequest struct {
	Zone string `json:"zone,omitempty"`
}

type LabelRecord

type LabelRecord struct {
	Label string `json:"label"`
	Rdata string `json:"rdata"`
}

type MX_Record

type MX_Record struct {
	Ttl        uint32 `json:"ttl,omitempty"`
	Host       string `json:"host"`
	Preference uint16 `json:"preference"`
}

type NS_Record

type NS_Record struct {
	Ttl  uint32 `json:"ttl,omitempty"`
	Host string `json:"host"`
}

type PermissionDescription

type PermissionDescription struct {
	PermissionDoi string `json:"permission_doi,omitempty"` // 权限定义DOI
	ParentDoi     string `json:"parent_doi,omitempty"`     // 上一级数据对象DOI
	CreatorDoi    string `json:"creator_doi,omitempty"`    // 权限创建者DOI
	Key           string `json:"key,omitempty"`            // 权限密钥,权属对象公钥加密的数据内容加密对称密钥的16进制表示(长度为256)
}

权属信息中的权益特征

type RP_Record

type RP_Record struct {
	Ttl  uint32 `json:"ttl,omitempty"`
	Mbox string `json:"mbox"`
	Txt  string `json:"txt"`
}

type Record

type Record struct {
	A     []A_Record     `json:"a,omitempty"`
	AAAA  []AAAA_Record  `json:"aaaa,omitempty"`
	TXT   []TXT_Record   `json:"txt,omitempty"`
	CNAME []CNAME_Record `json:"cname,omitempty"`
	NS    []NS_Record    `json:"ns,omitempty"`
	MX    []MX_Record    `json:"mx,omitempty"`
	SRV   []SRV_Record   `json:"srv,omitempty"`
	CAA   []CAA_Record   `json:"caa,omitempty"`
	URI   []URI_Record   `json:"uri,omitempty"`
	CERT  []CERT_Record  `json:"cert,omitempty"`
	RP    []RP_Record    `json:"rp,omitempty"`
	SOA   SOA_Record     `json:"soa,omitempty"`
}

type RegistrationData

type RegistrationData struct {
	Doi          string   `json:"doi,omitempty"`
	Organization []string `json:"organization,omitempty"` // 组织
	Contact      []string `json:"contact,omitempty"`      // 联系方式
	IP           []string `json:"ip,omitempty"`           // IP地址
	ASN          []string `json:"asn,omitempty"`
}

type ResourceRecord

type ResourceRecord struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Class string `json:"class"`
	Ttl   int    `json:"ttl"`
	Rdata string `json:"rdata"`
}

type SOAData

type SOAData struct {
	Mname   string `json:"mname"`
	Rname   string `json:"rname"`
	Serial  int    `json:"serial"`
	Refresh int    `json:"refresh"`
	Retry   int    `json:"retry"`
	Expire  int    `json:"expire"`
	Minimum int    `json:"minimum"`
}

type SOAResponse

type SOAResponse struct {
	SOARR ResourceRecord `json:"soa"`
}

type SOA_Record

type SOA_Record struct {
	Ttl     uint32 `json:"ttl,omitempty"`
	Ns      string `json:"ns"`
	MBox    string `json:"MBox"`
	Refresh uint32 `json:"refresh"`
	Retry   uint32 `json:"retry"`
	Expire  uint32 `json:"expire"`
	MinTtl  uint32 `json:"minttl"`
}

type SRV_Record

type SRV_Record struct {
	Ttl      uint32 `json:"ttl,omitempty"`
	Priority uint16 `json:"priority"`
	Weight   uint16 `json:"weight"`
	Port     uint16 `json:"port"`
	Target   string `json:"target"`
}

type SearchType

type SearchType string

数据对象属性查询

const (
	Dar        SearchType = "dar"        // 存储地址
	Owner      SearchType = "owner"      // 所有者DO
	PubKey     SearchType = "pubkey"     // 公钥
	Auth       SearchType = "auth"       // 权属
	Digest     SearchType = "digest"     // 数据内容摘要
	ClassGrade SearchType = "classgrade" // 数据分类分级
)

type ServiceZonesInDIS

type ServiceZonesInDIS struct {
	Zones []string `json:"zones,omitempty"`
}

type TXT_Record

type TXT_Record struct {
	Ttl  uint32 `json:"ttl,omitempty"`
	Text string `json:"text"`
}

type TransactionInfo

type TransactionInfo struct {
	Doi           string               `json:"data_doi"`  //权属对象
	TransactionID string               `json:"tx_id"`     // 最新交易ID
	CreatedAt     *timestamp.Timestamp `json:"create_at"` // 创建时间
	UpdatedAt     *timestamp.Timestamp `json:"update_at"` // 更新时间
}

数据对象的最新Transaction信息

type URI_Record

type URI_Record struct {
	Ttl      uint32 `json:"ttl,omitempty"`
	Priority uint16 `json:"priority"`
	Weight   uint16 `json:"weight"`
	Target   string `json:"target"`
}

type UpdateRequestData

type UpdateRequestData struct {
	Doi                      string                    `json:"doi,omitempty"`
	NewDoi                   string                    `json:"new_doi,omitempty"` // 更新后的DO标识
	DwDoi                    string                    `json:"dw_doi,omitempty"`  //更新所有者
	PubKey                   string                    `json:"pub_key,omitempty"`
	Dar                      string                    `json:"dar,omitempty"`                    // DOI地址
	Digest                   *DataDigest               `json:"digest,omitempty"`                 // 数据内容摘要
	Authorization            *DataAuthorization        `json:"authorization,omitempty"`          // 授权信息数组
	ClassificationAndGrading *ClassificationAndGrading `json:"classification_grading,omitempty"` // 数据分类分级信息
	WhoisData                *RegistrationData         `json:"whois_data,omitempty"`             // WHOIS注册数据
}

type UpdateSOASerialRequest

type UpdateSOASerialRequest struct {
	Zone string `json:"zone,omitempty"`
	Keys string `json:"keys,omitempty"`
}

type Zone

type Zone struct {
	Name      string
	Locations map[string]struct{}
}

type ZoneData

type ZoneData struct {
	Identifier      string            `json:"identifier"`
	ResourceRecords []*ResourceRecord `json:"resource_records"`
}

type ZoneDataRedis

type ZoneDataRedis struct {
	Zone      string        `json:"zone"`
	LabelData []LabelRecord `json:"label_data"`
}

type ZoneFullUpdateEvent

type ZoneFullUpdateEvent struct {
	ZoneList []string `json:"zone_list"`
}

全量更新事件

type ZoneFullUpdateFunc

type ZoneFullUpdateFunc = func(string, ZoneFullUpdateEvent) error

type ZoneRR

type ZoneRR struct {
	SOARR  ResourceRecord   `json:"SOA_RR"`
	RRList []ResourceRecord `json:"RR_list,omitempty"`
}

type ZoneResponse

type ZoneResponse struct {
	ZoneDatas []*ZoneData `json:"zone_datas"`
}

type ZoneUpdateEvent

type ZoneUpdateEvent struct {
	Operations []ZoneUpdateOperation `json:"operations"`
}

增量更新事件

type ZoneUpdateFunc

type ZoneUpdateFunc = func(string, ZoneUpdateEvent) error

type ZoneUpdateOperation

type ZoneUpdateOperation struct {
	Opcode uint8  `json:"opcode"`
	Zone   string `json:"zone"`  //e.g. "viv.cn"
	Label  string `json:"label"` //e.g. "alice"
	Rdata  string `json:"rdata"` //json of Record data
}

增量更新操作

Jump to

Keyboard shortcuts

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