api

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

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