Documentation
¶
Overview ¶
Package deploy is the togo deployment subsystem — a provider-agnostic Deployer contract. Real targets (terraform, docker, kubernetes, the clouds, and VPS distros) ship as driver plugins that call deploy.RegisterDriver in their init(); pick one with DEPLOY_PROVIDER (or `deploy.provider` in togo.yaml). The CLI's `togo deploy` resolves the provider and calls Build/Deploy without booting the app.
Index ¶
- func Drivers() []string
- func RegisterDriver(name string, f DriverFactory)
- type Deployer
- type DriverFactory
- type Result
- type Service
- func (s *Service) Deploy(ctx context.Context, spec Spec) (*Result, error)
- func (s *Service) Deployer() Deployer
- func (s *Service) Destroy(ctx context.Context, spec Spec) error
- func (s *Service) Driver() string
- func (s *Service) Provision(ctx context.Context, spec Spec) (*Result, error)
- func (s *Service) Status(ctx context.Context, spec Spec) (*Status, error)
- type Spec
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Drivers ¶
func Drivers() []string
Drivers lists the registered driver names (sorted) — handy for `togo deploy --list`.
func RegisterDriver ¶
func RegisterDriver(name string, f DriverFactory)
RegisterDriver registers a deploy driver by name (call from a plugin's init()).
Types ¶
type Deployer ¶
type Deployer interface {
Provision(ctx context.Context, spec Spec) (*Result, error) // create/ensure infrastructure
Deploy(ctx context.Context, spec Spec) (*Result, error) // ship the app
Destroy(ctx context.Context, spec Spec) error // tear it down
Status(ctx context.Context, spec Spec) (*Status, error)
}
Deployer is implemented by driver plugins. Not every target supports every operation — return a clear error for the unsupported ones.
type DriverFactory ¶
DriverFactory builds a Deployer from the kernel (env-configured).
type Result ¶
type Result struct {
URL string // public URL if known
Message string // human summary
Raw map[string]any // provider raw response
}
Result of a deploy/provision.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the deploy runtime stored on the kernel (k.Get("deploy")).
func FromKernel ¶
FromKernel fetches the deploy service from the kernel container.
type Spec ¶
type Spec struct {
App string // app name
Dir string // project directory
BuildCmd string // local build command (optional)
Binary string // built artifact path (for VPS drivers)
Image string // container image ref (for docker/k8s)
Env map[string]string // runtime env
Host string // target host / cluster endpoint
User string // ssh user (VPS drivers)
Domain string // public domain
Region string // cloud region
Options map[string]any // provider-specific knobs
}
Spec describes what to deploy. Drivers use the fields they need.