federated

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRecentRequests = 10
View Source
const Name = "federated"

Variables

View Source
var (
	RecentRequests *cb.Queue
)

Functions

func GetRecentRequest

func GetRecentRequest() []string

GetRecentRequest returns the filtered recent requests.

Types

type ActivitiesResponse

type ActivitiesResponse struct {
	Data []*activityx.Activity `json:"data"`
	Meta *MetaCursor           `json:"meta,omitempty"`
}

type ActivityResponse

type ActivityResponse struct {
	Data *activityx.Activity `json:"data"`
	Meta *MetaTotalPages     `json:"meta"`
}

type Component

type Component struct {
	// contains filtered or unexported fields
}

func NewComponent

func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File, databaseClient database.Client, redisClient rueidis.Client) *Component

func (*Component) BatchGetAccountsActivities

func (c *Component) BatchGetAccountsActivities(ctx echo.Context) (err error)

BatchGetAccountsActivities returns the activities of multiple accounts in a single request

func (*Component) CollectMetric

func (c *Component) CollectMetric(ctx context.Context, path, value string)

func (*Component) CollectTrace

func (c *Component) CollectTrace(ctx context.Context, path, value string)

func (*Component) GetAccountActivities

func (c *Component) GetAccountActivities(ctx echo.Context, account string, request docs.GetFederatedAccountParams) (err error)

func (*Component) GetActivity

func (c *Component) GetActivity(ctx echo.Context, id string, request docs.GetFederatedTxIDParams) error

func (*Component) GetHandles

func (c *Component) GetHandles(ctx echo.Context) error

GetHandles retrieves all active handles or updated handles based on the 'since' parameter

func (*Component) GetNetworkActivities

func (c *Component) GetNetworkActivities(ctx echo.Context, net network.Network, request docs.GetFederatedNetworkParams) (err error)

func (*Component) GetPlatformActivities

func (c *Component) GetPlatformActivities(ctx echo.Context, plat federated.Platform, request docs.GetFederatedPlatformParams) (err error)

func (*Component) InitMeter

func (c *Component) InitMeter() (err error)

func (*Component) Name

func (c *Component) Name() string

func (*Component) TransformActivities

func (c *Component) TransformActivities(ctx context.Context, activities []*activityx.Activity) []*activityx.Activity

func (*Component) TransformActivity

func (c *Component) TransformActivity(ctx context.Context, activity *activityx.Activity) (*activityx.Activity, error)

TransformActivity should add related URLs to the activity based on action tag, network and platform

func (*Component) TransformSocialPost

func (c *Component) TransformSocialPost(ctx context.Context, network network.Network, platform string, action activity.Action) (activity.Action, error)

TransformSocialPost adds author url and note url to social post action

func (*Component) TransformSocialType

func (c *Component) TransformSocialType(ctx context.Context, network network.Network, platform string, action activity.Action) (activity.Action, error)

TransformSocialType adds author url and note url to social actions based on type, network and platform

type HandleRequest

type HandleRequest struct {
	Since    *uint64            `query:"since"`
	Limit    int                `query:"limit" default:"100" validate:"omitempty,min=1,max=500"`
	Cursor   *string            `query:"cursor"`
	Platform federated.Platform `query:"platform" default:"1" validate:"required"`
}

type MetaCursor

type MetaCursor struct {
	Cursor string `json:"cursor"`
}

type MetaTotalPages

type MetaTotalPages struct {
	TotalPages int `json:"totalPages"`
}

type PaginatedHandlesResponse

type PaginatedHandlesResponse struct {
	Platform   federated.Platform `json:"platform"`
	Handles    []string           `json:"handles"`
	Cursor     string             `json:"cursor,omitempty"`
	TotalCount int64              `json:"total_count"`
}

Jump to

Keyboard shortcuts

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