manager

package
v8.64.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package manager is the client of giantswarm-repo-manager, the MCP server behind muster that keeps the repository inventory. `devctl repo status` asks it first -- through the person's muster endpoint, as the person -- and falls back to the engine's own checks when it cannot be reached. The tool's answer carries the set-up state as the engine's structured result, so both paths print the same verdicts.

Index

Constants

View Source
const ToolGetRepository = "giantswarm-repo-manager_get_repository"

ToolGetRepository is the muster tool that returns one inventory record.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsTool

func IsTool(err error) bool

IsTool asserts toolError: the manager answered with an error or an answer the client does not understand.

func IsUnreachable

func IsUnreachable(err error) bool

IsUnreachable asserts unreachableError: the endpoint did not answer, or not with MCP. The caller falls back to the engine.

Types

type Client

type Client struct {
	// Endpoint is the muster MCP endpoint (https://muster.example/mcp).
	Endpoint string
	// Token is the person's bearer token for the endpoint; empty sends none.
	Token string
	// HTTPClient overrides the HTTP client; nil means one with a timeout.
	HTTPClient *http.Client
	// Version is reported as the client's version in the handshake.
	Version string
}

Client calls giantswarm-repo-manager's tools through a muster endpoint over MCP's streamable HTTP transport.

func (*Client) GetRepository

func (c *Client) GetRepository(ctx context.Context, repository string) (*Record, error)

GetRepository calls the get_repository tool for owner/name.

type Record

type Record struct {
	// Repository is owner/name.
	Repository string `json:"repository"`
	// Team is the slug of the team file that declares it; empty when no file
	// does.
	Team string `json:"team,omitempty"`
	// Setup is the engine's check result the inventory stores.
	Setup *reconcile.Result `json:"setup,omitempty"`
	// UpdatedAt is when the record was refreshed.
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

Record is one inventory record of giantswarm-repo-manager as `devctl repo status` reads it. The manager's tool schema is filled in by its own change; the client reads the fields below and ignores the rest, and a payload that is the set-up result itself is accepted as one too.

type RepositoryGetter

type RepositoryGetter interface {
	GetRepository(ctx context.Context, repository string) (*Record, error)
}

RepositoryGetter answers `devctl repo status` from the inventory. Client satisfies it; a test fakes it.

Jump to

Keyboard shortcuts

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