aries

package
v0.31.46 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package aries is implementation package for didcomm messages. See related package mesg which is for our legacy messages. Both aries and mesg messages share same interfaces defined in the didcomm package. didcomm defines a message factor interfaces as well. With the help of the factoring system, the actual messages can be constructed from the incoming messages with the correct type. We use statically typed JSON messages i.e. they are always mapped to corresponding Go struct.

Index

Constants

This section is empty.

Variables

View Source
var Creator = &Factor{factors: make(map[string]didcomm.Factor)}
View Source
var MsgCreator = MsgFactor{}
View Source
var PayloadCreator = PayloadFactor{}

Functions

func ProtocolForType added in v0.25.7

func ProtocolForType(typeStr string) string

func ProtocolMsgForType added in v0.25.7

func ProtocolMsgForType(typeStr string) string

Types

type Factor

type Factor struct {
	// contains filtered or unexported fields
}

func (*Factor) Add

func (f *Factor) Add(t string, factor didcomm.Factor)

type Msg

type Msg struct {
	Type string `json:"@type,omitempty"`
	AID  string `json:"@id,omitempty"`

	Thread *decorator.Thread `json:"~thread,omitempty"`

	ID    string                 `json:"id,omitempty"`    // Used for transferring additional ID like the Cred Def ID
	Ready bool                   `json:"ready,omitempty"` // In queries tells if something is ready when true
	Msg   map[string]interface{} `json:"msg,omitempty"`   // Forwarded message
}

type MsgFactor

type MsgFactor struct{}

func (MsgFactor) Create

func (MsgFactor) NewMessage

func (f MsgFactor) NewMessage(data []byte) didcomm.MessageHdr

func (MsgFactor) NewMsg

func (f MsgFactor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr

type PayloadFactor

type PayloadFactor struct{}

func (PayloadFactor) New

New creates a new Aries PL with PayloadInit struct. The type of the Msg is generic.

func (PayloadFactor) NewFromData

func (f PayloadFactor) NewFromData(data []byte) didcomm.Payload

NewFromData creates a new Aries PL in correct Go struct type. If @Type is associated to Go struct type which is registered to this Factor, it's used. If not a generic type is used.

func (PayloadFactor) NewMsg

NewMsg creates a new PL by ID, Type and already created internal Msg.

type PayloadImpl

type PayloadImpl struct {
	didcomm.MessageHdr
}

func (*PayloadImpl) Creator

func (pl *PayloadImpl) Creator() didcomm.PayloadFactor

func (*PayloadImpl) Data

func (pl *PayloadImpl) Data() []byte

func (*PayloadImpl) FieldObj

func (pl *PayloadImpl) FieldObj() interface{}

func (*PayloadImpl) ID

func (pl *PayloadImpl) ID() string

func (*PayloadImpl) Message

func (pl *PayloadImpl) Message() didcomm.Msg

func (*PayloadImpl) MsgCreator

func (pl *PayloadImpl) MsgCreator() didcomm.MsgFactor

func (*PayloadImpl) MsgHdr

func (pl *PayloadImpl) MsgHdr() didcomm.MessageHdr

func (*PayloadImpl) Namespace

func (pl *PayloadImpl) Namespace() string

func (*PayloadImpl) Protocol

func (pl *PayloadImpl) Protocol() string

func (*PayloadImpl) ProtocolMsg

func (pl *PayloadImpl) ProtocolMsg() string

func (*PayloadImpl) SetThread

func (pl *PayloadImpl) SetThread(_ *decorator.Thread)

func (*PayloadImpl) ThreadID

func (pl *PayloadImpl) ThreadID() string

func (*PayloadImpl) Type

func (pl *PayloadImpl) Type() string

Jump to

Keyboard shortcuts

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