veille

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 18 Imported by: 0

README

Veille Go SDK

The official Go SDK for the Veille fraud prevention API.

Validate emails, domains, IPs, VAT numbers and IBANs in milliseconds to block fake sign-ups, bots and fraud.

The SDK exposes 11 typed methods, one per documented endpoint, plus a generic Request(). It has no dependencies outside the standard library.

Requirements

  • Go 1.22 or newer

Installation

go get github.com/veilleio/veille-go

Get your API key

Sign up for Veille or sign in, then copy your API key from the dashboard. NewClient("", nil) reads the VEILLE_API_KEY environment variable.

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/veilleio/veille-go"
)

func main() {
	client, err := veille.NewClient("", nil) // reads VEILLE_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	response, err := client.IntelligenceEmail(ctx, &veille.IntelligenceEmailParams{Query: "jane.doe@example.com"})
	if err != nil {
		log.Fatal(err)
	}
	data, err := response.Map()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(data)
}

Parameter structs mirror the API reference. Required fields are plain values; optional fields are pointers — use veille.String, veille.Float, veille.Int and veille.Bool.

Decode into your own types with response.Decode(&value).

Async jobs

Any call accepts is_async: true (useful past the 60-second server limit): the response is then a job_id. WaitForJob polls GET /v1/jobs/{id} until a terminal status (CompletedJob, Error, NotFound, BadRequest):

submitted, err := client.IntelligenceEmail(ctx, &veille.IntelligenceEmailParams{Query: "jane.doe@example.com", IsAsync: veille.Bool(true)})
if err != nil {
	log.Fatal(err)
}
var accepted struct{ JobID string `json:"job_id"` }
if err := submitted.Decode(&accepted); err != nil {
	log.Fatal(err)
}
job, err := client.WaitForJob(ctx, accepted.JobID, &veille.WaitForJobOptions{
	OnProgress: func(job map[string]any) { fmt.Println(job["status"], job["progress"]) },
})

GET or POST

Methods use GET when the endpoint supports it (parameters in the query string); WithMethod("POST") sends them as a JSON body.

Any endpoint

response, err := client.Request(ctx, "GET", "/v1/usage", nil)

Errors

response, err := client.IntelligenceEmail(ctx, &veille.IntelligenceEmailParams{Query: "jane.doe@example.com"})
if apiError, ok := veille.IsAPIError(err); ok {
	log.Printf("HTTP %d: %s", apiError.StatusCode, apiError.Message)
}
Error When
*ConfigurationError Missing API key, invalid options or unsupported method.
*SerializationError A required parameter is missing or a value can't be sent.
*TransportError Network failure, timeout or cancelled context (errors.Is(err, context.DeadlineExceeded)).
*APIError Non-2xx status (StatusCode, Message, Response).
*ResponseDecodingError A success response could not be decoded.

Retries

Requests are retried up to 3 times after a network error, a 408, 500, 502, 503 or 504, or a rate limit — which the API returns as 401 (or 429) with a Rate limit exceeded message. Per-key quota errors (…: quota daily) are not retried, nor are 400, 402, 404 or client-side timeouts. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a Retry-After header wins.

client, err := veille.NewClient("", &veille.ClientOptions{
	MaxRetries: 5,                      // negative disables retries
	RetryDelay: 500 * time.Millisecond,
})

// or for one request
response, err := client.IntelligenceEmail(ctx, &veille.IntelligenceEmailParams{Query: "jane.doe@example.com"}, veille.WithMaxRetries(0))

Batch requests

veille.Batch runs a function per item with at most 10 calls in flight and returns one BatchResult per item, in input order. A failing item never stops the others.

inputs := []string{"jane.doe@example.com", "john@mailinator.com", "contact@veille.io"}
results := veille.Batch(ctx, inputs, 5, func(ctx context.Context, value string) (*veille.Response, error) {
	return client.IntelligenceEmail(ctx, &veille.IntelligenceEmailParams{Query: value})
})
for _, result := range results {
	if result.Err != nil {
		log.Printf("%s: %v", inputs[result.Index], result.Err)
		continue
	}
	fmt.Println(string(result.Value.Body))
}
Constant Default Description
DefaultConcurrency 10 Tasks run at the same time by batch
DefaultTimeout 120 * time.Second Request timeout
MaxRetries 3 Retry attempts after a network error, a 408/5xx or a rate limit
RetryBackoffFactor 1.5 Exponential backoff multiplier
DefaultRetryDelay time.Second Delay before the first retry

