IPackageManager interface
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Interface for defining the registry of packers
IPackageManager
Signature:
export interface IPackageManager
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
packers | Map<MediaType, IPacker> | Map of packers key is media type, value is packer implementation {Map<MediaType, IPacker>} |
Methods
Method | Description |
---|---|
getMediaType(envelope) | gets media type from an envelope |
pack(mediaType, payload, params) | packs payload with a packer that is assigned to media type forwards packer params to implementation |
registerPackers(packers) | registers new packer in the manager |
unpack(envelope) | unpacks packed envelope to basic protocol message and returns media type of the envelope |
unpackWithType(mediaType, envelope) | unpacks an envelope with a known media type |