metadata

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

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, log *zap.Logger, store *sql.DB) 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 *sql.DB) *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

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_api.UnimplementedMetadataApiServer
	// contains filtered or unexported fields
}

func NewMetadataApiService

func NewMetadataApiService(
	ctx context.Context,
	log *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