Timeouts and custom HTTP clients

client, err := veille.NewClient("", &veille.ClientOptions{
	Timeout:    60 * time.Second, // default 120 s; negative disables
	HTTPClient: &http.Client{Transport: myTransport},
})

Every method also honours the deadline and cancellation of the context.Context you pass.

Endpoints

11 methods, generated from the OpenAPI document.

Method HTTP Description
IntelligenceDomain GET /v1/intelligence/domain Check any domain instantly. Detects disposable email providers, public webmail, relay services, and education domains. Returns DNS health w…
IntelligenceEmail GET /v1/intelligence/email Validate any email address in a single call. Detects disposable and temporary inboxes, identifies role accounts, public webmail, relay serv…
IntelligenceEmailq GET /v1/intelligence/emailq Deep email deliverability verification. Performs full Email Validation plus SMTP inbox check, catch-all detection, and returns a qualificat…
IntelligenceIP GET /v1/intelligence/ip Assess the reputation of any IP address. Detects VPNs, proxies, Tor exit nodes, datacenter hosting, abusive traffic, and bots. Returns geol…
IntelligencePhone GET /v1/intelligence/phone Validate any phone number in E.164 format. Detects disposable and virtual numbers, identifies carrier and line type (mobile/fixed/VoIP), re…
Jobs GET /v1/jobs/{id} Poll the status, progress (0–100) and result of a job started with is_async=true. Polling is free. Poll until status is terminal: Completed…
Stats GET /v1/stats Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 mea…
Usage GET /v1/usage Retrieve real-time usage statistics and credit balance for your Veille account.
VAT GET /v1/vat Validate a European VAT number against the VIES database. Returns company name, registered address, and validity status for any EU member s…
VATIBAN GET /v1/vat/iban Validate any IBAN and retrieve associated bank details. Returns the BIC/SWIFT code, bank name, country, BBAN structural breakdown, and SEPA…
VATRates GET /v1/vat/rates Get current ECB exchange rates for any supported base currency. Optionally filter to specific target currencies. Updated daily from the Eur…

License

MIT — see LICENSE.

Documentation

Overview

