Documentation ¶
Index ¶
- type DocumentGet
- type Holder
- type Login
- type Property
- func (p *Property) GetDesc() string
- func (p *Property) GetReg() string
- func (p *Property) GetTitle() string
- func (p *Property) GetType() string
- func (p *Property) SetDesc(desc string)
- func (p *Property) SetReg(reg string)
- func (p *Property) SetTitle(title string)
- func (p *Property) SetType(t string)
- type VcGet
- type VcIssue
- func (vcIssue *VcIssue) GetCredentialSubject() []byte
- func (vcIssue *VcIssue) GetExpirationDate() string
- func (vcIssue *VcIssue) GetHolder() string
- func (vcIssue *VcIssue) GetTemplateId() string
- func (vcIssue *VcIssue) GetVerificationMethod() string
- func (vcIssue *VcIssue) GetVersion() string
- func (vcIssue *VcIssue) SetCredentialSubject(subject []byte)
- func (vcIssue *VcIssue) SetExpirationDate(expirationDate string)
- func (vcIssue *VcIssue) SetHolder(holder string)
- func (vcIssue *VcIssue) SetTemplateId(templateId string)
- func (vcIssue *VcIssue) SetVerificationMethod(verificationMethod string)
- func (vcIssue *VcIssue) SetVersion(version string)
- type VcListLatest
- type VcListLocal
- type VcRevoke
- type VctCreate
- func (v *VctCreate) GetAdditionalProperties() bool
- func (v *VctCreate) GetName() string
- func (v *VctCreate) GetProperties() map[string]*Property
- func (v *VctCreate) GetRequired() []string
- func (v *VctCreate) GetVcType() string
- func (v *VctCreate) GetVerificationMethod() string
- func (v *VctCreate) GetVersion() string
- func (v *VctCreate) SetAdditionalProperties(additionalProperties bool)
- func (v *VctCreate) SetName(name string)
- func (v *VctCreate) SetProperties(properties map[string]*Property)
- func (v *VctCreate) SetRequired(required []string)
- func (v *VctCreate) SetVcType(vcType string)
- func (v *VctCreate) SetVerificationMethod(verificationMethod string)
- func (v *VctCreate) SetVersion(version string)
- type VctList
- func (v *VctList) GetId() string
- func (v *VctList) GetName() string
- func (v *VctList) GetPage() *module.Page
- func (v *VctList) GetVersion() string
- func (v *VctList) SetId(id string)
- func (v *VctList) SetName(name string)
- func (v *VctList) SetPage(page *module.Page)
- func (v *VctList) SetVersion(version string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentGet ¶
type DocumentGet struct {
Did string `json:"did,omitempty"` // DID
}
DocumentGet define the request structure of DocumentGet, used to get document
type Holder ¶
type Holder struct { Holder string `json:"holder,omitempty"` // 持有人,不填则查询所有 Page *module.Page `json:"page"` // 分页结构 }
Holder define the request structure of Holder, used to query holder's VC
func NewHolder ¶
NewHolder create a new Holder with page
type Login ¶
type Login struct { PhoneNumber string `json:"phoneNumber,omitempty,optional"` // 用户名 Username string `json:"username,omitempty,optional"` // 用户名 Password string `json:"password"` // 密码 }
Login define the request structure of Login, used to log in
type Property ¶
type Property struct { Desc string `json:"desc,omitempty"` // 描述 Enum []string `json:"enum,optional"` // 属性的可选取值,当type为string类型时生效。 MaxLength int `json:"maxLength,optional,omitempty"` MinLength int `json:"minLength,optional,omitempty"` Maximum int `json:"maximum,optional,omitempty"` Minimum int `json:"minimum,optional,omitempty"` Pattern string `json:"pattern,omitempty"` // 正则表达式, VC中credentialSubject的值的校验 Title string `json:"title"` // 提示VC中credentialSubject的key含义 Type string `json:"type"` // 类型 }
Property define the structure of Property
func NewProperty ¶
func NewProperty(t, title, pattern, desc string, enum []string, maxLength, minLength, maximum, minimum int) *Property
NewProperty create a new Property
func (*Property) SetTitle ¶
SetTitle set title of Property
type VcGet ¶
type VcGet struct {
Id string `json:"vcId"` // VC ID
}
VcGet define the request structure of VcGet, used to get VC
type VcIssue ¶
type VcIssue struct { TemplateId string `json:"templateId"` // 凭证模板编号 Holder string `json:"holder"` // 凭证持有者 ExpirationDate string `json:"expirationDate"` // 过期时间 VerificationMethod string `json:"verificationMethod,omitempty"` // 验签公钥地址 CredentialSubject json.RawMessage `json:"credentialSubject"` // 模板填充内容 Version string `json:"version,optional"` // 模板版本号 }
VcIssue define the request structure of VcIssue, used to issue VC
func NewVcIssue ¶
func NewVcIssue(template, holder, expirationDate, verificationMethod, version string, subject []byte) *VcIssue
NewVcIssue create a new VcIssue
func (*VcIssue) GetCredentialSubject ¶
GetCredentialSubject get credentialSubject of VcIssue
func (*VcIssue) GetExpirationDate ¶
GetExpirationDate get expirationDate of VcIssue
func (*VcIssue) GetHolder ¶
GetHolder get holder of VcIssue
func (*VcIssue) GetTemplateId ¶
GetTemplateId get templateId of VcIssue
func (*VcIssue) GetVerificationMethod ¶
GetVerificationMethod get verificationMethod of VcIssue
func (*VcIssue) GetVersion ¶
GetVersion get version of VcIssue
func (*VcIssue) SetCredentialSubject ¶
SetCredentialSubject set credentialSubject of VcIssue
func (*VcIssue) SetExpirationDate ¶
SetExpirationDate set expirationDate of VcIssue
func (*VcIssue) SetHolder ¶
SetHolder set holder of VcIssue
func (*VcIssue) SetTemplateId ¶
SetTemplateId set templateId of VcIssue
func (*VcIssue) SetVerificationMethod ¶
SetVerificationMethod set verificationMethod of VcIssue
type VcListLatest ¶
type VcListLatest struct { Issuer string `json:"issuer,omitempty"` // 发证人, 不填则查询所有 Limit int `json:"limit,omitempty"` // 限制数量, 不填则查询所有 }
VcListLatest define the request structure of VcListLatest, used to update VC list
type VcListLocal ¶
type VcListLocal struct { Id string `json:"id,omitempty"` Issuer string `json:"issuer,omitempty"` Page *module.Page `json:"page"` }
VcListLocal define the request structure of VcListLocal, used to get VC list
func NewVcListLocal ¶
func NewVcListLocal(id, issuer string, page *module.Page) *VcListLocal
NewVcListLocal create a new VcListLocal
func (*VcListLocal) GetId ¶
func (v *VcListLocal) GetId() string
GetId returns the id of the VcListLocal
func (*VcListLocal) GetIssuer ¶
func (v *VcListLocal) GetIssuer() string
GetIssuer returns the issuer of the VcListLocal
func (*VcListLocal) GetPage ¶
func (v *VcListLocal) GetPage() *module.Page
GetPage returns the page of the VcListLocal
func (*VcListLocal) SetId ¶
func (v *VcListLocal) SetId(id string)
SetId sets the id of the VcListLocal
func (*VcListLocal) SetIssuer ¶
func (v *VcListLocal) SetIssuer(issuer string)
SetIssuer sets the issuer of the VcListLocal
func (*VcListLocal) SetPage ¶
func (v *VcListLocal) SetPage(page *module.Page)
SetPage sets the page of the VcListLocal
type VcRevoke ¶
type VcRevoke struct {
Id string `json:"id"` // VC ID
}
VcRevoke define the request structure of VcRevoke, used to revoke VC
type VctCreate ¶
type VctCreate struct { AdditionalProperties bool `json:"additionalProperties"` // 是否允许额外的属性 Name string `json:"name"` // VCTemplate的名称 Properties map[string]*Property `json:"properties"` // VC中credentialSubject的key-value Required []string `json:"required"` // VC中credentialSubject的key VcType string `json:"vcType,omitempty"` // VC类型, 默认为IdentityCredential VerificationMethod string `json:"verificationMethod"` // 验签公钥地址 Version string `json:"versions"` // VCTemplate的版本 }
VctCreate define the request structure of VctCreate, used to create VCTemplate
func NewVctCreate ¶
func NewVctCreate(vcType string, properties map[string]*Property, required []string, name, version string, additionalProperties bool, verificationMethod string) *VctCreate
NewVctCreate create a new VctCreate, VcType default is IdentityCredential
func (*VctCreate) GetAdditionalProperties ¶
GetAdditionalProperties get additionalProperties of VctCreate
func (*VctCreate) GetProperties ¶
GetProperties get properties of VctCreate
func (*VctCreate) GetRequired ¶
GetRequired get required of VctCreate
func (*VctCreate) GetVcType ¶
GetVcType get vcType of VctCreate
func (*VctCreate) GetVerificationMethod ¶
GetVerificationMethod get verificationMethod of VctCreate
func (*VctCreate) GetVersion ¶
GetVersion get version of VctCreate
func (*VctCreate) SetAdditionalProperties ¶
SetAdditionalProperties set additionalProperties of VctCreate
func (*VctCreate) SetProperties ¶
SetProperties set properties of VctCreate
func (*VctCreate) SetRequired ¶
SetRequired set required of VctCreate
func (*VctCreate) SetVcType ¶
SetVcType set vcType of VctCreate
func (*VctCreate) SetVerificationMethod ¶
SetVerificationMethod set verificationMethod of VctCreate
type VctList ¶
type VctList struct { Id string `json:"id,omitempty"` // VCT ID Name string `json:"name,omitempty"` // VCT 名称 Version string `json:"version,omitempty"` // VCT 版本 Page *module.Page `json:"page"` // 分页结构 }
VctList define the request structure of VctList, used to get VCT list
func NewVctList ¶
NewVctList create a new VctList
func (*VctList) GetPage ¶
GetPage return the page of the VctList
func (*VctList) GetVersion ¶
GetVersion return the version of the VctList
func (*VctList) SetName ¶
SetName set the name of the VctList
func (*VctList) SetPage ¶
SetPage set the page of the VctList