ionosclient

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ionosclient builds and maintains the User-Agent string the MCP server attaches to outbound IONOS CLOUD API calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Product          string // e.g. "ionoscloud-mcp"
	Version          string // server version
	SDKBundleVersion string // detected from build info
	Transport        string // "stdio", "streamable-http"
	Mode             string // "eager", "lazy"
	GOOS             string
	GOARCH           string
}

Options configures the static portion of the User-Agent that is fixed at startup. All fields are best-effort: empty values cause the matching segment to be omitted.

type UserAgent

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

UserAgent owns the composed User-Agent string and updates it atomically.

func New

func New(opts Options) *UserAgent

New constructs a UserAgent with the provided static metadata. Before SetClient is called (i.e. before the MCP initialize handshake), String returns the static portion only.

func (*UserAgent) SetClient

func (u *UserAgent) SetClient(name, version, protocol string)

SetClient updates the dynamic segments with information from the MCP initialize handshake. Inputs are sanitised; empty fields are omitted. Safe to call concurrently with String and outbound requests.

func (*UserAgent) String

func (u *UserAgent) String() string

String returns the current User-Agent.

func (*UserAgent) Transport

func (u *UserAgent) Transport(base http.RoundTripper) http.RoundTripper

Transport wraps base so that every outbound request carries the current User-Agent. If base is nil, http.DefaultTransport is used.

Jump to

Keyboard shortcuts

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