contractcheck

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package contractcheck is funcd's check of every call against its contract (ADR-0303): two invokePlugins of the ADR-0302 chain, contract-input at Before and contract-output at After, with ADR-0301's rules.

Index

Constants

View Source
const (
	CallBudget = time.Second
	MaxDigits  = 1000
)

The checks' bounds (Decision 6): the pattern budget of one check, and the most digits a number, or its exponent's magnitude, may have.

View Source
const MaxCheckedBytes = 1 << 20

MaxCheckedBytes is the largest input or result the check reads (Decision 6): the limit external bodies and fn-to-fn calls already have.

Variables

This section is empty.

Functions

func Plugins

func Plugins(src Source) []invoke.Plugin

Plugins returns contract-input (Before) and contract-output (After).

Types

type Pair

type Pair struct{ Input, Output *contract.Validator }

Pair is one revision's compiled contract.

type Source

type Source interface {
	ContractOf(ctx context.Context, ref activator.FunctionRef, fn *v1.Function) (*Pair, error)
}

Source returns the compiled contract of the revision that serves a call to ref, or nil when it delivers none. fn is the Function the data plane read, or nil on a client path.

Jump to

Keyboard shortcuts

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