Documentation
¶
Index ¶
- func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string]string) error
- func CreateDockerfile(dir string, projectType ProjectType, settingsMap map[string]string) error
- func DetectEnvFile(maybeFile string) (string, map[string]string, error)
- func GenerateDockerArtifacts(dir string, projectType ProjectType, settingsMap map[string]string) ([]byte, []byte, error)
- func HasDockerfile(dir string) (bool, error)
- func LocateLockfile(dir string, p ProjectType) (bool, string)
- func ParseCpu(cpu string) (string, error)
- func ParseEnvFile(file string) (map[string]string, error)
- func ParseMem(mem string, suffix bool) (string, error)
- func UploadTarball(directory string, presignedUrl string, excludeFiles []string, ...) error
- type APIError
- type Client
- func (c *Client) Build(ctx context.Context, id string) error
- func (c *Client) CreateAgent(ctx context.Context, workingDir string, secrets []*lkproto.AgentSecret, ...) (*lkproto.CreateAgentResponse, error)
- func (c *Client) DeployAgent(ctx context.Context, agentID string, workingDir string, ...) error
- func (c *Client) StreamLogs(ctx context.Context, logType, agentID string, writer io.Writer) error
- type ClientOption
- type PackageInfo
- type ProjectType
- type VersionCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSDKVersion ¶ added in v2.5.0
func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string]string) error
CheckSDKVersion performs a comprehensive check for livekit-agents packages
func CreateDockerfile ¶
func CreateDockerfile(dir string, projectType ProjectType, settingsMap map[string]string) error
func DetectEnvFile ¶ added in v2.4.5
func GenerateDockerArtifacts ¶ added in v2.5.2
func GenerateDockerArtifacts(dir string, projectType ProjectType, settingsMap map[string]string) ([]byte, []byte, error)
GenerateDockerArtifacts returns the Dockerfile and .dockerignore contents for the provided project type without writing them to disk. The Dockerfile content may be templated/validated (e.g., Python entrypoint).
func HasDockerfile ¶ added in v2.4.5
func LocateLockfile ¶ added in v2.5.0
func LocateLockfile(dir string, p ProjectType) (bool, string)
func UploadTarball ¶
func UploadTarball(directory string, presignedUrl string, excludeFiles []string, projectType ProjectType) error
Types ¶
type Client ¶ added in v2.6.2
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 ¶ added in v2.6.2
func New(opts ...ClientOption) (*Client, error)
New returns a new Client with the given project URL, API key, and API secret.
func (*Client) CreateAgent ¶ added in v2.6.2
func (c *Client) CreateAgent( ctx context.Context, workingDir string, secrets []*lkproto.AgentSecret, regions []string, excludeFiles []string, ) (*lkproto.CreateAgentResponse, error)
CreateAgent creates a new agent by building from source.
type ClientOption ¶ added in v2.6.2
type ClientOption func(*Client)
ClientOption provides a way to configure the Client.
func WithHTTPClient ¶ added in v2.6.2
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets the http client for the Client.
func WithLogger ¶ added in v2.6.2
func WithLogger(logger logger.Logger) ClientOption
WithLogger sets the logger for the Client.
func WithProject ¶ added in v2.6.2
func WithProject(projectURL, apiKey, apiSecret string) ClientOption
WithProject sets the livekit project credentials for the Client.
type PackageInfo ¶ added in v2.5.0
type PackageInfo struct {
Name string
Version string
FoundInFile string
ProjectType ProjectType
Ecosystem string // "pypi" or "npm"
}
PackageInfo represents information about a package found in a project
type ProjectType ¶ added in v2.5.0
type ProjectType string
const ( ProjectTypePythonPip ProjectType = "python.pip" ProjectTypePythonUV ProjectType = "python.uv" ProjectTypeNode ProjectType = "node" ProjectTypeUnknown ProjectType = "unknown" )
func DetectProjectType ¶ added in v2.5.0
func DetectProjectType(dir string) (ProjectType, error)
func (ProjectType) DefaultEntrypoint ¶ added in v2.5.2
func (p ProjectType) DefaultEntrypoint() string
func (ProjectType) FileExt ¶ added in v2.5.0
func (p ProjectType) FileExt() string
func (ProjectType) IsNode ¶ added in v2.5.0
func (p ProjectType) IsNode() bool
func (ProjectType) IsPython ¶ added in v2.5.0
func (p ProjectType) IsPython() bool
func (ProjectType) Lang ¶ added in v2.5.0
func (p ProjectType) Lang() string
type VersionCheckResult ¶ added in v2.5.0
type VersionCheckResult struct {
PackageInfo
MinVersion string
Satisfied bool
Error error
}
VersionCheckResult represents the result of a version check