httpclient

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 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 httpclient is a client of the workspaces' API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

Client is a client of the workspaces' API, which wraps the base HTTP client, with typed methods

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

New returns a client of the workspaces' API, at the URL of the shared API endpoint, such as "http://localhost:8080/api", with the options, of which each method's path is its own "llm/workspace/..." path, as the handlers register them

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(ctx context.Context, name string) (*schema.Workspace, error)

GetWorkspace returns the workspace with the name

func (*Client) ListResources

func (c *Client) ListResources(ctx context.Context, name string, req schema.ListRequest) (*schema.ListResponse, error)

ListResources returns a page of the folders, and resources, of the workspace with the name, in the request's folder, or under it, from its cursor, whose URIs are the workspace's, resource://<workspace>/<uri>

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces(ctx context.Context) (*schema.WorkspaceList, error)

ListWorkspaces returns the workspaces which are available, in order of their names, with whether each reads its resources, and is watched

func (*Client) ReadResource

func (c *Client) ReadResource(ctx context.Context, name string, req schema.ReadRequest, w io.Writer) (string, error)

ReadResource writes the content of the resource of the workspace with the name, by the request's URI, as it is, or as a Markdown document, to the writer, as it's read, and returns its type. The download isn't timed out, as a large file can take a while.

Jump to

Keyboard shortcuts

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