Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APICounter = APICallCounter{} DefaultCountValidSpan = 30 * time.Second DefaultCountSpanDays = 30 )
View Source
var LogOptionPattern = DefaultLogPattern()
Functions ¶
func CleanupUpdateDBTask ¶
func CleanupUpdateDBTask(kill, finish chan bool)
Types ¶
type APICallCounter ¶
func (*APICallCounter) GetCount ¶
func (ac *APICallCounter) GetCount(ctx context.Context, apikey string, path model.URITemplate) (int, error)
type BillingStatus ¶
type BillingStatus int
const ( NotBilling BillingStatus = iota Billing )
func (BillingStatus) String ¶
func (bs BillingStatus) String() string
type CSVAppender ¶
func NewCSVAppender ¶
func NewCSVAppender(writer *csv.Writer) CSVAppender
func (*CSVAppender) Do ¶
func (a *CSVAppender) Do(key, path string, r *http.Request, apiResp *http.Response, calcBillingStatus func(resp *http.Response) BillingStatus) error
func (*CSVAppender) UpdateDB ¶
func (a *CSVAppender) UpdateDB(ctx context.Context)
type DefaultAppender ¶
func (*DefaultAppender) Do ¶
func (a *DefaultAppender) Do(key, path string, r *http.Request, apiResp *http.Response, calcBillingStatus func(resp *http.Response) BillingStatus) error
func (*DefaultAppender) UpdateDB ¶
func (a *DefaultAppender) UpdateDB(ctx context.Context)
type LogItem ¶
type LogItem struct { TimeStamp string `dynamo:"timestamp"` Key string `dynamo:"api_key"` Path string `dynamo:"path"` StatusCode int `dynamo:"status_code"` BillingStatus BillingStatus `dynamo:"billing_status"` }
func NewLogItem ¶
type LogOption ¶
func DefaultLogPattern ¶
func DefaultLogPattern() []LogOption
func HeaderElement ¶
func WithBillingStatus ¶
func WithBillingStatus() LogOption
func WithResponseStatus ¶
func WithResponseStatus() LogOption
Click to show internal directories.
Click to hide internal directories.