usereditor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileChanged

func CheckFileChanged(path string, storedMtime time.Time) bool

CheckFileChanged compares the current mtime of the file against a stored mtime. Returns true if the file was modified externally.

func CloneUser

func CloneUser(u *user.User) *user.User

CloneUser creates a deep copy of a user record.

func LoadUsers

func LoadUsers(path string) ([]*user.User, time.Time, error)

LoadUsers reads users.json and returns the user slice plus the file's mtime.

func SaveUsers

func SaveUsers(path string, users []*user.User) (time.Time, error)

SaveUsers writes the user slice to disk atomically (temp file + rename). Returns the new file mtime after writing.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the BubbleTea model for the user editor TUI.

func New

func New(filePath string) (Model, error)

New creates a new user editor model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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