config

package
v0.0.0-...-d04ce0e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ensure

func Ensure(cfg *Config) error

Ensure function will check for required configuration values that are missing. If they do, they will be requested from Stdin.

func Export

func Export(configPath string, config Config, parents bool) error

Export function creates a config.yaml file at the specified config path using the config struct provided.

If parents is set to true, the given directory path will be created (if not existed)

func ExportDefault

func ExportDefault(config Config, parents bool) error

ExportDefault function creates a config.yaml file at the default path using the config struct provided.

If parents is set to true, the default directory path will be created (if not existed)

Types

type Config

type Config struct {
	Credentials auth.Credentials `yaml:"credentials"`
	Options     Options          `yaml:"options"`
	SecretKey   string           `yaml:"secretKey"`
}

func Import

func Import(configPath string) (*Config, error)

Import function will read options and credentials from the given path of a yaml file. If the config file is missing, it will be created with default values.

func ImportDefault

func ImportDefault() (*Config, error)

Import function will read options and credentials from the given path of a yaml file. If the config file is missing, it will be created with default values.

type Options

type Options struct {
	PlainText           bool                `yaml:"plainText"`
	IncludeExpired      bool                `yaml:"includeExpired"`
	ExportICS           bool                `yaml:"exportICS"`
	ExcludedAssignments map[string][]string `yaml:"excludedAssignments"`
	course.Options      `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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