Documentation ¶
Index ¶
- Constants
- type Generator
- func (g *Generator) CreateContentObject(payload *subject.Payload) (vocab.Document, error)
- func (g *Generator) CreatePayload(doc vocab.Document, coreIndexURI *url.URL, anchors []*url.URL) (*subject.Payload, error)
- func (g *Generator) ID() *url.URL
- func (g *Generator) Namespace() string
- func (g *Generator) ValidateAnchorCredential(vc *verifiable.Credential, contentBytes []byte) error
- func (g *Generator) Version() uint64
- type Opt
Constants ¶
const ( // ID specifies the ID of the generator. ID = "https://w3id.org/orb#v0" // Namespace specifies the namespace of the generator. Namespace = "did:orb" // Version specifies the version of the generator. Version = uint64(0) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates a content object for did:orb anchor events.
func (*Generator) CreateContentObject ¶
CreateContentObject creates a content object from the given payload.
func (*Generator) CreatePayload ¶
func (g *Generator) CreatePayload(doc vocab.Document, coreIndexURI *url.URL, anchors []*url.URL) (*subject.Payload, error)
CreatePayload creates a payload from the given document.
func (*Generator) ValidateAnchorCredential ¶
func (g *Generator) ValidateAnchorCredential(vc *verifiable.Credential, contentBytes []byte) error
ValidateAnchorCredential validates the anchor credential against the given content. - The ID of the credential subject is a hashlink of the content. - The content must be a valid anchor linkset. - If profile is provided then it must be set to https://w3id.org/orb#v0. - If anchor is provided then it is set to the same value as 'anchor' in the anchor linkset.
type Opt ¶
type Opt func(opts *options)
Opt defines an option for the generator.
func WithNamespace ¶
WithNamespace sets the namespace of the generator.
func WithVersion ¶
WithVersion sets the version of the generator.