serverupdate

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package serverupdate implements MCP tools for on-demand server update checks and manual update application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatApplyMarkdown

func FormatApplyMarkdown(o ApplyOutput) *mcp.CallToolResult

FormatApplyMarkdown renders the apply result as an MCP CallToolResult.

func FormatApplyMarkdownString

func FormatApplyMarkdownString(o ApplyOutput) string

FormatApplyMarkdownString renders the apply result as Markdown.

func FormatCheckMarkdown

func FormatCheckMarkdown(o CheckOutput) *mcp.CallToolResult

FormatCheckMarkdown renders the check result as an MCP CallToolResult.

func FormatCheckMarkdownString

func FormatCheckMarkdownString(o CheckOutput) string

FormatCheckMarkdownString renders the check result as Markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, updater *autoupdate.Updater)

RegisterTools registers the gitlab_server_check_update and gitlab_server_apply_update tools. If updater is nil the tools are not registered (auto-update disabled).

func SetServerInfo

func SetServerInfo(info ServerInfo)

SetServerInfo configures the static metadata included in check results.

Types

type ApplyInput

type ApplyInput struct{}

ApplyInput is the (empty) input for the apply-update tool.

type ApplyOutput

type ApplyOutput struct {
	toolutil.HintableOutput
	Applied         bool   `json:"applied"`
	Deferred        bool   `json:"deferred,omitempty"`
	PreviousVersion string `json:"previous_version"`
	NewVersion      string `json:"new_version,omitempty"`
	StagingPath     string `json:"staging_path,omitempty"`
	ScriptPath      string `json:"script_path,omitempty"`
	Message         string `json:"message"`
}

ApplyOutput describes the result of applying an update.

func Apply

func Apply(ctx context.Context, updater *autoupdate.Updater, _ ApplyInput) (ApplyOutput, error)

Apply downloads and applies the latest server update. On Windows, if the binary cannot be replaced (running exe lock), it falls back to downloading to a staging path with an update script.

type CheckInput

type CheckInput struct{}

CheckInput is the (empty) input for the check-update tool.

type CheckOutput

type CheckOutput struct {
	toolutil.HintableOutput
	UpdateAvailable bool   `json:"update_available"`
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version,omitempty"`
	ReleaseURL      string `json:"release_url,omitempty"`
	ReleaseNotes    string `json:"release_notes,omitempty"`
	Mode            string `json:"mode"`
	Author          string `json:"author,omitempty"`
	Department      string `json:"department,omitempty"`
	Repository      string `json:"repository,omitempty"`
}

CheckOutput describes the result of an update availability check.

func Check

func Check(ctx context.Context, updater *autoupdate.Updater, _ CheckInput) (CheckOutput, error)

Check verifies whether a newer server version is available.

type ServerInfo

type ServerInfo struct {
	Author     string
	Department string
	Repository string
}

ServerInfo holds static project metadata, set via SetServerInfo.

Jump to

Keyboard shortcuts

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