Package veille is the official Go SDK for the Veille API (https://www.veille.io).

Validate emails, domains, IPs, VAT numbers and IBANs in milliseconds to block fake sign-ups, bots and fraud.

Create one client and reuse it:

client, err := veille.NewClient("", nil) // reads VEILLE_API_KEY
response, err := client.IntelligenceEmail(ctx, ...)

Every documented endpoint has a typed method; Client.Request reaches any other path.

Index

Constants

View Source
const (
	// DefaultBaseURL is the production API origin.
	DefaultBaseURL = "https://api.veille.io"
	// DefaultTimeout bounds every request unless ClientOptions.Timeout says otherwise.
	DefaultTimeout = 120 * time.Second
	// APIKeyEnvironmentVariable is read when NewClient receives an empty API key.
	APIKeyEnvironmentVariable = "VEILLE_API_KEY"
	// DefaultConcurrency is the number of tasks Batch runs at the same time.
	DefaultConcurrency = 10
	// MaxRetries is the default number of retries after a network error or a 408, 429, 500, 502, 503 or 504.
	MaxRetries = 3
	// RetryBackoffFactor multiplies the delay before each new retry (a Retry-After header wins).
	RetryBackoffFactor = 1.5
	// DefaultRetryDelay is the delay before the first retry.
	DefaultRetryDelay = time.Second
	// MaxRetryDelay caps the delay between two attempts.
	MaxRetryDelay = 30 * time.Second
)
View Source
const Version = "0.1.0"

Version is the SDK version sent in the User-Agent header.

Variables

View Source
var JobTerminalStatuses = []string{"CompletedJob", "Error", "NotFound", "BadRequest"}

JobTerminalStatuses are the job statuses WaitForJob stops on.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to v, for optional boolean parameters.

func Float

func Float(v float64) *float64

Float returns a pointer to v, for optional number parameters.

func Int

func Int(v int64) *int64

Int returns a pointer to v, for optional integer parameters.

func String

func String(v string) *string

String returns a pointer to v, for optional parameters.

Types

type APIError

type APIError struct {
	StatusCode int
	// Message is the "error" (or "message") field of the JSON body, when present.
	Message  string
	Response *Response
}

APIError is returned for non-2xx responses.

func IsAPIError

func IsAPIError(err error) (*APIError, bool)

IsAPIError reports whether err is an *APIError and returns it.

func (*APIError) Error

func (e *APIError) Error() string

type BatchResult

type BatchResult[T any] struct {
	Index int
	Value T
	Err   error
}

BatchResult is the outcome of one Batch item.

func Batch

func Batch[I, T any](ctx context.Context, items []I, concurrency int, task func(ctx context.Context, item I) (T, error)) []BatchResult[T]

Batch runs task for every item with at most concurrency calls in flight (DefaultConcurrency when concurrency <= 0) and returns one result per item, in input order. A failing item never stops the others; items not started when ctx is done get ctx.Err().

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a reusable, concurrency-safe Veille API client.

func NewClient

func NewClient(apiKey string, options *ClientOptions) (*Client, error)

NewClient creates a client. An empty apiKey falls back to the VEILLE_API_KEY environment variable.

func (*Client) IntelligenceDomain

func (c *Client) IntelligenceDomain(ctx context.Context, params *IntelligenceDomainParams, options ...RequestOption) (*Response, error)

IntelligenceDomain — Domain Validation. Check any domain instantly. Detects disposable email providers, public webmail, relay services, and education domains. Returns DNS health with MX provider detection, domain history, and optional SSL/TLS certificate transparency. Credit cost: 2 credits per call.

GET /v1/intelligence/domain

func (*Client) IntelligenceEmail

func (c *Client) IntelligenceEmail(ctx context.Context, params *IntelligenceEmailParams, options ...RequestOption) (*Response, error)

IntelligenceEmail — Email Validation. Validate any email address in a single call. Detects disposable and temporary inboxes, identifies role accounts, public webmail, relay services, and returns a 0-100 risk score. For deep deliverability verification (SMTP check, catch-all de… Credit cost: 3 credits per call.

GET /v1/intelligence/email

func (*Client) IntelligenceEmailq

func (c *Client) IntelligenceEmailq(ctx context.Context, params *IntelligenceEmailqParams, options ...RequestOption) (*Response, error)

IntelligenceEmailq — Email Qualification. Deep email deliverability verification. Performs full Email Validation plus SMTP inbox check, catch-all detection, and returns a qualification verdict (valid, invalid, risky, disposable, unknown). Credit cost: 5 credits per call.

GET /v1/intelligence/emailq

func (*Client) IntelligenceIP

func (c *Client) IntelligenceIP(ctx context.Context, params *IntelligenceIPParams, options ...RequestOption) (*Response, error)

IntelligenceIP — IP Reputation. Assess the reputation of any IP address. Detects VPNs, proxies, Tor exit nodes, datacenter hosting, abusive traffic, and bots. Returns geolocation, network owner, and a 0-100 threat score. Credit cost: 2 credits per call.

GET /v1/intelligence/ip

func (*Client) IntelligencePhone

func (c *Client) IntelligencePhone(ctx context.Context, params *IntelligencePhoneParams, options ...RequestOption) (*Response, error)

IntelligencePhone — Phone Validation. Validate any phone number in E.164 format. Detects disposable and virtual numbers, identifies carrier and line type (mobile/fixed/VoIP), returns country and timezone, and computes a 0-100 risk score. Credit cost: 1 credit per call.

GET /v1/intelligence/phone

func (*Client) Jobs

func (c *Client) Jobs(ctx context.Context, params *JobsParams, options ...RequestOption) (*Response, error)

Jobs — Jobs. Poll the status, progress (0–100) and result of a job started with is_async=true. Polling is free. Poll until status is terminal: CompletedJob, Error, NotFound or BadRequest.

GET /v1/jobs/{id}

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, params map[string]any, options ...RequestOption) (*Response, error)

Request sends any request, including endpoints released after this SDK version. GET parameters travel in the query string; POST parameters travel in a JSON body.

func (*Client) Stats

func (c *Client) Stats(ctx context.Context, params *StatsParams, options ...RequestOption) (*Response, error)

Stats — Stats. Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 means contact support to activate it.

GET /v1/stats

func (*Client) Usage

func (c *Client) Usage(ctx context.Context, options ...RequestOption) (*Response, error)

Usage — Usage. Retrieve real-time usage statistics and credit balance for your Veille account.

GET /v1/usage

func (*Client) VAT

func (c *Client) VAT(ctx context.Context, params *VATParams, options ...RequestOption) (*Response, error)

VAT — VAT Validation. Validate a European VAT number against the VIES database. Returns company name, registered address, and validity status for any EU member state. Credit cost: 1 credit per call.

GET /v1/vat

func (*Client) VATIBAN

func (c *Client) VATIBAN(ctx context.Context, params *VATIBANParams, options ...RequestOption) (*Response, error)

VATIBAN — IBAN Validation. Validate any IBAN and retrieve associated bank details. Returns the BIC/SWIFT code, bank name, country, BBAN structural breakdown, and SEPA zone membership. Credit cost: 1 credit per call.

GET /v1/vat/iban

func (*Client) VATRates

func (c *Client) VATRates(ctx context.Context, params *VATRatesParams, options ...RequestOption) (*Response, error)

VATRates — Exchange Rates. Get current ECB exchange rates for any supported base currency. Optionally filter to specific target currencies. Updated daily from the European Central Bank. Credit cost: 1 credit per call.

GET /v1/vat/rates

func (*Client) WaitForJob

func (c *Client) WaitForJob(ctx context.Context, jobID string, options *WaitForJobOptions) (*Response, error)

WaitForJob polls GET /v1/jobs/{id} until the job reaches a terminal status and returns the last response.

type ClientOptions

type ClientOptions struct {
	// BaseURL overrides DefaultBaseURL.
	BaseURL string
	// Timeout bounds each request. Zero uses DefaultTimeout; a negative value disables it.
	Timeout time.Duration
	// HTTPClient is copied and used for requests. Redirects are never followed.
	HTTPClient *http.Client
	// Headers are sent with every request.
	Headers map[string]string
	// MaxRetries overrides the number of retries. Zero uses MaxRetries; a negative value disables retries.
	MaxRetries int
	// RetryDelay is the delay before the first retry. Zero uses DefaultRetryDelay.
	RetryDelay time.Duration
}

ClientOptions configures a Client. The zero value is valid.

type ConfigurationError

type ConfigurationError struct {
	Message string
	Err     error
}

ConfigurationError reports a missing or unusable client configuration.

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

func (*ConfigurationError) Unwrap

func (e *ConfigurationError) Unwrap() error

type IntelligenceDomainParams

type IntelligenceDomainParams struct {
	// The domain to validate. Accepts raw domains (tempmail.org), full URLs (https://www.tempmail.org/page), or domains with www. prefix, all are normalized automatically.
	Query string `json:"query" api:"query,required"`
	// Enable Certificate Transparency lookup. Returns SSL/TLS certificate history, current certificate, issuers, and all Subject Alternative Names (SANs) ever associated with the domain. Adds 1-5 seconds of latency. Default: false.
	CertificateTransparency *bool `json:"certificate_transparency" api:"certificate_transparency"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

IntelligenceDomainParams holds the parameters of IntelligenceDomain (GET /v1/intelligence/domain). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type IntelligenceEmailParams

type IntelligenceEmailParams struct {
	// The email address to validate (e.g. john@example.com). Automatically normalized to lowercase.
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

IntelligenceEmailParams holds the parameters of IntelligenceEmail (GET /v1/intelligence/email). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type IntelligenceEmailqParams

type IntelligenceEmailqParams struct {
	// The email address to qualify (e.g. john@example.com). Automatically normalized to lowercase.
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

IntelligenceEmailqParams holds the parameters of IntelligenceEmailq (GET /v1/intelligence/emailq). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type IntelligenceIPParams

type IntelligenceIPParams struct {
	// The IP address to analyze (IPv4 or IPv6).
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

IntelligenceIPParams holds the parameters of IntelligenceIP (GET /v1/intelligence/ip). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type IntelligencePhoneParams

type IntelligencePhoneParams struct {
	// The phone number to validate in E.164 format (must start with +, e.g. +33612345678).
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

IntelligencePhoneParams holds the parameters of IntelligencePhone (GET /v1/intelligence/phone). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type JobTimeoutError

type JobTimeoutError struct {
	JobID        string
	LastResponse *Response
}

JobTimeoutError reports an async job that did not finish before the deadline.

func (*JobTimeoutError) Error

func (e *JobTimeoutError) Error() string

type JobsParams

type JobsParams struct {
	// The job_id returned by an endpoint called with is_async=true.
	ID string `json:"id" api:"id,required"`
}

JobsParams holds the parameters of Jobs (GET /v1/jobs/{id}). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type RequestOption

type RequestOption func(*requestOptions)

RequestOption customizes one request.

func WithHeader

func WithHeader(name, value string) RequestOption

WithHeader adds a header to one request.

func WithMaxRetries

func WithMaxRetries(n int) RequestOption

WithMaxRetries overrides the number of retries for one request (0 disables them).

func WithMethod

func WithMethod(method string) RequestOption

WithMethod selects GET or POST. Operations default to GET when they support it.

type Response

type Response struct {
	StatusCode  int
	Header      http.Header
	ContentType string
	// Body holds the raw bytes: JSON text, or a file such as an image or PDF.
	Body []byte
	// IsJSON reports whether the body is JSON (Content-Type application/json or +json).
	IsJSON bool
}

Response is a buffered, successful API response.

func (*Response) Decode

func (r *Response) Decode(v any) error

Decode unmarshals a JSON body into v.

func (*Response) Map

func (r *Response) Map() (map[string]any, error)

Map decodes a JSON object body.

type ResponseDecodingError

type ResponseDecodingError struct {
	Message  string
	Response *Response
	Err      error
}

ResponseDecodingError reports a success response that could not be decoded.

func (*ResponseDecodingError) Error

func (e *ResponseDecodingError) Error() string

func (*ResponseDecodingError) Unwrap

func (e *ResponseDecodingError) Unwrap() error

type SerializationError

type SerializationError struct {
	Param   string
	Message string
	Err     error
}

SerializationError reports a parameter that is missing or cannot be sent.

func (*SerializationError) Error

func (e *SerializationError) Error() string

func (*SerializationError) Unwrap

func (e *SerializationError) Unwrap() error

type StatsParams

type StatsParams struct {
	// API family to check, for example vat. Provide at least engine or path.
	Engine *string `json:"engine" api:"engine"`
	// Specific endpoint to check, for example /v1/vat. If you also pass engine, use an endpoint from that API.
	Path *string `json:"path" api:"path"`
}

StatsParams holds the parameters of Stats (GET /v1/stats). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type TransportError

type TransportError struct {
	Message string
	Err     error
}

TransportError reports a failure before a complete HTTP response was received, including client-side timeouts and context cancellation (see Unwrap).

func (*TransportError) Error

func (e *TransportError) Error() string

func (*TransportError) Unwrap

func (e *TransportError) Unwrap() error

type VATIBANParams

type VATIBANParams struct {
	// The IBAN to validate (e.g. FR7630006000011234567890189).
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

VATIBANParams holds the parameters of VATIBAN (GET /v1/vat/iban). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type VATParams

type VATParams struct {
	// The VAT number to validate (e.g. FR40303265045).
	Query string `json:"query" api:"query,required"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

VATParams holds the parameters of VAT (GET /v1/vat). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type VATRatesParams

type VATRatesParams struct {
	// Base currency ISO 4217 code (defaults to EUR). Default: "EUR".
	Base *string `json:"base" api:"base"`
	// Comma-separated target currency codes to filter (e.g. USD,GBP,JPY).
	Symbols *string `json:"symbols" api:"symbols"`
	// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
	Fields *string `json:"fields" api:"fields"`
	// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
	IsAsync *bool `json:"is_async" api:"is_async"`
	// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
	SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}

VATRatesParams holds the parameters of VATRates (GET /v1/vat/rates). Required fields are plain values; optional fields are pointers (use veille.String, veille.Float, veille.Bool) or nil slices and maps.

type WaitForJobOptions

type WaitForJobOptions struct {
	Interval   time.Duration
	Timeout    time.Duration
	OnProgress func(job map[string]any)
}

WaitForJobOptions configures WaitForJob. The zero value polls after 3 s, then 1.5x longer each time up to 60 s, for up to 12 hours.

Directories

Path Synopsis
examples
json command
request command
wait-for-job command

Jump to

Keyboard shortcuts

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