state

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package state persists the details of a running SoloEnv environment so that later commands (down, status) can find and clean it up.

Index

Constants

View Source
const (
	ModeCompose    = "compose"
	ModeDockerfile = "dockerfile"
)

Variables

This section is empty.

Functions

func Dir

func Dir(projectDir string) string

func Exists

func Exists(projectDir string) bool

func Path

func Path(projectDir string) string

func Remove

func Remove(projectDir string) error

func Save

func Save(projectDir string, s *State) error

Types

type State

type State struct {
	ProjectDir   string     `json:"project_dir"`
	URL          string     `json:"url"`
	TunnelPID    int        `json:"tunnel_pid"`
	TunnelPort   int        `json:"tunnel_port"` // port cloudflared targets (may be auth proxy)
	AppPort      int        `json:"app_port"`
	AuthProxyPID int        `json:"auth_proxy_pid,omitempty"`
	AuthEnabled  bool       `json:"auth_enabled"`
	AuthUser     string     `json:"auth_user,omitempty"`
	Detached     bool       `json:"detached"`
	ExpiresAt    *time.Time `json:"expires_at,omitempty"`
	WatcherPID   int        `json:"watcher_pid,omitempty"`
	Mode         string     `json:"mode"`
	ComposeFile  string     `json:"compose_file,omitempty"`
	ContainerID  string     `json:"container_id,omitempty"`
	ImageTag     string     `json:"image_tag,omitempty"`
	StartedAt    time.Time  `json:"started_at"`
}

State is the on-disk record of a live environment.

func Load

func Load(projectDir string) (*State, error)

func (*State) Expired

func (s *State) Expired() bool

Expired reports whether the environment passed its TTL deadline.

Jump to

Keyboard shortcuts

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