storage

package
v0.0.0-...-b33f08c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GITCONFIG = `` /* 143-byte string literal not displayed */

GITCONFIG is the default contents of the .git/gitconfig file

View Source
const GITIGNORE = `
*~
logs/
`

GITIGNORE is the default contents of the .gitignore file

Variables

View Source
var (
	STORAGEDIR   string
	JARDIR       string
	SERVERDIR    string
	SPIGOTBLDDIR string
)

Necesary storage directories

View Source
var (
	DEFAULTFILEPERM fs.FileMode = 0640
	DEFAULTDIRPERM  fs.FileMode = 0750
)

Default file and directory permissions

Functions

func AuditWrite

func AuditWrite(who, what, where string)

AuditWrite writes an entry to the audit log

func DeleteServer

func DeleteServer(id string) error

DeleteServer is WAY scary!!!

func DeployJar

func DeployJar(flavor, release, serverID string) error

DeployJar will copy (and download if necessary) the specified release jar into the server directory

func DownloadJar

func DownloadJar(flavor, release, jarURL string, force bool) error

DownloadJar downloads a jar file

func EraseServerFile

func EraseServerFile(id, fname string) error

EraseServerFile will remove a file from the instance dir

func GetReleases

func GetReleases(flavor string) ([]string, error)

GetReleases returns a list of jar files (minus the extension) for the specified flavor

func GitCommit

func GitCommit(serverID, message string) error

GitCommit adds all files in the instance dir and commits them

func JarExists

func JarExists(flavor, release string) bool

JarExists returns whether or now a jar file is available in storage

func MakeServerDir

func MakeServerDir(id string) error

MakeServerDir creates the server directory

func Prepare

func Prepare(sd string) error

Prepare will create all the base storage directories

func SetupServerBackup

func SetupServerBackup(serverID string) error

SetupServerBackup initializes a git repo inside an instance dir

func WriteServerFile

func WriteServerFile(id, fname string, content []byte) error

WriteServerFile will save the given filename (and content) to the server directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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