apifs

package module
v0.0.0-...-d0c1390 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 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

apifs

Mount an API to disk

Built on FUSE. Depends on fusermount3

My use-case is letting a common text editor manipulate API items.

This is what it looks like atm:

type API interface {
	List(context.Context) []Item
	Lookup(context.Context, string) (Item, error)

    // Read(context.Context, string) []byte

	Write(context.Context, string, []byte) error
}

Synchronization and caching is left to the implementation.

todos

  • create mountPoint if missing
  • unmount on exit
  • unmount on interrupt
  • lib for common APIs like 1password, s3
  • file permissions
  • put ops logs behind verbose flag
  • honor context deadline
  • api item cache
  • Inode id generation
  • add note on vim complaining about fsync

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilAPI = errors.New("api cannot be nil")

Functions

func Mount

func Mount(api API, mountPoint string) error

Types

type API

type API interface {
	List(context.Context) []Item
	Lookup(context.Context, string) (Item, error)
	// Read(context.Context, string) []byte
	Write(context.Context, string, []byte) error
}

type Item

type Item struct {
	// Must be unique
	Id   uint64
	Name string
	Data []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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