internal

package
v0.0.0-...-6daa909 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: 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

func (c *CaptiveCoreAPI) GetLatestLedgerSequence() (ledgerbackend.LatestLedgerSequenceResponse, error)

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

func (*CaptiveCoreAPI) GetLedger

func (c *CaptiveCoreAPI) GetLedger(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