Documentation
¶
Overview ¶
Package wrapper contains wrappers that convert between the Go and gomobile APIs.
Index ¶
- func NewHTTPClient(timeout *time.Duration, additionalHeaders api.Headers, ...) *http.Client
- func ToMobileError(err error) error
- func ToMobileErrorWithTrace(err error, trace *otel.Trace) error
- type DocumentLoaderWrapper
- type MobileActivityLoggerWrapper
- type MobileMetricsLoggerWrapper
- type VDRResolverWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(timeout *time.Duration, additionalHeaders api.Headers, disableTLSVerification bool, ) *http.Client
NewHTTPClient returns a new HTTP client using the given parameters.
func ToMobileError ¶
ToMobileError translates Go API errors to gomobile API errors.
Types ¶
type DocumentLoaderWrapper ¶
type DocumentLoaderWrapper struct {
DocumentLoader api.LDDocumentLoader
}
DocumentLoaderWrapper wraps a gomobile-compatible version of a LDDocumentLoader and translates methods calls to their corresponding Go API versions.
func (*DocumentLoaderWrapper) LoadDocument ¶
func (l *DocumentLoaderWrapper) LoadDocument(url string) (*ld.RemoteDocument, error)
LoadDocument wraps LoadDocument of api.LDDocumentLoader.
type MobileActivityLoggerWrapper ¶
type MobileActivityLoggerWrapper struct {
MobileAPIActivityLogger api.ActivityLogger
}
MobileActivityLoggerWrapper is a goapi.ActivityLogger implementation that intercepts Activity log events, converts them to the gomobile-compatible Activity objects, and sends them to the wrapped mobile ActivityLogger.
func (*MobileActivityLoggerWrapper) Log ¶
func (m *MobileActivityLoggerWrapper) Log(activity *goapi.Activity) error
Log converts the given activity from a goapi.Activity object to a gomobile-compatible Activity object and then passes that converted object to the underlying mobile activity logger implementation.
type MobileMetricsLoggerWrapper ¶
type MobileMetricsLoggerWrapper struct {
MobileAPIMetricsLogger gomobileapi.MetricsLogger
}
MobileMetricsLoggerWrapper is a goapi.MetricsLogger implementation that intercepts metrics log events, converts them to the gomobile-compatible MetricsEvent objects, and sends them to the wrapped mobile MetricsLogger.
func (*MobileMetricsLoggerWrapper) Log ¶
func (m *MobileMetricsLoggerWrapper) Log(metricsEvent *goapi.MetricsEvent) error
Log converts the given activity from a goapi.MetricsEvent object to a gomobile-compatible MetricsEvent object and then passes that converted object to the underlying MetricsLogger implementation.
type VDRResolverWrapper ¶
type VDRResolverWrapper struct {
DIDResolver api.DIDResolver
}
VDRResolverWrapper wraps a gomobile-compatible version of a DIDResolver and translates methods calls to their corresponding Go API versions.
func (*VDRResolverWrapper) Resolve ¶
func (a *VDRResolverWrapper) Resolve(didID string) (*did.DocResolution, error)
Resolve wraps Resolve of api.DIDResolver.