internal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package internal provides internal assets for the NodeManager

Index

Constants

This section is empty.

Variables

View Source
var (
	// CTX is a context for webdav vfs
	CTX = context.Background()

	// FS is a virtual memory file system
	FS = webdav.NewMemFS()

	// Handler is used to server files through a http handler
	Handler *webdav.Handler

	// HTTP is the http file system
	HTTP http.FileSystem = new(HTTPFS)
)
View Source
var FileIpfsInternalIpfsStartSh = []byte("\x23\x21\x2f\x62\x69\x6e\x2f\x73\x68\x0a\x0a\x23\x20\x4d\x6f\x64\x69\x66\x69\x65\x64\x20\x49\x50\x46\x53\x20\x6e\x6f\x64\x65\x20\x69\x6e\x69\x74\x69\x61\x6c\x69\x7a\x61\x74\x69\x6f\x6e\x20\x73\x63\x72\x69\x70\x74\x2e\x0a\x23\x20\x4d\x6f\x75\x6e\x74\x20\x74\x6f\x20\x2f\x75\x73\x72\x2f\x6c\x6f\x63\x61\x6c\x2f\x62\x69\x6e\x2f\x73\x74\x61\x72\x74\x5f\x69\x70\x66\x73\x0a\x23\x20\x53\x6f\x75\x72\x63\x65\x3a\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x69\x70\x66\x73\x2f\x67\x6f\x2d\x69\x70\x66\x73\x2f\x62\x6c\x6f\x62\x2f\x24\x7b\x49\x50\x46\x53\x5f\x56\x45\x52\x53\x49\x4f\x4e\x7d\x2f\x62\x69\x6e\x2f\x63\x6f\x6e\x74\x61\x69\x6e\x65\x72\x5f\x64\x61\x65\x6d\x6f\x6e\x0a\x0a\x73\x65\x74\x20\x2d\x65\x0a\x0a\x23\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\x74\x68\x72\x6f\x75\x67\x68\x20\x73\x74\x72\x69\x6e\x67\x20\x74\x65\x6d\x70\x6c\x61\x74\x65\x73\x0a\x44\x49\x53\x4b\x5f\x4d\x41\x58\x3d\x25\x64\x47\x42\x0a\x0a\x23\x20\x73\x65\x74\x20\x76\x61\x72\x69\x61\x62\x6c\x65\x73\x0a\x75\x73\x65\x72\x3d\x69\x70\x66\x73\x0a\x72\x65\x70\x6f\x3d\x22\x24\x49\x50\x46\x53\x5f\x50\x41\x54\x48\x22\x0a\x0a\x23\x20\x73\x65\x74\x20\x75\x73\x65\x72\x0a\x69\x66\x20\x5b\x20\x22\x24\x28\x69\x64\x20\x2d\x75\x29\x22\x20\x2d\x65\x71\x20\x30\x20\x5d\x3b\x20\x74\x68\x65\x6e\x0a\x20\x20\x65\x63\x68\x6f\x20\x22\x63\x68\x61\x6e\x67\x69\x6e\x67\x20\x75\x73\x65\x72\x20\x74\x6f\x20\x24\x75\x73\x65\x72\x22\x0a\x20\x20\x23\x20\x65\x6e\x73\x75\x72\x65\x20\x66\x6f\x6c\x64\x65\x72\x20\x69\x73\x20\x77\x72\x69\x74\x61\x62\x6c\x65\x0a\x20\x20\x73\x75\x2d\x65\x78\x65\x63\x20\x22\x24\x75\x73\x65\x72\x22\x20\x74\x65\x73\x74\x20\x2d\x77\x20\x22\x24\x72\x65\x70\x6f\x22\x20\x7c\x7c\x20\x63\x68\x6f\x77\x6e\x20\x2d\x52\x20\x2d\x2d\x20\x22\x24\x75\x73\x65\x72\x22\x20\x22\x24\x72\x65\x70\x6f\x22\x0a\x20\x20\x23\x20\x72\x65\x73\x74\x61\x72\x74\x20\x73\x63\x72\x69\x70\x74\x20\x77\x69\x74\x68\x20\x6e\x65\x77\x20\x70\x72\x69\x76\x69\x6c\x65\x67\x65\x73\x0a\x20\x20\x65\x78\x65\x63\x20\x73\x75\x2d\x65\x78\x65\x63\x20\x22\x24\x75\x73\x65\x72\x22\x20\x22\x24\x30\x22\x20\x22\x24\x40\x22\x0a\x66\x69\x0a\x0a\x23\x20\x63\x68\x65\x63\x6b\x20\x65\x78\x65\x63\x2c\x20\x72\x65\x70\x6f\x72\x74\x20\x76\x65\x72\x73\x69\x6f\x6e\x0a\x69\x70\x66\x73\x20\x76\x65\x72\x73\x69\x6f\x6e\x0a\x0a\x23\x20\x63\x68\x65\x63\x6b\x20\x66\x6f\x72\x20\x65\x78\x69\x73\x74\x69\x6e\x67\x20\x72\x65\x70\x6f\x20\x2d\x20\x6f\x74\x68\x65\x72\x77\x69\x73\x65\x20\x69\x6e\x69\x74\x20\x6e\x65\x77\x20\x6f\x6e\x65\x0a\x69\x66\x20\x5b\x20\x2d\x65\x20\x22\x24\x72\x65\x70\x6f\x2f\x63\x6f\x6e\x66\x69\x67\x22\x20\x5d\x3b\x20\x74\x68\x65\x6e\x0a\x20\x20\x65\x63\x68\x6f\x20\x22\x66\x6f\x75\x6e\x64\x20\x49\x50\x46\x53\x20\x66\x73\x2d\x72\x65\x70\x6f\x20\x61\x74\x20\x24\x72\x65\x70\x6f\x22\x0a\x65\x6c\x73\x65\x0a\x20\x20\x69\x70\x66\x73\x20\x69\x6e\x69\x74\x20\x2d\x2d\x70\x72\x6f\x66\x69\x6c\x65\x20\x73\x65\x72\x76\x65\x72\x0a\x20\x20\x69\x70\x66\x73\x20\x63\x6f\x6e\x66\x69\x67\x20\x41\x64\x64\x72\x65\x73\x73\x65\x73\x2e\x41\x50\x49\x20\x2f\x69\x70\x34\x2f\x30\x2e\x30\x2e\x30\x2e\x30\x2f\x74\x63\x70\x2f\x35\x30\x30\x31\x0a\x20\x20\x69\x70\x66\x73\x20\x63\x6f\x6e\x66\x69\x67\x20\x41\x64\x64\x72\x65\x73\x73\x65\x73\x2e\x47\x61\x74\x65\x77\x61\x79\x20\x2f\x69\x70\x34\x2f\x30\x2e\x30\x2e\x30\x2e\x30\x2f\x74\x63\x70\x2f\x38\x30\x38\x30\x0a\x66\x69\x0a\x0a\x23\x20\x73\x65\x74\x20\x64\x61\x74\x61\x73\x74\x6f\x72\x65\x20\x71\x75\x6f\x74\x61\x0a\x69\x70\x66\x73\x20\x63\x6f\x6e\x66\x69\x67\x20\x44\x61\x74\x61\x73\x74\x6f\x72\x65\x2e\x53\x74\x6f\x72\x61\x67\x65\x4d\x61\x78\x20\x24\x44\x49\x53\x4b\x5f\x4d\x41\x58\x0a\x0a\x23\x20\x72\x65\x6c\x65\x61\x73\x65\x20\x6c\x6f\x63\x6b\x73\x0a\x69\x70\x66\x73\x20\x72\x65\x70\x6f\x20\x66\x73\x63\x6b\x0a\x0a\x23\x20\x69\x66\x20\x74\x68\x65\x20\x66\x69\x72\x73\x74\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x20\x69\x73\x20\x64\x61\x65\x6d\x6f\x6e\x0a\x69\x66\x20\x5b\x20\x22\x24\x31\x22\x20\x3d\x20\x22\x64\x61\x65\x6d\x6f\x6e\x22\x20\x5d\x3b\x20\x74\x68\x65\x6e\x0a\x20\x20\x23\x20\x66\x69\x6c\x74\x65\x72\x20\x74\x68\x65\x20\x66\x69\x72\x73\x74\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x20\x75\x6e\x74\x69\x6c\x0a\x20\x20\x23\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x69\x70\x66\x73\x2f\x67\x6f\x2d\x69\x70\x66\x73\x2f\x70\x75\x6c\x6c\x2f\x33\x35\x37\x33\x0a\x20\x20\x23\x20\x68\x61\x73\x20\x62\x65\x65\x6e\x20\x72\x65\x73\x6f\x6c\x76\x65\x64\x0a\x20\x20\x73\x68\x69\x66\x74\x0a\x65\x6c\x73\x65\x0a\x20\x20\x23\x20\x70\x72\x69\x6e\x74\x20\x64\x65\x70\x72\x65\x63\x61\x74\x69\x6f\x6e\x20\x77\x61\x72\x6e\x69\x6e\x67\x0a\x20\x20\x23\x20\x67\x6f\x2d\x69\x70\x66\x73\x20\x75\x73\x65\x64\x20\x74\x6f\x20\x68\x61\x72\x64\x63\x6f\x64\x65\x20\x22\x69\x70\x66\x73\x20\x64\x61\x65\x6d\x6f\x6e\x22\x20\x69\x6e\x20\x69\x74\x27\x73\x20\x65\x6e\x74\x72\x79\x70\x6f\x69\x6e\x74\x0a\x20\x20\x23\x20\x74\x68\x69\x73\x20\x77\x6f\x72\x6b\x61\x72\x6f\x75\x6e\x64\x20\x73\x75\x70\x70\x6f\x72\x74\x73\x20\x74\x68\x65\x20\x6e\x65\x77\x20\x73\x79\x6e\x74\x61\x78\x20\x73\x6f\x20\x70\x65\x6f\x70\x6c\x65\x20\x73\x74\x61\x72\x74\x20\x73\x65\x74\x74\x69\x6e\x67\x20\x64\x61\x65\x6d\x6f\x6e\x20\x65\x78\x70\x6c\x69\x63\x69\x74\x6c\x79\x0a\x20\x20\x23\x20\x77\x68\x65\x6e\x20\x6f\x76\x65\x72\x77\x72\x69\x74\x69\x6e\x67\x20\x43\x4d\x44\x0a\x20\x20\x65\x63\x68\x6f\x20\x22\x44\x45\x50\x52\x45\x43\x41\x54\x45\x44\x3a\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6e\x20\x73\x65\x74\x20\x62\x75\x74\x20\x74\x68\x65\x20\x66\x69\x72\x73\x74\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x20\x69\x73\x6e\x27\x74\x20\x27\x64\x61\x65\x6d\x6f\x6e\x27\x22\x20\x3e\x26\x32\x0a\x66\x69\x0a\x0a\x65\x78\x65\x63\x20\x69\x70\x66\x73\x20\x64\x61\x65\x6d\x6f\x6e\x20\x22\x24\x40\x22\x0a")

FileIpfsInternalIpfsStartSh is "ipfs/internal/ipfs_start.sh"

Functions

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile is adapTed from ioutil

func WalkDirs

func WalkDirs(name string, includeDirsInList bool, files ...string) ([]string, error)

WalkDirs looks for files in the given dir and returns a list of files in it usage for all files in the b0x: WalkDirs("", false)

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile is adapTed from ioutil

Types

type HTTPFS

type HTTPFS struct {
	// Prefix allows to limit the path of all requests. F.e. a prefix "css" would allow only calls to /css/*
	Prefix string
}

HTTPFS implements http.FileSystem

func (*HTTPFS) Open

func (hfs *HTTPFS) Open(path string) (http.File, error)

Open a file

Jump to

Keyboard shortcuts

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