uri

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

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 interface{}) (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)

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 {
	Field          string           `url:"field,omitempty"`
	Runtimes       string           `url:"runtimes,omitempty"`
	Query          string           `url:"query,omitempty"`
	Type           string           `url:"type,omitempty"`
	Extended       string           `url:"extended,omitempty"`
	Years          string           `url:"years,omitempty"`
	Certifications []string         `url:"certifications,omitempty"`
	Genres         []string         `url:"genres,omitempty"`
	EpisodeTypes   []string         `url:"episode_types,omitempty"`
	Countries      []string         `url:"countries,omitempty"`
	Languages      []string         `url:"languages,omitempty"`
	StudioIDs      []int            `url:"studio_ids,omitempty"`
	Status         []string         `url:"status,omitempty"`
	NetworkIDs     []int            `url:"network_ids,omitempty"`
	Ratings        RatingRange      `url:"ratings,omitempty"`
	TmdbVotes      VotesRange       `url:"tmdb_votes,omitempty"`
	ImdbRatings    RatingRange      `url:"imdb_ratings,omitempty"`
	ImdbVotes      ImdbVotesRange   `url:"imdb_votes,omitempty"`
	RtMeters       RatingRange      `url:"rt_meters,omitempty"`
	RtUserMeters   RatingRange      `url:"rt_user_meters,omitempty"`
	Votes          VotesRange       `url:"votes,omitempty"`
	Page           int              `url:"page,omitempty"`
	Limit          int              `url:"limit,omitempty"`
	Metascores     RatingRangeFloat `url:"metascores,omitempty"`
	TmdbRatings    TmdbRatingRange  `url:"tmdb_ratings,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