server

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidBody = fmt.Errorf("%w: invalid body", status.HTTP[400])

ErrInvalidBody is returned when the request body cannot be decoded.

Functions

This section is empty.

Types

type DirectConfig

type DirectConfig struct {
	Enable      bool
	APIKey      string
	NoAPIKey    bool
	MaxBodySize int64
}

DirectConfig holds configuration for the /direct endpoint.

type External

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

External is the client-facing HTTP server exposing instruction, result, wallet, and TEE info endpoints.

func NewExternal

func NewExternal(
	port string,
	instructionService *instruction.Service,
	resultService ResultService,
	teeInfo *info.Service,
	wallet *wallets.Service,
	privateKey *ecdsa.PrivateKey,
	actionQueues *queue.ActionQueues,
	direct DirectConfig,
) *External

NewExternal creates and configures a new External server listening on port.

func (*External) Close

func (e *External) Close(ctx context.Context) error

Close gracefully closes the server.

func (*External) Serve

func (e *External) Serve() error

Serve starts the server.

type Internal

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

Internal is the system-facing HTTP server exposing action queue, result, and liveness endpoints.

func NewInternal

func NewInternal(port string,
	actionQueues *queue.ActionQueues,
	resultService ResultService,
	wallet *wallets.Service,
	liveness liveness,
) *Internal

NewInternal creates and configures a new Internal server listening on port.

func (*Internal) Close

func (i *Internal) Close(ctx context.Context) error

Close gracefully closes the server.

func (*Internal) Serve

func (i *Internal) Serve() error

Serve starts the server.

type ResultService

type ResultService interface {
	ProcessAndStore(context.Context, *types.ActionResponse) error
	Serve(context.Context, common.Hash, types.SubmissionTag) (*types.ActionResponse, error)
}

ResultService defines the interface for processing and serving action results.

Jump to

Keyboard shortcuts

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