configurator

package
v10.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlavorNativeLinux denotes native linux executables
	FlavorNativeLinux Flavor = "linux"
	// ExecNativeMacos denotes native macOS executables
	FlavorNativeMacos = "macos"
	// FlavorPe denotes native windows executables
	FlavorNativeWindows = "windows"
	// FlavorAppMacos denotes a macOS app bundle
	FlavorAppMacos = "app-macos"
	// FlavorScript denotes scripts starting with a shebang (#!)
	FlavorScript = "script"
	// FlavorScriptWindows denotes windows scripts (.bat or .cmd)
	FlavorScriptWindows = "windows-script"
	// FlavorJar denotes a .jar archive with a Main-Class
	FlavorJar = "jar"
	// FlavorHTML denotes an index html file
	FlavorHTML = "html"
	// FlavorLove denotes a love package
	FlavorLove = "love"
)
View Source
const (
	WindowsInstallerTypeMsi      WindowsInstallerType = "msi"
	WindowsInstallerTypeInno                          = "inno"
	WindowsInstallerTypeNullsoft                      = "nsis"
	// self-extracting installer that unarchiver knows how to extract
	WindowsInstallerTypeArchive = "archive"
)
View Source
const (
	PenaltyExclude = iota
	PenaltyScore
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch

type Arch string
const (
	Arch386   Arch = "386"
	ArchAmd64      = "amd64"
)

type BiggestFirst

type BiggestFirst struct {
	// contains filtered or unexported fields
}

func (*BiggestFirst) Len

func (bf *BiggestFirst) Len() int

func (*BiggestFirst) Less

func (bf *BiggestFirst) Less(i, j int) bool

func (*BiggestFirst) Swap

func (bf *BiggestFirst) Swap(i, j int)

type BlacklistEntry

type BlacklistEntry struct {
	// contains filtered or unexported fields
}

type Candidate

type Candidate struct {
	Path        string       `json:"path"`
	Mode        uint32       `json:"mode,omitempty"`
	Depth       int          `json:"depth"`
	Flavor      Flavor       `json:"flavor"`
	Arch        Arch         `json:"arch,omitempty"`
	Size        int64        `json:"size"`
	Spell       []string     `json:"spell,omitempty"`
	WindowsInfo *WindowsInfo `json:"windowsInfo,omitempty"`
	LinuxInfo   *LinuxInfo   `json:"linuxInfo,omitempty"`
	MacosInfo   *MacosInfo   `json:"macosInfo,omitempty"`
	LoveInfo    *LoveInfo    `json:"loveInfo,omitempty"`
	ScriptInfo  *ScriptInfo  `json:"scriptInfo,omitempty"`
	JarInfo     *JarInfo     `json:"jarInfo,omitempty"`
}

Candidate indicates what's interesting about a file

func SelectByArch

func SelectByArch(candidates []*Candidate, a Arch) []*Candidate

func SelectByFlavor

func SelectByFlavor(candidates []*Candidate, f Flavor) []*Candidate

func SelectByFunc

func SelectByFunc(candidates []*Candidate, f CandidateFilter) []*Candidate

func Sniff

func Sniff(r io.ReadSeeker, path string, size int64) (*Candidate, error)

func (*Candidate) String

func (c *Candidate) String() string

type CandidateFilter

type CandidateFilter func(candidate *Candidate) bool

type Flavor

type Flavor string

Flavor describes the flavor of an executable

type HighestScoreFirst

type HighestScoreFirst struct {
	// contains filtered or unexported fields
}

func (*HighestScoreFirst) Len

func (hsf *HighestScoreFirst) Len() int

func (*HighestScoreFirst) Less

func (hsf *HighestScoreFirst) Less(i, j int) bool

func (*HighestScoreFirst) Swap

func (hsf *HighestScoreFirst) Swap(i, j int)

type JarInfo

type JarInfo struct {
	MainClass string `json:"mainClass,omitempty"`
}

type LinuxInfo

type LinuxInfo struct {
}

type LoveInfo

type LoveInfo struct {
	Version string `json:"version,omitempty"`
}

type MacosInfo

type MacosInfo struct {
}

type Penalty

type Penalty struct {
	// contains filtered or unexported fields
}

type PenaltyKind

type PenaltyKind int

type ScoredCandidate

type ScoredCandidate struct {
	// contains filtered or unexported fields
}

type ScriptInfo

type ScriptInfo struct {
	Interpreter string `json:"interpreter,omitempty"`
}

type Verdict

type Verdict struct {
	BasePath   string       `json:"basePath"`
	TotalSize  int64        `json:"totalSize"`
	Candidates []*Candidate `json:"candidates"`
}

func Configure

func Configure(root string, showSpell bool) (*Verdict, error)

func (*Verdict) FilterPlatform

func (v *Verdict) FilterPlatform(osFilter string, archFilter string)

func (*Verdict) FixPermissions

func (v *Verdict) FixPermissions(dryrun bool) ([]string, error)

func (*Verdict) String

func (v *Verdict) String() string

type WindowsInfo

type WindowsInfo struct {
	InstallerType WindowsInstallerType `json:"installerType,omitempty"`
	Uninstaller   bool                 `json:"uninstaller,omitempty"`
	Gui           bool                 `json:"gui,omitempty"`
	DotNet        bool                 `json:"dotNet,omitempty"`
}

type WindowsInstallerType

type WindowsInstallerType string

Jump to

Keyboard shortcuts

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