client

package
v6.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHTTPClient

type DefaultHTTPClient struct {
	// contains filtered or unexported fields
}

DefaultHTTPClient implements HTTPClient using HTTP.

func New

func New(timeout time.Duration) *DefaultHTTPClient

New creates a new DefaultHTTPClient.

func (DefaultHTTPClient) Get

func (h DefaultHTTPClient) Get(ctx context.Context, serviceEndpointURL string, timestamp int) (map[string]vc.VerifiablePresentation, string, int, error)

func (DefaultHTTPClient) Register

func (h DefaultHTTPClient) Register(ctx context.Context, serviceEndpointURL string, presentation vc.VerifiablePresentation) error

type HTTPClient

type HTTPClient interface {
	// Register registers a Verifiable Presentation on the remote Discovery Service.
	Register(ctx context.Context, serviceEndpointURL string, presentation vc.VerifiablePresentation) error

	// Get retrieves Verifiable Presentations from the remote Discovery Service, that were added since the given timestamp.
	// If the call succeeds it returns the Verifiable Presentations and the timestamp that was returned by the server.
	// If the given timestamp is 0, all Verifiable Presentations are retrieved.
	Get(ctx context.Context, serviceEndpointURL string, timestamp int) (map[string]vc.VerifiablePresentation, string, int, error)
}

HTTPClient is the interface for the client that invokes the remote Discovery Service.

type MockHTTPClient

type MockHTTPClient struct {
	// contains filtered or unexported fields
}

MockHTTPClient is a mock of HTTPClient interface.

func NewMockHTTPClient

func NewMockHTTPClient(ctrl *gomock.Controller) *MockHTTPClient

NewMockHTTPClient creates a new mock instance.

func (*MockHTTPClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHTTPClient) Get

func (m *MockHTTPClient) Get(ctx context.Context, serviceEndpointURL string, timestamp int) (map[string]vc.VerifiablePresentation, string, int, error)

Get mocks base method.

func (*MockHTTPClient) Register

func (m *MockHTTPClient) Register(ctx context.Context, serviceEndpointURL string, presentation vc.VerifiablePresentation) error

Register mocks base method.

type MockHTTPClientMockRecorder

type MockHTTPClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockHTTPClientMockRecorder is the mock recorder for MockHTTPClient.

func (*MockHTTPClientMockRecorder) Get

func (mr *MockHTTPClientMockRecorder) Get(ctx, serviceEndpointURL, timestamp any) *gomock.Call

Get indicates an expected call of Get.

func (*MockHTTPClientMockRecorder) Register

func (mr *MockHTTPClientMockRecorder) Register(ctx, serviceEndpointURL, presentation any) *gomock.Call

Register indicates an expected call of Register.

type PresentationsResponse

type PresentationsResponse struct {
	// Entries contains mappings from timestamp (as string) to a VerifiablePresentation.
	Entries map[string]vc.VerifiablePresentation `json:"entries"`
	// Seed is a unique value for the combination of serviceID and a server instance.
	Seed string `json:"seed"`
	// Timestamp is the timestamp of the latest entry. It's not a unix timestamp but a Lamport Clock.
	Timestamp int `json:"timestamp"`
}

PresentationsResponse is the response for the GetPresentations endpoint.

Jump to

Keyboard shortcuts

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