Documentation
¶
Overview ¶
Package deploy provides convention-based deploy directory discovery.
Index ¶
- type Dependency
- type Deploy
- func (d *Deploy) Dependencies() []Dependency
- func (d *Deploy) Dir() string
- func (d *Deploy) Endpoint(name string) (Endpoint, bool)
- func (d *Deploy) Endpoints() map[string]Endpoint
- func (d *Deploy) Environment() Environment
- func (d *Deploy) FlagSource() *FlagLookup
- func (d *Deploy) Found() bool
- func (d *Deploy) Health(components map[string]string) HealthStatus
- func (d *Deploy) LoadEnv()
- func (d *Deploy) Meta() *DeployMeta
- func (d *Deploy) Name() string
- func (d *Deploy) Path(rel string) string
- func (d *Deploy) RunHook(name string) error
- func (d *Deploy) Spec() string
- func (d *Deploy) TLS() (TLSPaths, bool)
- type DeployMeta
- type Endpoint
- type Environment
- type FlagLookup
- type HealthStatus
- type TLSPaths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Service string `json:"service"`
Endpoint string `json:"endpoint,omitempty"`
Protocol string `json:"protocol,omitempty"`
Port int `json:"port,omitempty"`
Required *bool `json:"required,omitempty"`
}
Dependency describes a service dependency.
type Deploy ¶
type Deploy struct {
// contains filtered or unexported fields
}
func (*Deploy) Dependencies ¶
func (d *Deploy) Dependencies() []Dependency
Dependencies returns the list of service dependencies from deploy.json. Required defaults to true when omitted.
func (*Deploy) Endpoints ¶
Endpoints returns all named endpoints from deploy.json. Protocol defaults to "http" when omitted.
func (*Deploy) Environment ¶
func (d *Deploy) Environment() Environment
Environment returns auto-detected and operator-declared runtime info. It reads the "environment" block from deploy.json (if present), then applies env var overrides (CHASSIS_ENV, CHASSIS_PROVIDER, CHASSIS_REGION, CHASSIS_CLUSTER). For Kubernetes, it also reads namespace and pod name.
func (*Deploy) FlagSource ¶
func (d *Deploy) FlagSource() *FlagLookup
func (*Deploy) Health ¶
func (d *Deploy) Health(components map[string]string) HealthStatus
Health returns a standard health status payload for the service.
func (*Deploy) Meta ¶
func (d *Deploy) Meta() *DeployMeta
type DeployMeta ¶
type Endpoint ¶
type Endpoint struct {
Port int `json:"port"`
Protocol string `json:"protocol"`
Path string `json:"path,omitempty"`
}
Endpoint describes a named network endpoint for a service.
type Environment ¶
type Environment struct {
Runtime string `json:"runtime"`
Hostname string `json:"hostname"`
Service string `json:"service"`
Env string `json:"env,omitempty"`
Provider string `json:"provider,omitempty"`
Region string `json:"region,omitempty"`
Cluster string `json:"cluster,omitempty"`
Namespace string `json:"namespace,omitempty"`
PodName string `json:"pod_name,omitempty"`
}
Environment holds auto-detected and operator-declared runtime info.
type FlagLookup ¶
type FlagLookup struct {
// contains filtered or unexported fields
}
type HealthStatus ¶
type HealthStatus struct {
Service string `json:"service"`
Version string `json:"version,omitempty"`
ChassisSpec string `json:"chassis_spec,omitempty"`
Runtime string `json:"runtime"`
Uptime float64 `json:"uptime"`
Environment string `json:"environment,omitempty"`
Endpoints map[string]Endpoint `json:"endpoints,omitempty"`
Components map[string]string `json:"components,omitempty"`
}
HealthStatus is the standard health payload for a service.