deploy

package
v10.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package deploy provides convention-based deploy directory discovery.

Index

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 Discover

func Discover(name string) *Deploy

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) Dir

func (d *Deploy) Dir() string

func (*Deploy) Endpoint

func (d *Deploy) Endpoint(name string) (Endpoint, bool)

Endpoint returns a single named endpoint and whether it was found.

func (*Deploy) Endpoints

func (d *Deploy) Endpoints() map[string]Endpoint

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) Found

func (d *Deploy) Found() bool

func (*Deploy) Health

func (d *Deploy) Health(components map[string]string) HealthStatus

Health returns a standard health status payload for the service.

func (*Deploy) LoadEnv

func (d *Deploy) LoadEnv()

func (*Deploy) Meta

func (d *Deploy) Meta() *DeployMeta

func (*Deploy) Name

func (d *Deploy) Name() string

func (*Deploy) Path

func (d *Deploy) Path(rel string) string

func (*Deploy) RunHook

func (d *Deploy) RunHook(name string) error

func (*Deploy) Spec

func (d *Deploy) Spec() string

func (*Deploy) TLS

func (d *Deploy) TLS() (TLSPaths, bool)

type DeployMeta

type DeployMeta struct {
	Version    string         `json:"version"`
	MinVersion string         `json:"min_version"`
	Notes      string         `json:"notes"`
	Resources  map[string]any `json:"resources"`
}

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
}

func (*FlagLookup) Lookup

func (f *FlagLookup) Lookup(name string) (string, bool)

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.

type TLSPaths

type TLSPaths struct {
	Cert string
	Key  string
	CA   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL