identity

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package identity persists the user's name and email across runs so the identify screen can pre-fill the form. Stored as a plain JSON file in the OS-native user-config directory — this is convenience data, not a secret.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() (string, error)

Path returns the absolute path to the identity file under the OS user config dir, creating the parent dir on demand. An error here is fatal — callers can't persist without it.

func Save

func Save(id Identity) error

Save writes the identity to disk. Non-atomic — good enough for a file this small; a truncated write still parses or silently returns zero values on next load.

Types

type Identity

type Identity struct {
	FullName string `json:"full_name"`
	Email    string `json:"email"`
}

func Load

func Load() Identity

Load returns the saved identity, or a zero-value Identity if no file exists yet. Parse errors are ignored — a corrupt file behaves like no file.

Jump to

Keyboard shortcuts

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