config

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config manages ~/.seictl/config.json — the per-engineer alias and operating namespace seictl reads on every cluster-facing invocation.

  • File mode 0600, parent dir 0700.
  • Read refuses to proceed if perms are loose.
  • Two fields: alias, namespace.

Convention enforcement (e.g. namespace = "eng-<alias>" for engineer cells) lives in the writer side — `seictl onboard`. Verbs read namespace verbatim so non-engineer flows (nightly, CI) can drop a shim with whatever namespace they operate against.

Index

Constants

View Source
const (
	FileMode os.FileMode = 0o600
	DirMode  os.FileMode = 0o700
)

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns ~/.seictl/config.json.

func Write

func Write(path string, c Config) *clioutput.Error

Write atomically writes the config to path with mode 0600 and ensures the parent directory is 0700. Refuses if an existing parent directory has loose perms — silently tightening would mask a security concern.

Types

type Config

type Config struct {
	Alias     string `json:"alias"`
	Namespace string `json:"namespace"`
}

func Read

func Read(path string) (*Config, *clioutput.Error)

Read returns the config at path. Refuses if the file has any group or world permission bits set.

Jump to

Keyboard shortcuts

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