file

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeConf         = Type{Key: "conf", Suffixes: []string{".conf"}, Title: "Configuration file"}
	TypeCSS          = Type{Key: "css", Suffixes: []string{".css"}, Title: "Cascading Stylesheet"}
	TypeDocker       = Type{Key: "docker", Suffixes: []string{"Dockerfile"}, Title: "Docker build configuration"}
	TypeEntitlements = Type{Key: "entitlements", Suffixes: []string{".entitlements"}, Title: "Xcode entitlements file"}
	TypeGitIgnore    = Type{Key: "gitignore", Suffixes: []string{".gitignore"}, Title: "Git file for ignored paths"}
	TypeGo           = Type{Key: "go", Suffixes: []string{".go"}, Title: "Go source"}
	TypeGoMod        = Type{Key: "gomod", Suffixes: []string{".mod"}, Title: "Go module configuration"}
	TypeGradle       = Type{Key: "gradle", Suffixes: []string{".gradle"}, Title: "Gradle project definition"}
	TypeHCL          = Type{Key: "hcl", Suffixes: []string{".hcl"}, Title: "HashiCorp Configuration Language"}
	TypeHTML         = Type{Key: "html", Suffixes: []string{".html", ".htm"}, Title: "HTML web page"}
	TypeIgnore       = Type{Key: "dockerignore", Suffixes: []string{".dockerignore"}, Title: "Docker ignore file"}
	TypeIcons        = Type{Key: "icons", Suffixes: []string{".icns"}, Title: "Apple icon collection"}
	TypeJavaScript   = Type{Key: "javascript", Suffixes: []string{".js", ".javascript"}, Title: "JavaScript source"}
	TypeJSON         = Type{Key: "json", Suffixes: []string{".json"}, Title: "JavaScript Object Notation"}
	TypeKotlin       = Type{Key: "kotlin", Suffixes: []string{".kotlin", ".kt"}, Title: "Kotlin source code"}
	TypeMakefile     = Type{Key: "makefile", Suffixes: []string{"Makefile", "makefile"}, Title: "Build file"}
	TypeMarkdown     = Type{Key: "markdown", Suffixes: []string{".md", ".markdown"}, Title: "Markdown document"}
	TypePBXProject   = Type{Key: "pbxproject", Suffixes: []string{".pbxproj"}, Title: "Apple project configuration"}
	TypePList        = Type{Key: "plist", Suffixes: []string{".plist"}, Title: "Apple configuration plist"}
	TypeProperties   = Type{Key: "properties", Suffixes: []string{".properties"}, Title: "Java configuration properties"}
	TypeShell        = Type{Key: "shell", Suffixes: []string{".sh"}, Title: "Shell script"}
	TypeSVG          = Type{Key: "svg", Suffixes: []string{".svg"}, Title: "Simple Vector Graphics file"}
	TypeSwift        = Type{Key: "swift", Suffixes: []string{".swift"}, Title: "Swift source code file"}
	TypeText         = Type{Key: "text", Suffixes: []string{".txt"}, Title: "Plaintext"}
	TypeTypeScript   = Type{Key: "typescript", Suffixes: []string{".ts"}, Title: "TypeScript source"}
	TypeXML          = Type{Key: "xml", Suffixes: []string{".xml"}, Title: "XML markup file"}
	TypeYAML         = Type{Key: "yaml", Suffixes: []string{".yml", ".yaml"}, Title: "YAML configuration source"}
)

Functions

func ContainsHeader

func ContainsHeader(s string) bool

func ReplaceSections

func ReplaceSections(fl *File, tgt filesystem.FileLoader) error

Types

type File

type File struct {
	Type    Type        `json:"type"`
	Path    []string    `json:"path,omitempty"`
	Name    string      `json:"name"`
	Mode    os.FileMode `json:"mode,omitempty"`
	Content string      `json:"-"`
	// contains filtered or unexported fields
}

func NewFile

func NewFile(path string, mode os.FileMode, b []byte, addHeader bool, logger *zap.SugaredLogger) *File

func (*File) FullPath

func (f *File) FullPath() string

type Files

type Files []*File

func (Files) Exists

func (f Files) Exists(path string) bool

func (Files) Get

func (f Files) Get(path string) *File

func (Files) String

func (f Files) String() string

type Inheritiance

type Inheritiance struct {
	Prefix  string `json:"prefix"`
	Suffix  string `json:"suffix"`
	Content string `json:"content"`
}

func InheritanceContent

func InheritanceContent(fl *File) (*Inheritiance, error)

type Type

type Type struct {
	Key      string
	Suffixes []string
	Title    string
}

func TypeFromString

func TypeFromString(s string) Type

func (*Type) MarshalJSON

func (t *Type) MarshalJSON() ([]byte, error)

func (*Type) String

func (t *Type) String() string

func (*Type) UnmarshalJSON

func (t *Type) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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