binfs

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package binfs is filesystem over registered binary data.

This pacakge is used by ./cmd/gitfs to generate files that contain static content of a filesystem.

Index

Constants

View Source
const EncodeVersion = 1

EncodeVersion is the current encoding version.

Variables

This section is empty.

Functions

func GenerateBinaries added in v0.1.0

func GenerateBinaries(c Calls, provider fsProviderFn) map[string]string

GenerateBinaries generate binary representation to all given calls. The returned map maps project name that is used in any of the files that matched any of the pattern to its binary encoded content.

func Get

func Get(project string) http.FileSystem

Get returns filesystem of a registered project.

func Match

func Match(project string) bool

Match returns wether project exists in registered binaries. The matching is done also over the project `ref`.

func Register

func Register(project string, version int, encoded string)

Register a filesystem under the project name. It panics if anything goes wrong.

Types

type Calls added in v0.1.0

type Calls map[string]*Config

Calls is a map of project to load configuration.

func LoadCalls added in v0.1.0

func LoadCalls(patterns ...string) (Calls, error)

LoadCalls load all calls to gitfs.New in the files according to the defined patterns.

type Config added in v0.1.0

type Config struct {
	Project string
	// contains filtered or unexported fields
}

Config is a configuration for generating a filesystem.

func (*Config) GlobPatterns added in v0.1.0

func (c *Config) GlobPatterns() []string

GlobPatterns that should be used for this project.

Jump to

Keyboard shortcuts

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