Documentation ¶
Overview ¶
Package aries provides a pluggable dependency framework, where implementors can customize primitives via Service Provider Interfaces (SPIs). The framework comes with a "batteries included" model where default primitives are included. The framework holds a context that can be used to create aries clients.
Usage:
// create the framework framework := aries.New() // get the context ctx := framework.Context() // initialize the aries clients didexchangeClient, err := didexchange.New(ctx)
Example ¶
package main import ( "fmt" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" "github.com/hyperledger/aries-framework-go/pkg/didcomm/transport" ) func main() { // create the framework with user options framework, err := New( WithInboundTransport(newMockInTransport()), WithStoreProvider(mem.NewProvider()), WithProtocolStateStoreProvider(mem.NewProvider()), ) if err != nil { fmt.Println("failed to create framework") } // get the context from the framework ctx, err := framework.Context() if err != nil { fmt.Println("failed to create framework context") } fmt.Println("context created successfully") fmt.Println(ctx.ServiceEndpoint()) } // mock inbound transport. type mockInTransport struct{} func newMockInTransport() *mockInTransport { return &mockInTransport{} } func (c *mockInTransport) Start(prov transport.Provider) error { return nil } func (c *mockInTransport) Stop() error { return nil } func (c *mockInTransport) Endpoint() string { return "http://server" }
Output: context created successfully http://server
Index ¶
- type Aries
- type Option
- func WithCrypto(c crypto.Crypto) Option
- func WithDIDConnectionStore(store did.ConnectionStore) Option
- func WithInboundTransport(inboundTransport ...transport.InboundTransport) Option
- func WithJSONLDContextProviderURL(url ...string) Option
- func WithJSONLDContextStore(store ldstore.ContextStore) Option
- func WithJSONLDDocumentLoader(loader jsonld.DocumentLoader) Option
- func WithJSONLDRemoteProviderStore(store ldstore.RemoteProviderStore) Option
- func WithKMS(k kms.Creator) Option
- func WithKeyAgreementType(keyAgreementType kms.KeyType) Option
- func WithKeyType(keyType kms.KeyType) Option
- func WithMediaTypeProfiles(mediaTypeProfiles []string) Option
- func WithMessageServiceProvider(msv api.MessageServiceProvider) Option
- func WithMessengerHandler(mh service.MessengerHandler) Option
- func WithOutboundTransports(outboundTransports ...transport.OutboundTransport) Option
- func WithPacker(primary packer.Creator, additionalPackers ...packer.Creator) Option
- func WithProtocolStateStoreProvider(prov storage.Provider) Option
- func WithProtocols(protocolSvcCreator ...api.ProtocolSvcCreator) Option
- func WithSecretLock(s secretlock.Service) Option
- func WithServiceMsgTypeTargets(msgTypeTargets ...dispatcher.MessageTypeTarget) Option
- func WithStoreProvider(prov storage.Provider) Option
- func WithTransportReturnRoute(transportReturnRoute string) Option
- func WithVDR(v vdrapi.VDR) Option
- func WithVerifiableStore(store verifiable.Store) Option
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aries ¶
type Aries struct {
// contains filtered or unexported fields
}
Aries provides access to the context being managed by the framework. The context can be used to create aries clients.
func New ¶
New initializes the Aries framework based on the set of options provided. This function returns a framework which can be used to manage Aries clients by getting the framework context.
type Option ¶
Option configures the framework.
func WithCrypto ¶ added in v0.1.1
WithCrypto injects a crypto service to the Aries framework.
func WithDIDConnectionStore ¶ added in v0.1.7
func WithDIDConnectionStore(store did.ConnectionStore) Option
WithDIDConnectionStore injects a DID connection store.
func WithInboundTransport ¶
func WithInboundTransport(inboundTransport ...transport.InboundTransport) Option
WithInboundTransport injects an inbound transport to the Aries framework.
func WithJSONLDContextProviderURL ¶ added in v0.1.7
WithJSONLDContextProviderURL injects URLs of the remote JSON-LD context providers.
func WithJSONLDContextStore ¶ added in v0.1.7
func WithJSONLDContextStore(store ldstore.ContextStore) Option
WithJSONLDContextStore injects a JSON-LD context store.
func WithJSONLDDocumentLoader ¶ added in v0.1.7
func WithJSONLDDocumentLoader(loader jsonld.DocumentLoader) Option
WithJSONLDDocumentLoader injects a JSON-LD document loader.
func WithJSONLDRemoteProviderStore ¶ added in v0.1.7
func WithJSONLDRemoteProviderStore(store ldstore.RemoteProviderStore) Option
WithJSONLDRemoteProviderStore injects a JSON-LD remote provider store.
func WithKeyAgreementType ¶ added in v0.1.7
WithKeyAgreementType injects a default encryption key type.
func WithKeyType ¶ added in v0.1.7
WithKeyType injects a default signing key type.
func WithMediaTypeProfiles ¶ added in v0.1.7
WithMediaTypeProfiles injects a default media types profile.
func WithMessageServiceProvider ¶ added in v0.1.1
func WithMessageServiceProvider(msv api.MessageServiceProvider) Option
WithMessageServiceProvider injects a message service provider to the Aries framework. Message service provider returns list of message services which can be used to provide custom handle functionality based on incoming messages type and purpose.
func WithMessengerHandler ¶ added in v0.1.1
func WithMessengerHandler(mh service.MessengerHandler) Option
WithMessengerHandler injects a messenger handler to the Aries framework.
func WithOutboundTransports ¶ added in v0.1.1
func WithOutboundTransports(outboundTransports ...transport.OutboundTransport) Option
WithOutboundTransports injects an outbound transports to the Aries framework.
func WithPacker ¶
WithPacker injects at least one Packer service into the Aries framework, with the primary Packer being used for inbound/outbound communication and the additional packers being available for unpacking inbound messages.
func WithProtocolStateStoreProvider ¶ added in v0.1.4
WithProtocolStateStoreProvider injects a protocol state storage provider to the Aries framework.
func WithProtocols ¶
func WithProtocols(protocolSvcCreator ...api.ProtocolSvcCreator) Option
WithProtocols injects a protocol service to the Aries framework.
func WithSecretLock ¶ added in v0.1.2
func WithSecretLock(s secretlock.Service) Option
WithSecretLock injects a SecretLock service to the Aries framework.
func WithServiceMsgTypeTargets ¶ added in v0.1.8
func WithServiceMsgTypeTargets(msgTypeTargets ...dispatcher.MessageTypeTarget) Option
WithServiceMsgTypeTargets injects service msg type to target mappings in the context.
func WithStoreProvider ¶
WithStoreProvider injects a storage provider to the Aries framework.
func WithTransportReturnRoute ¶ added in v0.1.1
WithTransportReturnRoute injects transport return route option to the Aries framework. Acceptable values - "none", "all" or "thread". RFC - https://github.com/hyperledger/aries-rfcs/tree/master/features/0092-transport-return-route. Currently, framework supports "all" and "none" option with WebSocket transport ("thread" is not supported).
func WithVerifiableStore ¶ added in v0.1.4
func WithVerifiableStore(store verifiable.Store) Option
WithVerifiableStore injects a verifiable credential store.