cloudagents

package
v2.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSourceTarball added in v2.16.2

func CreateSourceTarball(
	directory fs.FS,
	excludeFiles []string,
	w io.Writer,
) error

func MultipartUpload added in v2.16.2

func MultipartUpload(presignedURL string, fields map[string]string, buf *bytes.Buffer) error

Types

type APIError

type APIError struct {
	Message string            `json:"msg"`
	Meta    map[string]string `json:"meta,omitempty"`
}

type Client

type Client struct {
	*lksdk.AgentClient
	// contains filtered or unexported fields
}

Client is a wrapper around the lksdk.AgentClient that provides a simpler interface for creating and deploying agents.

func New

func New(opts ...ClientOption) (*Client, error)

New returns a new Client with the given project URL, API key, and API secret.

func (*Client) CreateAgent

func (c *Client) CreateAgent(
	ctx context.Context,
	source fs.FS,
	secrets []*lkproto.AgentSecret,
	regions []string,
	excludeFiles []string,
	buildLogStreamWriter io.Writer,
) (*lkproto.CreateAgentResponse, error)

CreateAgent creates a new agent by building from source.

CreatePrivateLink creates a new private link for cloud agents.

func (*Client) DeployAgent

func (c *Client) DeployAgent(
	ctx context.Context,
	agentID string,
	source fs.FS,
	secrets []*lkproto.AgentSecret,
	excludeFiles []string,
	buildLogStreamWriter io.Writer,
) error

DeployAgent deploys new agent by building from source.

DestroyPrivateLink deletes a private link by ID.

func (*Client) GetPushTarget added in v2.16.2

func (c *Client) GetPushTarget(ctx context.Context, agentID string) (*PushTarget, error)

GetPushTarget asks cloud-agents for the OCI proxy location for the given agent. The caller should then push the image to ProxyHost/Name:Tag using a transport returned by NewRegistryTransport.

ListPrivateLinks lists private links for the project.

func (*Client) NewRegistryTransport added in v2.16.2

func (c *Client) NewRegistryTransport() http.RoundTripper

NewRegistryTransport returns an http.RoundTripper that injects the LiveKit JWT on every request. Pass this to crane via crane.WithTransport when pushing to the cloud-agents OCI proxy so the proxy's auth middleware accepts the requests.

func (*Client) RegisterAgent added in v2.16.2

func (c *Client) RegisterAgent(ctx context.Context, secrets []*lkproto.AgentSecret, regions []string) (string, error)

RegisterAgent creates an agent record without uploading source or triggering a build. Use this when you intend to push a prebuilt image immediately after via GetPushTarget.

func (*Client) StreamLogs

func (c *Client) StreamLogs(ctx context.Context, logType, agentID string, writer io.Writer, serverRegion string) error

StreamLogs streams the logs for the given agent.

type ClientOption

type ClientOption func(*Client)

ClientOption provides a way to configure the Client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient sets the http client for the Client.

func WithHeaders

func WithHeaders(headers map[string]string) ClientOption

func WithJsonLogStream added in v2.12.4

func WithJsonLogStream() ClientOption

func WithLogger

func WithLogger(logger logger.Logger) ClientOption

WithLogger sets the logger for the Client.

func WithProject

func WithProject(projectURL, apiKey, apiSecret string) ClientOption

WithProject sets the livekit project credentials for the Client.

type PushTarget added in v2.16.2

type PushTarget struct {
	// ProxyHost is the OCI registry host exposed by cloud-agents (e.g. "agents.livekit.io").
	ProxyHost string `json:"proxy_host"`
	// Name is the OCI repository name to use in /v2/{name}/... paths.
	Name string `json:"name"`
	// Tag is the version tag cloud-agents generated; use this as the image tag.
	Tag string `json:"tag"`
}

PushTarget describes where and how the CLI should push a prebuilt image.

Jump to

Keyboard shortcuts

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