app

package
v0.0.0-...-f8e6c51 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package app handles all the application settings

Index

Constants

This section is empty.

Variables

View Source
var (
	// DB config
	DB = DBStruct{}

	// ProjectRoot var
	ProjectRoot string

	// Verbose logging
	Verbose bool

	// TempFiles get cleaned up on exit
	TempFiles []string

	// TempDir runtime variable can overridden with flags
	TempDir string

	// OnlyAssets runtime variable set with flags
	OnlyAssets bool

	// OnlyDB runtime variable set with flags
	OnlyDB bool

	// IgnoreResampled runtime variable set with flags
	IgnoreResampled bool

	// ResampledRegex regular expressions should match all common thumbnail manipulations except for
	// resized images as those tend to be linked from HTMLText and aren't auto-generated without a republish
	ResampledRegex = []*regexp.Regexp{

		regexp.MustCompile(`(?i)\_\_(Fit|Fill|Scale|Resampled)([a-z0-9]+)\.(jpg|png|jpeg|tiff)$`),

		regexp.MustCompile(`(?i)\/\_resampled\/(Pad|CMSThumbnail|stripthumbnail|Cropped|Set|Fit|Fill|Scale|Resampled).*\.(jpg|png|jpeg|tiff)`),
	}
)

Functions

func AddTempFile

func AddTempFile(file string)

AddTempFile adds a file to the temporary files to clean up

func BootstrapEnv

func BootstrapEnv(dir string) error

BootstrapEnv sets up the Silverstripe environment

func Cleanup

func Cleanup() error

Cleanup removes temporary files & directories on exit

func GetTempDir

func GetTempDir() string

GetTempDir will create & return a temporary directory if one has not been specified

func Log

func Log(msg string)

Log will print out data in verbose output

func RealPath

func RealPath(filename string) string

RealPath will return the actual path if the path is a symbolic link

Types

type DBStruct

type DBStruct struct {
	// Host database host
	Host string

	// Username database user
	Username string

	// Password database password
	Password string

	// Name database name
	Name string

	// Port database port (as string)
	Port string

	// Database type (mysql, postgres etc)
	Type string
}

DBStruct struct

Jump to

Keyboard shortcuts

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