Documentation ¶
Overview ¶
Package didcomm is package to offer interfaces for all types of the didcomm messages. The package helps to abstract indy's legacy messages as well as new Aries messages. Corresponding packages are mesg and aries.
The package offers needed interfaces, some helper functions and variables. More information can be found from each individual type.
Index ¶
- Variables
- func FieldAtInd(s string, where int) string
- type CredentialAttribute
- type Factor
- type God
- func (g *God) AddMsgCreator(namespace string, c MsgFactor)
- func (g *God) AddPayloadCreator(namespace string, c PayloadFactor)
- func (g *God) MsgCreator(namespace string) MsgFactor
- func (g *God) MsgCreatorByType(t string) MsgFactor
- func (g *God) PayloadCreator(namespace string) PayloadFactor
- func (g *God) PayloadCreatorByType(t string) PayloadFactor
- type JSONSpeaker
- type MessageHdr
- type Msg
- type MsgFactor
- type MsgInit
- type Payload
- type PayloadFactor
- type PayloadHdr
- type PayloadInit
- type PayloadThread
- type PayloadWriteHdr
- type ProofAttribute
- type ProofPredicate
- type ProofValue
Constants ¶
This section is empty.
Variables ¶
var CreatorGod = God{}
CreatorGod creates payloads and messages by namespace string.
Functions ¶
func FieldAtInd ¶
Types ¶
type CredentialAttribute ¶
type CredentialAttribute struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` MimeType string `json:"mime-type,omitempty"` }
CredentialAttribute for credential value
type Factor ¶
type Factor interface { NewMessage(data []byte) MessageHdr NewMsg(init MsgInit) MessageHdr }
type God ¶
type God struct {
// contains filtered or unexported fields
}
func (*God) AddMsgCreator ¶
func (*God) AddPayloadCreator ¶
func (g *God) AddPayloadCreator(namespace string, c PayloadFactor)
func (*God) MsgCreator ¶
func (*God) MsgCreatorByType ¶
func (*God) PayloadCreator ¶
func (g *God) PayloadCreator(namespace string) PayloadFactor
func (*God) PayloadCreatorByType ¶
func (g *God) PayloadCreatorByType(t string) PayloadFactor
type JSONSpeaker ¶
type JSONSpeaker interface {
JSON() []byte
}
type MessageHdr ¶
type MessageHdr interface { PayloadHdr PayloadWriteHdr JSON() []byte Thread() *decorator.Thread FieldObj() interface{} }
MessageHdr is the base interface for all protocol messages. It has the minimum needed to handle and process inbound and outbound protocol messages. The are message factors to help creation of these messages as well. This is the interface which should be used for all common references to didcomm messages. Please be noted that there still is a Payload concept which is a envelope level abstraction, and works well with the message.
type Msg ¶
type Msg interface { MessageHdr SubLevelID() string Ready() bool }
Msg is a legacy interface for before Aries message protocols. For new Aries protocols it isn't recommended to use it, but use MessageHdr instead.
type MsgFactor ¶
type MsgFactor interface { Factor Create(mcd MsgInit) MessageHdr }
type MsgInit ¶
type MsgInit struct { AID string Type string Nonce string Error string Did string VerKey string Endpoint string EndpVerKey string RcvrEndp service.Addr Name string Info string ID string Ready bool Thread *decorator.Thread DIDObj core.DID To string Msg map[string]interface{} }
MsgInit is a helper struct for factors to construct new message instances.
type Payload ¶
type Payload interface { PayloadHdr PayloadThread JSONSpeaker SetType(t string) Creator() PayloadFactor MsgCreator() MsgFactor FieldObj() interface{} Message() Msg // this is mostly for legacy message handling, before Aries MsgHdr() MessageHdr // this generic and preferable way to get the message Protocol() string ProtocolMsg() string Namespace() string }
type PayloadFactor ¶
type PayloadFactor interface { NewFromData(data []byte) Payload New(pi PayloadInit) Payload NewMsg(id, t string, m MessageHdr) Payload }
type PayloadHdr ¶
type PayloadInit ¶
type PayloadThread ¶
type PayloadWriteHdr ¶
type ProofAttribute ¶
type ProofAttribute struct { ID string `json:"-"` Name string `json:"name,omitempty"` CredDefID string `json:"credDefId,omitempty"` Predicate string `json:"predicate,omitempty"` Value string `json:"-"` }
ProofAttribute for proof request attributes