apiclient

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package apiclient wraps the k8shell-go SDK client, authenticated with a static personal access token read from the K8SHELL_PAT_TOKEN environment variable rather than a per-workspace identity JWT.

Index

Constants

View Source
const PATTokenEnv = "K8SHELL_PAT_TOKEN"

PATTokenEnv is the environment variable holding the personal access token used to authenticate all outbound API server calls.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps a k8shell-go SDK client authenticated with the PAT from K8SHELL_PAT_TOKEN.

func New

func New(server string) *Client

New creates a Client for the given API server address, authenticated with the personal access token from the K8SHELL_PAT_TOKEN environment variable.

func (*Client) ComposeBlueprint

func (c *Client) ComposeBlueprint(ctx context.Context, username string, k8shellFile *models.K8shellFile) (*models.Blueprint, error)

ComposeBlueprint delegates to the underlying SDK client's blueprint composition.

func (*Client) GetUserProfile

func (c *Client) GetUserProfile(ctx context.Context, username string) (*models.UserProfile, error)

GetUserProfile delegates to the underlying SDK client's profile lookup.

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context, username, workspace string, limit int, all bool) ([]models.SSHSession, error)

ListSessions delegates to the underlying SDK client's session listing, reversing the order returned by the API server.

func (*Client) ResolveUserCredential

func (c *Client) ResolveUserCredential(ctx context.Context, username, serviceName, scope string) (*models.UserCredential, error)

ResolveUserCredential delegates to the underlying SDK client's credential resolution.

func (*Client) SetUserPassword

func (c *Client) SetUserPassword(ctx context.Context, username, password, currentPassword string) (*models.User, error)

SetUserPassword delegates to the underlying SDK client's password update. currentPassword is required by the API server when a non-sudo user is changing their own password, and ignored otherwise; pass "" when not needed.

func (*Client) StopWorkspace

func (c *Client) StopWorkspace(ctx context.Context, name string) error

StopWorkspace shuts down the named workspace, keeping its persistent storage intact so it can later be resumed with StartWorkspace.

func (*Client) TerminateWorkspace

func (c *Client) TerminateWorkspace(ctx context.Context, name string) error

TerminateWorkspace shuts down the named workspace and permanently deletes its persistent storage.

Jump to

Keyboard shortcuts

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