storage

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLaunchDelay = 1000

DefaultLaunchDelay is used if a launch delay hasn't been set by a user.

View Source
const (

	// Permissions are the directory permissions for storage.
	Permissions = 0755
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Games       []Game `json:"games"`
	LaunchDelay int    `json:"launch_delay"`
}

Config is the configuration required to run the app.

type Game

type Game struct {
	ID             string   `json:"id"`
	Location       string   `json:"location"`
	Instances      int      `json:"instances"`
	OverrideBHCfg  bool     `json:"override_bh_cfg"`
	Flags          []string `json:"flags"`
	HDVersion      string   `json:"hd_version"`
	MaphackVersion string   `json:"maphack_version"`
}

Game represents a game setup by the user.

type Store

type Store interface {
	Load() error
	Read() (*Config, error)
	Write(config *Config) error
}

Store represents the data store while hiding implementation behind the interface.

func NewStore

func NewStore(path string) Store

NewStore returns a new store with all dependencies set up.

Jump to

Keyboard shortcuts

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