mirror of
https://github.com/tinode/chat.git
synced 2025-03-14 10:05:07 +00:00
gofmt -w
This commit is contained in:
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user