service

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package service provides the relayer HTTP service layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(r chi.Router, svc Service, engine Engine, logger *zap.Logger)

RegisterRoutes registers relayer HTTP endpoints on the given chi router.

Types

type Engine

type Engine interface {
	IsReady() bool
}

Engine is the interface for checking relayer readiness.

type HTTP

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

HTTP wraps Service and Engine to provide HTTP endpoints.

type Service

type Service interface {
	ListTransfers(ctx context.Context, limit int) ([]*relayer.Transfer, error)
	GetTransfer(ctx context.Context, id string) (*relayer.Transfer, error)
}

Service defines the interface for relayer query operations.

func NewLog

func NewLog(svc Service, logger *zap.Logger) Service

NewLog creates a logging decorator for the relayer Service. It logs method entry/exit, duration, and errors.

func NewService

func NewService(store Store) Service

NewService creates a new relayer service.

type Store

type Store interface {
	ListTransfers(ctx context.Context, limit int) ([]*relayer.Transfer, error)
	GetTransfer(ctx context.Context, id string) (*relayer.Transfer, error)
}

Store is the narrow data-access interface for the relayer service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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