config

package
v0.0.0-...-22661af Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfDir holds the path for wapty configuration directory
	ConfDir = path.Join(getUserHomeDir(), ".wapty")
	// ConfName holds the basename of the configuration file
	ConfName = "wapty-conf.json"
)

Functions

func LoadConf

func LoadConf()

LoadConf loads the configuration from the default conf file WARNING: this function may panic

func SaveConf

func SaveConf()

SaveConf saves the current configuration into the default conf file WARNING: this function may panic

Types

type Configuration

type Configuration struct {
	RecentProjects []string
	Workspaces     []string
}

Configuration represents the struct holding all of wapty settings but not the saved status

type Project

type Project []SaveLoadStringer

Project is a collection of SaveLoadStringers

func NewProject

func NewProject(SLSs ...SaveLoadStringer) Project

NewProject returns a Project as a collection of the given SaveLoadStringers

func (Project) LoadAll

func (p Project) LoadAll(workspace string) error

LoadAll invokes all the "Load" methods of the project, deflating a zip file containing the status.

func (Project) SaveAll

func (p Project) SaveAll(workspace string) error

SaveAll invokes all the "Save" methods of the project, creating a zip file containing the status. The old file will be removed only on successful save.

type SaveLoadStringer

type SaveLoadStringer interface {
	Save(io.Writer) error
	Load(io.Reader) error
	// for debug purposes
	fmt.Stringer
}

SaveLoadStringer represents a unit of wapty that allows resuming a previous state

Jump to

Keyboard shortcuts

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