state

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package state provides generic JSON state persistence and port resolution shared across databricks-claude, databricks-codex, and databricks-opencode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load[T any](path string) (T, error)

Load reads and unmarshals JSON from path into a value of type T. Returns the zero value if the file does not exist or cannot be parsed.

func ResolvePort

func ResolvePort(flagPort, savedPort, defaultPort int) int

ResolvePort returns the port to use, following the resolution chain:

  1. flagPort (if > 0)
  2. savedPort (if > 0)
  3. defaultPort

func Save

func Save[T any](path string, v T) error

Save atomically writes v as indented JSON to path. Parent directories are created as needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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