server

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttestorHandler

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

AttestorHandler handles attestor RPC requests.

func NewAttestorHandler

func NewAttestorHandler(srv AttestorService) *AttestorHandler

func (*AttestorHandler) CheckReady

func (h *AttestorHandler) CheckReady(ctx context.Context) error

func (*AttestorHandler) Info

func (*AttestorHandler) Name

func (h *AttestorHandler) Name() string

func (*AttestorHandler) Register

func (h *AttestorHandler) Register(opts ...connect.HandlerOption) (string, http.Handler)

type AttestorService

type AttestorService interface {
	CheckReady(ctx context.Context) error
	LatestHeight(ctx context.Context, attestor string) (uint64, error)
	StateAttestation(ctx context.Context, attestor string, height uint64) (attestor.Attestation, error)
	PacketAttestation(
		ctx context.Context,
		attestor string,
		req attestor.PacketAttestationRequest,
	) (attestor.Attestation, error)
	Info(alias string) (attestor.Info, bool)
}

AttestorService defines attestor business logic.

type Handler

type Handler interface {
	Register(opts ...connect.HandlerOption) (prefix string, handler http.Handler)
	Name() string
	CheckReady(ctx context.Context) error
}

Handler represents GRPC handler

type RelayerHandler

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

RelayerHandler handles relayer RPC requests.

func NewRelayerHandler

func NewRelayerHandler(srv RelayerService) *RelayerHandler

func (*RelayerHandler) CheckReady

func (h *RelayerHandler) CheckReady(ctx context.Context) error

func (*RelayerHandler) Name

func (h *RelayerHandler) Name() string

func (*RelayerHandler) Packets

func (*RelayerHandler) Register

func (h *RelayerHandler) Register(opts ...connect.HandlerOption) (string, http.Handler)

func (*RelayerHandler) Relay

type RelayerService

type RelayerService interface {
	CheckReady(ctx context.Context) error
	Relay(ctx context.Context, request relayer.RelayRequest) ([]relayer.ObservedPacket, error)
	Packets(
		ctx context.Context,
		filter relayer.PacketFilter,
		query relayer.PacketQuery,
	) (relayer.PacketPage, error)
}

RelayerService defines relayer business logic.

type Server

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

Server wraps the HTTP server and registered RPC handlers.

func New

func New(addr string, useReflection, enableObservability bool) *Server

New Server constructor.

func (*Server) Register

func (s *Server) Register(h Handler)

Register adds a service and its readiness check before Start is called.

func (*Server) Start

func (s *Server) Start() (net.Addr, error)

Start starts the server. Not safe to call twice.

func (*Server) Stop

func (s *Server) Stop() error

Jump to

Keyboard shortcuts

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