profile

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidName = errors.New("invalid profile name")
	ErrNameInUse   = errors.New("name in use")
	ErrNotFound    = errors.New("profile not found")
)

Functions

func IsValidName

func IsValidName(name string) bool

Types

type Config

type Config struct {
	Java string `mapstructure:"java"` // The name of the java installation to use
}

Config represents all the profile specific configuration options. Options not specified in a profile config will be inherited from the global config.

type Manager

type Manager interface {
	// CreateProfile creates a new profile and fills in defaults.
	// The returned profile may be modified, and then Save will save it.
	CreateProfile(name string) (*Profile, error)

	Profiles() []string
	GetProfile(name string) (*Profile, error)

	Save() error
}

func NewManager

func NewManager(dataDir string) (Manager, error)

type Profile

type Profile struct {
	Name      string `json:"name"`
	Directory string `json:"directory"`

	Type Type `json:"type"`
	// Version represents the Minecraft version of the profile.
	// Present no matter the type (except Unknown)
	Version string `json:"version"`
	// contains filtered or unexported fields
}

func (*Profile) Config

func (p *Profile) Config() *Config

type Type

type Type int
const (
	// Unknown indicates that the profile has not been installed yet.
	Unknown Type = iota
	Vanilla
	Fabric
)

Jump to

Keyboard shortcuts

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