template

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package template provides some predefined descriptors used to issue verifiable credentials, they are compliant with the Axone Ontology.

Index

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

func (d *DatasetDescriptor) Generate() (*bytes.Buffer, error)

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 HasFormat

type HasFormat interface {
	// contains filtered or unexported methods
}

type HasID

type HasID interface {
	// contains filtered or unexported methods
}

type HasIssuanceDate

type HasIssuanceDate interface {
	// contains filtered or unexported methods
}

type HasTags

type HasTags interface {
	// contains filtered or unexported methods
}

type HasTopic

type HasTopic 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

Jump to

Keyboard shortcuts

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