wrapper

package
v0.0.0-...-6ffe938 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package wrapper contains wrappers that convert between the Go and gomobile APIs.

Index

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

func ToMobileError(err error) error

ToMobileError translates Go API errors to gomobile API errors.

func ToMobileErrorWithTrace

func ToMobileErrorWithTrace(err error, trace *otel.Trace) error

ToMobileErrorWithTrace 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.

Jump to

Keyboard shortcuts

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