uri

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package uri used for url operations

Package uri used for url operations

Package uri used for url operations

Package uri used for url operations

Package uri used for url operations

Package uri used for url operations

Package uri used for url operations

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusOptions = []string{"running series", "continuing", "in production", "planned", "upcoming", "pilot", "canceled", "ended"}
	EpisodeTypes  = []string{"standard", "series_premiere", "season_premiere", "mid_season_finale", "mid_season_premiere", "season_finale", "series_finale"}
)

config slices

Functions

func AddQuery

func AddQuery(s string, opts any) (string, error)

AddQuery adds query parameters to s.

func EncodeParams

func EncodeParams(values url.Values) string

EncodeParams encodes the values for query sorted by key

func SanitizeURL

func SanitizeURL(uri *url.URL) *url.URL

SanitizeURL redacts the client_secret parameter from the URL which may be exposed to the user.

Types

type CustomTypeHandler

type CustomTypeHandler func(reflect.Value, *url.Values, string) error

CustomTypeHandler defines the function signature for handling custom types

type ImdbVotesRange

type ImdbVotesRange struct {
	Min int `url:"min,omitempty"`
	Max int `url:"max,omitempty"`
}

ImdbVotesRange represents min/max int imdb votes parameters

func (ImdbVotesRange) String

func (r ImdbVotesRange) String() string

type ListOptions

type ListOptions struct {
	Certifications    []string         `url:"certifications,omitempty"`
	Countries         []string         `url:"countries,omitempty"`
	EpisodeTypes      []string         `url:"episode_types,omitempty"`
	Extended          string           `url:"extended,omitempty"`
	Field             string           `url:"field,omitempty"`
	Genres            []string         `url:"genres,omitempty"`
	IgnoreCollected   string           `url:"ignore_collected,omitempty"`
	IgnoreWatchlisted string           `url:"ignore_watchlisted,omitempty"`
	ImdbRatings       RatingRange      `url:"imdb_ratings,omitempty"`
	ImdbVotes         ImdbVotesRange   `url:"imdb_votes,omitempty"`
	IncludeReplies    string           `url:"include_replies,omitempty"`
	Languages         []string         `url:"languages,omitempty"`
	Translations      []string         `url:"translations,omitempty"`
	Limit             int              `url:"limit,omitempty"`
	Metascores        RatingRangeFloat `url:"metascores,omitempty"`
	NetworkIDs        []int            `url:"network_ids,omitempty"`
	Page              int              `url:"page,omitempty"`
	Query             string           `url:"query,omitempty"`
	Ratings           RatingRange      `url:"ratings,omitempty"`
	RtMeters          RatingRange      `url:"rt_meters,omitempty"`
	RtUserMeters      RatingRange      `url:"rt_user_meters,omitempty"`
	Runtimes          string           `url:"runtimes,omitempty"`
	Status            []string         `url:"status,omitempty"`
	StudioIDs         []int            `url:"studio_ids,omitempty"`
	TmdbRatings       TmdbRatingRange  `url:"tmdb_ratings,omitempty"`
	TmdbVotes         VotesRange       `url:"tmdb_votes,omitempty"`
	Type              string           `url:"type,omitempty"`
	Votes             VotesRange       `url:"votes,omitempty"`
	Years             string           `url:"years,omitempty"`
	Hidden            string           `url:"hidden,omitempty"`
	Specials          string           `url:"specials,omitempty"`
	CountSpecials     string           `url:"count_specials,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support offset pagination.

type Pagination

type Pagination struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`
	// For paginated result sets, the number of elements on one page.
	Limit int `url:"limit,omitempty"`
}

Pagination represents pagination params

type RatingRange

type RatingRange struct {
	Min int `url:"min,omitempty"`
	Max int `url:"max,omitempty"`
}

RatingRange represents min/max int parameters

func (RatingRange) String

func (rr RatingRange) String() string

type RatingRangeFloat

type RatingRangeFloat struct {
	Min float32 `url:"min,omitempty"`
	Max float32 `url:"max,omitempty"`
}

RatingRangeFloat represents min/max float parameters

func (RatingRangeFloat) String

func (rr RatingRangeFloat) String() string

type TmdbRatingRange

type TmdbRatingRange struct {
	Min float32 `url:"min,omitempty"`
	Max float32 `url:"max,omitempty"`
}

TmdbRatingRange represents min/max float tmdb rating parameters

func (TmdbRatingRange) String

func (r TmdbRatingRange) String() string

type VotesRange

type VotesRange struct {
	Min int `url:"min,omitempty"`
	Max int `url:"max,omitempty"`
}

VotesRange represents min/max int votes parameters

func (VotesRange) String

func (r VotesRange) String() string

Jump to

Keyboard shortcuts

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