handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Read and parse Refractor engine configuration files (.con)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrGameNotSupported

type ErrGameNotSupported struct {
	// contains filtered or unexported fields
}

func (*ErrGameNotSupported) Error

func (e *ErrGameNotSupported) Error() string

type FileRepository added in v0.0.2

type FileRepository interface {
	FileExists(path string) (bool, error)
	WriteFile(path string, data []byte, perm os.FileMode) error
	ReadFile(path string) ([]byte, error)
	ReadDir(path string) ([]os.DirEntry, error)
}

type Game

type Game string
const (
	GameBf2 Game = "bf2"
)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(repository FileRepository) *Handler

func (*Handler) BuildBasePath added in v0.1.0

func (h *Handler) BuildBasePath(game Game) (string, error)

func (*Handler) GetProfileKeys added in v0.1.0

func (h *Handler) GetProfileKeys(game Game) ([]string, error)

Retrieve a list of profile keys (valid profile directories in the game's profile folder)

func (*Handler) IsValidProfileKey added in v0.1.0

func (h *Handler) IsValidProfileKey(game Game, profileKey string) (bool, error)

Checks whether a given profile key is valid (a profile with the given key exists)

func (*Handler) ReadConfigFile added in v0.1.0

func (h *Handler) ReadConfigFile(path string) (*config.Config, error)

func (*Handler) ReadGlobalConfig

func (h *Handler) ReadGlobalConfig(game Game) (*config.Config, error)

func (*Handler) ReadProfileConfig

func (h *Handler) ReadProfileConfig(game Game, profileKey string) (*config.Config, error)

func (*Handler) WriteConfigFile added in v0.1.0

func (h *Handler) WriteConfigFile(c *config.Config) error

Jump to

Keyboard shortcuts

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