confy

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 5 Imported by: 3

README

confy

A stupid simple configuration store.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confy

type Confy interface {
	Load() ([]byte, error)
	Store([]byte) error
}

A Confy is a stupid simple configuration store.

type Func added in v0.8.0

type Func struct {
	LoadFn  func() ([]byte, error)
	StoreFn func([]byte) error
}

Func is a Confy that just contains Load and Store funcs.

func (Func) Load added in v0.8.0

func (f Func) Load() ([]byte, error)

Load implements Confy using LoadFn.

func (Func) Store added in v0.8.0

func (f Func) Store(data []byte) error

Store implements Confy using StoreFn.

type Mem added in v0.7.1

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

Mem is an in-memory Confy that uses a bytes.Buffer.

func (*Mem) Load added in v0.8.0

func (m *Mem) Load() ([]byte, error)

Load implements Confy using io.ReadAll.

func (*Mem) Store added in v0.8.0

func (m *Mem) Store(data []byte) error

Store implements Confy using (*bytes.Buffer).Write.

type OS added in v0.7.0

type OS string

OS is a Confy which uses a filepath to load and store.

func (OS) Load added in v0.8.0

func (o OS) Load() ([]byte, error)

Load implements Confy using os.Open and io.ReadAll.

func (OS) Store added in v0.8.0

func (o OS) Store(data []byte) error

Store implements Confy using os.Create.

Jump to

Keyboard shortcuts

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