degrees

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPersonNotFound = errors.New("person not found")

Functions

This section is empty.

Types

type Client

type Client struct {
	TMDBClient
	IncludeTV bool
	// contains filtered or unexported fields
}

func New

func New(c TMDBClient, logger *slog.Logger) *Client

func (*Client) Degrees

func (c *Client) Degrees(ctx context.Context, fromActorID, toActorID int, maxDepth int) chan Path

func (*Client) FindActor

func (c *Client) FindActor(ctx context.Context, query string) (tmdb.Person, error)
type Link struct {
	Movie
	tmdb.Person
}

func (Link) String

func (l Link) String() string

type Movie

type Movie struct {
	ID   int
	Name string
}

type Path

type Path []Link

func (Path) String

func (p Path) String() string

type TMDBClient

type TMDBClient interface {
	GetPersonCredits(ctx context.Context, id int) (tmdb.PersonCredits, error)
	SearchPersonPage(ctx context.Context, query string, page int) ([]tmdb.Person, int, error)
	GetPerson(ctx context.Context, id int) (tmdb.Person, error)
	GetMovie(ctx context.Context, id int) (tmdb.Movie, error)
	GetMovieCredits(ctx context.Context, id int) (tmdb.MovieCredits, error)
	SearchPersonAllPages(ctx context.Context, query string) ([]tmdb.Person, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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