config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config handles the interactions with C3PM's various configuration files. It handles interaction with both the c3pm.yml file (see package manifest), and the storage of authentication tokens in the global C3PM directory as found by GlobalC3PMDirPath.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFilePath

func AuthFilePath() string

AuthFilePath returns the path to the global auth file.

func GlobalC3PMDirPath added in v0.1.0

func GlobalC3PMDirPath() string

GlobalC3PMDirPath finds the path to the global C3PM directory.

func LibCachePath

func LibCachePath(name, version string) string

LibCachePath returns the path to the global C3PM cache

func Token

func Token() string

Token returns an empty string if it fails to read token

func TokenStrict

func TokenStrict() (string, error)

TokenStrict gets the authentication token from the auth file.

Types

type ProjectConfig

type ProjectConfig struct {
	//Manifest is the representation of the contents of the c3pm.yml file.
	Manifest manifest.Manifest
	//ProjectRoot stores the absolute path to the C3PM project.
	ProjectRoot string
}

ProjectConfig represents the configuration of a C3PM project.

func Load

func Load(projectPath string) (*ProjectConfig, error)

Load takes the path of a project and creates the ProjectConfig object that represents the configuration of this project.

func (*ProjectConfig) LocalC3PMDirPath added in v0.1.0

func (pc *ProjectConfig) LocalC3PMDirPath() string

LocalC3PMDirPath returns the path to the local C3PM directory.

func (*ProjectConfig) Save

func (pc *ProjectConfig) Save() error

Save writes the current configuration and writes it to the project directory.

Directories

Path Synopsis
Package manifest handles loading and writing of the C3PM manifest file (usually c3pm.yml).
Package manifest handles loading and writing of the C3PM manifest file (usually c3pm.yml).

Jump to

Keyboard shortcuts

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