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

mcpauthority

package
v0.0.44 Latest Latest
Warning

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

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

Documentation

Overview

Package mcpauthority carries the exclusive MCP construction selection between command-side profile loading and application composition.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerConfig

type BrokerConfig struct {
	Routes      []permconfig.MCPServerProfile
	CallbackURL string
}

BrokerConfig is the neutral, runtime-independent broker declaration set.

type Mode

type Mode string

Mode identifies the sole selected MCP authority path. The zero value is invalid.

const (
	// Global selects the established process-global MCP manager.
	Global Mode = "global"
	// Broker selects session-scoped broker route declarations.
	Broker Mode = "broker"
)

type Result

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

Result is the canonical authority tagged union. Unexported payloads prevent a caller from constructing a value with both authority paths.

func NewBroker

func NewBroker(config BrokerConfig) *Result

NewBroker takes one deep defensive copy and creates a broker-only result.

func NewGlobal

func NewGlobal(servers []mcp.ServerConfig, lifecycle interface{ Close() error }) *Result

NewGlobal takes a defensive copy and creates a global-only result.

func (*Result) Broker

func (r *Result) Broker() (BrokerConfig, bool)

Broker returns broker declarations only for a valid broker selection. The returned declaration tree does not alias the result.

func (*Result) Global

func (r *Result) Global() ([]mcp.ServerConfig, interface{ Close() error }, bool)

Global returns global server configs and their lifecycle only for a valid global selection. The returned slice and header maps do not alias the result.

func (*Result) Mode

func (r *Result) Mode() Mode

Mode returns the selected authority tag. Nil, zero, and malformed results fail closed to the invalid zero mode.

Jump to

Keyboard shortcuts

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