privfile

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package privfile writes files only their owner can read: the token file (internal/auth) and the cache (internal/cache), which holds portfolio data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(path string, data []byte) error

Write replaces the file at path with data, in one step: data goes to a temporary file next to it, which is then renamed over it. A crash leaves the old file or the new one, never half of either, and a reader never sees a file being written. os.CreateTemp makes the file 0600 from the start, so it is never readable by others, not even for a moment. A missing directory is made 0700.

Types

This section is empty.

Jump to

Keyboard shortcuts

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