statepath

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package statepath provides helpers for resolving OSS state directory paths with one-release backward-compat migration from ~/.rensei/ to ~/.donmai/.

Migration policy:

  • Canonical path is ~/.donmai/<file>
  • If ~/.donmai/ does not exist but ~/.rensei/ does, the legacy path is returned with a one-time stderr warning.
  • Once ~/.donmai/ exists, the legacy path is ignored.
  • New writes always go to ~/.donmai/.
  • ~/Library/Logs/rensei/ is shared with the closed-source rensei binary and is NOT migrated here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(suffix, tmpFallback string) string

Resolve returns the path to use for a state file under the ~/.donmai/ directory, with a one-release fallback to ~/.rensei/ if the new directory does not yet exist.

fallbackSuffix is the path suffix under the home dir, e.g. "daemon.yaml". The function constructs both ~/.donmai/<suffix> and ~/.rensei/<suffix>, checks which base directory exists, and returns the appropriate path.

tmpFallback is used when os.UserHomeDir() fails (e.g. in some test envs).

Types

This section is empty.

Jump to

Keyboard shortcuts

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