Documentation ¶
Index ¶
- func CreateTempDir(user, dirName string) error
- func CreateTempFile(user, dirName, filename, extension string) (string, error)
- func DeleteAll(user string) error
- func DeleteTempDir(user, dirName string) error
- func ExecutableFile(user, dirname, filename string) string
- func WriteToFile(filename, code string) error
- type Database
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempDir ¶
CreateTempDir creates a temporary directory for the user at `/tmp/<user>/<dirName>`.
func CreateTempFile ¶
CreateTempFile creates a temporary file for the user at location `/tmp/<user>/<dirName>/<filename><extension>`.
func DeleteAll ¶
DeleteAll deletes all directories and files for the user at location `/tmp/<user>`.
func DeleteTempDir ¶
DeleteTempDir deletes the temporary directory for the user at location `/tmp/<user>/<dirName>`.
func ExecutableFile ¶
ExecutableFile returns the path to the executable file for the user.
func WriteToFile ¶
WriteToFile writes the code to the file at the given path. If the file does not exist, it will be created. If the file exists, the code will be appended to the file.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) Connect ¶
Connect connects the database to `mongodb://database:27017` and sets up the client to this database. It also initializes the `client` in the database struct.
func (*Database) CreateCollection ¶
CreateCollection creates a new collection in the database `kira`. It also sets the `db` database struct field. When the creation of the collection returns an error, it will return this error in this function.
func (*Database) Disconnect ¶
func (d *Database) Disconnect()
Disconnect closes the connection to the database.