api

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 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

This section is empty.

Functions

This section is empty.

Types

type Bucket added in v0.12.6

type Bucket struct {
	At             time.Time `json:"at,omitempty"`
	RequestCount   int       `json:"requestCount,omitempty"`
	FailedQuota    float64   `json:"failedQuota,omitempty"`
	UsedQuota      float64   `json:"usedQuota,omitempty"`
	FailedRequests int       `json:"failedRequests,omitempty"`
}

type Changes

type Changes struct {
	From *time.Time `json:"from,omitempty"`
	Till *time.Time `json:"till,omitempty"`
	Data []*Key     `json:"data,omitempty"`
}

Changes response

type CreateInput

type CreateInput struct {
	ID          string     `json:"id,omitempty"`
	OperationID string     `json:"operationID,omitempty"`
	Service     string     `json:"service,omitempty"`
	Credits     float64    `json:"credits,omitempty"`
	ValidTo     *time.Time `json:"validTo,omitempty"`
	Description string     `json:"description,omitempty"`
	Disabled    bool       `json:"disabled,omitempty"`
	IPWhiteList string     `json:"IPWhiteList,omitempty"`
	Tags        []string   `json:"tags,omitempty"`
}

CreateInput for create key request

type CreditsInput

type CreditsInput struct {
	OperationID string  `json:"operationID,omitempty"`
	Credits     float64 `json:"credits,omitempty"`
	Msg         string  `json:"msg,omitempty"`
}

CreditsInput for add credits

type Key

type Key struct {
	ID          string     `json:"id,omitempty"`
	Key         string     `json:"key,omitempty"`
	Service     string     `json:"service,omitempty"`
	ValidTo     *time.Time `json:"validTo,omitempty"`
	Disabled    bool       `json:"disabled,omitempty"`
	IPWhiteList string     `json:"IPWhiteList,omitempty"`
	Description string     `json:"description,omitempty"`
	Manual      bool       `json:"manual,omitempty"`
	Tags        []string   `json:"tags,omitempty"`

	TotalCredits  float64 `json:"totalCredits,omitempty"`
	UsedCredits   float64 `json:"usedCredits,omitempty"`
	FailedCredits float64 `json:"failedCredits,omitempty"`

	Created  *time.Time `json:"created,omitempty"`
	Updated  *time.Time `json:"updated,omitempty"`
	LastUsed *time.Time `json:"lastUsed,omitempty"`
	LastIP   string     `json:"lastIP,omitempty"`
}

Key structure for key data

type KeyID

type KeyID struct {
	ID      string `json:"id,omitempty"`
	Service string `json:"service,omitempty"`
}

KeyID provides key ID by key, response structure

type Log

type Log struct {
	UsedCredits float64    `json:"usedCredits,omitempty"`
	Date        *time.Time `json:"date,omitempty"`
	IP          string     `json:"ip,omitempty"`
	Fail        bool       `json:"fail,omitempty"`
	Response    int        `json:"response,omitempty"`
}

Log detailed usage record

type StatParams added in v0.12.6

type StatParams struct {
	ID   string
	From *time.Time
	To   *time.Time
	Type usage.Enum
}

type UpdateInput added in v0.12.6

type UpdateInput struct {
	ValidTo     *time.Time `json:"validTo,omitempty"`
	Disabled    *bool      `json:"disabled,omitempty"`
	Description *string    `json:"description,omitempty"`
	IPWhiteList *string    `json:"IPWhiteList,omitempty"`
	Tags        []string   `json:"tags,omitempty"`
}

type Usage

type Usage struct {
	RequestCount  int     `json:"requestCount"`
	UsedCredits   float64 `json:"usedCredits,omitempty"`
	FailedCredits float64 `json:"failedCredits,omitempty"`
	Logs          []*Log  `json:"logs,omitempty"`
}

Usage response

Jump to

Keyboard shortcuts

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