Documentation
¶
Index ¶
- Constants
- func AppendConfigDocsFooter(sb *strings.Builder)
- type ValidationError
- func AbsolutePath(value, fieldName, jsonPath string) *ValidationError
- func MissingRequired(fieldName, serverType, jsonPath, suggestion string) *ValidationError
- func MountFormat(mount, jsonPath string, index int) *ValidationError
- func NonEmptyString(value, fieldName, jsonPath string) *ValidationError
- func PortRange(port int, jsonPath string) *ValidationError
- func TimeoutPositive(timeout int, fieldName, jsonPath string) *ValidationError
- func UndefinedVariable(varName, jsonPath string) *ValidationError
- func UnsupportedField(fieldName, message, jsonPath, suggestion string) *ValidationError
- func UnsupportedType(fieldName, actualType, jsonPath, suggestion string) *ValidationError
Constants ¶
const ( ConfigSpecURL = "https://github.com/github/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md" SchemaURL = "https://raw.githubusercontent.com/github/gh-aw/main/docs/public/schemas/mcp-gateway-config.schema.json" )
Documentation URL constants
Variables ¶
This section is empty.
Functions ¶
func AppendConfigDocsFooter ¶
AppendConfigDocsFooter appends standard documentation links to an error message
Types ¶
type ValidationError ¶
ValidationError represents a configuration validation error with context. It provides detailed information about what went wrong during configuration validation, including the field that failed, a human-readable message, the JSON path to the error location, and a suggestion for how to fix it.
This error type implements the error interface and formats itself with helpful context when Error() is called, including the JSON path and suggestion if available.
func AbsolutePath ¶
func AbsolutePath(value, fieldName, jsonPath string) *ValidationError
AbsolutePath validates that a directory path is an absolute path Per MCP Gateway schema: Unix paths start with '/', Windows paths start with a drive letter followed by ':\' Pattern: ^(/|[A-Za-z]:\\) Returns nil if valid, *ValidationError if invalid
func MissingRequired ¶
func MissingRequired(fieldName, serverType, jsonPath, suggestion string) *ValidationError
MissingRequired creates a ValidationError for missing required fields
func MountFormat ¶
func MountFormat(mount, jsonPath string, index int) *ValidationError
MountFormat validates a mount specification in the format "source:dest" or "source:dest:mode" Returns nil if valid, *ValidationError if invalid Per MCP Gateway specification v1.7.0 section 4.1.5: - Host path MUST be an absolute path - Container path MUST be an absolute path - Mode (if provided) MUST be either "ro" (read-only) or "rw" (read-write)
func NonEmptyString ¶
func NonEmptyString(value, fieldName, jsonPath string) *ValidationError
NonEmptyString validates that a string field is not empty (minLength: 1) Returns nil if valid, *ValidationError if invalid
func PortRange ¶
func PortRange(port int, jsonPath string) *ValidationError
PortRange validates that a port is in the valid range (1-65535) Returns nil if valid, *ValidationError if invalid
func TimeoutPositive ¶
func TimeoutPositive(timeout int, fieldName, jsonPath string) *ValidationError
TimeoutPositive validates that a timeout value is at least 1 Returns nil if valid, *ValidationError if invalid
func UndefinedVariable ¶
func UndefinedVariable(varName, jsonPath string) *ValidationError
UndefinedVariable creates a ValidationError for undefined environment variables
func UnsupportedField ¶
func UnsupportedField(fieldName, message, jsonPath, suggestion string) *ValidationError
UnsupportedField creates a ValidationError for unsupported fields
func UnsupportedType ¶
func UnsupportedType(fieldName, actualType, jsonPath, suggestion string) *ValidationError
UnsupportedType creates a ValidationError for unsupported type values
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string