snapshots

package
v0.0.0-...-764741f Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCountingUpdater

func MakeCountingUpdater(i *int, d time.Duration, p bool) snapshot.Updater

func MakeInvalidCheckouter

func MakeInvalidCheckouter() snapshot.Checkouter

Create a Checkouter that essentially does nothing, based on a static path

func MakeInvalidFiler

func MakeInvalidFiler() snapshot.Filer

Make an invalid Filer

func MakeInvalidFilerUpdater

func MakeInvalidFilerUpdater(updater snapshot.Updater) snapshot.Filer

Make invalid filer with an updater

func MakeNoopCheckouter

func MakeNoopCheckouter(path string) snapshot.Checkouter

func MakeNoopFiler

func MakeNoopFiler(path string) snapshot.Filer

func MakeTempCheckouter

func MakeTempCheckouter(tmp *temp.TempDir) snapshot.Checkouter

MakeTempCheckouter creates a new Checkouter that always checks out by creating a new, empty temp dir

func MakeTempCheckouterFiler

func MakeTempCheckouterFiler(tmp *temp.TempDir) snapshot.Filer

Make a Filer that can Checkout() but does a noop Ingest().

func MakeTempFiler

func MakeTempFiler(tmp *temp.TempDir) snapshot.Filer

Creates a filer that copies ingested paths in and then back out for checkouts.

func Module

func Module() ice.Module

Module returns a module to allow serving Snapshots as an http.Handler

Types

type CountingUpdater

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

func (*CountingUpdater) Unpause

func (c *CountingUpdater) Unpause()

func (*CountingUpdater) Update

func (c *CountingUpdater) Update() error

update waits on unpauseCh Unpause just sends to unpauseCh (which means Update() should be running when we hit unpause) WFUR should wait on an updateRunningCh, that Update() sends to.

func (*CountingUpdater) UpdateInterval

func (c *CountingUpdater) UpdateInterval() time.Duration

func (*CountingUpdater) WaitForUpdateRunning

func (c *CountingUpdater) WaitForUpdateRunning()

type FakeContents

type FakeContents struct {
	Contents string
	Exec     bool
}

func NewContents

func NewContents(contents string, exec bool) *FakeContents

func (*FakeContents) Close

func (f *FakeContents) Close() error

func (*FakeContents) IsDir

func (f *FakeContents) IsDir() bool

func (*FakeContents) IsExec

func (f *FakeContents) IsExec() bool

func (*FakeContents) ReadAll

func (f *FakeContents) ReadAll() ([]byte, error)

func (*FakeContents) ReadAt

func (f *FakeContents) ReadAt(p []byte, off int64) (int, error)

func (*FakeContents) Size

func (f *FakeContents) Size() int64

func (*FakeContents) Type

func (f *FakeContents) Type() snapshot.FileType

type FakeDir

type FakeDir struct {
	Children map[string]FakeFile
}

func NewDir

func NewDir(children map[string]FakeFile) *FakeDir

func (*FakeDir) IsDir

func (f *FakeDir) IsDir() bool

func (*FakeDir) IsExec

func (f *FakeDir) IsExec() bool

func (*FakeDir) Size

func (f *FakeDir) Size() int64

func (*FakeDir) Type

func (f *FakeDir) Type() snapshot.FileType

type FakeFile

type FakeFile interface {
	IsExec() bool
	Size() int64

	Type() snapshot.FileType
	IsDir() bool
}

type FakeSnapshot

type FakeSnapshot struct {
	Root *FakeDir
	ID   string
}

func NewSnapshot

func NewSnapshot(root *FakeDir, id string) *FakeSnapshot

func (*FakeSnapshot) Id

func (s *FakeSnapshot) Id() string

func (*FakeSnapshot) Lstat

func (s *FakeSnapshot) Lstat(name string) (snapshot.FileInfo, error)

func (*FakeSnapshot) Open

func (s *FakeSnapshot) Open(path string) (snapshot.File, error)

func (*FakeSnapshot) Readdirents

func (s *FakeSnapshot) Readdirents(name string) ([]snapshot.Dirent, error)
func (s *FakeSnapshot) Readlink(name string) (string, error)

func (*FakeSnapshot) Stat

func (s *FakeSnapshot) Stat(name string) (snapshot.FileInfo, error)

type FilerFacade

type FilerFacade struct {
	snapshot.Checkouter
	snapshot.Ingester
	snapshot.Updater
}

FilerFacade creates a Filer from a Checkouter and Ingester

func MakeFilerFacade

func MakeFilerFacade(
	checkouter snapshot.Checkouter,
	ingester snapshot.Ingester,
	updater snapshot.Updater) *FilerFacade

Make a Filer from a Checkouter and Ingester

type NoopIngester

type NoopIngester struct{}

Ingester that does nothing.

func MakeNoopIngester

func MakeNoopIngester() *NoopIngester

Make an Ingester that does nothing

func (*NoopIngester) Ingest

func (n *NoopIngester) Ingest(string) (string, error)

func (*NoopIngester) IngestMap

func (n *NoopIngester) IngestMap(map[string]string) (string, error)

type NoopUpdater

type NoopUpdater struct{}

func MakeNoopUpdater

func MakeNoopUpdater() *NoopUpdater

Make an Updater that does nothing

func (*NoopUpdater) Update

func (n *NoopUpdater) Update() error

func (*NoopUpdater) UpdateInterval

func (n *NoopUpdater) UpdateInterval() time.Duration

type ViewServer

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

ViewServer allows viewing files in a Snapshot

func NewViewServer

func NewViewServer(db snapshot.DB) *ViewServer

NewViewServer creates a new ViewServer to serve snapshots in DB

func (*ViewServer) ServeHTTP

func (s *ViewServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

Serve requests to View files in a Snapshot

Jump to

Keyboard shortcuts

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