filex

package
v4.3.1-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(filename string) bool

Exists check if a file is present or not

func NewRevisionsStore added in v4.0.1

func NewRevisionsStore(configDir string, debounceTime ...time.Duration) revisions.Store

NewRevisionsStore opens a new store

func Read

func Read(filename string, readOnly ...bool) ([]byte, error)

Read reads the content of a file

func Save

func Save(filename string, b []byte) error

Save writes configs to json file

func WriteIfNotExists

func WriteIfNotExists(filename string, data string) (bool, error)

WriteIfNotExists writes data directly inside file

Types

type BoltStore

type BoltStore struct {
	FileName string
	// contains filtered or unexported fields
}

BoltStore is a BoltDB implementation of the Store interface

func (*BoltStore) GetConnection

func (b *BoltStore) GetConnection(readOnly bool) (*bolt.DB, error)

func (*BoltStore) List

func (b *BoltStore) List(offset uint64, limit uint64) (result []*revisions.Version, err error)

List lists all version starting at a given id

func (*BoltStore) Put

func (b *BoltStore) Put(version *revisions.Version) error

func (*BoltStore) Retrieve

func (b *BoltStore) Retrieve(id uint64) (*revisions.Version, error)

Retrieve loads data from db by version ID

Jump to

Keyboard shortcuts

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