api

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLogRestored = errors.New("already restored")

ErrLogRestored indicates conflict call for restoring usage by requestID

View Source
var ErrNoRecord = errors.New("no record found")

ErrNoRecord indicates no record found error

View Source
var ErrWrongField = errors.New("wrong field")

ErrWrongField indicates wrong passed field on update

Functions

This section is empty.

Types

type Key

type Key struct {
	Key         string     `json:"key,omitempty"`
	KeyID       string     `json:"keyID,omitempty"`
	Manual      bool       `json:"manual,omitempty"`
	ValidTo     *time.Time `json:"validTo,omitempty"`
	Limit       float64    `json:"limit,omitempty"`
	QuotaValue  float64    `json:"quotaValue,omitempty"`
	QuotaFailed float64    `json:"quotaFailed,omitempty"`
	Created     *time.Time `json:"created,omitempty"`
	Updated     *time.Time `json:"updated,omitempty"`
	LastUsed    *time.Time `json:"lastUsed,omitempty"`
	LastIP      string     `json:"lastIP,omitempty"`
	IPWhiteList string     `json:"IPWhiteList,omitempty"`
	Disabled    bool       `json:"disabled,omitempty"`
	Description string     `json:"description,omitempty"`
	Tags        []string   `json:"tags,omitempty"`
}

Key structure for key data

type KeyInfoResp

type KeyInfoResp struct {
	Key  *Key   `json:"key,omitempty"`
	Logs []*Log `json:"logs,omitempty"`
}

KeyInfoResp keep key and logs data

type Log

type Log struct {
	Key          string    `json:"key,omitempty"`
	URL          string    `json:"url,omitempty"`
	QuotaValue   float64   `json:"quotaValue,omitempty"`
	Date         time.Time `json:"date,omitempty"`
	IP           string    `json:"ip,omitempty"`
	Value        string    `json:"value,omitempty"`
	Fail         bool      `json:"fail,omitempty"`
	ResponseCode int       `json:"response,omitempty"`
	RequestID    string    `json:"requestID,omitempty"`
	ErrorMsg     string    `json:"errorMsg,omitempty"`
}

Log structure for log data

Jump to

Keyboard shortcuts

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