Documentation
¶
Index ¶
- Variables
- func Client(method string) error
- func GetMethodAlternatives(method string) []string
- func Server(method string) error
- func ValidateAccess(method string, role string) error
- func ValidateMethodName(method string, isClient bool) error
- func ValidateMethodPath(method string) error
- type AccessType
Constants ¶
This section is empty.
Variables ¶
View Source
var CoreMethodAccess = map[string]AccessType{ "initialize": AccessBoth, "tools/list": AccessClient, "tools/call": AccessClient, "tools/progress": AccessServer, "tools/cancel": AccessClient, "mcp/list_tools": AccessClient, "mcp/call_tool": AccessClient, "mcp/progress": AccessServer, "mcp/cancel": AccessClient, }
CoreMethodAccess maps core method names to their access types
Functions ¶
func GetMethodAlternatives ¶
GetMethodAlternatives returns alternative method names for a given method This handles cases where method names might have different formats (e.g., with or without slashes)
func ValidateAccess ¶
ValidateAccess checks if a method has the correct access type for the given role
func ValidateMethodName ¶
ValidateMethodName checks if a method name is valid and has the correct access type
func ValidateMethodPath ¶
ValidateMethodPath checks if a method path is valid
Types ¶
type AccessType ¶
type AccessType int
AccessType represents the type of access a method has
const ( // AccessClient indicates the method is accessible only by clients AccessClient AccessType = iota // AccessServer indicates the method is accessible only by servers AccessServer // AccessBoth indicates the method is accessible by both clients and servers AccessBoth )
Click to show internal directories.
Click to hide internal directories.