handler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

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 ErrActionNotSupportedForGame added in v0.1.2

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

func (*ErrActionNotSupportedForGame) Error added in v0.1.2

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)
	DirExists(path string) (bool, error)
	WriteFile(path string, data []byte, perm os.FileMode) error
	ReadFile(path string) ([]byte, error)
	ReadDir(path string) ([]os.DirEntry, error)
	Glob(pattern string) ([]string, error)
	RemoveAll(path string) 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)

Build path to the root folder for given game's configuration

func (*Handler) BuildProfilesFolderPath added in v0.1.2

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

Build path to the folder containing given game's profile configuration

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) PurgeLogoCache added in v0.1.2

func (h *Handler) PurgeLogoCache(game Game) error

Delete all cached server banner images [Refractor v2 games only]

func (*Handler) PurgeShaderCache added in v0.1.2

func (h *Handler) PurgeShaderCache(game Game) error

Delete all shader cache (.cfx) files [Refractor v2 games only]

func (*Handler) ReadConfigFile added in v0.1.0

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

Read the config file at given path

func (*Handler) ReadGlobalConfig

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

Read central profile configuration file (primarily contains reference to current default profile)

func (*Handler) ReadProfileConfig

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

Read the profile configuration file for the specified profile

func (*Handler) WriteConfigFile added in v0.1.0

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

Write the given config file to disk

Jump to

Keyboard shortcuts

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