request

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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

func NewHolder(holder string, page *module.Page) *Holder

NewHolder create a new Holder with page

func (*Holder) GetHolder

func (h *Holder) GetHolder() string

GetHolder get holder of Holder

func (*Holder) GetPage

func (h *Holder) GetPage() *module.Page

GetPage get page of Holder

func (*Holder) SetHolder

func (h *Holder) SetHolder(holder string)

SetHolder set holder of Holder

func (*Holder) SetPage

func (h *Holder) SetPage(page *module.Page)

SetPage set page of Holder

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) GetDesc

func (p *Property) GetDesc() string

GetDesc get desc of Property

func (*Property) GetReg

func (p *Property) GetReg() string

GetReg get reg of Property

func (*Property) GetTitle

func (p *Property) GetTitle() string

GetTitle get title of Property

func (*Property) GetType

func (p *Property) GetType() string

GetType get type of Property

func (*Property) SetDesc

func (p *Property) SetDesc(desc string)

SetDesc set desc of Property

func (*Property) SetReg

func (p *Property) SetReg(reg string)

SetReg set reg of Property

func (*Property) SetTitle

func (p *Property) SetTitle(title string)

SetTitle set title of Property

func (*Property) SetType

func (p *Property) SetType(t string)

SetType set type 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

func (vcIssue *VcIssue) GetCredentialSubject() []byte

GetCredentialSubject get credentialSubject of VcIssue

func (*VcIssue) GetExpirationDate

func (vcIssue *VcIssue) GetExpirationDate() string

GetExpirationDate get expirationDate of VcIssue

func (*VcIssue) GetHolder

func (vcIssue *VcIssue) GetHolder() string

GetHolder get holder of VcIssue

func (*VcIssue) GetTemplateId

func (vcIssue *VcIssue) GetTemplateId() string

GetTemplateId get templateId of VcIssue

func (*VcIssue) GetVerificationMethod

func (vcIssue *VcIssue) GetVerificationMethod() string

GetVerificationMethod get verificationMethod of VcIssue

func (*VcIssue) GetVersion

func (vcIssue *VcIssue) GetVersion() string

GetVersion get version of VcIssue

func (*VcIssue) SetCredentialSubject

func (vcIssue *VcIssue) SetCredentialSubject(subject []byte)

SetCredentialSubject set credentialSubject of VcIssue

func (*VcIssue) SetExpirationDate

func (vcIssue *VcIssue) SetExpirationDate(expirationDate string)

SetExpirationDate set expirationDate of VcIssue

func (*VcIssue) SetHolder

func (vcIssue *VcIssue) SetHolder(holder string)

SetHolder set holder of VcIssue

func (*VcIssue) SetTemplateId

func (vcIssue *VcIssue) SetTemplateId(templateId string)

SetTemplateId set templateId of VcIssue

func (*VcIssue) SetVerificationMethod

func (vcIssue *VcIssue) SetVerificationMethod(verificationMethod string)

SetVerificationMethod set verificationMethod of VcIssue

func (*VcIssue) SetVersion

func (vcIssue *VcIssue) SetVersion(version string)

SetVersion set holder 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

func (v *VctCreate) GetAdditionalProperties() bool

GetAdditionalProperties get additionalProperties of VctCreate

func (*VctCreate) GetName

func (v *VctCreate) GetName() string

GetName get name of VctCreate

func (*VctCreate) GetProperties

func (v *VctCreate) GetProperties() map[string]*Property

GetProperties get properties of VctCreate

func (*VctCreate) GetRequired

func (v *VctCreate) GetRequired() []string

GetRequired get required of VctCreate

func (*VctCreate) GetVcType

func (v *VctCreate) GetVcType() string

GetVcType get vcType of VctCreate

func (*VctCreate) GetVerificationMethod

func (v *VctCreate) GetVerificationMethod() string

GetVerificationMethod get verificationMethod of VctCreate

func (*VctCreate) GetVersion

func (v *VctCreate) GetVersion() string

GetVersion get version of VctCreate

func (*VctCreate) SetAdditionalProperties

func (v *VctCreate) SetAdditionalProperties(additionalProperties bool)

SetAdditionalProperties set additionalProperties of VctCreate

func (*VctCreate) SetName

func (v *VctCreate) SetName(name string)

SetName set name of VctCreate

func (*VctCreate) SetProperties

func (v *VctCreate) SetProperties(properties map[string]*Property)

SetProperties set properties of VctCreate

func (*VctCreate) SetRequired

func (v *VctCreate) SetRequired(required []string)

SetRequired set required of VctCreate

func (*VctCreate) SetVcType

func (v *VctCreate) SetVcType(vcType string)

SetVcType set vcType of VctCreate

func (*VctCreate) SetVerificationMethod

func (v *VctCreate) SetVerificationMethod(verificationMethod string)

SetVerificationMethod set verificationMethod of VctCreate

func (*VctCreate) SetVersion

func (v *VctCreate) SetVersion(version string)

SetVersion set version 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

func NewVctList(id, name, version string, page *module.Page) *VctList

NewVctList create a new VctList

func (*VctList) GetId

func (v *VctList) GetId() string

GetId return the id of the VctList

func (*VctList) GetName

func (v *VctList) GetName() string

GetName return the name of the VctList

func (*VctList) GetPage

func (v *VctList) GetPage() *module.Page

GetPage return the page of the VctList

func (*VctList) GetVersion

func (v *VctList) GetVersion() string

GetVersion return the version of the VctList

func (*VctList) SetId

func (v *VctList) SetId(id string)

SetId set the id of the VctList

func (*VctList) SetName

func (v *VctList) SetName(name string)

SetName set the name of the VctList

func (*VctList) SetPage

func (v *VctList) SetPage(page *module.Page)

SetPage set the page of the VctList

func (*VctList) SetVersion

func (v *VctList) SetVersion(version string)

SetVersion set the version of the VctList

Jump to

Keyboard shortcuts

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