Documentation ¶
Index ¶
- Constants
- Variables
- func AddKeyToRouter(routeSvc ProtocolService, connID, recKey string) error
- func GetRouterConfig(routeSvc ProtocolService, connID, endpoint string) (string, []string, error)
- type ClientOption
- type ClientOptions
- type Config
- type Grant
- type KeylistUpdate
- type KeylistUpdateResponse
- type Options
- type ProtocolService
- type Request
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AddKey(connID, recKey string) error
- func (s *Service) Config(connID string) (*Config, error)
- func (s *Service) GetConnections() ([]string, error)
- func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)
- func (s *Service) HandleOutbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)
- func (s *Service) Initialize(p interface{}) error
- func (s *Service) Name() string
- func (s *Service) Register(connectionID string, options ...ClientOption) error
- func (s *Service) Unregister(connID string) error
- type Update
- type UpdateResponse
Constants ¶
const ( // Coordination route coordination protocol. Coordination = "coordinatemediation" // RouteCoordinationSpec defines the route coordination spec. CoordinationSpec = "https://didcomm.org/coordinatemediation/1.0/" // RouteRequestMsgType defines the route coordination request message type. RequestMsgType = CoordinationSpec + "mediate-request" // RouteGrantMsgType defines the route coordination request grant message type. GrantMsgType = CoordinationSpec + "mediate-grant" // KeyListUpdateMsgType defines the route coordination key list update message type. KeylistUpdateMsgType = CoordinationSpec + "keylist_update" // KeyListUpdateResponseMsgType defines the route coordination key list update message response type. KeylistUpdateResponseMsgType = CoordinationSpec + "keylist_update_response" )
constants for route coordination spec types.
Variables ¶
var ErrConnectionNotFound = errors.New("connection not found")
ErrConnectionNotFound connection not found error.
var ErrRouterNotRegistered = errors.New("router not registered")
ErrRouterNotRegistered router not registered error.
Functions ¶
func AddKeyToRouter ¶
func AddKeyToRouter(routeSvc ProtocolService, connID, recKey string) error
AddKeyToRouter util to add the recipient keys to the router.
func GetRouterConfig ¶
func GetRouterConfig(routeSvc ProtocolService, connID, endpoint string) (string, []string, error)
GetRouterConfig util to get the router configuration. The endpoint is overridden with routers endpoint, if router is registered. Returns endpoint, routingKeys and error.
Types ¶
type ClientOption ¶
type ClientOption func(opts *ClientOptions)
ClientOption configures the route client.
type ClientOptions ¶
ClientOptions holds options for the router client.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides the router configuration.
type Grant ¶
type Grant struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` Endpoint string `json:"endpoint,omitempty"` RoutingKeys []string `json:"routing_keys,omitempty"` }
Grant route grant message. https://github.com/hyperledger/aries-rfcs/tree/master/features/0211-route-coordination#route-grant
type KeylistUpdate ¶
type KeylistUpdate struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` Updates []Update `json:"updates,omitempty"` }
KeylistUpdate route keylist update message. https://github.com/hyperledger/aries-rfcs/tree/master/features/0211-route-coordination#keylist-update
type KeylistUpdateResponse ¶
type KeylistUpdateResponse struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` Updated []UpdateResponse `json:"updated,omitempty"` }
KeylistUpdateResponse route keylist update response message. https://github.com/hyperledger/aries-rfcs/tree/master/features/0211-route-coordination#keylist-update-response
type ProtocolService ¶
type ProtocolService interface { // AddKey adds agents recKey to the router AddKey(connID, recKey string) error // Config gives back the router configuration Config(connID string) (*Config, error) // GetConnections returns all router connections GetConnections() ([]string, error) }
ProtocolService service interface for router.
type Request ¶
type Request struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` decorator.Timing `json:"~timing,omitempty"` }
Request route request message. https://github.com/hyperledger/aries-rfcs/tree/master/features/0211-route-coordination#route-request
type Service ¶
Service for Route Coordination protocol. https://github.com/hyperledger/aries-rfcs/tree/master/features/0211-route-coordination
func (*Service) AddKey ¶
AddKey adds a recKey of the agent to the registered router. This method blocks until a response is received from the router or it times out. TODO https://github.com/hyperledger/aries-framework-go/issues/1076 Support for multiple routers TODO https://github.com/hyperledger/aries-framework-go/issues/1105 Support to Add multiple
recKeys to the Router
func (*Service) GetConnections ¶ added in v0.1.5
GetConnections returns the connections of the router.
func (*Service) HandleInbound ¶
func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)
HandleInbound handles inbound route coordination messages.
func (*Service) HandleOutbound ¶
HandleOutbound handles outbound route coordination messages.
func (*Service) Initialize ¶ added in v0.1.8
Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.
func (*Service) Register ¶
func (s *Service) Register(connectionID string, options ...ClientOption) error
Register registers the agent with the router on the other end of the connection identified by connectionID. This method blocks until a response is received from the router or it times out. The agent is registered with the router and retrieves the router endpoint and routing keys. This function throws an error if the agent is already registered against a router.
func (*Service) Unregister ¶
Unregister unregisters the agent with the router.
type Update ¶
type Update struct { RecipientKey string `json:"recipient_key,omitempty"` Action string `json:"action,omitempty"` }
Update route key update message.
type UpdateResponse ¶
type UpdateResponse struct { RecipientKey string `json:"recipient_key,omitempty"` Action string `json:"action,omitempty"` Result string `json:"result,omitempty"` }
UpdateResponse route key update response message.