profile

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package profile keeps each character's play style on the player's own machine (the user config directory, never a repo).

Index

Constants

View Source
const Env = "WOWC_PROFILES"

Env overrides the store's path.

View Source
const (
	MaxField = 120
)

Limits on what is stored.

Variables

View Source
var (
	Roles = []string{"damage", "tank", "healer", "balanced"}
	Foci  = []string{"leveling", "dungeons", "pvp", "mixed"}
	// StatPrefs are the optional stat preferences ("" is balanced): see the stats package.
	StatPrefs = []string{"", "balanced", "damage", "survival"}
)

Allowed values, first is listed first in the question the model asks.

Functions

func Ask

func Ask() string

Ask is the short multiple-choice question the model puts to a player who has no saved play style, before it gives any talent advice. The answer is saved with set_character_profile.

func Attach

Attach returns c with its stored profile and plan; c is unchanged when path holds neither.

func Clean

Clean checks a profile: role and focus are from the allowed lists (case-insensitive, lower-cased on save) and the spec is short text.

func Path

func Path() string

Path is the store file: $WOWC_PROFILES, else <user config dir>/wowc-advisor/profiles.json; empty when the system has no config directory.

Types

type Entry

type Entry struct {
	Profile *character.Profile `json:"profile,omitempty"`
}

Entry is everything stored for one character.

func Get

func Get(path, key string) Entry

Get reads one character's entry; the zero Entry when there is none or the file is unreadable.

func Update

func Update(path, key string, fn func(*Entry) error) (Entry, error)

Update reads the character's entry, lets fn change it and writes the file back atomically (mode 0600). A file that cannot be parsed is an error, never overwritten.

Jump to

Keyboard shortcuts

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