cloudagents

package
v2.12.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

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.

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.

Jump to

Keyboard shortcuts

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