Get more of the container creation fleshed out
This commit is contained in:
22
server/filesystem.go
Normal file
22
server/filesystem.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user