api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabaseChecksumV2Request

func NewDatabaseChecksumV2Request(server string, params *DatabaseChecksumV2Params) (*http.Request, error)

NewDatabaseChecksumV2Request constructs an http.Request for the DatabaseChecksumV2 method

func NewDatabaseMetadataV2Request

func NewDatabaseMetadataV2Request(server string, params *DatabaseMetadataV2Params) (*http.Request, error)

NewDatabaseMetadataV2Request constructs an http.Request for the DatabaseMetadataV2 method

func NewDownloadDatabaseV2Request

func NewDownloadDatabaseV2Request(server string, params *DownloadDatabaseV2Params) (*http.Request, error)

NewDownloadDatabaseV2Request constructs an http.Request for the DownloadDatabaseV2 method

func NewListDatabasesRequest

func NewListDatabasesRequest(server string) (*http.Request, error)

NewListDatabasesRequest constructs an http.Request for the ListDatabases method

func NewListDownloadsRequest

func NewListDownloadsRequest(server string, params *ListDownloadsParams) (*http.Request, error)

NewListDownloadsRequest constructs an http.Request for the ListDownloads method

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) DatabaseChecksumV2

func (c *Client) DatabaseChecksumV2(ctx context.Context, params *DatabaseChecksumV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

DatabaseChecksumV2 Checksums for one published file, to verify a download

Corresponds with GET /api/v2/database/checksum (the `DatabaseChecksumV2` operationId).

func (*Client) DatabaseMetadataV2

func (c *Client) DatabaseMetadataV2(ctx context.Context, params *DatabaseMetadataV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

DatabaseMetadataV2 What is inside one database - schema, sample rows, row count, sizes

Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything.

No `format` parameter - one document describes every format the database is built in.

Corresponds with GET /api/v2/database/metadata (the `DatabaseMetadataV2` operationId).

func (*Client) DownloadDatabaseV2

func (c *Client) DownloadDatabaseV2(ctx context.Context, params *DownloadDatabaseV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

DownloadDatabaseV2 Redirect to a time-limited download URL for one database

Answers `302`; the bytes come straight from object storage rather than through this API. Follow the redirect.

Corresponds with GET /api/v2/database/download (the `DownloadDatabaseV2` operationId).

func (*Client) ListDatabases

func (c *Client) ListDatabases(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListDatabases Every database your organization may see, and where each one stands

The whole published catalog, with your organization's licence beside each entry, so `standing` says whether a database is yours today (`licensed`), was (`expired`), or has never been bought (`unlicensed`).

Databases commissioned for a single customer are not listed to anyone else.

Corresponds with GET /api/v2/database/list (the `ListDatabases` operationId).

func (*Client) ListDownloads

func (c *Client) ListDownloads(ctx context.Context, params *ListDownloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListDownloads Your organization's recent download attempts, newest first

Refusals are listed too: a denial is what answers "it stopped working", and its absence answers nothing.

Corresponds with GET /api/v2/database/downloads (the `ListDownloads` operationId).

type ClientInterface

type ClientInterface interface {

	// DatabaseChecksumV2 Checksums for one published file, to verify a download
	//
	// Corresponds with GET /api/v2/database/checksum (the `DatabaseChecksumV2` operationId).
	DatabaseChecksumV2(ctx context.Context, params *DatabaseChecksumV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DownloadDatabaseV2 Redirect to a time-limited download URL for one database
	//
	// Answers `302`; the bytes come straight from object storage rather than
	// through this API. Follow the redirect.
	//
	// Corresponds with GET /api/v2/database/download (the `DownloadDatabaseV2` operationId).
	DownloadDatabaseV2(ctx context.Context, params *DownloadDatabaseV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListDownloads Your organization's recent download attempts, newest first
	//
	// Refusals are listed too: a denial is what answers "it stopped working",
	// and its absence answers nothing.
	//
	// Corresponds with GET /api/v2/database/downloads (the `ListDownloads` operationId).
	ListDownloads(ctx context.Context, params *ListDownloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListDatabases Every database your organization may see, and where each one stands
	//
	// The whole published catalog, with your organization's licence beside
	// each entry, so `standing` says whether a database is yours today
	// (`licensed`), was (`expired`), or has never been bought (`unlicensed`).
	//
	// Databases commissioned for a single customer are not listed to anyone
	// else.
	//
	// Corresponds with GET /api/v2/database/list (the `ListDatabases` operationId).
	ListDatabases(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DatabaseMetadataV2 What is inside one database - schema, sample rows, row count, sizes
	//
	// Poll this to decide whether today's build is worth fetching: it carries
	// `updated` and `entries` without downloading anything.
	//
	// No `format` parameter - one document describes every format the database
	// is built in.
	//
	// Corresponds with GET /api/v2/database/metadata (the `DatabaseMetadataV2` operationId).
	DatabaseMetadataV2(ctx context.Context, params *DatabaseMetadataV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) DatabaseChecksumV2WithResponse

func (c *ClientWithResponses) DatabaseChecksumV2WithResponse(ctx context.Context, params *DatabaseChecksumV2Params, reqEditors ...RequestEditorFn) (*DatabaseChecksumV2Response, error)

DatabaseChecksumV2WithResponse Checksums for one published file, to verify a download

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/database/checksum (the `DatabaseChecksumV2` operationId).

func (*ClientWithResponses) DatabaseMetadataV2WithResponse

func (c *ClientWithResponses) DatabaseMetadataV2WithResponse(ctx context.Context, params *DatabaseMetadataV2Params, reqEditors ...RequestEditorFn) (*DatabaseMetadataV2Response, error)

DatabaseMetadataV2WithResponse What is inside one database - schema, sample rows, row count, sizes

Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything.

No `format` parameter - one document describes every format the database is built in.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/database/metadata (the `DatabaseMetadataV2` operationId).

func (*ClientWithResponses) DownloadDatabaseV2WithResponse

func (c *ClientWithResponses) DownloadDatabaseV2WithResponse(ctx context.Context, params *DownloadDatabaseV2Params, reqEditors ...RequestEditorFn) (*DownloadDatabaseV2Response, error)

DownloadDatabaseV2WithResponse Redirect to a time-limited download URL for one database

Answers `302`; the bytes come straight from object storage rather than through this API. Follow the redirect.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/database/download (the `DownloadDatabaseV2` operationId).

func (*ClientWithResponses) ListDatabasesWithResponse

func (c *ClientWithResponses) ListDatabasesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabasesResponse, error)

ListDatabasesWithResponse Every database your organization may see, and where each one stands

The whole published catalog, with your organization's licence beside each entry, so `standing` says whether a database is yours today (`licensed`), was (`expired`), or has never been bought (`unlicensed`).

Databases commissioned for a single customer are not listed to anyone else.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/database/list (the `ListDatabases` operationId).

func (*ClientWithResponses) ListDownloadsWithResponse

func (c *ClientWithResponses) ListDownloadsWithResponse(ctx context.Context, params *ListDownloadsParams, reqEditors ...RequestEditorFn) (*ListDownloadsResponse, error)

ListDownloadsWithResponse Your organization's recent download attempts, newest first

Refusals are listed too: a denial is what answers "it stopped working", and its absence answers nothing.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/database/downloads (the `ListDownloads` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// DatabaseChecksumV2WithResponse Checksums for one published file, to verify a download
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/database/checksum (the `DatabaseChecksumV2` operationId).
	DatabaseChecksumV2WithResponse(ctx context.Context, params *DatabaseChecksumV2Params, reqEditors ...RequestEditorFn) (*DatabaseChecksumV2Response, error)

	// DownloadDatabaseV2WithResponse Redirect to a time-limited download URL for one database
	//
	// Answers `302`; the bytes come straight from object storage rather than
	// through this API. Follow the redirect.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/database/download (the `DownloadDatabaseV2` operationId).
	DownloadDatabaseV2WithResponse(ctx context.Context, params *DownloadDatabaseV2Params, reqEditors ...RequestEditorFn) (*DownloadDatabaseV2Response, error)

	// ListDownloadsWithResponse Your organization's recent download attempts, newest first
	//
	// Refusals are listed too: a denial is what answers "it stopped working",
	// and its absence answers nothing.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/database/downloads (the `ListDownloads` operationId).
	ListDownloadsWithResponse(ctx context.Context, params *ListDownloadsParams, reqEditors ...RequestEditorFn) (*ListDownloadsResponse, error)

	// ListDatabasesWithResponse Every database your organization may see, and where each one stands
	//
	// The whole published catalog, with your organization's licence beside
	// each entry, so `standing` says whether a database is yours today
	// (`licensed`), was (`expired`), or has never been bought (`unlicensed`).
	//
	// Databases commissioned for a single customer are not listed to anyone
	// else.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/database/list (the `ListDatabases` operationId).
	ListDatabasesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabasesResponse, error)

	// DatabaseMetadataV2WithResponse What is inside one database - schema, sample rows, row count, sizes
	//
	// Poll this to decide whether today's build is worth fetching: it carries
	// `updated` and `entries` without downloading anything.
	//
	// No `format` parameter - one document describes every format the database
	// is built in.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/database/metadata (the `DatabaseMetadataV2` operationId).
	DatabaseMetadataV2WithResponse(ctx context.Context, params *DatabaseMetadataV2Params, reqEditors ...RequestEditorFn) (*DatabaseMetadataV2Response, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type DBChecksums

type DBChecksums struct {
	// Md5 Hex-encoded MD5 digest.
	Md5 string `json:"md5"`

	// Sha1 Hex-encoded SHA-1 digest.
	Sha1 string `json:"sha1"`

	// Sha256 Hex-encoded SHA-256 digest.
	Sha256 string `json:"sha256"`

	// Sha512 Hex-encoded SHA-512 digest.
	Sha512 string `json:"sha512"`
}

DBChecksums defines model for DbChecksums.

type DBFormat

type DBFormat string

DBFormat Example: mmdb

const (
	DBFormatCsvgz DBFormat = "csvgz"
	DBFormatMmdb  DBFormat = "mmdb"
)

Defines values for DBFormat.

func (DBFormat) Valid

func (e DBFormat) Valid() bool

Valid indicates whether the value is a known member of the DBFormat enum.

type DBID

type DBID = string

DBID Example: vpn_ip_v1

type Database

type Database struct {
	// Base The family, e.g. `vpn_ip`. What a licence is held against.
	//
	// Example: vpn_ip
	Base string `json:"base"`

	// Expires Null when the licence has no end date, or when there is none.
	Expires *time.Time `json:"expires"`

	// Name Example: VPN IP
	Name string `json:"name"`

	// Redistribution What your licence permits you to do with the data. Null when there
	// is no licence.
	Redistribution *DatabaseRedistribution `json:"redistribution"`

	// Standing `licensed` is a live grant, `expired` one whose term has ended, and
	// `unlicensed` a database published but never bought.
	Standing DatabaseStanding `json:"standing"`
	Starts   *time.Time       `json:"starts"`

	// Summary One line on what the newest version contains.
	Summary string `json:"summary"`

	// Versions Every published version of this family, oldest first. Old versions
	// are frozen rather than migrated, so both stay downloadable.
	Versions []DatabaseVersion `json:"versions"`
}

Database One database FAMILY, with your organization's licence beside it. A licence covers the family, while a download names a specific version, so the ids passed to `download` and `checksum` come from `versions`.

type DatabaseChecksumV2Params

type DatabaseChecksumV2Params struct {
	// ID Database identifier (e.g. `vpn_ip_v1`, `resproxy_provider_v1`).
	ID DBID `form:"id" json:"id"`

	// Format Database file format.
	Format DatabaseChecksumV2ParamsFormat `form:"format" json:"format"`
}

DatabaseChecksumV2Params defines parameters for DatabaseChecksumV2.

type DatabaseChecksumV2ParamsFormat

type DatabaseChecksumV2ParamsFormat string

DatabaseChecksumV2ParamsFormat defines parameters for DatabaseChecksumV2.

const (
	DatabaseChecksumV2ParamsFormatCsvgz DatabaseChecksumV2ParamsFormat = "csvgz"
	DatabaseChecksumV2ParamsFormatMmdb  DatabaseChecksumV2ParamsFormat = "mmdb"
)

Defines values for DatabaseChecksumV2ParamsFormat.

func (DatabaseChecksumV2ParamsFormat) Valid

Valid indicates whether the value is a known member of the DatabaseChecksumV2ParamsFormat enum.

type DatabaseChecksumV2Response

type DatabaseChecksumV2Response struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Checksums DBChecksums                                 `json:"checksums"`
		Format    DatabaseChecksumV2200JSONResponseBodyFormat `json:"format"`
		ID        string                                      `json:"id"`
	}
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *V2Unauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *V2NotLicensed
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *V2UnknownDatabase
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *V2NotAvailable
}

func ParseDatabaseChecksumV2Response

func ParseDatabaseChecksumV2Response(rsp *http.Response) (*DatabaseChecksumV2Response, error)

ParseDatabaseChecksumV2Response parses an HTTP response from a DatabaseChecksumV2WithResponse call

func (DatabaseChecksumV2Response) ContentType

func (r DatabaseChecksumV2Response) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DatabaseChecksumV2Response) GetBody

func (r DatabaseChecksumV2Response) GetBody() []byte

GetBody returns the raw response body bytes

func (DatabaseChecksumV2Response) GetJSON200

func (r DatabaseChecksumV2Response) GetJSON200() *struct {
	Checksums DBChecksums                                 `json:"checksums"`
	Format    DatabaseChecksumV2200JSONResponseBodyFormat `json:"format"`
	ID        string                                      `json:"id"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DatabaseChecksumV2Response) GetJSON400

func (r DatabaseChecksumV2Response) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DatabaseChecksumV2Response) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DatabaseChecksumV2Response) GetJSON403

func (r DatabaseChecksumV2Response) GetJSON403() *V2NotLicensed

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (DatabaseChecksumV2Response) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DatabaseChecksumV2Response) GetJSON503

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (DatabaseChecksumV2Response) Status

Status returns HTTPResponse.Status

func (DatabaseChecksumV2Response) StatusCode

func (r DatabaseChecksumV2Response) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DatabaseChecksumV2200JSONResponseBodyFormat

type DatabaseChecksumV2200JSONResponseBodyFormat string

DatabaseChecksumV2200JSONResponseBodyFormat defines parameters for DatabaseChecksumV2.

const (
	DatabaseChecksumV2200JSONResponseBodyFormatCsvgz DatabaseChecksumV2200JSONResponseBodyFormat = "csvgz"
	DatabaseChecksumV2200JSONResponseBodyFormatMmdb  DatabaseChecksumV2200JSONResponseBodyFormat = "mmdb"
)

Defines values for DatabaseChecksumV2200JSONResponseBodyFormat.

func (DatabaseChecksumV2200JSONResponseBodyFormat) Valid

Valid indicates whether the value is a known member of the DatabaseChecksumV2200JSONResponseBodyFormat enum.

type DatabaseMetadata

type DatabaseMetadata struct {
	// Entries Row count in the current build.
	Entries int64  `json:"entries"`
	ID      string `json:"id"`

	// Sample A few real rows, keyed by format.
	Sample *map[string][]map[string]interface{} `json:"sample,omitempty"`

	// Schema Columns, keyed by format.
	Schema map[string][]DatabaseMetadataColumn `json:"schema"`

	// Size Bytes per format.
	Size map[string]int64 `json:"size"`

	// UpdateFreq How often a new build is published.
	UpdateFreq *string `json:"update_freq,omitempty"`

	// Updated ISO-8601 date (YYYY-MM-DD) the published build was generated on.
	//
	// Example: 2026-09-04
	Updated openapi_types.Date `json:"updated"`
}

DatabaseMetadata The build document written by the exporter, served through unchanged.

type DatabaseMetadataColumn

type DatabaseMetadataColumn struct {
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`
	Type        string  `json:"type"`
}

DatabaseMetadataColumn defines model for DatabaseMetadataColumn.

type DatabaseMetadataV2Params

type DatabaseMetadataV2Params struct {
	// ID Database identifier (e.g. `vpn_ip_v1`, `resproxy_provider_v1`).
	ID DBID `form:"id" json:"id"`
}

DatabaseMetadataV2Params defines parameters for DatabaseMetadataV2.

type DatabaseMetadataV2Response

type DatabaseMetadataV2Response struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *DatabaseMetadata
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *V2Unauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *V2NotLicensed
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *V2UnknownDatabase
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *V2NotAvailable
}

func ParseDatabaseMetadataV2Response

func ParseDatabaseMetadataV2Response(rsp *http.Response) (*DatabaseMetadataV2Response, error)

ParseDatabaseMetadataV2Response parses an HTTP response from a DatabaseMetadataV2WithResponse call

func (DatabaseMetadataV2Response) ContentType

func (r DatabaseMetadataV2Response) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DatabaseMetadataV2Response) GetBody

func (r DatabaseMetadataV2Response) GetBody() []byte

GetBody returns the raw response body bytes

func (DatabaseMetadataV2Response) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DatabaseMetadataV2Response) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DatabaseMetadataV2Response) GetJSON403

func (r DatabaseMetadataV2Response) GetJSON403() *V2NotLicensed

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (DatabaseMetadataV2Response) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DatabaseMetadataV2Response) GetJSON503

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (DatabaseMetadataV2Response) Status

Status returns HTTPResponse.Status

func (DatabaseMetadataV2Response) StatusCode

func (r DatabaseMetadataV2Response) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DatabaseRedistribution

type DatabaseRedistribution string

DatabaseRedistribution What your licence permits you to do with the data. Null when there is no licence.

const (
	Evaluation   DatabaseRedistribution = "evaluation"
	Internal     DatabaseRedistribution = "internal"
	LessThanNil  DatabaseRedistribution = "<nil>"
	Redistribute DatabaseRedistribution = "redistribute"
)

Defines values for DatabaseRedistribution.

func (DatabaseRedistribution) Valid

func (e DatabaseRedistribution) Valid() bool

Valid indicates whether the value is a known member of the DatabaseRedistribution enum.

type DatabaseStanding

type DatabaseStanding string

DatabaseStanding `licensed` is a live grant, `expired` one whose term has ended, and `unlicensed` a database published but never bought.

const (
	DatabaseStandingExpired    DatabaseStanding = "expired"
	DatabaseStandingLicensed   DatabaseStanding = "licensed"
	DatabaseStandingUnlicensed DatabaseStanding = "unlicensed"
)

Defines values for DatabaseStanding.

func (DatabaseStanding) Valid

func (e DatabaseStanding) Valid() bool

Valid indicates whether the value is a known member of the DatabaseStanding enum.

type DatabaseVersion

type DatabaseVersion struct {
	// Formats The formats this version is BUILT in. Asking for another is a 400,
	// not a gap - the `_provider` catalogs are keyed by provider id, so no
	// MMDB exists for them.
	Formats []DatabaseVersionFormats `json:"formats"`

	// ID The versioned id. Pass this to `download`, `checksum` and `metadata`.
	//
	// Example: vpn_ip_v1
	ID      string `json:"id"`
	Summary string `json:"summary"`

	// Version Example: 1
	Version int `json:"version"`
}

DatabaseVersion defines model for DatabaseVersion.

type DatabaseVersionFormats

type DatabaseVersionFormats string

DatabaseVersionFormats defines model for DatabaseVersion.Formats.

const (
	DatabaseVersionFormatsCsvgz DatabaseVersionFormats = "csvgz"
	DatabaseVersionFormatsMmdb  DatabaseVersionFormats = "mmdb"
)

Defines values for DatabaseVersionFormats.

func (DatabaseVersionFormats) Valid

func (e DatabaseVersionFormats) Valid() bool

Valid indicates whether the value is a known member of the DatabaseVersionFormats enum.

type Download

type Download struct {
	// ApikeyID The key that made the request. Null when it could not be resolved.
	ApikeyID *string `json:"apikey_id"`

	// Bytes Object size at redirect time, NOT bytes delivered: the transfer is a
	// presigned redirect straight to object storage, so we never observe
	// how much of it was taken.
	Bytes      *int64          `json:"bytes"`
	ClientIP   *string         `json:"client_ip"`
	Created    time.Time       `json:"created"`
	DatasetID  string          `json:"dataset_id"`
	Format     string          `json:"format"`
	HTTPStatus *int            `json:"http_status"`
	Outcome    DownloadOutcome `json:"outcome"`
	UserAgent  *string         `json:"user_agent"`
}

Download One download ATTEMPT, refusals included.

type DownloadDatabaseV2Params

type DownloadDatabaseV2Params struct {
	// ID Database identifier (e.g. `vpn_ip_v1`, `resproxy_provider_v1`).
	ID DBID `form:"id" json:"id"`

	// Format Database file format.
	Format DownloadDatabaseV2ParamsFormat `form:"format" json:"format"`
}

DownloadDatabaseV2Params defines parameters for DownloadDatabaseV2.

type DownloadDatabaseV2ParamsFormat

type DownloadDatabaseV2ParamsFormat string

DownloadDatabaseV2ParamsFormat defines parameters for DownloadDatabaseV2.

const (
	DownloadDatabaseV2ParamsFormatCsvgz DownloadDatabaseV2ParamsFormat = "csvgz"
	DownloadDatabaseV2ParamsFormatMmdb  DownloadDatabaseV2ParamsFormat = "mmdb"
)

Defines values for DownloadDatabaseV2ParamsFormat.

func (DownloadDatabaseV2ParamsFormat) Valid

Valid indicates whether the value is a known member of the DownloadDatabaseV2ParamsFormat enum.

type DownloadDatabaseV2Response

type DownloadDatabaseV2Response struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *V2Unauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *V2NotLicensed
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *V2UnknownDatabase
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *V2NotAvailable
	// Headers302 the parsed response headers for an HTTP 302 response
	Headers302 *DownloadDatabaseV2Response302Headers
}

func ParseDownloadDatabaseV2Response

func ParseDownloadDatabaseV2Response(rsp *http.Response) (*DownloadDatabaseV2Response, error)

ParseDownloadDatabaseV2Response parses an HTTP response from a DownloadDatabaseV2WithResponse call

func (DownloadDatabaseV2Response) ContentType

func (r DownloadDatabaseV2Response) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DownloadDatabaseV2Response) GetBody

