call

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package call is the sealed bridge between the root batchdata package and the service packages, such as skiptrace.

The root Client embeds a Handle under an unexported alias, which promotes Handle's unexported sender method into the Client's method set. A service passes its *batchdata.Client to FuncOf, whose parameter is a Holder: an interface with that unexported method, so only a type embedding a Handle satisfies it, and the compiler rejects anything else. Code outside this module cannot import this package, so it can neither build a Handle nor reach the Sender.

The root package owns every public error. A Sender returns only errors the root built, and a Call's Decode reports a failure with any error, which the root replaces with its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call[W any] struct {
	// Path is the endpoint path relative to the API root, such as
	// "/property/skip-trace". It is a constant of the service package.
	Path string

	// Body is the encoded JSON request, sent verbatim.
	Body []byte

	// Decode receives the raw "result" object of a successful response and
	// the envelope's warnings. A non-nil error marks the response malformed.
	Decode func(result []byte, warnings []W) error
}

Call is one provider call.

type Handle

type Handle[W any] struct {
	// contains filtered or unexported fields
}

Handle holds a Sender. It has no exported fields or methods.

func NewHandle

func NewHandle[W any](s Sender[W]) Handle[W]

NewHandle returns a Handle holding s.

type Holder

type Holder[W any] interface {
	// contains filtered or unexported methods
}

Holder is satisfied only by types that embed a Handle.

type Sender

type Sender[W any] func(ctx context.Context, c Call[W]) error

Sender makes one call. It makes at most one HTTP attempt.

func FuncOf

func FuncOf[W any](h Holder[W]) Sender[W]

FuncOf returns the Sender held by h, or nil when h is nil or holds none. A typed nil pointer panics: callers check for one before calling FuncOf.

Jump to

Keyboard shortcuts

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