transport

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSTransport

type FSTransport struct {
	Dir      string
	Filename string
}

FSTransport writes a formatted report to the filesystem. If Filename is empty, it defaults to "report" + the formatter's file extension.

func NewFSTransport

func NewFSTransport(dir string) *FSTransport

NewFSTransport creates an FSTransport that writes to dir.

func (*FSTransport) Send

type HTTPTransport

type HTTPTransport struct {
	URL     string
	Headers map[string]string
	Client  *http.Client
}

HTTPTransport POSTs a formatted report to a URL (webhook). The Content-Type header is set from the formatter's MediaType. Additional headers (e.g. Authorization) can be provided via Headers. If Client is nil, http.DefaultClient is used.

func NewHTTPTransport

func NewHTTPTransport(url string) *HTTPTransport

NewHTTPTransport creates an HTTPTransport that POSTs to url.

func (*HTTPTransport) Send

type Transport

type Transport interface {
	Send(ctx context.Context, r *reportx.Report, f reportx.Formatter) error
}

Transport sends a formatted report to a destination.

Jump to

Keyboard shortcuts

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