overlay

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	*conjure.Dir
	// contains filtered or unexported fields
}

func (*Dir) DirGenerator

func (d *Dir) DirGenerator(path string, generator DirGenerator)

func (*Dir) FileGenerator

func (d *Dir) FileGenerator(path string, generator FileGenerator)

func (*Dir) GenerateDir

func (d *Dir) GenerateDir(path string, fn func(ctx context.Context, fsys F, dir *Dir) error)

func (*Dir) GenerateFile

func (d *Dir) GenerateFile(path string, fn func(ctx context.Context, fsys F, file *File) error)

type DirGenerator

type DirGenerator interface {
	GenerateDir(ctx context.Context, fsys F, dir *Dir) error
}

type Embed

type Embed conjure.Embed

func (*Embed) GenerateFile

func (e *Embed) GenerateFile(_ context.Context, _ F, file *File) error

func (*Embed) ServeFile

func (e *Embed) ServeFile(_ context.Context, _ F, file *File) error

type F

type F interface {
	fs.FS
	Link(from, to string)
}

type File

type File struct {
	*conjure.File
}

TODO: don't wrap, just extend

func (f *File) Link(path string)

Link a path

type FileGenerator

type FileGenerator interface {
	GenerateFile(ctx context.Context, fsys F, file *File) error
}

type FileServer

type FileServer interface {
	ServeFile(ctx context.Context, fsys F, file *File) error
}

type FileSystem

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

func Load

func Load(module *gomod.Module) (*FileSystem, error)

Load the overlay filesystem

func (*FileSystem) DirGenerator

func (f *FileSystem) DirGenerator(path string, generator DirGenerator)

func (*FileSystem) FileGenerator

func (f *FileSystem) FileGenerator(path string, generator FileGenerator)

func (*FileSystem) FileServer

func (f *FileSystem) FileServer(path string, server FileServer)

func (*FileSystem) GenerateDir

func (f *FileSystem) GenerateDir(path string, fn func(ctx context.Context, fsys F, dir *Dir) error)

func (*FileSystem) GenerateFile

func (f *FileSystem) GenerateFile(path string, fn func(ctx context.Context, fsys F, file *File) error)
func (f *FileSystem) Link(from, to string)

func (*FileSystem) Open

func (f *FileSystem) Open(name string) (fs.File, error)

func (*FileSystem) ServeFile

func (f *FileSystem) ServeFile(path string, fn func(ctx context.Context, fsys F, file *File) error)

func (*FileSystem) Subscribe

func (f *FileSystem) Subscribe(name string) pubsub.Subscription

func (*FileSystem) Sync

func (f *FileSystem) Sync(dir string) error

Sync the overlay to the filesystem

type GenerateDir

type GenerateDir func(ctx context.Context, fsys F, dir *Dir) error

func (GenerateDir) GenerateDir

func (fn GenerateDir) GenerateDir(ctx context.Context, fsys F, dir *Dir) error

type GenerateFile

type GenerateFile func(ctx context.Context, fsys F, file *File) error

func (GenerateFile) GenerateFile

func (fn GenerateFile) GenerateFile(ctx context.Context, fsys F, file *File) error

type ServeFile

type ServeFile func(ctx context.Context, fsys F, file *File) error

func (ServeFile) ServeFile

func (fn ServeFile) ServeFile(ctx context.Context, fsys F, file *File) error

type Server

type Server = FileSystem

func Serve

func Serve(module *gomod.Module) (*Server, error)

Serve is just load without the cache TODO: consolidate

Jump to

Keyboard shortcuts

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