dirs

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

GitHub

dirs

Introduction

  • a tiny low-level library with a minimal API
  • that provides the platform-specific, user-accessible locations
  • for retrieving and storing configuration, cache and other data
  • on Linux, Windows, macOS and other platforms.

The library provides the location of these directories by leveraging the mechanisms defined by

Platforms

This library is written in Go, and supports Linux, macOS and Windows. Other platforms are also supported; they use the XDG conventions.

It's mid-level sister library, directories, is available for Rust (directories-rs) and on the JVM (directories-jvm).

License

Licensed under Apache License 2.0.

Documentation

Overview

Copyright 2022 Rishvic Pushpakaran

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("directory not found")

Functions

func AudioDir

func AudioDir() (string, error)

func CacheDir

func CacheDir() (string, error)

func ConfigDir

func ConfigDir() (string, error)

func DataDir

func DataDir() (string, error)

func DataLocalDir

func DataLocalDir() (string, error)

func DesktopDir

func DesktopDir() (string, error)

func DocumentDir

func DocumentDir() (string, error)

func DownloadDir

func DownloadDir() (string, error)

func ExecutableDir

func ExecutableDir() (string, error)

func FontDir

func FontDir() (string, error)

func HomeDir

func HomeDir() (string, error)

func PictureDir

func PictureDir() (string, error)

func PreferenceDir

func PreferenceDir() (string, error)

func PublicDir

func PublicDir() (string, error)

func RuntimeDir

func RuntimeDir() (string, error)

func StateDir

func StateDir() (string, error)

func TemplateDir

func TemplateDir() (string, error)

func VideoDir

func VideoDir() (string, error)

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(f func() (string, error)) *Cache

func (*Cache) Cur

func (c *Cache) Cur() (string, error)

func (*Cache) Reset

func (c *Cache) Reset()

Directories

Path Synopsis
pkg
xdg

Jump to

Keyboard shortcuts

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