Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config loads ~/.config/d2l/config.toml and resolves XDG paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir added in v0.2.0

func CacheDir() string

CacheDir holds files downloaded to be opened.

func Dir

func Dir() string

func EnsureFile

func EnsureFile() (string, error)

EnsureFile writes the default config if none exists and returns its path.

func Path

func Path() string

func StateDir

func StateDir() string

Types

type Config

type Config struct {
	// BaseURL is the Brightspace instance, without a trailing slash.
	BaseURL string `toml:"base_url"`
	// Browser is the browser `d2l login` launches, as a path or command. Empty means the default browser.
	Browser string `toml:"browser"`
	// Openers maps a file extension (no dot) to a command that runs detached, e.g. pdf = "zathura".
	Openers map[string]string `toml:"openers"`
	// TerminalOpeners maps an extension to a command that takes over the terminal, e.g. md = "nvim".
	TerminalOpeners map[string]string `toml:"terminal_openers"`
	// Concurrency is the number of parallel downloads.
	Concurrency int `toml:"concurrency"`
}

func Load

func Load() (*Config, error)

Jump to

Keyboard shortcuts

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