Documentation
¶
Overview ¶
Package httpclient is a client of the workspaces' API
Index ¶
- type Client
- func (c *Client) GetWorkspace(ctx context.Context, name string) (*schema.Workspace, error)
- func (c *Client) ListResources(ctx context.Context, name string, req schema.ListRequest) (*schema.ListResponse, error)
- func (c *Client) ListWorkspaces(ctx context.Context) (*schema.WorkspaceList, error)
- func (c *Client) ReadResource(ctx context.Context, name string, req schema.ReadRequest, w io.Writer) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client of the workspaces' API, which wraps the base HTTP client, with typed methods
func New ¶
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 ¶
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 ¶
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.