memory

package
v0.73.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GlobalMaxBytes  = 8 * 1024
	ProjectMaxBytes = 16 * 1024
)

Variables

This section is empty.

Functions

func Add added in v0.73.0

func Add(content, section, entry string) (string, error)

Add appends entry under the "## section" heading, creating the section at the end of the file if missing. An empty section appends to the end of the file.

func CapFor added in v0.73.0

func CapFor(scope Scope) int

func ContainsSecret

func ContainsSecret(content string) bool

func FormatSize added in v0.73.0

func FormatSize(n int) string

func GlobalPath

func GlobalPath() string

func Load

func Load(workingDir string) string

func LoadAt

func LoadAt(globalPath, projectPath string) string

func ProjectPath

func ProjectPath(workingDir string) string

func Replace added in v0.73.0

func Replace(content, oldText, newText string) (string, error)

Replace swaps oldText for newText. oldText must occur exactly once. An empty newText removes the entry along with the blank lines it leaves behind.

Types

type File

type File struct {
	Path    string
	Scope   Scope
	Exists  bool
	Content string
}

func Files

func Files(workingDir string) (global, project File)

func FilesAt

func FilesAt(globalPath, projectPath string) (global, project File)

type Scope

type Scope string
const (
	ScopeGlobal  Scope = "Global"
	ScopeProject Scope = "Project"
)

Jump to

Keyboard shortcuts

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