Documentation
¶
Index ¶
- func CreateSourceTarball(directory fs.FS, excludeFiles []string, w io.Writer) error
- func MultipartUpload(presignedURL string, fields map[string]string, buf *bytes.Buffer) error
- type APIError
- type Client
- func (c *Client) CreateAgent(ctx context.Context, source fs.FS, secrets []*lkproto.AgentSecret, ...) (*lkproto.CreateAgentResponse, error)
- func (c *Client) CreatePrivateLink(ctx context.Context, req *lkproto.CreatePrivateLinkRequest) (*lkproto.CreatePrivateLinkResponse, error)
- func (c *Client) DeployAgent(ctx context.Context, agentID string, source fs.FS, ...) error
- func (c *Client) DestroyPrivateLink(ctx context.Context, req *lkproto.DestroyPrivateLinkRequest) (*lkproto.DestroyPrivateLinkResponse, error)
- func (c *Client) GetPushTarget(ctx context.Context, agentID string) (*PushTarget, error)
- func (c *Client) ListPrivateLinks(ctx context.Context, req *lkproto.ListPrivateLinksRequest) (*lkproto.ListPrivateLinksResponse, error)
- func (c *Client) NewRegistryTransport() http.RoundTripper
- func (c *Client) RegisterAgent(ctx context.Context, secrets []*lkproto.AgentSecret, regions []string) (string, error)
- func (c *Client) StreamLogs(ctx context.Context, logType, agentID string, writer io.Writer, ...) error
- type ClientOption
- type PushTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSourceTarball ¶ added in v2.16.2
Types ¶
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) CreatePrivateLink ¶ added in v2.14.0
func (c *Client) CreatePrivateLink(ctx context.Context, req *lkproto.CreatePrivateLinkRequest) (*lkproto.CreatePrivateLinkResponse, error)
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.
func (*Client) DestroyPrivateLink ¶ added in v2.14.0
func (c *Client) DestroyPrivateLink(ctx context.Context, req *lkproto.DestroyPrivateLinkRequest) (*lkproto.DestroyPrivateLinkResponse, error)
DestroyPrivateLink deletes a private link by ID.
func (*Client) GetPushTarget ¶ added in v2.16.2
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.
func (*Client) ListPrivateLinks ¶ added in v2.14.0
func (c *Client) ListPrivateLinks(ctx context.Context, req *lkproto.ListPrivateLinksRequest) (*lkproto.ListPrivateLinksResponse, error)
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.
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.