func (r DownloadDatabaseV2Response) GetBody() []byte

GetBody returns the raw response body bytes

func (DownloadDatabaseV2Response) GetJSON400

func (r DownloadDatabaseV2Response) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DownloadDatabaseV2Response) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DownloadDatabaseV2Response) GetJSON403

func (r DownloadDatabaseV2Response) GetJSON403() *V2NotLicensed

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (DownloadDatabaseV2Response) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DownloadDatabaseV2Response) GetJSON503

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (DownloadDatabaseV2Response) Status

Status returns HTTPResponse.Status

func (DownloadDatabaseV2Response) StatusCode

func (r DownloadDatabaseV2Response) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DownloadDatabaseV2Response302Headers

type DownloadDatabaseV2Response302Headers struct {
	Location *string
}

DownloadDatabaseV2Response302Headers the declared response headers of an HTTP 302 response for DownloadDatabaseV2

type DownloadOutcome

type DownloadOutcome string

DownloadOutcome defines model for Download.Outcome.

const (
	DownloadOutcomeDenied       DownloadOutcome = "denied"
	DownloadOutcomeExpired      DownloadOutcome = "expired"
	DownloadOutcomeOk           DownloadOutcome = "ok"
	DownloadOutcomeUnauthorized DownloadOutcome = "unauthorized"
	DownloadOutcomeUnavailable  DownloadOutcome = "unavailable"
	DownloadOutcomeUnknown      DownloadOutcome = "unknown"
)

