api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package api provides a general API result.

Index

Constants

View Source
const (
	Clean      = "clean"
	Unknown    = "unknown"
	Unrated    = "unrated"
	Breached   = "breached"
	Suspicious = "suspicious"
)

Variables

View Source
var Timeout = time.Second * 30

Timeout to use (general)

View Source
var UserAgent = "check"

UserAgent to use (general)

Functions

func Client

func Client() *http.Client

Client returns the default HTTP client.

Types

type Result

type Result struct {
	Verdict string            `json:"verdict,omitempty"`
	Details map[string]string `json:"details,omitempty"`
	Stats   struct {
		All int `json:"all,omitempty"`
		Bad int `json:"bad,omitempty"`
	} `json:"stats,omitempty"`
}

Result of API call.

func (*Result) ToJSON

func (res *Result) ToJSON() string

ToJSON returns the result as JSON object.

func (*Result) ToJSONL

func (res *Result) ToJSONL() string

ToJSONL returns the result as JSON lines.

Directories

Path Synopsis
Package hibp implements the HaveIBeenPwned API.
Package hibp implements the HaveIBeenPwned API.
Package vt implements the VirusTotal API.
Package vt implements the VirusTotal API.

Jump to

Keyboard shortcuts

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