file

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileEmpty     string = "file is empty"
	LockFileEmpty string = "lock file is empty"
)
View Source
const (
	EnvNameFile        string = "BLUDGEON_META_FILE"
	EnvNameLockFile    string = "BLUDGEON_META_LOCK_FILE"
	EnvNameFileLocking string = "BLUDGEON_META_FILE_LOCKING"
)
View Source
const (
	DefaultFile        string = "./data/bludgeon.json"
	DefaultLockFile    string = "./data/bludgeon.lock"
	DefaultFileLocking bool   = false
)

Variables

View Source
var (
	ErrFileEmpty     = errors.New(FileEmpty)
	ErrLockFileEmpty = errors.New(LockFileEmpty)
)

Functions

Types

type Configuration

type Configuration struct {
	File        string `json:"file"`
	FileLocking bool   `json:"file_locking"`
	LockFile    string `json:"lock_file"`
}

func (*Configuration) Default

func (c *Configuration) Default()

func (*Configuration) FromEnv

func (c *Configuration) FromEnv(envs map[string]string)

func (*Configuration) Validate

func (c *Configuration) Validate() (err error)

type File

type File interface {
	Write(item interface{}) error
	Read(item interface{}) error
}

Jump to

Keyboard shortcuts

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