Get more of the container creation fleshed out

This commit is contained in:
Dane Everitt
2019-04-03 22:49:15 -07:00
parent 3e4fcd527d
commit c683809efc
3 changed files with 130 additions and 10 deletions

22
server/filesystem.go Normal file
View File

@@ -0,0 +1,22 @@
package server
import "path"
type Filesystem struct {
// The root directory where all of the server data is contained. By default
// this is going to be /srv/daemon-data but can vary depending on the system.
Root string
// The server object associated with this Filesystem.
Server *Server
}
// Returns the root path that contains all of a server's data.
func (fs *Filesystem) Path() string {
return path.Join(fs.Root, fs.Server.Uuid)
}
// Returns a safe path for a server object.
func (fs *Filesystem) SafePath(p string) string {
return fs.Path()
}