internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingPrepareRange is returned when attempting an operation without satisfying
	// its PrepareRange dependency
	ErrMissingPrepareRange = errors.New("PrepareRange must be called before any other operations")
	// ErrMissingPrepareRange is returned when attempting an operation before PrepareRange has finished
	// running
	ErrPrepareRangeNotReady = errors.New("PrepareRange operation is not yet complete")
)

Functions

func Handler

func Handler(api CaptiveCoreAPI) http.Handler

Handler returns an HTTP handler which exposes captive core operations via HTTP endpoints.

Types

type CaptiveCoreAPI

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

CaptiveCoreAPI manages a shared captive core subprocess and exposes an API for executing commands remotely on the captive core instance.

func NewCaptiveCoreAPI

func NewCaptiveCoreAPI(core ledgerbackend.LedgerBackend, log *log.Entry) CaptiveCoreAPI

NewCaptiveCoreAPI constructs a new CaptiveCoreAPI instance.

func (*CaptiveCoreAPI) GetLatestLedgerSequence

GetLatestLedgerSequence determines the latest ledger sequence available on the captive core instance.

func (*CaptiveCoreAPI) GetLedger

func (c *CaptiveCoreAPI) GetLedger(ctx context.Context, sequence uint32) (ledgerbackend.LedgerResponse, error)

GetLedger fetches the ledger with the given sequence number from the captive core instance.

func (*CaptiveCoreAPI) PrepareRange

PrepareRange executes the PrepareRange operation on the captive core instance.

func (*CaptiveCoreAPI) Shutdown

func (c *CaptiveCoreAPI) Shutdown()

Shutdown disables the PrepareRange endpoint and closes the captive core process.

type GetLedgerRequest

type GetLedgerRequest struct {
	Sequence uint32 `path:"sequence"`
}

Jump to

Keyboard shortcuts

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