metadata

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package metadata implements the metadata API service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorUpdater

type CursorUpdater interface {
	GetCursor() *envelopes.Cursor
	AddSubscriber(clientID string, updateChan chan struct{})
	RemoveSubscriber(clientID string)
	Stop()
}

func NewCursorUpdater

func NewCursorUpdater(ctx context.Context, logger *zap.Logger, store *db.Handler) CursorUpdater

type DBBasedCursorUpdater

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

func (*DBBasedCursorUpdater) AddSubscriber

func (cu *DBBasedCursorUpdater) AddSubscriber(clientID string, updateChan chan struct{})

func (*DBBasedCursorUpdater) GetCursor

func (cu *DBBasedCursorUpdater) GetCursor() *envelopes.Cursor

func (*DBBasedCursorUpdater) RemoveSubscriber

func (cu *DBBasedCursorUpdater) RemoveSubscriber(clientID string)

func (*DBBasedCursorUpdater) Stop

func (cu *DBBasedCursorUpdater) Stop()

type IPayerInfoFetcher added in v0.5.0

type IPayerInfoFetcher interface {
	GetPayerByAddress(ctx context.Context, address string) (int32, error)
	GetPayerInfo(
		ctx context.Context,
		payerID int32,
		groupBy PayerInfoGroupBy,
	) (*metadata_api.GetPayerInfoResponse_PayerInfo, error)
}

type PayerInfoFetcher added in v0.5.0

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

func NewPayerInfoFetcher added in v0.5.0

func NewPayerInfoFetcher(db *db.Handler) *PayerInfoFetcher

func (*PayerInfoFetcher) GetPayerByAddress added in v0.5.0

func (f *PayerInfoFetcher) GetPayerByAddress(ctx context.Context, address string) (int32, error)

GetPayerByAddress looks up a payer ID by address

func (*PayerInfoFetcher) GetPayerInfo added in v0.5.0

GetPayerInfo gets the total spend and message count for a payer between the two timestamps, grouped by the appropriate granularity.

type PayerInfoGroupBy added in v0.5.0

type PayerInfoGroupBy string
const (
	PayerInfoGroupByHour PayerInfoGroupBy = "hour"
	PayerInfoGroupByDay  PayerInfoGroupBy = "day"
)

type Service

type Service struct {
	metadata_apiconnect.UnimplementedMetadataApiHandler
	// contains filtered or unexported fields
}

func NewMetadataAPIService added in v0.5.1

func NewMetadataAPIService(
	ctx context.Context,
	logger *zap.Logger,
	updater CursorUpdater,
	version *semver.Version,
	payerInfoFetcher IPayerInfoFetcher,
) (*Service, error)

func (*Service) GetPayerInfo added in v0.5.0

func (*Service) GetVersion added in v0.5.0

Jump to

Keyboard shortcuts

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