feedrouter

package
v0.0.0-...-b23f88e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package feedrouter describes the FeedRouter type, which is responsible for generating feeds for a given DID. It also describes the Feed interface, which is implemented by the various feed types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

type Feed interface {
	GetPage(ctx context.Context, feed string, userDID string, limit int64, cursor string) (feedPosts []*appbsky.FeedDefs_SkeletonFeedPost, newCursor *string, err error)
	Describe(ctx context.Context) ([]appbsky.FeedDescribeFeedGenerator_Feed, error)
}

type FeedRouter

type FeedRouter struct {
	FeedActorDID          did.DID         // DID of the Repo the Feed is published under
	ServiceEndpoint       string          // URL of the FeedRouter service
	ServiceDID            did.DID         // DID of the FeedRouter service
	DIDDocument           did.Document    // DID Document of the FeedRouter service
	AcceptableURIPrefixes []string        // URIs that the FeedRouter is allowed to generate feeds for
	FeedMap               map[string]Feed // map of FeedName to Feed
	Feeds                 []Feed
}

func NewFeedRouter

func NewFeedRouter(
	ctx context.Context,
	feedActorDIDString string,
	serviceDIDString string,
	acceptableDIDs []string,
	serviceEndpoint string,
) (*FeedRouter, error)

NewFeedRouter returns a new FeedRouter

func (*FeedRouter) AddFeed

func (fg *FeedRouter) AddFeed(feedAliases []string, feed Feed)

AddFeed adds a feed to the FeedRouter Feed precedence for overlapping aliases is determined by the order in which they are added (first added is highest precedence)

type NotFoundError

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

Jump to

Keyboard shortcuts

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