Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCIDFromNode(node datamodel.Node) cid.Cid
- func CreateDataCID(data string) string
- func CreateDescriptorCID(descriptor Descriptor) string
- func CreateProcessingCID(mp MessageProcessing) string
- func CreateRecordCID(descriptorCID string, processingCID string) string
- func ResolveDID(didToResolve string) (*didsdk.Document, error)
- func VerifyAttestation(message *Message) bool
- func VerifyAuthorization(message *Message) bool
- type DWNJWS
- type DWNJWSSig
- type Descriptor
- type DescriptorFilter
- type FeatureDetection
- type FeatureInterface
- type HooksFeatures
- type Message
- func CreateInitialRecordsWriteMessage(authorDID string, recipientDID string, protocolDef *ProtocolDefinition, ...) *Message
- func CreateMessage(authorDID string, recipientDID string, dataFormat string, data []byte, ...) *Message
- func CreateQueryRecordsMessage(schemaUri string, recordId string, protocolDef *ProtocolDefinition, ...) *Message
- func CreateRecordsCommitMessage(logicalRecordId string, schemaUrl string, committerDID string) *Message
- func CreateUpdateRecordsWriteMessage(authorDID string, recipientDID string, logicalRecordId string, ...) *Message
- type MessageProcessing
- type MessageResultEntry
- type MessageResultObject
- type MessagingFeatures
- type PermissionsFeatures
- type ProtocolDefinition
- type ProtocolsFeatures
- type RecordsFeatures
- type RequestObject
- type ResponseObject
- type ResponseStatus
Constants ¶
View Source
const ( DATA_FORMAT_JSON = "application/json" DATA_FORMAT_VC_JWT = "application/vc+jwt" DATA_FORMAT_VC_LDP = "application/vc+ldp" )
View Source
const ( INTERFACE_RECORDS = "Records" METHOD_RECORDS_QUERY = "Query" METHOD_RECORDS_WRITE = "Write" METHOD_RECORDS_COMMIT = "Commit" METHOD_RECORDS_DELETE = "Delete" INTERFACE_HOOKS = "Hooks" METHOD_HOOKS_WRITE = "Write" METHOD_HOOKS_QUERY = "Query" METHOD_HOOKS_DELETE = "Delete" )
Variables ¶
View Source
var DescriptorSchemaType schema.Type
Functions ¶
func CreateCIDFromNode ¶
func CreateDataCID ¶
func CreateProcessingCID ¶
func CreateProcessingCID(mp MessageProcessing) string
func CreateRecordCID ¶
func VerifyAttestation ¶
func VerifyAuthorization ¶
Types ¶
type DWNJWS ¶
type DWNJWS struct { Payload string `json:"payload" bson:"payload"` Signatures []DWNJWSSig `json:"signatures" bson:"signatures"` }
func CreateAttestation ¶
func CreateAuthorization ¶
type Descriptor ¶
type Descriptor struct { // Base Required Fields per https://identity.foundation/decentralized-web-node/spec/#messages Interface string `json:"interface" bson:"interface"` Method string `json:"method" bson:"method"` DataCID string `json:"dataCid,omitempty" bson:"dataCID"` DataFormat string `json:"dataFormat,omitempty" bson:"dataFormat"` // CollectionsQuery, HooksWrite per https://identity.foundation/decentralized-web-node/spec/#collectionsquery, https://identity.foundation/decentralized-web-node/spec/#hooks Filter DescriptorFilter `json:"filter,omitempty"` // CollectionsWrite, Delete, Commit per https://identity.foundation/decentralized-web-node/spec/#collectionswrite ParentID string `json:"parentId,omitempty" bson:"parent_id"` Protocol string `json:"protocol,omitempty" bson:"protocol"` ProtocolVersion string `json:"protocolVersion,omitempty" bson:"protocol_version"` Schema string `json:"schema,omitempty" bson:"schema"` CommitStrategy string `json:"commitStrategy,omitempty" bson:"commit_strategy"` Published bool `json:"published,omitempty" bson:"published"` DateCreated string `json:"dateCreated,omitempty" bson:"date_created"` DatePublished *string `json:"datePublished,omitempty" bson:"date_published"` // HooksWrite per https://identity.foundation/decentralized-web-node/spec/#hooks URI string `json:"uri,omitempty" bson:"uri"` }
type DescriptorFilter ¶
type DescriptorFilter struct { Schema string `json:"schema,omitempty"` RecordID string `json:"recordId,omitempty"` ContextID string `json:"contextId,omitempty"` Protocol string `json:"protocol,omitempty"` ProtocolVersion string `json:"protocolVersion,omitempty"` DataFormat string `json:"dataFormat,omitempty"` DateSort string `json:"dateSort,omitempty"` }
type FeatureDetection ¶
type FeatureDetection struct { Type string `json:"type"` Interfaces FeatureInterface `json:"interfaces"` }
var CurrentFeatureDetection FeatureDetection = FeatureDetection{ Type: "FeatureDetection", Interfaces: FeatureInterface{ Records: RecordsFeatures{ RecordsQuery: true, RecordsWrite: true, RecordsCommit: true, RecordsDelete: true, }, Hooks: HooksFeatures{ HooksQuery: true, HooksWrite: true, HooksDelete: true, }, Permissions: PermissionsFeatures{ PermissionsRequest: true, PermissionsGrant: true, PermissionsRevoke: true, }, Messaging: MessagingFeatures{ Batching: true, }, Protocols: ProtocolsFeatures{ ProtocolsQuery: true, ProtocolsConfigure: true, }, }, }
type FeatureInterface ¶
type FeatureInterface struct { Records RecordsFeatures `json:"records,omitempty"` Hooks HooksFeatures `json:"hooks,omitempty"` Permissions PermissionsFeatures `json:"permissions,omitempty"` Messaging MessagingFeatures `json:"messaging,omitempty"` Protocols ProtocolsFeatures `json:"protocols,omitempty"` }
type HooksFeatures ¶
type Message ¶
type Message struct { RecordID string `json:"recordId,omitempty" bson:"record_id"` ContextID string `json:"contextId,omitempty" bson:"context_id"` Data string `json:"data,omitempty" bson:"data"` Processing MessageProcessing `json:"processing" bson:"processing"` Descriptor Descriptor `json:"descriptor" bson:"descriptor"` Attestation DWNJWS `json:"attestation,omitempty" bson:"attestation"` Authorization DWNJWS `json:"authorization,omitempty" bson:"authorization"` }
func CreateMessage ¶
func CreateQueryRecordsMessage ¶
func CreateQueryRecordsMessage(schemaUri string, recordId string, protocolDef *ProtocolDefinition, requestorDID string) *Message
type MessageProcessing ¶
type MessageResultEntry ¶
type MessageResultEntry struct {
Result []byte `json:"result"`
}
type MessageResultObject ¶
type MessageResultObject struct { Status ResponseStatus `json:"status"` Entries []MessageResultEntry `json:"entries"` }
type MessagingFeatures ¶
type MessagingFeatures struct {
Batching bool `json:"batching"`
}
type PermissionsFeatures ¶
type ProtocolDefinition ¶
type ProtocolsFeatures ¶
type RecordsFeatures ¶
type RequestObject ¶
type RequestObject struct {
Messages []Message `json:"messages"`
}
type ResponseObject ¶
type ResponseObject struct { Status ResponseStatus `json:"status"` Replies []MessageResultObject `json:"replies"` }
type ResponseStatus ¶
Click to show internal directories.
Click to hide internal directories.