vt

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

vt

VirusTotal indicator lookups for the gollem LLM agent framework.

github.com/gollem-dev/tools/vt

Tools

Name Description
vt_ip Search IPv4/IPv6 indicator from VirusTotal.
vt_domain Search domain indicator from VirusTotal.
vt_file_hash Search file hash indicator from VirusTotal.
vt_url Search URL indicator from VirusTotal.

Usage

ts, err := vt.New("YOUR_API_KEY")
if err != nil {
	return err
}
if err := ts.Ping(ctx); err != nil { // optional preflight
	return err
}

Options

Option Default
WithBaseURL(string) https://www.virustotal.com/api/v3
WithHTTPClient(*http.Client) http.DefaultClient
WithLogger(*slog.Logger) slog.Default()

Testing

Mock tests run unconditionally. The live-service test runs only when TEST_VT_API_KEY is set:

TEST_VT_API_KEY=... go test ./...

Documentation

Overview

Package vt provides a gollem.ToolSet for VirusTotal threat-intelligence lookups (IP addresses, domains, file hashes, and URLs).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*ToolSet)

Option configures a ToolSet.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL overrides the VirusTotal API base URL.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient overrides the HTTP client used for requests.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger. A nil logger keeps the default (slog.Default()).

type ToolSet

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

ToolSet implements gollem.ToolSet for VirusTotal. Fields are unexported; configure via Option.

func New

func New(apiKey string, opts ...Option) (*ToolSet, error)

New constructs the ToolSet. apiKey is required; New returns an error if it is empty. It only validates static configuration; use Ping to verify connectivity and credentials.

func (*ToolSet) Ping

func (t *ToolSet) Ping(ctx context.Context) error

Ping verifies connectivity and credentials by querying a well-known IP address indicator.

func (*ToolSet) Run

func (t *ToolSet) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

Run executes the named VirusTotal lookup.

func (*ToolSet) Specs

func (t *ToolSet) Specs(ctx context.Context) ([]gollem.ToolSpec, error)

Specs returns the VirusTotal tool specifications.

Jump to

Keyboard shortcuts

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