api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package api contains REST API handling for the relayer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttestationAPI

type AttestationAPI interface {
	GetAttestation(context.Context, string) ([]byte, error)
}

AttestationAPI is the interface for the Attestation API.

type CircleAPI

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

CircleAPI is a wrapper for Circle's REST API..

func NewCircleAPI

func NewCircleAPI(url string) CircleAPI

NewCircleAPI creates a new CircleAPI.

func (CircleAPI) GetAttestation

func (c CircleAPI) GetAttestation(ctx context.Context, txHash string) (attestation []byte, err error)

GetAttestation is a wrapper for GET /attestations/{txHash}.

type MockCircleAPI

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

MockCircleAPI is a mock CircleAPI for testing.

func NewMockCircleAPI

func NewMockCircleAPI() *MockCircleAPI

NewMockCircleAPI creates a new MockCircleAPI.

func (*MockCircleAPI) GetAttestation

func (m *MockCircleAPI) GetAttestation(ctx context.Context, txHash string) (attestation []byte, err error)

GetAttestation is a mock GetAttestation.

func (*MockCircleAPI) SetGetAttestation

func (m *MockCircleAPI) SetGetAttestation(attestFunc func(context.Context, string) ([]byte, error))

SetGetAttestation overrides the attestFunc.

Jump to

Keyboard shortcuts

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