handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quotas

type Quotas struct {
	CustomerID string
	Tier       string // the currently held subscription tier for this customer
	// contains filtered or unexported fields
}

type UsageSvc

type UsageSvc struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(svc *service.Service, dbService dbproto.DbService) *UsageSvc

func (*UsageSvc) DeleteCustomer

func (p *UsageSvc) DeleteCustomer(ctx context.Context, request *pb.DeleteCustomerRequest, response *pb.DeleteCustomerResponse) error

func (*UsageSvc) ListAPIRanks

func (p *UsageSvc) ListAPIRanks(ctx context.Context, request *pb.ListAPIRanksRequest, response *pb.ListAPIRanksResponse) error

ListAPIRanks returns the ranking of the APIs based on data up to but not including today. We calculate the "popularity" (a score 0-10) based on how many requests an API has compared to the "top" performing API. Note: the top performing API is found after removing any APIs with zscore above 1.5 (i.e. outside of 1.5 standard deviations)

func (*UsageSvc) ListEvents

func (p *UsageSvc) ListEvents(ctx context.Context, request *pb.ListEventsRequest, response *pb.ListEventsResponse) error

func (*UsageSvc) RankingCron

func (p *UsageSvc) RankingCron()

func (*UsageSvc) Read

func (p *UsageSvc) Read(ctx context.Context, request *pb.ReadRequest, response *pb.ReadResponse) error

func (*UsageSvc) ReadMonthly

func (p *UsageSvc) ReadMonthly(ctx context.Context, request *pb.ReadMonthlyRequest, response *pb.ReadMonthlyResponse) error

func (*UsageSvc) ReadMonthlyTotal

func (p *UsageSvc) ReadMonthlyTotal(ctx context.Context, request *pb.ReadMonthlyTotalRequest, response *pb.ReadMonthlyTotalResponse) error

func (*UsageSvc) SaveEvent

func (p *UsageSvc) SaveEvent(ctx context.Context, request *pb.SaveEventRequest, response *pb.SaveEventResponse) error

func (*UsageSvc) Sweep

func (p *UsageSvc) Sweep(ctx context.Context, request *pb.SweepRequest, response *pb.SweepResponse) error

func (*UsageSvc) UsageCron

func (p *UsageSvc) UsageCron()

Jump to

Keyboard shortcuts

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