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

executionprotection

package
v0.1.58 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalJSON

func CanonicalJSON(value interface{}) ([]byte, error)

CanonicalJSON encodes the JSON data model deterministically.

func ClaimKey

func ClaimKey(ruleID, canonicalToolName, turnID, semanticHash string) (string, error)

ClaimKey computes the length-prefixed v1 claim identity.

Types

type ClaimRecord

type ClaimRecord struct {
	ClaimKey          string
	RuleID            string
	CanonicalToolName string
	TurnID            string
	SemanticHash      string
	CreatedAt         time.Time
}

type Repository

type Repository interface {
	Claim(ctx context.Context, record ClaimRecord) (bool, error)
	Finish(ctx context.Context, claimKey string, state toolprotection.State, finishedAt time.Time) error
}

func NewComponentRepository added in v0.1.57

func NewComponentRepository(invoker dexec.ComponentInvoker) Repository

NewComponentRepository uses the shared linked Datly host. Missing persistence is reported when a protected tool attempts to claim or finish.

type Service

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

func (*Service) Claim

func (s *Service) Claim(ctx context.Context, name string, args map[string]interface{}) (toolprotection.Claim, error)

func (*Service) Finish

func (s *Service) Finish(ctx context.Context, claim toolprotection.Claim, state toolprotection.State)

func (*Service) IsProtected

func (s *Service) IsProtected(name string) bool

Jump to

Keyboard shortcuts

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