templates

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

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 FileTemplatesHomebrewRb = []byte("\x63\x6c\x61\x73\x73\x20\x49\x6e\x65\x72\x74\x69\x61\x20\x3c\x20\x46\x6f\x72\x6d\x75\x6c\x61\x0a\x20\x20\x64\x65\x73\x63\x20\x22\x53\x69\x6d\x70\x6c\x65\x2c\x20\x73\x65\x6c\x66\x2d\x68\x6f\x73\x74\x65\x64\x20\x63\x6f\x6e\x74\x69\x6e\x75\x6f\x75\x73\x20\x64\x65\x70\x6c\x6f\x79\x6d\x65\x6e\x74\x22\x0a\x20\x20\x68\x6f\x6d\x65\x70\x61\x67\x65\x20\x22\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x75\x62\x63\x6c\x61\x75\x6e\x63\x68\x70\x61\x64\x2f\x69\x6e\x65\x72\x74\x69\x61\x22\x0a\x20\x20\x62\x6f\x74\x74\x6c\x65\x20\x3a\x75\x6e\x6e\x65\x65\x64\x65\x64\x0a\x0a\x20\x20\x23\x20\x53\x74\x61\x62\x6c\x65\x0a\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x20\x22\x7b\x7b\x20\x2e\x56\x65\x72\x73\x69\x6f\x6e\x20\x7d\x7d\x22\x0a\x20\x20\x73\x68\x61\x32\x35\x36\x20\x22\x7b\x7b\x20\x69\x6e\x64\x65\x78\x20\x2e\x53\x68\x61\x32\x35\x36\x20\x22\x64\x61\x72\x77\x69\x6e\x2e\x61\x6d\x64\x36\x34\x22\x20\x7d\x7d\x22\x0a\x20\x20\x75\x72\x6c\x20\x22\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x75\x62\x63\x6c\x61\x75\x6e\x63\x68\x70\x61\x64\x2f\x69\x6e\x65\x72\x74\x69\x61\x2f\x72\x65\x6c\x65\x61\x73\x65\x73\x2f\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x2f\x76\x23\x7b\x76\x65\x72\x73\x69\x6f\x6e\x7d\x2f\x69\x6e\x65\x72\x74\x69\x61\x2e\x76\x23\x7b\x76\x65\x72\x73\x69\x6f\x6e\x7d\x2e\x64\x61\x72\x77\x69\x6e\x2e\x61\x6d\x64\x36\x34\x22\x0a\x0a\x20\x20\x23\x20\x42\x75\x69\x6c\x64\x20\x66\x72\x6f\x6d\x20\x6c\x61\x74\x65\x73\x74\x20\x63\x6f\x6d\x6d\x69\x74\x0a\x20\x20\x68\x65\x61\x64\x20\x22\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x75\x62\x63\x6c\x61\x75\x6e\x63\x68\x70\x61\x64\x2f\x69\x6e\x65\x72\x74\x69\x61\x2e\x67\x69\x74\x22\x0a\x20\x20\x68\x65\x61\x64\x20\x64\x6f\x0a\x20\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x20\x22\x6c\x61\x74\x65\x73\x74\x22\x0a\x20\x20\x20\x20\x64\x65\x70\x65\x6e\x64\x73\x5f\x6f\x6e\x20\x22\x67\x6f\x22\x20\x3d\x3e\x20\x3a\x62\x75\x69\x6c\x64\x0a\x20\x20\x65\x6e\x64\x0a\x0a\x20\x20\x64\x65\x66\x20\x69\x6e\x73\x74\x61\x6c\x6c\x0a\x20\x20\x20\x20\x69\x66\x20\x62\x75\x69\x6c\x64\x2e\x68\x65\x61\x64\x3f\x0a\x20\x20\x20\x20\x20\x20\x73\x79\x73\x74\x65\x6d\x20\x22\x67\x6f\x22\x2c\x20\x22\x6d\x6f\x64\x22\x2c\x20\x22\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x22\x0a\x20\x20\x20\x20\x20\x20\x73\x79\x73\x74\x65\x6d\x20\x22\x67\x6f\x22\x2c\x20\x22\x62\x75\x69\x6c\x64\x22\x2c\x20\x22\x2d\x6f\x22\x2c\x20\x22\x23\x7b\x62\x69\x6e\x7d\x2f\x69\x6e\x65\x72\x74\x69\x61\x22\x0a\x20\x20\x20\x20\x65\x6c\x73\x65\x0a\x20\x20\x20\x20\x20\x20\x6d\x76\x20\x22\x69\x6e\x65\x72\x74\x69\x61\x2e\x76\x23\x7b\x76\x65\x72\x73\x69\x6f\x6e\x7d\x2e\x64\x61\x72\x77\x69\x6e\x2e\x61\x6d\x64\x36\x34\x22\x2c\x20\x22\x69\x6e\x65\x72\x74\x69\x61\x22\x0a\x20\x20\x20\x20\x20\x20\x62\x69\x6e\x2e\x69\x6e\x73\x74\x61\x6c\x6c\x20\x22\x69\x6e\x65\x72\x74\x69\x61\x22\x0a\x20\x20\x20\x20\x65\x6e\x64\x0a\x20\x20\x65\x6e\x64\x0a\x0a\x20\x20\x74\x65\x73\x74\x20\x64\x6f\x0a\x20\x20\x20\x20\x61\x73\x73\x65\x72\x74\x5f\x6d\x61\x74\x63\x68\x20\x76\x65\x72\x73\x69\x6f\x6e\x2e\x74\x6f\x5f\x73\x2c\x20\x73\x68\x65\x6c\x6c\x5f\x6f\x75\x74\x70\x75\x74\x28\x22\x23\x7b\x62\x69\x6e\x7d\x2f\x69\x6e\x65\x72\x74\x69\x61\x20\x2d\x2d\x76\x65\x72\x73\x69\x6f\x6e\x22\x29\x0a\x20\x20\x65\x6e\x64\x0a\x65\x6e\x64\x0a")

FileTemplatesHomebrewRb is "templates/homebrew.rb"

View Source
var FileTemplatesScoopJSON = []byte("\x7b\x0a\x20\x20\x20\x20\x22\x76\x65\x72\x73\x69\x6f\x6e\x22\x3a\x20\x22\x7b\x7b\x20\x2e\x56\x65\x72\x73\x69\x6f\x6e\x20\x7d\x7d\x22\x2c\x0a\x20\x20\x20\x20\x22\x75\x72\x6c\x22\x3a\x20\x22\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x69\x74\x68\x75\x62\x2e\x63\x6f\x6d\x2f\x75\x62\x63\x6c\x61\x75\x6e\x63\x68\x70\x61\x64\x2f\x69\x6e\x65\x72\x74\x69\x61\x2f\x72\x65\x6c\x65\x61\x73\x65\x73\x2f\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x2f\x7b\x7b\x20\x2e\x56\x65\x72\x73\x69\x6f\x6e\x20\x7d\x7d\x2f\x69\x6e\x65\x72\x74\x69\x61\x2e\x7b\x7b\x20\x2e\x56\x65\x72\x73\x69\x6f\x6e\x20\x7d\x7d\x2e\x77\x69\x6e\x64\x6f\x77\x73\x2e\x33\x38\x36\x2e\x65\x78\x65\x22\x2c\x0a\x20\x20\x20\x20\x22\x62\x69\x6e\x22\x3a\x20\x22\x69\x6e\x65\x72\x74\x69\x61\x2e\x65\x78\x65\x22\x0a\x7d\x0a")

FileTemplatesScoopJSON is "templates/scoop.json"

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