client

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Status string                `json:"status"`
	Data   json.RawMessage       `json:"data"`
	Meta   json.RawMessage       `json:"meta,omitempty"`
	Error  *models.ErrorResponse `json:"error"`
}

APIResponse represents the standardized JSON structure for M3TAL API responses.

type Client

type Client struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

Client handles authenticated HTTP communications with the M3TAL API.

func NewClient

func NewClient(baseURL, token string) *Client

NewClient instantiates a new Client.

func (*Client) CancelQueueJob

func (c *Client) CancelQueueJob(id string) error

CancelQueueJob aborts a pending or active job by ID.

func (*Client) CheckVPNLeak

func (c *Client) CheckVPNLeak() (*models.VPNLeakReport, error)

CheckVPNLeak runs leak detection on the host and VPN outbound IPs.

func (*Client) ControlContainer

func (c *Client) ControlContainer(name, action string) error

ControlContainer starts, stops, or restarts a container via the API.

func (*Client) ControlVPN

func (c *Client) ControlVPN(action string) (any, error)

ControlVPN sends a start, stop, or restart command to the VPN.

func (*Client) DisablePlugin

func (c *Client) DisablePlugin(name, kind string) error

DisablePlugin disables a plugin by name and kind.

func (*Client) EnablePlugin

func (c *Client) EnablePlugin(name, kind string) error

EnablePlugin enables a plugin by name and kind.

func (*Client) GetAIModels

func (c *Client) GetAIModels() ([]string, error)

GetAIModels returns the list of available AI models from the Ollama backend.

func (*Client) GetContainers

func (c *Client) GetContainers() ([]models.Container, error)

GetContainers returns the list of all active containers.

func (*Client) GetLogs

func (c *Client) GetLogs(containerID string) (string, error)

GetLogs returns the logs (last 100 lines) of a container.

func (*Client) GetPluginCatalog

func (c *Client) GetPluginCatalog() ([]models.CatalogItemStatus, error)

GetPluginCatalog correlates remote catalog items with local loaded plugins.

func (*Client) GetPlugins

func (c *Client) GetPlugins() (*models.PluginsResponse, error)

GetPlugins returns all loaded plugins across all kinds.

func (*Client) GetQueue

func (c *Client) GetQueue() ([]models.JobRecord, error)

GetQueue returns the list of all queued and finished tasks.

func (*Client) GetStacks

func (c *Client) GetStacks() ([]models.Stack, error)

GetStacks returns all discovered stacks merged with DB status.

func (*Client) GetStats

func (c *Client) GetStats() (*models.MetricsResponse, error)

GetStats returns the host system metrics response.

func (*Client) GetStatus

func (c *Client) GetStatus() (*models.Status, error)

GetStatus checks the detailed system components health check report.

func (*Client) GetVPNStatus

func (c *Client) GetVPNStatus() (*models.VPNStatus, error)

GetVPNStatus checks the current status of the VPN connection.

func (*Client) InstallPlugin

func (c *Client) InstallPlugin(name, kind string) error

InstallPlugin downloads and installs a plugin by name and kind.

func (*Client) Request

func (c *Client) Request(method, path string, body any, target any) error

Request executes a generic API request.

func (*Client) RestartStack

func (c *Client) RestartStack(name string) (any, error)

RestartStack restarts a stack by name (stops then starts).

func (*Client) StartStack

func (c *Client) StartStack(name string) (any, error)

StartStack deploys a stack by name.

func (*Client) StopStack

func (c *Client) StopStack(name string) (any, error)

StopStack tears down/stops a stack by name.

func (*Client) SwitchVPNRegion

func (c *Client) SwitchVPNRegion(region string) (any, error)

SwitchVPNRegion switches the VPN connection region.

func (*Client) SyncVPNPort

func (c *Client) SyncVPNPort() (int, error)

SyncVPNPort triggers manual port synchronization for Gluetun.

func (*Client) UninstallPlugin

func (c *Client) UninstallPlugin(name, kind string) error

UninstallPlugin uninstalls a plugin by name and kind.

Jump to

Keyboard shortcuts

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