Documentation ¶
Index ¶
- Variables
- func Handler(api CaptiveCoreAPI) http.Handler
- type CaptiveCoreAPI
- func (c *CaptiveCoreAPI) GetLatestLedgerSequence(ctx context.Context) (ledgerbackend.LatestLedgerSequenceResponse, error)
- func (c *CaptiveCoreAPI) GetLedger(ctx context.Context, sequence uint32) (ledgerbackend.LedgerResponse, error)
- func (c *CaptiveCoreAPI) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) (ledgerbackend.PrepareRangeResponse, error)
- func (c *CaptiveCoreAPI) Shutdown()
- type GetLedgerRequest
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(ctx context.Context) (ledgerbackend.LatestLedgerSequenceResponse, error)
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 ¶
func (c *CaptiveCoreAPI) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) (ledgerbackend.PrepareRangeResponse, error)
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"`
}
Click to show internal directories.
Click to hide internal directories.