Documentation ¶
Index ¶
- Constants
- Variables
- func AddBranchFromBuild(build, accessRank int, name, log, semver string) error
- func AddEmptyBranch(name string, accessRank int) error
- func AddStatTable(table ComplexStatTableInfo) error
- func AddUserStatFields(name string) error
- func CanUserAccessBranch(name string, rank int) bool
- func CanUserDispatch(pipe string) bool
- func CanUserJoin(pipe string, user *UserSession) bool
- func CountOnlineUsers() int
- func CreateBuild(log string) error
- func CreateGitBuild(commit string, log string) error
- func CreateSession(username string, password string) (string, error)
- func CreateUpdate(build int, branch, semver, log string) error
- func DeleteAchievementData(id int) error
- func DeleteStatTable(name string) error
- func DeleteUserStatFields(name string) error
- func Die()
- func DisconnectUser(userid int)
- func Dispatch(pipe, name string, message interface{})
- func DispatchRank(pipe, name string, message interface{}, rank int)
- func GenerateSessionId(username string) string
- func GetBranchActiveBuild(branchName string) (int, error)
- func GetBranchList(rank int) []string
- func GetBuildsCount() int
- func GetCompleteUpdatesInfos() completeBranchUpdatesData
- func GetLatestBuildCommit() (string, error)
- func GetMessages(userid int) chan string
- func GetPastLogs(size int64) string
- func GetProductionBranch() string
- func GetUpdateSystem() string
- func GetUpdaterVersion() int
- func GetUpdatesLocation() string
- func GetUserCount() int
- func GetUserStatsFields() ([]string, error)
- func HashPassword(password string, hash string) string
- func Init()
- func Install()
- func IsUserLongPolling(userid int) bool
- func Listen(pipe, name string, user *UserSession)
- func PrepareGitBuild(commit string) (gitBuildPrepInfos, error)
- func PurgeSessions()
- func RegisterUser(username string, password string, rank int) error
- func SendMessageToUserId(user *UserSession, message string)
- func SetAchievementData(id int, data AchievementData) error
- func SetActiveUpdate(branchName string, buildId int) error
- func SetStatFields(table ComplexStatTableInfo) error
- func SetStatTable(table ComplexStatTableInfo) error
- func SetUsersStatFields(fields string) error
- func SignalGameUpdated(branch Branch, update Update)
- func StopListen(pipe, name string, user *UserSession)
- func UpdateGitCommitCache() error
- func UserStopListen(user *UserSession)
- type Achievement
- type AchievementData
- type Branch
- type Build
- type Commit
- type ComplexStat
- type ComplexStatTableInfo
- type DashboardLogWriter
- type Diff
- type FieldStruct
- type KeyValue
- type MessagePipeline
- type NebuleuseError
- type Update
- type User
- func (u *User) Disconnect()
- func (u *User) FetchUserInfos(Bitmask int) error
- func (u *User) Heartbeat()
- func (u *User) PopulateAchievements() error
- func (u *User) PopulateStats() error
- func (u *User) SetAchievementProgress(aid int, value int) error
- func (u *User) SetComplexStats(stats []ComplexStat) error
- func (u *User) SetStats(stats []UserStat) error
- type UserSession
- type UserStat
Constants ¶
View Source
const ( NebErrorNone = iota // Generic error NebError = iota // Session is dead, you were disconnected NebErrorDisconnected = iota // Login failed NebErrorLogin = iota // There were errors during multiple operations NebErrorPartialFail = iota // User is not authorized to do that NebErrorAuthFail = iota )
View Source
const ( UserMaskBase = 1 << iota UserMaskOnlyId UserMaskAchievements UserMaskStats UserMaskAll = UserMaskStats | UserMaskAchievements )
View Source
const ( UserRankBanned = 1 << iota UserRankNormal UserRankDev UserRankAdmin UserRankTester )
View Source
const NebuleuseVersion = 1
Variables ¶
View Source
var ( Trace *log.Logger Info *log.Logger Warning *log.Logger Error *log.Logger LogWriter *io.Writer )
View Source
var Cfg configMgr
View Source
var Db *sql.DB
Functions ¶
func AddBranchFromBuild ¶
func AddEmptyBranch ¶
func AddStatTable ¶
func AddStatTable(table ComplexStatTableInfo) error
func AddUserStatFields ¶
func CanUserAccessBranch ¶
If branch doesn't exist, returns false
func CanUserDispatch ¶
func CanUserJoin ¶
func CanUserJoin(pipe string, user *UserSession) bool
func CountOnlineUsers ¶
func CountOnlineUsers() int
func CreateBuild ¶
func CreateGitBuild ¶
func CreateUpdate ¶
func DeleteAchievementData ¶
func DeleteStatTable ¶
func DeleteUserStatFields ¶
func DisconnectUser ¶
func DisconnectUser(userid int)
func DispatchRank ¶
func GenerateSessionId ¶
func GetBranchActiveBuild ¶
func GetBranchList ¶
func GetBuildsCount ¶
func GetBuildsCount() int
func GetCompleteUpdatesInfos ¶
func GetCompleteUpdatesInfos() completeBranchUpdatesData
func GetLatestBuildCommit ¶
func GetMessages ¶
func GetPastLogs ¶
func GetProductionBranch ¶
func GetProductionBranch() string
func GetUpdateSystem ¶
func GetUpdateSystem() string
func GetUpdaterVersion ¶
func GetUpdaterVersion() int
func GetUpdatesLocation ¶
func GetUpdatesLocation() string
func GetUserCount ¶
func GetUserCount() int
func GetUserStatsFields ¶
func HashPassword ¶
func IsUserLongPolling ¶
func Listen ¶
func Listen(pipe, name string, user *UserSession)
func PrepareGitBuild ¶
func PurgeSessions ¶
func PurgeSessions()
func SendMessageToUserId ¶
func SendMessageToUserId(user *UserSession, message string)
func SetAchievementData ¶
func SetAchievementData(id int, data AchievementData) error
func SetActiveUpdate ¶
func SetStatFields ¶
func SetStatFields(table ComplexStatTableInfo) error
func SetStatTable ¶
func SetStatTable(table ComplexStatTableInfo) error
func SetUsersStatFields ¶
func SignalGameUpdated ¶
func StopListen ¶
func StopListen(pipe, name string, user *UserSession)
func UpdateGitCommitCache ¶
func UpdateGitCommitCache() error
func UserStopListen ¶
func UserStopListen(user *UserSession)
Types ¶
type Achievement ¶
Achievements
type AchievementData ¶
type AchievementData struct { Id int Name string Max int FullName string FullDesc string Icon string }
func AddAchievementData ¶
func AddAchievementData(data AchievementData) (AchievementData, error)
func GetAchievementData ¶
func GetAchievementData(id string) (AchievementData, error)
func GetAchievementsData ¶
func GetAchievementsData() ([]AchievementData, error)
type Build ¶
type Commit ¶
type Commit struct { Id string Message string Committer string Date string TotalAddition, TotalDeletion int Diff []Diff }
func GetGitCommitList ¶
type ComplexStat ¶
type ComplexStatTableInfo ¶
type ComplexStatTableInfo struct { Name string Fields []FieldStruct AutoCount bool }
func GetComplexStatsTableInfos ¶
func GetComplexStatsTableInfos(table string) (ComplexStatTableInfo, error)
func GetComplexStatsTablesInfos ¶
func GetComplexStatsTablesInfos() ([]ComplexStatTableInfo, error)
type DashboardLogWriter ¶
type DashboardLogWriter struct { }
type FieldStruct ¶
type MessagePipeline ¶
type MessagePipeline struct {
// contains filtered or unexported fields
}
type NebuleuseError ¶
func (NebuleuseError) Error ¶
func (e NebuleuseError) Error() string
type Update ¶
type Update struct { Build *Build `json:"-"` BuildId int Branch string Size int64 RollBack bool SemVer string Log string Date time.Time NextInBranch *Update `json:"-"` PrevInBranch *Update `json:"-"` }
func GetBranchHead ¶
func GetBranchUpdates ¶
Only return updates that are active or are older than the active one
type User ¶
type User struct { Id int Username string Rank int Avatar string Achievements []Achievement Stats []UserStat }
User
func GetUsersInfos ¶
func (*User) Disconnect ¶
func (u *User) Disconnect()
func (*User) FetchUserInfos ¶
func (*User) PopulateAchievements ¶
func (*User) PopulateStats ¶
We load complex stats informations stored in neb_stats_tables to make a list of stats the user has. Entry for users is the users' fields and entries with AutoCount true are additional fields updated when a complex stat is added
func (*User) SetAchievementProgress ¶
func (*User) SetComplexStats ¶
func (u *User) SetComplexStats(stats []ComplexStat) error
type UserSession ¶
type UserSession struct { LongPolling bool `json:"-"` LastAlive time.Time SessionId string UserId int UserRank int Messages chan string `json:"-"` TimedOut chan int `json:"-"` }
func GetOnlineUsersList ¶
func GetOnlineUsersList() []UserSession
func GetSessionBySessionId ¶
func GetSessionBySessionId(sessionid string) *UserSession
func GetSessionByUserId ¶
func GetSessionByUserId(userid int) *UserSession
func (*UserSession) Heartbeat ¶
func (s *UserSession) Heartbeat()
Click to show internal directories.
Click to hide internal directories.