client

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 29 Imported by: 0 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoginRequired  = errors.New("login required; run mcphub-cli login for this profile")
	ErrProfileChanged = errors.New("profile was logged in again; restart the MCP connection")
)

Functions

func AdminRequest added in v1.4.0

func AdminRequest(ctx context.Context, store *Store, name string, opts AdminRequestOptions) error

AdminRequest sends one management operation. Only a 401 can cause one retry; network failures never replay writes. ETags are emitted separately to stderr.

func Connect

func Connect(ctx context.Context, store *Store, name string, opts ConnectOptions) error

func Login

func Login(ctx context.Context, store *Store, opts LoginOptions) error

Types

type AdminRequestOptions added in v1.4.0

type AdminRequestOptions struct {
	Method, Path, IfMatch string
	Body                  []byte
	Output, Diagnostics   io.Writer
	HTTPClient            *http.Client
}

type ConnectOptions

type ConnectOptions struct {
	Input      io.ReadCloser
	Output     io.WriteCloser
	HTTPClient *http.Client
}

type LoginOptions

type LoginOptions struct {
	Admin        bool
	ServerURL    string
	ClientID     string
	Profile      string
	Scopes       []string
	CallbackPort int
	Output       io.Writer
	OpenBrowser  func(string) error
	HTTPClient   *http.Client
}

type Status

type Status struct {
	Admin      bool
	ServerURL  string
	ClientID   string
	Scopes     []string
	LoggedIn   bool
	ExpiresAt  time.Time
	CanRefresh bool
}

Status describes cached credentials, without checking their validity at the issuer.

type Store

type Store struct{ Dir string }

func DefaultStore

func DefaultStore() (*Store, error)

func (*Store) Logout

func (s *Store) Logout(ctx context.Context, name string) error

func (*Store) Status

func (s *Store) Status(ctx context.Context, name string) (Status, error)

Jump to

Keyboard shortcuts

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