semantic

package
v1.64.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: AGPL-3.0, AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

ORM mapper for Freelancer ini reader. Easy mapping values to change.

Index

Constants

View Source
const PATH_SEPARATOR = `/`

Variables

View Source
var InheritKey = cfg.Key("inherit")

Functions

This section is empty.

Types

type Bool

type Bool struct {
	*Value
	// contains filtered or unexported fields
}

func NewBool

func NewBool(section *inireader.Section, key cfg.ParamKey, bool_type BoolType, opts ...ValueOption) *Bool

func (*Bool) Delete

func (s *Bool) Delete()

func (*Bool) Get

func (s *Bool) Get() bool

func (*Bool) GetValue

func (s *Bool) GetValue() (bool, bool)

func (*Bool) Set

func (s *Bool) Set(value bool)

type BoolType

type BoolType int64
const (
	IntBool BoolType = iota
	StrBool
)

type ConfigModel

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

func (*ConfigModel) Init

func (s *ConfigModel) Init(sections []*inireader.Section, comments []string, filepath utils_types.FilePath)

func (*ConfigModel) Render

func (s *ConfigModel) Render() *inireader.INIFile

func (*ConfigModel) SetOutputPath

func (s *ConfigModel) SetOutputPath(filepath utils_types.FilePath)

type Float

type Float struct {
	*Value
	// contains filtered or unexported fields
}

func NewFloat

func NewFloat(section *inireader.Section, key cfg.ParamKey, precision Precision, opts ...FloatOption) *Float

func (*Float) Delete

func (s *Float) Delete()

func (*Float) Get

func (s *Float) Get() float64

func (*Float) GetValue

func (s *Float) GetValue() (float64, bool)

func (*Float) Set

func (s *Float) Set(value float64)

type FloatOption

type FloatOption func(s *Float)

func OptsF

func OptsF(opts ...ValueOption) FloatOption

func WithDefaultF

func WithDefaultF(default_value float64) FloatOption

type Int

type Int struct {
	*Value
}

func NewInt

func NewInt(section *inireader.Section, key cfg.ParamKey, opts ...ValueOption) *Int

func (*Int) Delete

func (s *Int) Delete()

func (*Int) Get

func (s *Int) Get() int

func (*Int) GetValue

func (s *Int) GetValue() (int, bool)

func (*Int) Set

func (s *Int) Set(value int)

type Model

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

func (*Model) Map

func (s *Model) Map(section *inireader.Section)

func (*Model) RenderModel

func (s *Model) RenderModel() *inireader.Section

type Path

type Path struct {
	*Value
	// contains filtered or unexported fields
}

Linux friendly filepath, that can be returned to Windows way from linux

func NewPath

func NewPath(section *inireader.Section, key cfg.ParamKey, opts ...PathOption) *Path

func (*Path) Delete

func (s *Path) Delete()

func (*Path) FileName

func (s *Path) FileName() utils_types.FilePath

func (*Path) Get

func (s *Path) Get() utils_types.FilePath

func (*Path) GetValue

func (s *Path) GetValue() (utils_types.FilePath, bool)

func (*Path) Set

func (s *Path) Set(value utils_types.FilePath)

type PathOption

type PathOption func(s *Path)

func OptsP

func OptsP(opts ...ValueOption) PathOption

func WithLowercaseP

func WithLowercaseP() PathOption

func WithoutSpacesP

func WithoutSpacesP() PathOption

type Precision

type Precision int

type String

type String struct {
	*Value
	// contains filtered or unexported fields
}

func NewString

func NewString(section *inireader.Section, key cfg.ParamKey, opts ...StringOption) *String

func (*String) Delete

func (s *String) Delete()

func (*String) Get

func (s *String) Get() string

func (*String) GetValue

func (s *String) GetValue() (string, bool)

func (*String) Set

func (s *String) Set(value string)

type StringOption

type StringOption func(s *String)

func OptsS

func OptsS(opts ...ValueOption) StringOption

func WithLowercaseS

func WithLowercaseS() StringOption

func WithoutSpacesS

func WithoutSpacesS() StringOption

type Value

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

func NewValue

func NewValue(
	section *inireader.Section,
	key cfg.ParamKey,
) *Value

type ValueOption

type ValueOption func(i *Value)

func Comment

func Comment() ValueOption

func Index

func Index(index int) ValueOption

func Optional

func Optional() ValueOption

func Order

func Order(order int) ValueOption

type ValueType

type ValueType int64
const (
	TypeComment ValueType = iota
	TypeVisible
)

type Vect

type Vect struct {
	Model
	X *Float
	Y *Float
	Z *Float
}

func NewVector

func NewVector(section *inireader.Section, key cfg.ParamKey, precision Precision, opts ...ValueOption) *Vect

func (*Vect) Get

func (s *Vect) Get() cfg.Vector

func (*Vect) GetValue

func (s *Vect) GetValue() (cfg.Vector, bool)

Jump to

Keyboard shortcuts

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