Defines values for DownloadOutcome.

func (DownloadOutcome) Valid

func (e DownloadOutcome) Valid() bool

Valid indicates whether the value is a known member of the DownloadOutcome enum.

type Error

type Error struct {
	// Rc A machine-readable result code. Deliberately not an enum: a code
	// added later must stay parseable by a client generated today.
	Rc string `json:"rc"`
}

Error defines model for Error.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListDatabasesResponse

type ListDatabasesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Databases []Database `json:"databases"`
	}
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *V2Unauthorized
}

func ParseListDatabasesResponse

func ParseListDatabasesResponse(rsp *http.Response) (*ListDatabasesResponse, error)

ParseListDatabasesResponse parses an HTTP response from a ListDatabasesWithResponse call

func (ListDatabasesResponse) ContentType

func (r ListDatabasesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListDatabasesResponse) GetBody

func (r ListDatabasesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListDatabasesResponse) GetJSON200

func (r ListDatabasesResponse) GetJSON200() *struct {
	Databases []Database `json:"databases"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListDatabasesResponse) GetJSON401

func (r ListDatabasesResponse) GetJSON401() *V2Unauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListDatabasesResponse) Status

func (r ListDatabasesResponse) Status() string

Status returns HTTPResponse.Status

func (ListDatabasesResponse) StatusCode

func (r ListDatabasesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListDownloadsParams

type ListDownloadsParams struct {
	// Limit How many attempts to return. Clamped to 200.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}

ListDownloadsParams defines parameters for ListDownloads.

type ListDownloadsResponse

type ListDownloadsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Downloads []Download `json:"downloads"`
	}
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *V2Unauthorized
}

func ParseListDownloadsResponse

func ParseListDownloadsResponse(rsp *http.Response) (*ListDownloadsResponse, error)

ParseListDownloadsResponse parses an HTTP response from a ListDownloadsWithResponse call

func (ListDownloadsResponse) ContentType

func (r ListDownloadsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListDownloadsResponse) GetBody

func (r ListDownloadsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListDownloadsResponse) GetJSON200

func (r ListDownloadsResponse) GetJSON200() *struct {
	Downloads []Download `json:"downloads"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListDownloadsResponse) GetJSON401

func (r ListDownloadsResponse) GetJSON401() *V2Unauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ListDownloadsResponse) Status

func (r ListDownloadsResponse) Status() string

Status returns HTTPResponse.Status

func (ListDownloadsResponse) StatusCode

func (r ListDownloadsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type V2NotAvailable

type V2NotAvailable = Error

V2NotAvailable defines model for V2NotAvailable.

type V2NotLicensed

type V2NotLicensed = Error

V2NotLicensed defines model for V2NotLicensed.

type V2Unauthorized

type V2Unauthorized = Error

V2Unauthorized defines model for V2Unauthorized.

type V2UnknownDatabase

type V2UnknownDatabase = Error

V2UnknownDatabase defines model for V2UnknownDatabase.

Jump to

Keyboard shortcuts

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