usercount

package
v0.0.0-...-1eb5c16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PDSHostList = []string{
	"https://morel.us-east.host.bsky.network",
	"https://puffball.us-east.host.bsky.network",
	"https://inkcap.us-east.host.bsky.network",
	"https://oyster.us-east.host.bsky.network",
	"https://enoki.us-east.host.bsky.network",
	"https://porcini.us-east.host.bsky.network",
	"https://shimeji.us-east.host.bsky.network",
	"https://amanita.us-east.host.bsky.network",
	"https://lionsmane.us-east.host.bsky.network",
	"https://shiitake.us-east.host.bsky.network",
	"https://blewit.us-west.host.bsky.network",
	"https://conocybe.us-west.host.bsky.network",
	"https://boletus.us-west.host.bsky.network",
	"https://lepista.us-west.host.bsky.network",
	"https://chaga.us-west.host.bsky.network",
	"https://agaric.us-west.host.bsky.network",
	"https://maitake.us-west.host.bsky.network",
	"https://verpa.us-west.host.bsky.network",
	"https://russula.us-west.host.bsky.network",
	"https://hydnum.us-west.host.bsky.network",
}

Functions

This section is empty.

Types

type PDS

type PDS struct {
	Host         string
	UserCount    int
	LastCursor   string
	LastPageSize int
	Limiter      *rate.Limiter
	Client       *xrpc.Client
}

func NewPDS

func NewPDS(host string, rps int) *PDS

type UserCount

type UserCount struct {
	CurrentUserCount int

	RedisClient *redis.Client
	Prefix      string

	PDSs []*PDS
}

func NewUserCount

func NewUserCount(ctx context.Context, redisClient *redis.Client) *UserCount

func (*UserCount) GetUserCount

func (uc *UserCount) GetUserCount(ctx context.Context) (int, error)

GetUserCount returns the number of users of BSky from the Repo Sync API It uses a rate limiter to limit requests to 5 per second It does not implement any caching, so it will make a series of requests to the API every time it is called Caching should be implemented one layer up in the application

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL