Documentation ¶
Index ¶
- Constants
- func AggRateLimits(rlimits []chat1.RateLimit) (res []chat1.RateLimit)
- func AggRateLimitsP(rlimits []*chat1.RateLimit) (res []chat1.RateLimit)
- func Collar(lower int, ideal int, upper int) int
- func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery) (res []chat1.MessageUnboxed)
- func ParseDurationExtended(s string) (d time.Duration, err error)
- func ParseTimeFromRFC3339OrDurationFromPast(kbCtx KeybaseContext, s string) (t time.Time, err error)
- func ReorderParticipants(udc *UserDeviceCache, uimap *UserInfoMapper, tlfname string, ...) (writerNames []string, readerNames []string, err error)
- type BadTLFNameError
- type KeybaseContext
- type NoSuchNameError
- type NoSuchUserError
- type TlfNameNotCanonical
- type UserDeviceCache
- type UserInfoMapper
Constants ¶
const ( // ReaderSep is the string that separates readers from writers in a // TLF name. ReaderSep = "#" // TlfHandleExtensionSep is the string that separates the folder // participants from an extension suffix in the TLF name. TlfHandleExtensionSep = " " // PublicUIDName is the name given to keybase1.PublicUID. This string // should correspond to an illegal or reserved Keybase user name. PublicUIDName = "_public" )
Variables ¶
This section is empty.
Functions ¶
func AggRateLimitsP ¶
AggRateLimitsP takes a list of rate limit responses and dedups them to the last one received of each category
func FilterByType ¶
func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery) (res []chat1.MessageUnboxed)
func ParseDurationExtended ¶
parseDurationExtended is like time.ParseDuration, but adds "d" unit. "1d" is one day, defined as 24*time.Hour. Only whole days are supported for "d" unit, but it can be followed by smaller units, e.g., "1d1h".
func ParseTimeFromRFC3339OrDurationFromPast ¶
func ParseTimeFromRFC3339OrDurationFromPast(kbCtx KeybaseContext, s string) (t time.Time, err error)
func ReorderParticipants ¶
func ReorderParticipants(udc *UserDeviceCache, uimap *UserInfoMapper, tlfname string, activeList []gregor1.UID) (writerNames []string, readerNames []string, err error)
Reorder participants based on the order in activeList. Only allows usernames from tlfname in the output. This never fails, worse comes to worst it just returns the split of tlfname.
Types ¶
type BadTLFNameError ¶
type BadTLFNameError struct {
Name string
}
BadTLFNameError indicates a top-level folder name that has an incorrect format.
func (BadTLFNameError) Error ¶
func (e BadTLFNameError) Error() string
Error implements the error interface for BadTLFNameError.
type KeybaseContext ¶
type KeybaseContext interface { GetLog() logger.Logger LoadUserByUID(uid keybase1.UID) (*libkb.User, error) Clock() clockwork.Clock }
KeybaseContext defines what chat needs from Keybase
type NoSuchNameError ¶
type NoSuchNameError struct {
Name string
}
NoSuchNameError indicates that the user tried to access a subdirectory entry that doesn't exist.
func (NoSuchNameError) Error ¶
func (e NoSuchNameError) Error() string
Error implements the error interface for NoSuchNameError
type NoSuchUserError ¶
type NoSuchUserError struct {
Input string
}
NoSuchUserError indicates that the given user couldn't be resolved.
func (NoSuchUserError) Error ¶
func (e NoSuchUserError) Error() string
Error implements the error interface for NoSuchUserError
func (NoSuchUserError) ToStatus ¶
func (e NoSuchUserError) ToStatus() keybase1.Status
ToStatus implements the keybase1.ToStatusAble interface for NoSuchUserError
type TlfNameNotCanonical ¶
type TlfNameNotCanonical struct {
Name, NameToTry string
}
TlfNameNotCanonical indicates that a name isn't a canonical, and that another (not necessarily canonical) name should be tried.
func (TlfNameNotCanonical) Error ¶
func (e TlfNameNotCanonical) Error() string
type UserDeviceCache ¶
UserDeviceCache looks up usernames and device names, memoizing the results. These bindings are immutable and can be cached forever.
func NewUserDeviceCache ¶
func NewUserDeviceCache(kbCtx KeybaseContext) *UserDeviceCache
func (*UserDeviceCache) LookupUsername ¶
func (c *UserDeviceCache) LookupUsername(uimap *UserInfoMapper, uid keybase1.UID) (username string, err error)
func (*UserDeviceCache) LookupUsernameAndDeviceName ¶
func (c *UserDeviceCache) LookupUsernameAndDeviceName(uimap *UserInfoMapper, uid keybase1.UID, deviceID keybase1.DeviceID) (username string, devicename string, err error)
type UserInfoMapper ¶
UserInfoMapper looks up usernames and device names, memoizing the results. Only intended to be used for a single request (i.e., getting all the users and devices for a thread).
func GetUserInfoMapper ¶
func GetUserInfoMapper(ctx context.Context, kbCtx KeybaseContext) (context.Context, *UserInfoMapper)