Documentation ¶
Index ¶
- Constants
- Variables
- func Base64ToString(v string) (c string, err error)
- func GenUUID() string
- func NewTokenCert(str string) *string
- func ParseUUID(uuidStr string) (uuid.UUID, error)
- func PromptInfo(message ...string)
- func PromptWarning(message ...string)
- func PublicFlag(tagVer string, goVer string, timeVer string)
- func PublicServerFlag()
- func PublicVersion()
- func StartPPOFDebug(server http.Server, showHelp bool)
- func StringToBase64(v string) (c string)
- func StringToMD5(v string) (c string)
- func StringToSha1(v string) (c string)
- func StringToSha256(v string) (c string)
- func StringToSha512(v string) (c string)
- func TimestampToUTC8String(timestamp int64) string
- func TimestampToUTCString(timestamp int64) string
- func UTC8StringToTimestamp(str string) (int64, error)
- func UTCStringToTimestamp(str string) (int64, error)
- func VerifyToken(v string, tokenCert *string) error
- type Logger
- type Token
Constants ¶
View Source
const ( UserRoleTypeCodeUndefine int = 0 UserRoleTypeCodeRoot int = 1 UserRoleTypeCodeMaintainer int = 2 UserRoleTypeCodeManager int = 3 UserRoleTypeCodeLeader int = 4 UserRoleTypeCodeTeacher int = 5 UserRoleTypeCodeUndergraduate int = 6 UserRoleTypeCodeGraduateStudent int = 7 UserRoleTypeCodeDoctoralStudent int = 8 )
View Source
const ( UserGenderTypeCodeOther int = 0 UserGenderTypeCodeMan int = 1 UserGenderTypeCodeWoMan int = 2 )
View Source
const ( QuestionLevelCodeBasic int = 0 QuestionLevelCodeNormal int = 1 QuestionLevelCodeDifficult int = 2 QuestionLevelCodeChallenging int = 3 )
View Source
const ( QuestionTypeCodeSingle = 0 QuestionTypeCodeMultiple = 1 QuestionTypeCodeJudge = 2 )
View Source
const ( FileTypeCodeJPG = 0 FileTypeCodePNG = 1 FileTypeCodePPT = 2 FileTypeCodeXLS = 3 FileTypeCodeDOC = 4 FileTypeCodePPTX = 5 FileTypeCodeXLSX = 6 FileTypeCodeDOCX = 7 FileTypeCodePDF = 8 FileTypeCodeMP3 = 9 FileTypeCodeMP4 = 10 FileTypeCodeZIP = 11 )
View Source
const ( LogDebug int = iota LogInfo LogWarning LogError )
View Source
const DefTokenCert string = "96be053dab04"
View Source
const DefaultPassword = "1234567890"
View Source
const TokenHeader string = "3c6b9fc1"
View Source
const TokenSplitCharacter string = "."
Variables ¶
View Source
var ( FlagHelp bool FlagVersion bool FlagUseSqlite bool FlagUsePG bool FlagSqliteDB string FlagPgAddr string FlagPgPort int FlagPgDB string FlagPgUser string FlagPgPassword string FlagPgSSLMode string FlagPgSSLCert string FlagPgSSLKey string FlagPgSSLRootCert string FlagLogLevel int )
View Source
var ( BuildTag string BuildGo string BuildTime string )
Functions ¶
func Base64ToString ¶
func NewTokenCert ¶
func PromptInfo ¶ added in v0.6.0
func PromptInfo(message ...string)
func PromptWarning ¶ added in v0.6.0
func PromptWarning(message ...string)
func PublicFlag ¶ added in v0.2.0
func PublicServerFlag ¶ added in v0.4.0
func PublicServerFlag()
func PublicVersion ¶ added in v0.4.0
func PublicVersion()
func StartPPOFDebug ¶
func StringToBase64 ¶
func TimestampToUTC8String ¶
func TimestampToUTCString ¶
func UTC8StringToTimestamp ¶
func UTCStringToTimestamp ¶
func VerifyToken ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type Token ¶
type Token struct { Timestamp int64 `json:"timestamp"` LifeCycle int64 `json:"lifeCycle"` UUID string `json:"uuid"` AccountID int `json:"accountID"` Name string `json:"name"` Gender int `json:"gender"` CollegeUUID string `json:"collegeUUID"` DisciplineUUID string `json:"disciplineUUID"` ClassUUID string `json:"classUUID"` Type int `json:"type"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.