mirror of
https://github.com/Xevion/banner.git
synced 2025-12-09 18:06:29 -06:00
Rename NoCache() to Nonce()
This commit is contained in:
14
api.go
14
api.go
@@ -15,7 +15,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sessionID = RandomString(5) + NoCache()
|
sessionID = RandomString(5) + Nonce()
|
||||||
log.Printf("Session ID: %s", sessionID)
|
log.Printf("Session ID: %s", sessionID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ func GetTerms(search string, offset int, max int) ([]Term, error) {
|
|||||||
"searchTerm": search,
|
"searchTerm": search,
|
||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
onRequest(req)
|
onRequest(req)
|
||||||
@@ -62,7 +62,7 @@ func GetPartOfTerms(search string, term int, offset int, max int) ([]TermParts,
|
|||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"uniqueSessionId": sessionID,
|
"uniqueSessionId": sessionID,
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
@@ -89,7 +89,7 @@ func GetInstructor(search string, term int, offset int, max int) []Instructor {
|
|||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"uniqueSessionId": sessionID,
|
"uniqueSessionId": sessionID,
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
@@ -171,7 +171,7 @@ func GetSubjects(search string, term int, offset int, max int) []Subject {
|
|||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"uniqueSessionId": sessionID,
|
"uniqueSessionId": sessionID,
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
@@ -199,7 +199,7 @@ func GetCampuses(search string, term int, offset int, max int) []Campus {
|
|||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"uniqueSessionId": sessionID,
|
"uniqueSessionId": sessionID,
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
@@ -227,7 +227,7 @@ func GetInstructionalMethods(search string, term int, offset int, max int) ([]In
|
|||||||
"offset": strconv.Itoa(offset),
|
"offset": strconv.Itoa(offset),
|
||||||
"max": strconv.Itoa(max),
|
"max": strconv.Itoa(max),
|
||||||
"uniqueSessionId": sessionID,
|
"uniqueSessionId": sessionID,
|
||||||
"_": NoCache(),
|
"_": Nonce(),
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ func RandomString(n int) string {
|
|||||||
return string(b)
|
return string(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NoCache() string {
|
// Nonce returns a string made up of the current time in milliseconds, Unix epoch/UTC
|
||||||
|
func Nonce() string {
|
||||||
return strconv.Itoa(int(time.Now().UnixMilli()))
|
return strconv.Itoa(int(time.Now().UnixMilli()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user