Documentation
¶
Index ¶
- Constants
- Variables
- func NewHandler(egressBatches retrievaljournal.Journal) echo.HandlerFunc
- func ProvideConsolidationStore(lc fx.Lifecycle, cfg app.AppConfig) (consolidationstore.Store, error)
- func ProvideReceiptsClient(lc fx.Lifecycle, cfg app.AppConfig) *receipts.Client
- type EgressTrackerQueue
- type QueueParams
- type Server
- type Service
Constants ¶
View Source
const ReceiptsPath = "/receipts"
Variables ¶
View Source
var Module = fx.Module("egresstracker", fx.Provide( ProvideEgressTrackerQueue, ProvideReceiptsClient, NewEgressTrackerService, fx.Annotate( NewServer, fx.As(new(echofx.RouteRegistrar)), fx.ResultTags(`group:"route_registrar"`), ), ), )
Functions ¶
func NewHandler ¶
func NewHandler(egressBatches retrievaljournal.Journal) echo.HandlerFunc
Types ¶
type EgressTrackerQueue ¶
type EgressTrackerQueue interface {
Register(fn func(ctx context.Context, batchCID cid.Cid) error) error
Enqueue(ctx context.Context, batchCID cid.Cid) error
}
func NewEgressTrackerQueue ¶
func NewEgressTrackerQueue(queue *jobqueue.JobQueue[cid.Cid]) EgressTrackerQueue
func ProvideEgressTrackerQueue ¶
func ProvideEgressTrackerQueue(lc fx.Lifecycle, params QueueParams) (EgressTrackerQueue, error)
type QueueParams ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterRoutes ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service stores receipts from `space/content/retrieve` invocations, batches them and sends them to an egress tracking service via `space/egress/track` invocations.
func New ¶
func New( id principal.Signer, egressTrackerConn client.Connection, egressTrackerProofs delegation.Proofs, batchEndpoint *url.URL, journal retrievaljournal.Journal, consolidationStore consolidationstore.Store, queue EgressTrackerQueue, rcptsClient *receipts.Client, cleanupCheckInterval time.Duration, ) (*Service, error)
func NewEgressTrackerService ¶
func NewEgressTrackerService( lc fx.Lifecycle, id principal.Signer, journal retrievaljournal.Journal, consolidationStore consolidationstore.Store, queue EgressTrackerQueue, rcptsClient *receipts.Client, cfg app.AppConfig, ) (*Service, error)
func (*Service) AddReceipt ¶
func (s *Service) AddReceipt(ctx context.Context, rcpt receipt.Receipt[content.RetrieveOk, failure.FailureModel]) error
Click to show internal directories.
Click to hide internal directories.