endpoints

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

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Logger          *slog.Logger
	SearchService   *search.SearchService
	Store           *store.Store
	Directory       identity.Directory
	CheckoutLimiter *rate.Limiter
	MagicHeaderVal  string

	Appview   *appview.Client
	Renderer  *postcard.Renderer // nil disables card rendering
	Redis     *redis.Client
	PublicURL string // externally-visible base URL; derived from the request when empty
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(
	logger *slog.Logger,
	searchService *search.SearchService,
	store *store.Store,
	magicHeaderVal string,
	appviewClient *appview.Client,
	renderer *postcard.Renderer,
	redisClient *redis.Client,
	publicURL string,
) (*API, error)

func (*API) AddPDSToList

func (api *API) AddPDSToList(c echo.Context) error

AddPDSToList adds an official Bluesky PDS to the usercount scrape list at runtime, persisting it to redis. The host must be a *.host.bsky.network instance and must answer com.atproto.server.describeServer before it is accepted, so junk hostnames can't be injected.

func (*API) CancelCleanupJob

func (api *API) CancelCleanupJob(c echo.Context) error

func (*API) CleanupOldRecords

func (api *API) CleanupOldRecords(c echo.Context) error

func (*API) GetCleanupStats

func (api *API) GetCleanupStats(c echo.Context) error

func (*API) GetCleanupStatus

func (api *API) GetCleanupStatus(c echo.Context) error

func (*API) GetListMembers

func (api *API) GetListMembers(c echo.Context) error

func (*API) GetOEmbed

func (api *API) GetOEmbed(c echo.Context) error

func (*API) GetPDSList

func (api *API) GetPDSList(c echo.Context) error

func (*API) GetPostCardImage

func (api *API) GetPostCardImage(c echo.Context) error

func (*API) GetPostLinkProxy

func (api *API) GetPostLinkProxy(c echo.Context) error

func (*API) GetProfileLinkProxy

func (api *API) GetProfileLinkProxy(c echo.Context) error

func (*API) GetRepoAsJSON

func (api *API) GetRepoAsJSON(c echo.Context) error

func (*API) GetStats

func (api *API) GetStats(c echo.Context) error

func (*API) RedirectAtURI

func (api *API) RedirectAtURI(c echo.Context) error

func (*API) RunCleanupDaemon

func (api *API) RunCleanupDaemon(ctx context.Context)

type CancelCleanupJobRequest

type CancelCleanupJobRequest struct {
	JobID string `query:"job_id"`
}

CancelCleanupJobRequest for DELETE /repo/cleanup

type CleanupOldRecordsRequest

type CleanupOldRecordsRequest struct {
	Identifier          string   `json:"identifier"`
	AppPassword         string   `json:"app_password"`
	CleanupTypes        []string `json:"cleanup_types"`
	DeleteUntilDaysAgo  int      `json:"delete_until_days_ago"`
	ActuallyDeleteStuff bool     `json:"actually_delete_stuff"`
}

CleanupOldRecordsRequest for POST /repo/cleanup

type GetCleanupStatusRequest

type GetCleanupStatusRequest struct {
	JobID string `query:"job_id"`
	DID   string `query:"did"`
}

GetCleanupStatusRequest for GET /repo/cleanup

type GetListMembersRequest

type GetListMembersRequest struct {
	URI string `query:"uri"`
}

GetListMembersRequest for GET /list/members

type GetRepoRequest

type GetRepoRequest struct {
	DID string `param:"did"`
}

GetRepoRequest for GET /repo/:did

type RedirectAtURIRequest

type RedirectAtURIRequest struct {
	URI string `query:"uri"`
}

RedirectAtURIRequest for GET /redir

type RedirectRequest

type RedirectRequest struct {
	Q string `query:"q"`
}

Jump to

Keyboard shortcuts

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