Help us shape the future of Go! Take the 2026 Go Developer Survey

giztools

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package giztools provides stateless execution helpers for Tool backends.

Index

Constants

View Source
const (
	MaxRequestBytes      = 1 << 20
	MaxHTTPResponseBytes = 4 << 20
	MaxHTTPTimeout       = 60 * time.Second
)

Variables

This section is empty.

Functions

func BuildHTTPRequest

func BuildHTTPRequest(ctx context.Context, operation HTTPOperation, args json.RawMessage) (*http.Request, error)

Types

type EgressPolicy

type EgressPolicy struct {
	AllowedHosts   map[string]bool
	DeniedPrefixes []netip.Prefix
}

type HTTPAuthorizer

type HTTPAuthorizer interface {
	Authorize(context.Context, *http.Request) error
}

type HTTPAuthorizerFunc

type HTTPAuthorizerFunc func(context.Context, *http.Request) error

func (HTTPAuthorizerFunc) Authorize

func (f HTTPAuthorizerFunc) Authorize(ctx context.Context, request *http.Request) error

type HTTPBinding

type HTTPBinding struct {
	ArgumentPointer string
	Target          string
	Required        bool
}

type HTTPExecutor

type HTTPExecutor struct {
	Transport http.RoundTripper
	Policy    EgressPolicy
	Resolver  *net.Resolver
}

func (HTTPExecutor) Invoke

func (e HTTPExecutor) Invoke(
	ctx context.Context,
	operation HTTPOperation,
	args json.RawMessage,
	authorizer HTTPAuthorizer,
) (json.RawMessage, error)

type HTTPOperation

type HTTPOperation struct {
	URL                string
	Method             string
	Headers            map[string]string
	Query              []HTTPBinding
	Body               []HTTPBinding
	ResponsePointer    *string
	SuccessStatusCodes []int
	Timeout            time.Duration
	MaxResponseBytes   int64
}

Jump to

Keyboard shortcuts

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