admin

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlueGreenManager

type BlueGreenManager struct {
	// contains filtered or unexported fields
}

BlueGreenManager manages blue-green deployments

func NewBlueGreenManager

func NewBlueGreenManager(initialColor string, bluePort, greenPort int) *BlueGreenManager

NewBlueGreenManager creates a new blue-green deployment manager

func (*BlueGreenManager) GetStatus

func (bgm *BlueGreenManager) GetStatus() BlueGreenStatus

GetStatus returns the current blue-green deployment status

func (*BlueGreenManager) RegisterHandlers

func (bgm *BlueGreenManager) RegisterHandlers(mux *http.ServeMux)

RegisterHandlers registers blue-green HTTP handlers

func (*BlueGreenManager) Switch

Switch switches the active deployment from current to target color

type BlueGreenStatus

type BlueGreenStatus struct {
	CurrentActive string          `json:"current_active"`
	Blue          DeploymentColor `json:"blue"`
	Green         DeploymentColor `json:"green"`
	CanSwitch     bool            `json:"can_switch"`
	SwitchMessage string          `json:"switch_message,omitempty"`
}

BlueGreenStatus represents the current blue-green deployment status

type DeploymentColor

type DeploymentColor struct {
	Color       string    `json:"color"`
	Port        int       `json:"port"`
	Version     string    `json:"version"`
	Active      bool      `json:"active"`
	Healthy     bool      `json:"healthy"`
	NodeCount   uint64    `json:"node_count"`
	EdgeCount   uint64    `json:"edge_count"`
	LastChecked time.Time `json:"last_checked"`
}

DeploymentColor represents a deployment environment

type HealthChecker

type HealthChecker struct {
	// contains filtered or unexported fields
}

HealthChecker performs health checks on deployments

func (*HealthChecker) Check

func (hc *HealthChecker) Check(port int) bool

Check performs a health check on the given port

func (*HealthChecker) FetchVersion

func (hc *HealthChecker) FetchVersion(baseURL string) (string, error)

FetchVersion fetches the version from a deployment's health endpoint

type SwitchRequest

type SwitchRequest struct {
	TargetColor string        `json:"target_color"` // "blue" or "green"
	Timeout     time.Duration `json:"timeout"`
	DrainTime   time.Duration `json:"drain_time"` // Time to drain existing connections
}

SwitchRequest represents a request to switch active deployment

type SwitchResponse

type SwitchResponse struct {
	Success       bool      `json:"success"`
	PreviousColor string    `json:"previous_color"`
	NewColor      string    `json:"new_color"`
	Message       string    `json:"message"`
	SwitchedAt    time.Time `json:"switched_at"`
}

SwitchResponse represents the result of a deployment switch

Jump to

Keyboard shortcuts

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