dir

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dir provides functions to manage the config directories.

Index

Constants

This section is empty.

Variables

View Source
var ErrNetwork = goerrors.NewKind("network error downloading %s")

ErrNetwork is returned when could not download

View Source
var ErrNotExist = goerrors.NewKind("%s does not exist")

ErrNotExist is returned when config dir does not exists

View Source
var ErrNotValid = goerrors.NewKind("%s is not a valid config directory: %s")

ErrNotValid is returned when config dir is not valid

View Source
var ErrWrite = goerrors.NewKind("write error at %s")

ErrWrite is returned when could not write

Functions

func DownloadURL

func DownloadURL(url, dst string) (err error)

DownloadURL downloads the given url to a file to the dst path, creating the directory if it's needed

func Path

func Path() (string, error)

Path returns the absolute path for $SOURCED_DIR, or $HOME/.sourced if unset and returns an error if it does not exist or it could not be read.

func Prepare

func Prepare() error

Prepare tries to create the config directory, returning an error if it could not be created, or nil if already exist or was successfully created.

func TmpPath

func TmpPath() string

TmpPath returns the absolute path for /tmp/srcd

Types

This section is empty.

Jump to

Keyboard shortcuts

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