Documentation
¶
Overview ¶
Package provider provides the interfaces for implementing providers.
Index ¶
- func BundleJS(logger logger.Logger, project *project.Project, dir string, production bool) error
- func GetProviders() map[string]Provider
- type BunProvider
- func (p *BunProvider) Aliases() []string
- func (p *BunProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
- func (p *BunProvider) DefaultSrcDir() string
- func (p *BunProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
- func (p *BunProvider) Description() string
- func (p *BunProvider) Detect(logger logger.Logger, dir string, state map[string]any) (*Detection, error)
- func (p *BunProvider) Framework() string
- func (p *BunProvider) Identifier() string
- func (p *BunProvider) Language() string
- func (p *BunProvider) Name() string
- func (p *BunProvider) NewProject(logger logger.Logger, dir string, name string) error
- func (p *BunProvider) ProjectIgnoreRules() []string
- func (p *BunProvider) RunDev(logger logger.Logger, dir string, env []string, args []string) (Runner, error)
- func (p *BunProvider) Runtime() string
- type CrewAIProvider
- func (p *CrewAIProvider) Aliases() []string
- func (p *CrewAIProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
- func (p *CrewAIProvider) DefaultSrcDir() string
- func (p *CrewAIProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
- func (p *CrewAIProvider) Description() string
- func (p *CrewAIProvider) Detect(logger logger.Logger, dir string, state map[string]any) (*Detection, error)
- func (p *CrewAIProvider) Framework() string
- func (p *CrewAIProvider) Identifier() string
- func (p *CrewAIProvider) Language() string
- func (p *CrewAIProvider) Name() string
- func (p *CrewAIProvider) NewProject(logger logger.Logger, dir string, name string) error
- func (p *CrewAIProvider) ProjectIgnoreRules() []string
- func (p *CrewAIProvider) RunDev(logger logger.Logger, dir string, env []string, args []string) (Runner, error)
- func (p *CrewAIProvider) Runtime() string
- type DeployPreflightCheckData
- type Detection
- type EnvFile
- type NodeJSProvider
- func (p *NodeJSProvider) Aliases() []string
- func (p *NodeJSProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
- func (p *NodeJSProvider) DefaultSrcDir() string
- func (p *NodeJSProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
- func (p *NodeJSProvider) Description() string
- func (p *NodeJSProvider) Detect(logger logger.Logger, dir string, state map[string]any) (*Detection, error)
- func (p *NodeJSProvider) Framework() string
- func (p *NodeJSProvider) Identifier() string
- func (p *NodeJSProvider) Language() string
- func (p *NodeJSProvider) Name() string
- func (p *NodeJSProvider) NewProject(logger logger.Logger, dir string, name string) error
- func (p *NodeJSProvider) ProjectIgnoreRules() []string
- func (p *NodeJSProvider) RunDev(logger logger.Logger, dir string, env []string, args []string) (Runner, error)
- func (p *NodeJSProvider) Runtime() string
- type PromptHelpers
- type Provider
- type PyProject
- type PythonRunner
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProviders ¶
GetProviders will return the registered providers.
Types ¶
type BunProvider ¶
type BunProvider struct {
}
BunProvider is the provider implementation a generic Bun project.
func (*BunProvider) Aliases ¶ added in v0.0.10
func (p *BunProvider) Aliases() []string
func (*BunProvider) ConfigureDeploymentConfig ¶
func (p *BunProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
func (*BunProvider) DefaultSrcDir ¶ added in v0.0.17
func (p *BunProvider) DefaultSrcDir() string
func (*BunProvider) DeployPreflightCheck ¶ added in v0.0.5
func (p *BunProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
func (*BunProvider) Description ¶ added in v0.0.21
func (p *BunProvider) Description() string
func (*BunProvider) Framework ¶ added in v0.0.17
func (p *BunProvider) Framework() string
func (*BunProvider) Identifier ¶
func (p *BunProvider) Identifier() string
func (*BunProvider) Language ¶ added in v0.0.17
func (p *BunProvider) Language() string
func (*BunProvider) Name ¶
func (p *BunProvider) Name() string
func (*BunProvider) NewProject ¶
func (*BunProvider) ProjectIgnoreRules ¶
func (p *BunProvider) ProjectIgnoreRules() []string
func (*BunProvider) Runtime ¶ added in v0.0.17
func (p *BunProvider) Runtime() string
type CrewAIProvider ¶
type CrewAIProvider struct {
}
CrewAIProvider is the provider implementation for the CrewAI framework.
func (*CrewAIProvider) Aliases ¶ added in v0.0.10
func (p *CrewAIProvider) Aliases() []string
func (*CrewAIProvider) ConfigureDeploymentConfig ¶
func (p *CrewAIProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
func (*CrewAIProvider) DefaultSrcDir ¶ added in v0.0.17
func (p *CrewAIProvider) DefaultSrcDir() string
func (*CrewAIProvider) DeployPreflightCheck ¶ added in v0.0.5
func (p *CrewAIProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
func (*CrewAIProvider) Description ¶ added in v0.0.21
func (p *CrewAIProvider) Description() string
func (*CrewAIProvider) Framework ¶ added in v0.0.17
func (p *CrewAIProvider) Framework() string
func (*CrewAIProvider) Identifier ¶
func (p *CrewAIProvider) Identifier() string
func (*CrewAIProvider) Language ¶ added in v0.0.17
func (p *CrewAIProvider) Language() string
func (*CrewAIProvider) Name ¶
func (p *CrewAIProvider) Name() string
func (*CrewAIProvider) NewProject ¶
func (*CrewAIProvider) ProjectIgnoreRules ¶
func (p *CrewAIProvider) ProjectIgnoreRules() []string
func (*CrewAIProvider) Runtime ¶ added in v0.0.17
func (p *CrewAIProvider) Runtime() string
type DeployPreflightCheckData ¶ added in v0.0.5
type DeployPreflightCheckData struct {
// Dir returns the full path to the project folder
Dir string
// APIClient is for communicating with the backend
APIClient *util.APIClient
// APIURL is the base url to the API
APIURL string
// APIKey is the projects api key
APIKey string
// Envfile if the project has a .env file and the parsed contents of that file
Envfile *EnvFile
// Project is the project data
Project *project.Project
// ProjectData is the project data loaded from the backend
ProjectData *project.ProjectData
// Config is the deployment configuration
Config *project.DeploymentConfig
// PromptHelpers are a set of funcs to assist in prompting the user on the command line
PromptHelpers PromptHelpers
// OS Environment as a map
OSEnvironment map[string]string
}
type Detection ¶
type Detection struct {
Provider string `json:"provider"` // the name of the provider
Name string `json:"name,omitempty"` // the optional name of the project
Description string `json:"description,omitempty"` // the optional name of the description
Version string `json:"version,omitempty"` // the optional version of the project
}
Detection is the structure that is returned by the Detect function.
type NodeJSProvider ¶ added in v0.0.10
type NodeJSProvider struct {
}
NodeJSProvider is the provider implementation a generic Node project.
func (*NodeJSProvider) Aliases ¶ added in v0.0.10
func (p *NodeJSProvider) Aliases() []string
func (*NodeJSProvider) ConfigureDeploymentConfig ¶ added in v0.0.10
func (p *NodeJSProvider) ConfigureDeploymentConfig(config *project.DeploymentConfig) error
func (*NodeJSProvider) DefaultSrcDir ¶ added in v0.0.17
func (p *NodeJSProvider) DefaultSrcDir() string
func (*NodeJSProvider) DeployPreflightCheck ¶ added in v0.0.10
func (p *NodeJSProvider) DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
func (*NodeJSProvider) Description ¶ added in v0.0.21
func (p *NodeJSProvider) Description() string
func (*NodeJSProvider) Framework ¶ added in v0.0.17
func (p *NodeJSProvider) Framework() string
func (*NodeJSProvider) Identifier ¶ added in v0.0.10
func (p *NodeJSProvider) Identifier() string
func (*NodeJSProvider) Language ¶ added in v0.0.17
func (p *NodeJSProvider) Language() string
func (*NodeJSProvider) Name ¶ added in v0.0.10
func (p *NodeJSProvider) Name() string
func (*NodeJSProvider) NewProject ¶ added in v0.0.10
func (*NodeJSProvider) ProjectIgnoreRules ¶ added in v0.0.10
func (p *NodeJSProvider) ProjectIgnoreRules() []string
func (*NodeJSProvider) Runtime ¶ added in v0.0.17
func (p *NodeJSProvider) Runtime() string
type PromptHelpers ¶ added in v0.0.5
type PromptHelpers struct {
// ShowSpinner will show a spinner with the title while the action is running
ShowSpinner func(logger logger.Logger, title string, action func())
// PrintSuccess will print a check mark and the message provided with optional formatting arguments
PrintSuccess func(msg string, args ...any)
// PrintLock will print a lock and the message provided with optional formatting arguments
PrintLock func(msg string, args ...any)
// PrintLock will print an X mark and the message provided with optional formatting arguments
PrintWarning func(msg string, args ...any)
// CommandString will format a CLI command
CommandString func(cmd string, args ...string) string
// LinkString will return a formatted URL string
LinkString func(cmd string, args ...any) string
// Ask will ask the user for input and return true (confirm) or false (no!)
Ask func(logger logger.Logger, title string, defaultValue bool) bool
// PromptForEnv is a helper for prompting the user to get a environment (or secret) value. You must do something with the result such as save it.
PromptForEnv func(logger logger.Logger, key string, isSecret bool, localenv map[string]string, osenv map[string]string) string
}
type Provider ¶
type Provider interface {
// Name will return the name of the provider in a format that is easy to use in a CLI.
Name() string
// Description will return the description of the provider in a format that is easy to use in a CLI.
Description() string
// Identifier will return the identifier of the provider in a format that is easy to use in a CLI.
Identifier() string
// Aliases will return any aliases for the provider for identifier alternatives.
Aliases() []string
// Language will return the language of the provider.
Language() string
// Framework will return the framework of the provider.
Framework() string
// Runtime will return the runtime of the provider.
Runtime() string
// DefaultSrcDir will return the default source directory for the agent project
DefaultSrcDir() string
// Detect will detect the provider for the given directory.
// It will return the detection if it is found, otherwise it will return nil.
Detect(logger logger.Logger, dir string, state map[string]any) (*Detection, error)
// NewProject will create a new project for the given provider.
NewProject(logger logger.Logger, dir string, name string) error
// RunDev will run the development mode for the given provider.
// It will return the runner if it is found, otherwise it will return nil.
RunDev(logger logger.Logger, dir string, env []string, args []string) (Runner, error)
// ProjectIgnoreRules should return any additional project specific deployment ignore rules.
ProjectIgnoreRules() []string
// DeployPreflightCheck is called before cloud deployment to allow the provider to perform any preflight checks.
DeployPreflightCheck(logger logger.Logger, data DeployPreflightCheckData) error
// ConfigureDeploymentConfig will configure the deployment config for the given provider.
ConfigureDeploymentConfig(config *project.DeploymentConfig) error
}
Provider is the interface that is implemented by the provider to perform implementation specific logic.
func GetProviderForName ¶
GetProviderForName returns a provider registered as name or returns an error
type PyProject ¶
type PyProject struct {
Name string `toml:"name"`
Description string `toml:"description"`
Version string `toml:"version"`
RequiresPython string `toml:"requires-python"`
Dependencies []string `toml:"dependencies"`
}
PyProject is the structure that is used to parse the pyproject.toml file.
type PythonRunner ¶
type PythonRunner struct {
// contains filtered or unexported fields
}
PythonRunner is the runner implementation for python projects.
func (*PythonRunner) Done ¶
func (p *PythonRunner) Done() chan struct{}
func (*PythonRunner) Restart ¶
func (p *PythonRunner) Restart() chan struct{}
func (*PythonRunner) Start ¶
func (p *PythonRunner) Start() error
func (*PythonRunner) Stop ¶
func (p *PythonRunner) Stop() error
type Runner ¶
type Runner interface {
// Start will start the runner.
Start() error
// Stop will stop the runner.
Stop() error
// Restart will restart the runner.
Restart() chan struct{}
// Done will return a channel that is closed when the runner is done.
Done() chan struct{}
}
Runner is the interface that is implemented by the provider for running the project.