file

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File the file watcher

func New

func New(ctx context.Context, u *url.URL) (*File, error)

New new file client

func (*File) Load

func (f *File) Load(ctx context.Context, path string) (data map[string][]byte, err error)

Load load data from path

func (*File) Save

func (f *File) Save(_ context.Context, path string, data []byte) error

Save save data to path

func (*File) Watch

func (f *File) Watch(ctx context.Context, paths []string, onChange func(map[string][]byte)) (err error)

Watch watch the path

Jump to

Keyboard shortcuts

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