paths

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 6 Imported by: ? 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

Overview

Package paths returns the per-user directories an application keeps its files in, on every platform Tango runs on.

On desktop each directory is the platform's conventional location with the app ID appended; the app ID should be a reverse-DNS name such as "com.example.notes". Mobile apps are sandboxed, so there the ID is not appended.

           Config                     Data                        Cache                    Logs
macOS      ~/Library/Application      ~/Library/Application       ~/Library/Caches/ID      ~/Library/Logs/ID
           Support/ID                 Support/ID
Windows    %AppData%\ID               %LocalAppData%\ID           %LocalAppData%\ID\Cache  %LocalAppData%\ID\Logs
Linux/BSD  $XDG_CONFIG_HOME/ID        $XDG_DATA_HOME/ID           $XDG_CACHE_HOME/ID       $XDG_STATE_HOME/ID/logs
iOS        $HOME/Library/Application  $HOME/Library/Application   $HOME/Library/Caches     $HOME/Library/Caches/Logs
           Support                    Support/Data
Android    $HOME/config               $HOME/data                  $HOME/cache              $HOME/logs

The functions only compute paths; call os.MkdirAll before use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache(appID string) (string, error)

Cache returns For(appID).Cache.

func Config

func Config(appID string) (string, error)

Config returns For(appID).Config.

func Data

func Data(appID string) (string, error)

Data returns For(appID).Data.

func Logs

func Logs(appID string) (string, error)

Logs returns For(appID).Logs.

Types

type Dirs

type Dirs struct {
	Config string // settings the user would miss if lost
	Data   string // documents, databases and other durable state
	Cache  string // files that can be recreated; the OS may delete them
	Logs   string // log files
}

Dirs are an application's directories.

func For

func For(appID string) (Dirs, error)

For returns the directories of the app with the given ID on this platform.

Jump to

Keyboard shortcuts

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