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: 2 modules, 3 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.

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
⌂ 换网址