structure

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CinodeDirMimeType = "application/cinode-dir"
)

Variables

View Source
var (
	ErrNotFound      = blenc.ErrNotFound
	ErrNotADirectory = errors.New("entry is not a directory")
	ErrNotAFile      = errors.New("entry is not a file")
)
View Source
var (
	ErrMaxRedirectsReached   = errors.New("maximum limit of dynamic link redirects reached")
	ErrCorruptedLinkData     = errors.New("corrupted link data")
	ErrInvalidEntrypoint     = protobuf.ErrInvalidEntrypoint
	ErrInvalidEntrypointTime = protobuf.ErrInvalidEntrypointTime
)

Functions

func DereferenceLink(
	ctx context.Context,
	be blenc.BE,
	link *protobuf.Entrypoint,
	maxRedirects int,
	currentTime time.Time,
) (
	*protobuf.Entrypoint,
	error,
)

func UploadStaticDirectory

func UploadStaticDirectory(ctx context.Context, fsys fs.FS, be blenc.BE) (*protobuf.Entrypoint, error)

Types

type CinodeFS

type CinodeFS struct {
	BE               blenc.BE
	RootEntrypoint   *protobuf.Entrypoint
	MaxLinkRedirects int
	IndexFile        string
	CurrentTimeF     func() time.Time
}

func (*CinodeFS) FindEntrypoint

func (d *CinodeFS) FindEntrypoint(ctx context.Context, path string) (*protobuf.Entrypoint, error)

func (*CinodeFS) OpenContent

func (d *CinodeFS) OpenContent(ctx context.Context, ep *protobuf.Entrypoint) (io.ReadCloser, error)

type HTTPHandler added in v0.0.2

type HTTPHandler struct {
	FS *CinodeFS
}

func (*HTTPHandler) ServeHTTP added in v0.0.2

func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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