datadir

package
v0.0.0-...-2759aa6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir() (string, error)

Dir returns the path to the data directory for the current user Usually, this is ~/.vite

func SetHomeDir

func SetHomeDir(home string)

SetHomeDir sets the home directory for the current user

func UseTestHome

func UseTestHome(t *testing.T) string

UseTestHome is for unit testing only. It sets the dataDir to a temporary directory that is cleaned up after the test.

Types

type Store

type Store string

Store contains the name of the subdirectory in the data directory For example Store(certs) would return ~/.vite/certs

func (Store) Dir

func (s Store) Dir() (string, error)

Dir returns the store directory for the current user.

func (Store) Open

func (s Store) Open(path string, flags int, perm os.FileMode) (*os.File, error)

Open is a convenience method to open a file from the current Store

func (Store) String

func (s Store) String() string

String returns the string representation of the Store

Jump to

Keyboard shortcuts

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