joneva

package module
v0.0.0-...-2ab206a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("not found")
	ErrTypeMismatch = errors.New("type mismatch")
)

Functions

This section is empty.

Types

type Joneva

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

func New

func New(filePath string, defaults map[string]interface{}) (*Joneva, error)

func (*Joneva) Bool

func (j *Joneva) Bool(key string) (bool, error)

func (*Joneva) Duration

func (j *Joneva) Duration(key string) (time.Duration, error)

Duration gets the key value as time.Duration. Supports standard Go formats: "300ms", "1.5h", "2h45m", "30s", "5m", etc. Also supports numbers like nanoseconds.

func (*Joneva) Float64

func (j *Joneva) Float64(key string) (float64, error)

func (*Joneva) Get

func (j *Joneva) Get(key string) interface{}

func (*Joneva) Load

func (j *Joneva) Load(override ...string) error

func (*Joneva) Map

func (j *Joneva) Map(key string) (map[string]interface{}, error)

func (*Joneva) MustBool

func (j *Joneva) MustBool(key string) bool

func (*Joneva) MustDuration

func (j *Joneva) MustDuration(key string) time.Duration

MustDuration gets the key value as time.Duration or panics on error.

func (*Joneva) MustFloat64

func (j *Joneva) MustFloat64(key string) float64

func (*Joneva) MustMap

func (j *Joneva) MustMap(key string) map[string]interface{}

func (*Joneva) MustSlice

func (j *Joneva) MustSlice(key string) []interface{}

func (*Joneva) MustSliceBool

func (j *Joneva) MustSliceBool(key string) []bool

func (*Joneva) MustSliceFloat64

func (j *Joneva) MustSliceFloat64(key string) []float64

func (*Joneva) MustSliceString

func (j *Joneva) MustSliceString(key string) []string

func (*Joneva) MustString

func (j *Joneva) MustString(key string) string

func (*Joneva) Save

func (j *Joneva) Save() error

func (*Joneva) Set

func (j *Joneva) Set(key string, value interface{})

func (*Joneva) SetDuration

func (j *Joneva) SetDuration(key string, value time.Duration)

SetDuration sets the value of a key as a duration in string format.

func (*Joneva) Slice

func (j *Joneva) Slice(key string) ([]interface{}, error)

func (*Joneva) SliceBool

func (j *Joneva) SliceBool(key string) ([]bool, error)

func (*Joneva) SliceFloat64

func (j *Joneva) SliceFloat64(key string) ([]float64, error)

func (*Joneva) SliceString

func (j *Joneva) SliceString(key string) ([]string, error)

func (*Joneva) String

func (j *Joneva) String(key string) (string, error)

Jump to

Keyboard shortcuts

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