Versions in this module Expand all Collapse all v1 v1.0.0 Mar 2, 2021 Changes in this version + var BEAST_DATABASE string = "beast.db" + var BEAST_GLOBAL_DIR string = filepath.Join(os.Getenv("HOME"), ".beast") + var DBMux *sync.Mutex + var Db *gorm.DB + func AddNotification(notification *Notification) error + func BatchUpdateChallenge(whereMap map[string]interface{}, chall Challenge) error + func CheckPreviousSubmissions(userId uint, challId uint) (bool, error) + func CreateChallengeEntry(challenge *Challenge) error + func CreateUserEntry(user *User) error + func DeleteChallengeEntry(challenge *Challenge) error + func DeleteNotification(notification *Notification) error + func DeleteRelatedPorts(portList []Port) error + func GetUserRank(userID uint, userScore uint, updatedAt time.Time) (rank int64, error error) + func QueryOrCreateTagEntry(tag *Tag) error + func SaveFlagSubmission(user_challenges *UserChallenges) error + func SaveTransaction(transaction *Transaction) error + func UpdateChallenge(chall *Challenge, m map[string]interface{}) error + func UpdateNotification(notify *Notification, m map[string]interface{}) error + func UpdateUser(user *User, m map[string]interface{}) error + type AuthorizedKeyTemplate struct + Command string + PubKey string + UserID string + type Challenge struct + AuthorID uint + ContainerId string + Description string + Flag string + Format string + HealthCheck uint + Hints string + ImageId string + Name string + Points uint + Ports []Port + Sidecar string + Status string + Tags []*Tag + Type string + Users []*User + func GetRelatedChallenges(user *User) ([]Challenge, error) + func QueryAllChallenges() ([]Challenge, error) + func QueryChallengeEntries(key string, value string) ([]Challenge, error) + func QueryChallengeEntriesMap(whereMap map[string]interface{}) ([]Challenge, error) + func QueryFirstChallengeEntry(key string, value string) (Challenge, error) + func QueryRelatedChallenges(tag *Tag) ([]Challenge, error) + func (challenge *Challenge) AfterCreate(tx *gorm.DB) error + func (challenge *Challenge) AfterDelete(tx *gorm.DB) error + func (challenge *Challenge) AfterUpdate(tx *gorm.DB) error + type Notification struct + Description string + Title string + func QueryAllNotification() ([]Notification, error) + func QueryFirstNotificationEntry(key string, value string) (Notification, error) + func QueryNotificationEntries(key string, value string) ([]Notification, error) + type Port struct + ChallengeID uint + PortNo uint32 + func GetAllocatedPorts(challenge Challenge) ([]Port, error) + func PortEntryGetOrCreate(port *Port) (Port, error) + type ScriptFile struct + Challenges map[string]string + User string + type Tag struct + Challenges []*Challenge + TagName string + func GetRelatedTags(challenge *Challenge) ([]Tag, error) + func QueryTags(whereMap map[string]interface{}) ([]*Tag, error) + type Transaction struct + Action string + ChallengeID uint + UserID uint + type User struct + Challenges []*Challenge + Email string + Name string + Score uint + SshKey string + Status uint + func GetRelatedUsers(challenge *Challenge) ([]User, error) + func QueryAllUsers() ([]User, error) + func QueryFirstUserEntry(key string, value string) (User, error) + func QueryUserById(authorID uint) (User, error) + func QueryUserEntries(key string, value string) ([]User, error) + func (user *User) AfterCreate(tx *gorm.DB) error + func (user *User) AfterDelete(tx *gorm.DB) error + func (user *User) AfterUpdate(tx *gorm.DB) error + type UserChallenges struct + ChallengeID uint + CreatedAt time.Time + UserID uint + func QueryAllSubmissions() ([]UserChallenges, error)