Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SysName is the name of the system (in case we need to rename it) SysName = "Autograder" // SysNameLC is lower case version of the name of the system SysNameLC = "autograder" // SysURL is the placeholder URL for the system SysURL = "http://autograder.org" // FileName is the default file name for the JSON configuration file. FileName = "config" // StdPath is the default path used unless a path is provided at start up. StdPath = "./autograder" )
Variables ¶
This section is empty.
Functions ¶
func PrintInstructions ¶
func PrintInstructions()
PrintInstructions prints the configuration instructions.
Types ¶
type Configuration ¶
type Configuration struct { URL string `json:",omitempty"` Admin string `json:",omitempty"` OAuthClientID string `json:",omitempty"` OAuthClientSecret string `json:",omitempty"` BasePath string `json:",omitempty"` }
Configuration contains the necessary configuration data for the system.
func Load ¶
func Load(path string) (*Configuration, error)
Load loads the configuration file in the provided directory.
func NewConfig ¶
func NewConfig(url, admin, clientID, clientSecret, path string) (*Configuration, error)
NewConfig creates a new configuration object.
func (*Configuration) Save ¶
func (c *Configuration) Save() error
Save saves the configuration file in basepath.
func (*Configuration) SetCurrent ¶
func (c *Configuration) SetCurrent()
SetCurrent sets the current configuration. After this it cannot be set again.
Click to show internal directories.
Click to hide internal directories.