This commit is contained in:
or-else
2023-02-14 14:55:35 -08:00
parent 6dde89363b
commit 1c0a5fb017
8 changed files with 32 additions and 24 deletions

View File

@ -18,7 +18,9 @@ import (
)
// Singned AppID. Composition:
//
// [1:algorithm version][4:appid][2:key sequence][1:isRoot][16:signature] = 24 bytes
//
// convertible to base64 without padding. All integers are little-endian.
// Definitions for byte lengths of key's parts.
const (
@ -37,7 +39,9 @@ const (
)
// Client signature validation
//
// key: client's secret key
//
// Returns application id, key type.
func checkAPIKey(apikey string) (isValid, isRoot bool) {
if declen := base64.URLEncoding.DecodedLen(len(apikey)); declen != apikeyLength {

View File

@ -80,6 +80,7 @@ func (t *Topic) loadContacts(uid types.Uid) error {
// This topic got a request from a 'me' topic to start/stop sending presence updates.
// The originating topic reports its own status in 'what' as "on", "off", "gone" or "?unkn".
//
// "on" - requester came online
// "off" - requester is offline now
// "?none" - anchor for "+" command: requester status is unknown, won't generate a response

View File

@ -1267,6 +1267,7 @@ func (s *Session) note(msg *ClientComMessage) {
// expandTopicName expands session specific topic name to global name
// Returns
//
// topic: session-specific topic name the message recipient should see
// routeTo: routable global topic name
// err: *ServerComMessage with an error to return to the sender

View File

@ -19,6 +19,7 @@ import (
// A simple implementation of histogram expvar.Var.
// `Bounds` specifies the histogram buckets as follows (length = len(bounds)):
//
// (-inf, Bounds[i]) for i = 0
// [Bounds[i-1], Bounds[i]) for 0 < i < length
// [Bounds[i-1], +inf) for i = length

View File

@ -104,6 +104,7 @@ func normalizeTags(src []string) types.StringSlice {
}
// stringDelta extracts the slices of added and removed strings from two slices:
//
// added := newSlice - (oldSlice & newSlice) -- present in new but missing in old
// removed := oldSlice - (oldSlice & newSlice) -- present in old but missing in new
// intersection := oldSlice & newSlice -- present in both old and new