models

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package models defines domain types used across the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledRule

type CompiledRule struct {
	Methods []string
	Regex   *regexp.Regexp
}

CompiledRule is a precompiled method+path matching rule.

type OperationMatcher

type OperationMatcher struct {
	Allow []CompiledRule
	Block []CompiledRule
}

OperationMatcher evaluates allow/block rules for API operations.

func NewOperationMatcher

func NewOperationMatcher(allow, block []CompiledRule) *OperationMatcher

NewOperationMatcher creates a matcher with the given allow and block rules.

func (*OperationMatcher) IsAllowed

func (m *OperationMatcher) IsAllowed(method, path string) bool

IsAllowed returns true if the method+path is allowed and not blocked.

type ToolDefinition

type ToolDefinition struct {
	OperationID  string
	Method       string
	Path         string
	Description  string
	InputSchema  json.RawMessage
	OutputSchema json.RawMessage
	Params       []ToolParam
	HasBody      bool
	WrapOutput   bool
}

ToolDefinition describes an API operation exposed as an MCP tool.

type ToolParam

type ToolParam struct {
	Name string
	In   string
}

ToolParam describes an API operation parameter.

Jump to

Keyboard shortcuts

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