Documentation ¶
Index ¶
Constants ¶
View Source
const ( FailedGetUserErrorTemplate = "failed to get user ID: %w" ConvertUserIDErrorTemplate = "failed to convert user ID to integer: %w" FailedMediaErrorTemplate = "failed to fetch media list: %w" )
Variables ¶
View Source
var ( ErrNoTracker = errors.New("no tracker set up") ErrNoMapper = errors.New("no mapper set up") )
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper interface { io.Closer MapIDs(context.Context, []entities.SourceID) ([]entities.TargetID, error) Refresh(context.Context, Getter) error }
Mapper transforms IDs between two services based on the data from a provider
type MediaLister ¶ added in v0.2.0
type MediaLister interface { // Generate fetches the user media list from the Tracker and transform the IDs // found to the target service through the Mapper Generate(ctx context.Context, name string) (entities.CustomList, error) // GetUserID searches the Tracker for the user ID by their name/handle GetUserID(ctx context.Context, name string) (string, error) // Close closes both the Tracker and Mapper Close() error // Refresh requests the Mapper to update its mapping definitions Refresh(ctx context.Context, client Getter) error }
func NewMediaLister ¶ added in v0.2.0
func NewMediaLister(tracker Tracker, mapper Mapper) (MediaLister, error)
Click to show internal directories.
Click to hide internal directories.