Versions in this module Expand all Collapse all v1 v1.1.2 Aug 11, 2026 v1.1.1 Aug 4, 2026 v1.1.0 Aug 3, 2026 Changes in this version + const DefaultListLimit + const DefaultMaxFriends + const DefaultMaxPending + const GroupChannelMsgAdd + const GroupChannelMsgBan + const GroupChannelMsgDemote + const GroupChannelMsgJoin + const GroupChannelMsgKick + const GroupChannelMsgLeave + const GroupChannelMsgPromote + const GroupStateClosed + const GroupStateOpen + const MaxListLimit + const NotificationCodeFriendAccept + const NotificationCodeFriendImport + const NotificationCodeFriendRemove + const NotificationCodeFriendRequest + const NotificationCodeGroupAdd + const NotificationCodeGroupJoinRequest + const RoleAdmin + const RoleBanned + const RoleJoinRequest + const RoleMember + const RoleSuperAdmin + const StateBlocked + const StateFriend + const StateInviteReceived + const StateInviteSent + var ErrCannotAddSelf = errors.New("cannot add yourself as friend") + var ErrCannotBlockSelf = errors.New("cannot block yourself") + var ErrFriendLimitReached = errors.New("friend count limit reached") + var ErrInvalidCursor = errors.New("invalid friends cursor") + var ErrPendingLimitReached = errors.New("pending friend request limit reached") + var ImportHTTPClient = &http.Client + func AddFriend(ctx context.Context, pool *pgxpool.Pool, sourceID, destinationID string) error + func AddFriendWithOpts(ctx context.Context, pool *pgxpool.Pool, ...) error + func AddGroupUsers(ctx context.Context, pool *pgxpool.Pool, callerID, groupID string, ...) error + func BanGroupUsers(ctx context.Context, pool *pgxpool.Pool, callerID, groupID string, ...) error + func BlockUser(ctx context.Context, pool *pgxpool.Pool, sourceID, destinationID string) error + func DeleteFriend(ctx context.Context, pool *pgxpool.Pool, sourceID, destinationID string, ...) error + func DeleteGroup(ctx context.Context, pool *pgxpool.Pool, callerID, id string) error + func DemoteMember(ctx context.Context, pool *pgxpool.Pool, kickerID, userID, groupID string) error + func FetchFacebookFriendIDs(ctx context.Context, accessToken string) ([]string, error) + func FetchSteamFriendIDs(ctx context.Context, publisherKey, steamID string) ([]string, error) + func FriendMetadataUpdate(ctx context.Context, pool *pgxpool.Pool, userID, friendID string, ...) error + func GetUserRole(ctx context.Context, pool *pgxpool.Pool, userID, groupID string) (int, error) + func ImportFacebookFriends(ctx context.Context, pool *pgxpool.Pool, userID, username, token string, ...) error + func ImportFriendsFromProviderIDs(ctx context.Context, pool *pgxpool.Pool, userID, username, column string, ...) error + func ImportSteamFriends(ctx context.Context, pool *pgxpool.Pool, userID, username, steamToken string, ...) error + func IsGroupMember(ctx context.Context, pool *pgxpool.Pool, userID, groupID string) (bool, error) + func JoinGroup(ctx context.Context, pool *pgxpool.Pool, userID, groupID string, ...) error + func KickMember(ctx context.Context, pool *pgxpool.Pool, kickerID, userID, groupID string) error + func LeaveGroup(ctx context.Context, pool *pgxpool.Pool, userID, groupID string) error + func ParseLegacyPositionCursor(cursor string) int64 + func PromoteMember(ctx context.Context, pool *pgxpool.Pool, kickerID, userID, groupID string) error + func ResolveUserIDs(ctx context.Context, pool *pgxpool.Pool, ids, usernames []string) ([]string, error) + func UnblockUser(ctx context.Context, pool *pgxpool.Pool, sourceID, destinationID string) error + func UpdateGroup(ctx context.Context, pool *pgxpool.Pool, ...) error + func UpdateGroupMaxCount(ctx context.Context, pool *pgxpool.Pool, id string, maxCount int) error + func UserExistsAndDoesNotBlock(ctx context.Context, pool *pgxpool.Pool, checkUserID, blocksUserID string) (bool, error) + func UsersGetFriendStatus(ctx context.Context, pool *pgxpool.Pool, userID string, friendIDs []string) (map[string]int, error) + type ChannelBroadcaster interface + BroadcastGroupChannelMessage func(ctx context.Context, groupID string, code int16, ...) + var DefaultChannelBroadcaster ChannelBroadcaster = noopChannelBroadcaster{} + type Config struct + MaxFriends int + MaxPending int + func DefaultConfig() Config + type CreateGroupParams struct + AvatarURL string + Description string + LangTag string + MaxCount int + Metadata string + Name string + Open bool + type FacebookFriendProfile struct + ID string + Name string + type Friend struct + Metadata string + Position int64 + State int + UpdateTime time.Time + User FriendUser + func GetFriends(ctx context.Context, pool *pgxpool.Pool, userID string) ([]Friend, error) + func ListFriends(ctx context.Context, pool *pgxpool.Pool, userID string, filterState int, ...) ([]Friend, string, error) + type FriendNotifier interface + Notify func(ctx context.Context, userID, subject, content string, code int16, ...) error + var DefaultNotifier FriendNotifier = NoopNotifier{} + type FriendOfFriend struct + Referrer string + User FriendUser + func ListFriendsOfFriends(ctx context.Context, pool *pgxpool.Pool, userID string, limit int, ...) ([]FriendOfFriend, string, error) + type FriendUser struct + AvatarURL string + CreateTime time.Time + DisplayName string + EdgeCount int32 + ID string + LangTag string + Location string + Metadata string + Timezone string + UpdateTime time.Time + Username string + type Group struct + AvatarURL string + CreateTime time.Time + CreatorID string + Description string + DisableTime time.Time + EdgeCount int + ID string + LangTag string + MaxCount int + Metadata string + Name string + State int + UpdateTime time.Time + func CreateGroup(ctx context.Context, pool *pgxpool.Pool, ...) (*Group, error) + func CreateGroupWithParams(ctx context.Context, pool *pgxpool.Pool, creatorID string, p CreateGroupParams) (*Group, error) + func GroupsGetID(ctx context.Context, pool *pgxpool.Pool, ids []string) ([]*Group, error) + func GroupsGetRandom(ctx context.Context, pool *pgxpool.Pool, count int) ([]*Group, error) + func ListGroups(ctx context.Context, pool *pgxpool.Pool, name, langTag string, open *bool, ...) ([]*Group, string, error) + type GroupMember struct + Role int + UserID string + Username string + func ListGroupMembers(ctx context.Context, pool *pgxpool.Pool, groupID string, limit int, ...) ([]GroupMember, string, error) + type NoopNotifier struct + func (NoopNotifier) Notify(context.Context, string, string, string, int16, string) error + type SteamFriendProfile struct + SteamID uint64 + type UserGroupRelation struct + Group *Group + Role int + func ListUserGroups(ctx context.Context, pool *pgxpool.Pool, userID string, limit int, ...) ([]UserGroupRelation, string, error)