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

core

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolArg

func BoolArg(args map[string]any, key string, fallback bool) bool

func BoundedInt

func BoundedInt(value, fallback, minimum, maximum int) int

func BoundedMilliseconds

func BoundedMilliseconds(value, fallback, maximum int) time.Duration

func IntArg

func IntArg(args map[string]any, key string, fallback int) int

func MapArg

func MapArg(args map[string]any, key string) map[string]any

func ReadBoundedBody

func ReadBoundedBody(reader io.Reader, maxBytes int64) ([]byte, error)

func RedactSecrets

func RedactSecrets(value string, extraPatterns []string) string

func Remarshal

func Remarshal(input, output any) error

Remarshal 通过 JSON 契约在动态边界值和明确结构之间转换。

func RunBoundedCombinedOutput

func RunBoundedCombinedOutput(cmd *exec.Cmd, limit int) ([]byte, int64, bool, error)

func StringArg

func StringArg(args map[string]any, key, fallback string) string

func StringSliceArg

func StringSliceArg(args map[string]any, key string) []string

Types

type BoundedOutput

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

func NewBoundedOutput

func NewBoundedOutput(limit int) *BoundedOutput

func (*BoundedOutput) Snapshot

func (w *BoundedOutput) Snapshot() ([]byte, int64, bool)

func (*BoundedOutput) Write

func (w *BoundedOutput) Write(data []byte) (int, error)

type Result

type Result map[string]any

type ToolError

type ToolError struct {
	Code      string         `json:"code"`
	Message   string         `json:"message"`
	Category  string         `json:"category"`
	Retryable bool           `json:"retryable"`
	Details   map[string]any `json:"details,omitempty"`
	// contains filtered or unexported fields
}

func NewError

func NewError(code, message, category string) *ToolError

func NewErrorCause

func NewErrorCause(code, message, category string, details map[string]any, cause error) *ToolError

func NewErrorDetails

func NewErrorDetails(code, message, category string, details map[string]any) *ToolError

func (*ToolError) Error

func (e *ToolError) Error() string

func (*ToolError) Unwrap

func (e *ToolError) Unwrap() error

Jump to

Keyboard shortcuts

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