hooks

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockResult

type BlockResult struct {
	Err        error
	Extensions []graphsync.ExtensionData
}

BlockResult is the result of processing block hooks

type ErrPaused

type ErrPaused struct{}

ErrPaused indicates a request should stop processing, but only cause it's paused

func (ErrPaused) Error

func (e ErrPaused) Error() string

type IncomingRequestHooks

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

IncomingRequestHooks is a set of incoming request hooks that can be processed

func NewRequestHooks

func NewRequestHooks(persistenceOptions PersistenceOptions) *IncomingRequestHooks

NewRequestHooks returns a new list of incoming request hooks

func (*IncomingRequestHooks) ProcessRequestHooks

func (irh *IncomingRequestHooks) ProcessRequestHooks(p peer.ID, request graphsync.RequestData, reqCtx context.Context) RequestResult

ProcessRequestHooks runs request hooks against an incoming request

func (*IncomingRequestHooks) Register

func (irh *IncomingRequestHooks) Register(hook graphsync.OnIncomingRequestHook) graphsync.UnregisterHookFunc

Register registers an extension to process new incoming requests

type OutgoingBlockHooks

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

OutgoingBlockHooks is a set of outgoing block hooks that can be processed

func NewBlockHooks

func NewBlockHooks() *OutgoingBlockHooks

NewBlockHooks returns a new list of outgoing block hooks

func (*OutgoingBlockHooks) ProcessBlockHooks

func (obh *OutgoingBlockHooks) ProcessBlockHooks(p peer.ID, request graphsync.RequestData, blockData graphsync.BlockData) BlockResult

ProcessBlockHooks runs block hooks against a request and block data

func (*OutgoingBlockHooks) Register

func (obh *OutgoingBlockHooks) Register(hook graphsync.OnOutgoingBlockHook) graphsync.UnregisterHookFunc

Register registers an hook to process outgoing blocks in a response

type PersistenceOptions

type PersistenceOptions interface {
	GetLinkSystem(name string) (ipld.LinkSystem, bool)
}

PersistenceOptions is an interface for getting loaders by name

type RequestResult

type RequestResult struct {
	IsValidated      bool
	IsPaused         bool
	CustomLinkSystem ipld.LinkSystem
	CustomChooser    traversal.LinkTargetNodePrototypeChooser
	Err              error
	Extensions       []graphsync.ExtensionData
	Ctx              context.Context
	MaxLinks         uint64
}

RequestResult is the outcome of running requesthooks

type RequestUpdatedHooks

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

RequestUpdatedHooks manages and runs hooks for request updates

func NewUpdateHooks

func NewUpdateHooks() *RequestUpdatedHooks

NewUpdateHooks returns a new list of request updated hooks

func (*RequestUpdatedHooks) ProcessUpdateHooks

func (ruh *RequestUpdatedHooks) ProcessUpdateHooks(p peer.ID, request graphsync.RequestData, update graphsync.RequestData) UpdateResult

ProcessUpdateHooks runs request hooks against an incoming request

func (*RequestUpdatedHooks) Register

func (ruh *RequestUpdatedHooks) Register(hook graphsync.OnRequestUpdatedHook) graphsync.UnregisterHookFunc

Register registers an hook to process updates to requests

type UpdateResult

type UpdateResult struct {
	Err        error
	Unpause    bool
	Extensions []graphsync.ExtensionData
}

UpdateResult is the result of running update hooks

Jump to

Keyboard shortcuts

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