Documentation ¶
Overview ¶
Package conf includes configurations related manipulations.
Index ¶
- Constants
- Variables
- func CreateWorkspaceDir(path string)
- func FixedTimeCheckEnv()
- func GetEditorThemes() []string
- func GetGoFmt(username string) string
- func GetOwner(path string) string
- func GetThemes() []string
- func GetUserWorkspace(username string) string
- func Load(...)
- func Salt(password, salt string) string
- func UpdateCustomizedConf(username string)
- type LatestSessionContent
- type User
Constants ¶
const ( // PathSeparator holds the OS-specific path separator. PathSeparator = string(os.PathSeparator) // PathListSeparator holds the OS-specific path list separator. PathListSeparator = string(os.PathListSeparator) // WideVersion holds the current wide version. WideVersion = "1.1.0" // CodeMirrorVer holds the current editor version. CodeMirrorVer = "4.10" )
Variables ¶
var Docker bool
Indicates whether runs via Docker.
var Users []*User
configurations of users.
var Wide *conf
Wide configurations.
Functions ¶
func CreateWorkspaceDir ¶
func CreateWorkspaceDir(path string)
CreateWorkspaceDir creates (if not exists) directories on the path.
- root directory:{path}
- src directory: {path}/src
- package directory: {path}/pkg
- binary directory: {path}/bin
func FixedTimeCheckEnv ¶
func FixedTimeCheckEnv()
FixedTimeCheckEnv checks Wide runtime enviorment periodically (7 minutes).
Exits process if found fatal issues (such as not found $GOPATH), Notifies user by notification queue if found warning issues (such as not found gocode).
func GetEditorThemes ¶
func GetEditorThemes() []string
GetEditorThemes gets the names of editor themes.
func GetUserWorkspace ¶
GetUserWorkspace gets workspace path with the specified username, returns "" if not found.
func Load ¶
func Load(confPath, confIP, confPort, confServer, confLogLevel, confStaticServer, confContext, confChannel string, confDocker bool)
Load loads the Wide configurations from wide.json and users' configurations from users/{username}.json.
func UpdateCustomizedConf ¶
func UpdateCustomizedConf(username string)
UpdateCustomizedConf creates (if not exists) or updates user customized configuration files.
- /static/user/{username}/style.css
Types ¶
type LatestSessionContent ¶
type LatestSessionContent struct { FileTree []string // paths of expanding nodes of file tree Files []string // paths of files of opening editor tabs CurrentFile string // path of file of the current focused editor tab }
LatestSessionContent represents the latest session content.
type User ¶
type User struct { Name string Password string Salt string Email string Gravatar string // see http://gravatar.com Workspace string // the GOPATH of this user Locale string GoFormat string FontFamily string FontSize string Theme string Created int64 // user create time in unix nano Updated int64 // preference update time in unix nano Lived int64 // the latest session activity in unix nano Editor *editor LatestSessionContent *LatestSessionContent }
User configuration.
func GetUser ¶
GetUser gets configuration of the user specified by the given username, returns nil if not found.
func (*User) GetWorkspace ¶
GetWorkspace gets workspace path of the user.
Compared to the use of Wide.Workspace, this function will be processed as follows:
- Replace {WD} variable with the actual directory path
- Replace ${GOPATH} with enviorment variable GOPATH
- Replace "/" with "\\" (Windows)