Documentation
¶
Overview ¶
Package template provides some predefined descriptors used to issue verifiable credentials, they are compliant with the Axone Ontology.
Index ¶
- type DatasetDescriptor
- type GovernanceDescriptor
- type HasDatasetDID
- type HasDescription
- type HasFormat
- type HasID
- type HasIssuanceDate
- type HasTags
- type HasTopic
- type Option
- func WithDatasetDID[T interface{ ... }](did string) Option[T]
- func WithDescription[T interface{ ... }](description string) Option[T]
- func WithFormat[T interface{ ... }](format string) Option[T]
- func WithID[T interface{ ... }](id string) Option[T]
- func WithIssuanceDate[T interface{ ... }](t time.Time) Option[T]
- func WithTags[T interface{ ... }](tags []string) Option[T]
- func WithTopic[T interface{ ... }](topic string) Option[T]
- type PublicationDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatasetDescriptor ¶
type DatasetDescriptor struct {
// contains filtered or unexported fields
}
DatasetDescriptor is a descriptor for generate a dataset description VC. See https://docs.axone.xyz/ontology/next/schemas/credential-dataset-description
func NewDataset ¶
func NewDataset(datasetDID, title string, opts ...Option[*DatasetDescriptor]) *DatasetDescriptor
func (*DatasetDescriptor) IssuedAt ¶
func (d *DatasetDescriptor) IssuedAt() *time.Time
func (*DatasetDescriptor) ProofPurpose ¶
func (d *DatasetDescriptor) ProofPurpose() string
type GovernanceDescriptor ¶
type GovernanceDescriptor struct {
// contains filtered or unexported fields
}
GovernanceDescriptor is a descriptor for generate a credential governance text VC. See https://docs.axone.xyz/ontology/next/schemas/credential-governance-text
func NewGovernance ¶
func NewGovernance(datasetDID, govAddr string, opts ...Option[*GovernanceDescriptor]) *GovernanceDescriptor
NewGovernance creates a new governance verifiable credential descriptor. DatasetDID and GovAddr are required. If ID is not provided, it will be generated. If issuance date is not provided, it will be set to the current time at descriptor instantiation.
func (*GovernanceDescriptor) Generate ¶
func (g *GovernanceDescriptor) Generate() (*bytes.Buffer, error)
func (*GovernanceDescriptor) IssuedAt ¶
func (g *GovernanceDescriptor) IssuedAt() *time.Time
func (*GovernanceDescriptor) ProofPurpose ¶
func (g *GovernanceDescriptor) ProofPurpose() string
type HasDatasetDID ¶
type HasDatasetDID interface {
// contains filtered or unexported methods
}
type HasDescription ¶
type HasDescription interface {
// contains filtered or unexported methods
}
type HasIssuanceDate ¶
type HasIssuanceDate interface {
// contains filtered or unexported methods
}
type Option ¶
type Option[T credential.Descriptor] func(descriptor T)
func WithDatasetDID ¶
func WithDatasetDID[T interface {
HasDatasetDID
credential.Descriptor
}](did string) Option[T]
func WithDescription ¶
func WithDescription[T interface {
HasDescription
credential.Descriptor
}](description string) Option[T]
func WithFormat ¶
func WithFormat[T interface {
HasFormat
credential.Descriptor
}](format string) Option[T]
func WithID ¶
func WithID[T interface {
HasID
credential.Descriptor
}](id string) Option[T]
func WithIssuanceDate ¶
func WithIssuanceDate[T interface {
HasIssuanceDate
credential.Descriptor
}](t time.Time) Option[T]
func WithTags ¶
func WithTags[T interface {
HasTags
credential.Descriptor
}](tags []string) Option[T]
func WithTopic ¶
func WithTopic[T interface {
HasTopic
credential.Descriptor
}](topic string) Option[T]
type PublicationDescriptor ¶
type PublicationDescriptor struct {
// contains filtered or unexported fields
}
PublicationDescriptor is a descriptor for generate a digital resource publication VC. See https://docs.axone.xyz/ontology/next/schemas/credential-digital-resource-publication
func NewPublication ¶
func NewPublication(datasetDID, datasetURI, storageDID string, opts ...Option[*PublicationDescriptor], ) *PublicationDescriptor
func (*PublicationDescriptor) Generate ¶
func (d *PublicationDescriptor) Generate() (*bytes.Buffer, error)
func (*PublicationDescriptor) IssuedAt ¶
func (d *PublicationDescriptor) IssuedAt() *time.Time
func (*PublicationDescriptor) ProofPurpose ¶
func (d *PublicationDescriptor) ProofPurpose() string