usercount

package
v0.0.0-...-524d49d Latest Latest
Warning

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

Go to latest
Published: Nov 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",
	"https://coral.us-east.host.bsky.network",
	"https://lobster.us-east.host.bsky.network",
	"https://magic.us-west.host.bsky.network",
	"https://woodear.us-west.host.bsky.network",
	"https://cordyceps.us-west.host.bsky.network",
	"https://ganoderma.us-west.host.bsky.network",
	"https://bracket.us-west.host.bsky.network",
	"https://button.us-west.host.bsky.network",
	"https://chanterelle.us-west.host.bsky.network",
	"https://cremini.us-west.host.bsky.network",
	"https://gomphus.us-west.host.bsky.network",
	"https://matsutake.us-west.host.bsky.network",
	"https://milkcap.us-west.host.bsky.network",
	"https://shaggymane.us-west.host.bsky.network",
	"https://stinkhorn.us-west.host.bsky.network",
	"https://witchesbutter.us-west.host.bsky.network",
	"https://earthstar.us-east.host.bsky.network",
	"https://meadow.us-east.host.bsky.network",
	"https://parasol.us-east.host.bsky.network",
	"https://reishi.us-east.host.bsky.network",
	"https://scarletina.us-east.host.bsky.network",
	"https://splitgill.us-east.host.bsky.network",
	"https://truffle.us-east.host.bsky.network",
	"https://velvetfoot.us-east.host.bsky.network",
	"https://helvella.us-east.host.bsky.network",
	"https://panthercap.us-east.host.bsky.network",
	"https://yellowfoot.us-west.host.bsky.network",
	"https://blusher.us-east.host.bsky.network",
	"https://brittlegill.us-west.host.bsky.network",
	"https://fibercap.us-west.host.bsky.network",
	"https://poisonpie.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