api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket added in v1.0.1

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"`
	SaveRequests bool       `json:"saveRequests,omitempty"`
	Description  string     `json:"description,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"`
	SaveRequests bool       `json:"saveRequests,omitempty"`
	Description  string     `json:"description,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 v1.0.1

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

type UpdateInput added in v1.0.0

type UpdateInput struct {
	ValidTo     *time.Time `json:"validTo,omitempty"`
	Disabled    *bool      `json:"disabled,omitempty"`
	Description *string    `json:"description,omitempty"`
	IPWhiteList *string    `json:"IPWhiteList,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