radiogarden

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

README

radio-garden-go

A Go client and command line application for the Radio Garden API.

The client is autogenerated by oapi-codegen from radio-garden-openapi, an unofficial Radio Garden OpenAPI specification.

Client library

This package includes two client variants:

  • Client returns raw HTTP responses.
  • ClientWithResponses is a wrapper around Client with response type handling.
Example
import (
	"context"
	"fmt"

	radiogarden "github.com/jonasrmichel/radio-garden-go"
)

func main() {
	// construct a client
	client, err := radiogarden.NewClientWithResponses("https://radio.garden/api")
	if err != nil {
		panic(err)
	}

	// get a radio station's details
	res, err := client.GetAraContentChannelChannelIdWithResponse(
		context.Background(),
		"9bd5454",
	)
	if err != nil {
		panic(err)
	}

	// print the station's details
	fmt.Printf("%+v", res.JSON200.Data)
}
Updating the client

The client implementation is generated by oapi-codegen. Any Radio Garden API changes will require that the client be updated.

Run the following commands to update the client:

# install oapi-codegen (see below)
$ go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen

# generate the client
$ go generate ./...

# install any missing dependencies
$ go mod tidy
Support for oneOf and anyOf schema types

Currently, oapi-codegen does not support the OpenAPI oneOf or anyOf keywords. That caveat is addressed by this pull request.

To update the client with support for oneOf and anyOf schema types, download and install that PR's fork manually:

# clone ispringtech's oapi-codegen fork
$ git clone -b union git@github.com:ispringtech/oapi-codegen.git

# go there
$ cd oapi-codegen

# install oapi-codegen
$ go install ./cmd/oapi-codegen

The client implementation in this project does include type level support for oneOf and anyOf schema types generated by the above fork.

Command line application

Run the following commands to install and run the radio-garden command line application:

# install the radio-garden cli app
$ go install github.com/jonasrmichel/radio-garden-go/radio-garden

# run the app
$ radio-garden -h
An application for using the Radio Garden API

Usage:
  radio-garden [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  geo         Get your geolocation
  help        Help about any command
  place       Get a place's details
  places      Get places with registered radio stations
  search      Search for countries, places, and radio stations
  station     Get a radio station's details
  stations    Get a place's registered radio stations

Flags:
  -f, --format          format the output
  -h, --help            help for radio-garden
  -s, --server string   the Radio Garden server (default "https://radio.garden/api")

Use "radio-garden [command] --help" for more information about a command.

License

The client and CLI tool in this project are released under the Apache 2.0 License. Radio Garden and its API are copyrighted by Radio Garden BV.

Documentation

Overview

Package radiogarden provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT.

Package radiogarden provides a client for the Radio Garden API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(res Response, err error) error

CheckResponse returns a non-nil error if res StatusCode is not 200 or if err is non-nil.

func EnsureStatus

func EnsureStatus(res Response, status string) error

EnsureStatus returns a non-nil error when the res Status is not status.

func EnsureStatusByCode

func EnsureStatusByCode(res Response, code int) error

EnsureStatusByCode returns a non-nil error when the HTTP status text of res StatusCode does not match that of code.

func EnsureStatusCode

func EnsureStatusCode(res Response, code int) error

EnsureStatusCode returns a non-nil error when the res StatusCode is not code.

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewGetAraContentChannelChannelIdRequest

func NewGetAraContentChannelChannelIdRequest(server string, channelId string) (*http.Request, error)

NewGetAraContentChannelChannelIdRequest generates requests for GetAraContentChannelChannelId

func NewGetAraContentListenChannelIdChannelMp3Request

func NewGetAraContentListenChannelIdChannelMp3Request(server string, channelId string) (*http.Request, error)

NewGetAraContentListenChannelIdChannelMp3Request generates requests for GetAraContentListenChannelIdChannelMp3

func NewGetAraContentPagePlaceIdChannelsRequest

func NewGetAraContentPagePlaceIdChannelsRequest(server string, placeId string) (*http.Request, error)

NewGetAraContentPagePlaceIdChannelsRequest generates requests for GetAraContentPagePlaceIdChannels

func NewGetAraContentPagePlaceIdRequest

func NewGetAraContentPagePlaceIdRequest(server string, placeId string) (*http.Request, error)

NewGetAraContentPagePlaceIdRequest generates requests for GetAraContentPagePlaceId

func NewGetAraContentPlacesRequest

func NewGetAraContentPlacesRequest(server string) (*http.Request, error)

NewGetAraContentPlacesRequest generates requests for GetAraContentPlaces

func NewGetGeoRequest

func NewGetGeoRequest(server string) (*http.Request, error)

NewGetGeoRequest generates requests for GetGeo

func NewGetSearchRequest

func NewGetSearchRequest(server string, params *GetSearchParams) (*http.Request, error)

NewGetSearchRequest generates requests for GetSearch

func NewHeadAraContentListenChannelIdChannelMp3Request

func NewHeadAraContentListenChannelIdChannelMp3Request(server string, channelId string) (*http.Request, error)

NewHeadAraContentListenChannelIdChannelMp3Request generates requests for HeadAraContentListenChannelIdChannelMp3

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Channel

type Channel struct {
	Country *struct {
		Id    *string `json:"id,omitempty"`
		Title *string `json:"title,omitempty"`
	} `json:"country,omitempty"`
	Id    *string `json:"id,omitempty"`
	Place *struct {
		Id    *string `json:"id,omitempty"`
		Title *string `json:"title,omitempty"`
	} `json:"place,omitempty"`
	Secure  *bool   `json:"secure,omitempty"`
	Title   *string `json:"title,omitempty"`
	Url     *string `json:"url,omitempty"`
	Website *string `json:"website,omitempty"`
}

Channel defines model for Channel.

type ChannelPlaceRef

type ChannelPlaceRef struct {
	// Embedded struct due to allOf(#/components/schemas/ChannelRef)
	ChannelRef `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	Map      *string `json:"map,omitempty"`
	Subtitle *string `json:"subtitle,omitempty"`
}

ChannelPlaceRef defines model for ChannelPlaceRef.

type ChannelRef

type ChannelRef struct {
	Href  *string `json:"href,omitempty"`
	Title *string `json:"title,omitempty"`
}

ChannelRef defines model for ChannelRef.

type ChannelRefs

type ChannelRefs struct {
	Items     *[]ChannelRef `json:"items,omitempty"`
	ItemsType *string       `json:"itemsType,omitempty"`
	Type      *string       `json:"type,omitempty"`
}

ChannelRefs defines model for ChannelRefs.

type Cities

type Cities struct {
	Items          *[]LeftPageRef `json:"items,omitempty"`
	RightAccessory *string        `json:"rightAccessory,omitempty"`
	Title          *string        `json:"title,omitempty"`
	Type           *string        `json:"type,omitempty"`
}

Cities defines model for Cities.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetAraContentChannelChannelId

func (c *Client) GetAraContentChannelChannelId(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAraContentListenChannelIdChannelMp3

func (c *Client) GetAraContentListenChannelIdChannelMp3(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAraContentPagePlaceId

func (c *Client) GetAraContentPagePlaceId(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAraContentPagePlaceIdChannels

func (c *Client) GetAraContentPagePlaceIdChannels(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAraContentPlaces

func (c *Client) GetAraContentPlaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetGeo

func (c *Client) GetGeo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSearch

func (c *Client) GetSearch(ctx context.Context, params *GetSearchParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) HeadAraContentListenChannelIdChannelMp3

func (c *Client) HeadAraContentListenChannelIdChannelMp3(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetAraContentChannelChannelId request
	GetAraContentChannelChannelId(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAraContentListenChannelIdChannelMp3 request
	GetAraContentListenChannelIdChannelMp3(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// HeadAraContentListenChannelIdChannelMp3 request
	HeadAraContentListenChannelIdChannelMp3(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAraContentPagePlaceId request
	GetAraContentPagePlaceId(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAraContentPagePlaceIdChannels request
	GetAraContentPagePlaceIdChannels(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAraContentPlaces request
	GetAraContentPlaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetGeo request
	GetGeo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSearch request
	GetSearch(ctx context.Context, params *GetSearchParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithFollowRedirectsDisabled

func WithFollowRedirectsDisabled() ClientOption

WithFollowRedirectsDisabled prevents the underlying HTTP client from automatically following redirects. This is useful when getting a radio station's live broadcast stream URL via the following methods:

- GetAraContentListenChannelIdChannelMp3

- HeadAraContentListenChannelIdChannelMp3

- GetAraContentListenChannelIdChannelMp3WithResponse

- HeadAraContentListenChannelIdChannelMp3WithResponse

These methods invoke an endpoint that responds with a redirect to the URL of an audio stream. When redirect following is enabled (this is the default behavior), the typed WithResponse methods produce errors because they attempt to consume and parse the entire response body.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetAraContentChannelChannelIdWithResponse

func (c *ClientWithResponses) GetAraContentChannelChannelIdWithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*GetAraContentChannelChannelIdResponse, error)

GetAraContentChannelChannelIdWithResponse request returning *GetAraContentChannelChannelIdResponse

func (*ClientWithResponses) GetAraContentListenChannelIdChannelMp3WithResponse

func (c *ClientWithResponses) GetAraContentListenChannelIdChannelMp3WithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*GetAraContentListenChannelIdChannelMp3Response, error)

GetAraContentListenChannelIdChannelMp3WithResponse request returning *GetAraContentListenChannelIdChannelMp3Response

func (*ClientWithResponses) GetAraContentPagePlaceIdChannelsWithResponse

func (c *ClientWithResponses) GetAraContentPagePlaceIdChannelsWithResponse(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*GetAraContentPagePlaceIdChannelsResponse, error)

GetAraContentPagePlaceIdChannelsWithResponse request returning *GetAraContentPagePlaceIdChannelsResponse

func (*ClientWithResponses) GetAraContentPagePlaceIdWithResponse

func (c *ClientWithResponses) GetAraContentPagePlaceIdWithResponse(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*GetAraContentPagePlaceIdResponse, error)

GetAraContentPagePlaceIdWithResponse request returning *GetAraContentPagePlaceIdResponse

func (*ClientWithResponses) GetAraContentPlacesWithResponse

func (c *ClientWithResponses) GetAraContentPlacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAraContentPlacesResponse, error)

GetAraContentPlacesWithResponse request returning *GetAraContentPlacesResponse

func (*ClientWithResponses) GetGeoWithResponse

func (c *ClientWithResponses) GetGeoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetGeoResponse, error)

GetGeoWithResponse request returning *GetGeoResponse

func (*ClientWithResponses) GetSearchWithResponse

func (c *ClientWithResponses) GetSearchWithResponse(ctx context.Context, params *GetSearchParams, reqEditors ...RequestEditorFn) (*GetSearchResponse, error)

GetSearchWithResponse request returning *GetSearchResponse

func (*ClientWithResponses) HeadAraContentListenChannelIdChannelMp3WithResponse

func (c *ClientWithResponses) HeadAraContentListenChannelIdChannelMp3WithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*HeadAraContentListenChannelIdChannelMp3Response, error)

HeadAraContentListenChannelIdChannelMp3WithResponse request returning *HeadAraContentListenChannelIdChannelMp3Response

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetAraContentChannelChannelId request
	GetAraContentChannelChannelIdWithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*GetAraContentChannelChannelIdResponse, error)

	// GetAraContentListenChannelIdChannelMp3 request
	GetAraContentListenChannelIdChannelMp3WithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*GetAraContentListenChannelIdChannelMp3Response, error)

	// HeadAraContentListenChannelIdChannelMp3 request
	HeadAraContentListenChannelIdChannelMp3WithResponse(ctx context.Context, channelId string, reqEditors ...RequestEditorFn) (*HeadAraContentListenChannelIdChannelMp3Response, error)

	// GetAraContentPagePlaceId request
	GetAraContentPagePlaceIdWithResponse(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*GetAraContentPagePlaceIdResponse, error)

	// GetAraContentPagePlaceIdChannels request
	GetAraContentPagePlaceIdChannelsWithResponse(ctx context.Context, placeId string, reqEditors ...RequestEditorFn) (*GetAraContentPagePlaceIdChannelsResponse, error)

	// GetAraContentPlaces request
	GetAraContentPlacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAraContentPlacesResponse, error)

	// GetGeo request
	GetGeoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetGeoResponse, error)

	// GetSearch request
	GetSearchWithResponse(ctx context.Context, params *GetSearchParams, reqEditors ...RequestEditorFn) (*GetSearchResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CountryPopularStations

type CountryPopularStations struct {
	Items     *[]CountryPopularStations_Items_Item `json:"items,omitempty"`
	ItemsType *string                              `json:"itemsType,omitempty"`
	Title     *string                              `json:"title,omitempty"`
	Type      *string                              `json:"type,omitempty"`
}

CountryPopularStations defines model for CountryPopularStations.

type CountryPopularStations_Items_Item

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

CountryPopularStations_Items_Item defines model for CountryPopularStations.items.Item.

func (CountryPopularStations_Items_Item) AsChannelPlaceRef

func (t CountryPopularStations_Items_Item) AsChannelPlaceRef() (ChannelPlaceRef, error)

func (CountryPopularStations_Items_Item) AsMoreRef

func (*CountryPopularStations_Items_Item) FromChannelPlaceRef

func (t *CountryPopularStations_Items_Item) FromChannelPlaceRef(v ChannelPlaceRef) error

func (*CountryPopularStations_Items_Item) FromMoreRef

func (CountryPopularStations_Items_Item) MarshalJSON

func (t CountryPopularStations_Items_Item) MarshalJSON() ([]byte, error)

func (*CountryPopularStations_Items_Item) UnmarshalJSON

func (t *CountryPopularStations_Items_Item) UnmarshalJSON(b []byte) error

type CountryRef

type CountryRef struct {
	Map   *[]float32 `json:"map,omitempty"`
	Title *string    `json:"title,omitempty"`
	Url   *string    `json:"url,omitempty"`
}

CountryRef defines model for CountryRef.

type Geolocation

type Geolocation struct {
	City        *string  `json:"city,omitempty"`
	CountryCode *string  `json:"country_code,omitempty"`
	CountryName *string  `json:"country_name,omitempty"`
	Ip          *string  `json:"ip,omitempty"`
	Latitude    *float32 `json:"latitude,omitempty"`
	Longitude   *float32 `json:"longitude,omitempty"`
	MetroCode   *int32   `json:"metro_code,omitempty"`
	RegionCode  *string  `json:"region_code,omitempty"`
	RegionName  *string  `json:"region_name,omitempty"`
	TimeZone    *string  `json:"time_zone,omitempty"`
	ZipCode     *string  `json:"zip_code,omitempty"`
}

Geolocation defines model for Geolocation.

type GetAraContentChannelChannelIdResponse

type GetAraContentChannelChannelIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Embedded struct due to allOf(#/components/schemas/Versioned)
		Versioned `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Data *Channel `json:"data,omitempty"`
	}
}

func ParseGetAraContentChannelChannelIdResponse

func ParseGetAraContentChannelChannelIdResponse(rsp *http.Response) (*GetAraContentChannelChannelIdResponse, error)

ParseGetAraContentChannelChannelIdResponse parses an HTTP response from a GetAraContentChannelChannelIdWithResponse call

func (GetAraContentChannelChannelIdResponse) Status

Status returns HTTPResponse.Status

func (GetAraContentChannelChannelIdResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetAraContentListenChannelIdChannelMp3Response

type GetAraContentListenChannelIdChannelMp3Response struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseGetAraContentListenChannelIdChannelMp3Response

func ParseGetAraContentListenChannelIdChannelMp3Response(rsp *http.Response) (*GetAraContentListenChannelIdChannelMp3Response, error)

ParseGetAraContentListenChannelIdChannelMp3Response parses an HTTP response from a GetAraContentListenChannelIdChannelMp3WithResponse call

func (GetAraContentListenChannelIdChannelMp3Response) Status

Status returns HTTPResponse.Status

func (GetAraContentListenChannelIdChannelMp3Response) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetAraContentPagePlaceIdChannelsResponse

type GetAraContentPagePlaceIdChannelsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Embedded struct due to allOf(#/components/schemas/Versioned)
		Versioned `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Data *struct {
			// Embedded struct due to allOf(#/components/schemas/PlaceRef)
			PlaceRef `yaml:",inline"`
			// Embedded fields due to inline allOf schema
			Content *[]ChannelRefs `json:"content,omitempty"`
		} `json:"data,omitempty"`
	}
}

func ParseGetAraContentPagePlaceIdChannelsResponse

func ParseGetAraContentPagePlaceIdChannelsResponse(rsp *http.Response) (*GetAraContentPagePlaceIdChannelsResponse, error)

ParseGetAraContentPagePlaceIdChannelsResponse parses an HTTP response from a GetAraContentPagePlaceIdChannelsWithResponse call

func (GetAraContentPagePlaceIdChannelsResponse) Status

Status returns HTTPResponse.Status

func (GetAraContentPagePlaceIdChannelsResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetAraContentPagePlaceIdResponse

type GetAraContentPagePlaceIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Embedded struct due to allOf(#/components/schemas/Versioned)
		Versioned `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Data *struct {
			// Embedded struct due to allOf(#/components/schemas/PlaceRef)
			PlaceRef `yaml:",inline"`
			// Embedded struct due to allOf(#/components/schemas/PlaceContent)
			PlaceContent `yaml:",inline"`
		} `json:"data,omitempty"`
	}
}

func ParseGetAraContentPagePlaceIdResponse

func ParseGetAraContentPagePlaceIdResponse(rsp *http.Response) (*GetAraContentPagePlaceIdResponse, error)

ParseGetAraContentPagePlaceIdResponse parses an HTTP response from a GetAraContentPagePlaceIdWithResponse call

func (GetAraContentPagePlaceIdResponse) Status

Status returns HTTPResponse.Status

func (GetAraContentPagePlaceIdResponse) StatusCode

func (r GetAraContentPagePlaceIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetAraContentPlacesResponse

type GetAraContentPlacesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Embedded struct due to allOf(#/components/schemas/Versioned)
		Versioned `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Data *struct {
			List    *[]Place `json:"list,omitempty"`
			Version *string  `json:"version,omitempty"`
		} `json:"data,omitempty"`
	}
}

func ParseGetAraContentPlacesResponse

func ParseGetAraContentPlacesResponse(rsp *http.Response) (*GetAraContentPlacesResponse, error)

ParseGetAraContentPlacesResponse parses an HTTP response from a GetAraContentPlacesWithResponse call

func (GetAraContentPlacesResponse) Status

Status returns HTTPResponse.Status

func (GetAraContentPlacesResponse) StatusCode

func (r GetAraContentPlacesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetGeoResponse

type GetGeoResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Geolocation
}

func ParseGetGeoResponse

func ParseGetGeoResponse(rsp *http.Response) (*GetGeoResponse, error)

ParseGetGeoResponse parses an HTTP response from a GetGeoWithResponse call

func (GetGeoResponse) Status

func (r GetGeoResponse) Status() string

Status returns HTTPResponse.Status

func (GetGeoResponse) StatusCode

func (r GetGeoResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSearchParams

type GetSearchParams struct {
	// Search query
	Q string `json:"q"`
}

GetSearchParams defines parameters for GetSearch.

type GetSearchResponse

type GetSearchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Embedded struct due to allOf(#/components/schemas/Versioned)
		Versioned `yaml:",inline"`
		// Embedded struct due to allOf(#/components/schemas/SearchResults)
		SearchResults `yaml:",inline"`
	}
}

func ParseGetSearchResponse

func ParseGetSearchResponse(rsp *http.Response) (*GetSearchResponse, error)

ParseGetSearchResponse parses an HTTP response from a GetSearchWithResponse call

func (GetSearchResponse) Status

func (r GetSearchResponse) Status() string

Status returns HTTPResponse.Status

func (GetSearchResponse) StatusCode

func (r GetSearchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HeadAraContentListenChannelIdChannelMp3Response

type HeadAraContentListenChannelIdChannelMp3Response struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseHeadAraContentListenChannelIdChannelMp3Response

func ParseHeadAraContentListenChannelIdChannelMp3Response(rsp *http.Response) (*HeadAraContentListenChannelIdChannelMp3Response, error)

ParseHeadAraContentListenChannelIdChannelMp3Response parses an HTTP response from a HeadAraContentListenChannelIdChannelMp3WithResponse call

func (HeadAraContentListenChannelIdChannelMp3Response) Status

Status returns HTTPResponse.Status

func (HeadAraContentListenChannelIdChannelMp3Response) StatusCode

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type LeftPageRef

type LeftPageRef struct {
	LeftAccessory      *string   `json:"leftAccessory,omitempty"`
	LeftAccessoryCount *int32    `json:"leftAccessoryCount,omitempty"`
	Page               *PlaceRef `json:"page,omitempty"`
	Title              *string   `json:"title,omitempty"`
}

LeftPageRef defines model for LeftPageRef.

type LocalPickStations

type LocalPickStations struct {
	Items     *[]ChannelPlaceRef `json:"items,omitempty"`
	ItemsType *string            `json:"itemsType,omitempty"`
	Title     *string            `json:"title,omitempty"`
	Type      *string            `json:"type,omitempty"`
}

LocalPickStations defines model for LocalPickStations.

type LocalPopularStations

type LocalPopularStations struct {
	ActionPage *PlaceRef     `json:"actionPage,omitempty"`
	ActionText *string       `json:"actionText,omitempty"`
	Items      *[]ChannelRef `json:"items,omitempty"`
	ItemsType  *string       `json:"itemsType,omitempty"`
	Title      *string       `json:"title,omitempty"`
	Type       *string       `json:"type,omitempty"`
}

LocalPopularStations defines model for LocalPopularStations.

type MoreRef

type MoreRef struct {
	Page           *MoreRef_Page `json:"page,omitempty"`
	RightAccessory *string       `json:"rightAccessory,omitempty"`
	Title          *string       `json:"title,omitempty"`
	Type           *string       `json:"type,omitempty"`
}

MoreRef defines model for MoreRef.

type MoreRef_Page

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

MoreRef_Page defines model for MoreRef.Page.

func (MoreRef_Page) AsCountryRef

func (t MoreRef_Page) AsCountryRef() (CountryRef, error)

func (MoreRef_Page) AsPlaceRef

func (t MoreRef_Page) AsPlaceRef() (PlaceRef, error)

func (*MoreRef_Page) FromCountryRef

func (t *MoreRef_Page) FromCountryRef(v CountryRef) error

func (*MoreRef_Page) FromPlaceRef

func (t *MoreRef_Page) FromPlaceRef(v PlaceRef) error

func (MoreRef_Page) MarshalJSON

func (t MoreRef_Page) MarshalJSON() ([]byte, error)

func (*MoreRef_Page) UnmarshalJSON

func (t *MoreRef_Page) UnmarshalJSON(b []byte) error

type NearbyPlaces

type NearbyPlaces struct {
	Items          *[]RightPageRef `json:"items,omitempty"`
	RightAccessory *string         `json:"rightAccessory,omitempty"`
	Title          *string         `json:"title,omitempty"`
	Type           *string         `json:"type,omitempty"`
}

NearbyPlaces defines model for NearbyPlaces.

type Place

type Place struct {
	Boost   *bool      `json:"boost,omitempty"`
	Country *string    `json:"country,omitempty"`
	Geo     *[]float32 `json:"geo,omitempty"`
	Id      *string    `json:"id,omitempty"`
	Size    *int32     `json:"size,omitempty"`
	Title   *string    `json:"title,omitempty"`
	Url     *string    `json:"url,omitempty"`
}

Place defines model for Place.

type PlaceContent

type PlaceContent struct {
	Content *[]PlaceContent_Content_Item `json:"content,omitempty"`
}

PlaceContent defines model for PlaceContent.

type PlaceContent_Content_Item

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

PlaceContent_Content_Item defines model for PlaceContent.content.Item.

func (PlaceContent_Content_Item) AsCities

func (t PlaceContent_Content_Item) AsCities() (Cities, error)

func (PlaceContent_Content_Item) AsCountryPopularStations

func (t PlaceContent_Content_Item) AsCountryPopularStations() (CountryPopularStations, error)

func (PlaceContent_Content_Item) AsLocalPickStations

func (t PlaceContent_Content_Item) AsLocalPickStations() (LocalPickStations, error)

func (PlaceContent_Content_Item) AsLocalPopularStations

func (t PlaceContent_Content_Item) AsLocalPopularStations() (LocalPopularStations, error)

func (PlaceContent_Content_Item) AsNearbyPlaces

func (t PlaceContent_Content_Item) AsNearbyPlaces() (NearbyPlaces, error)

func (PlaceContent_Content_Item) AsSelectedStations

func (t PlaceContent_Content_Item) AsSelectedStations() (SelectedStations, error)

func (*PlaceContent_Content_Item) FromCities

func (t *PlaceContent_Content_Item) FromCities(v Cities) error

func (*PlaceContent_Content_Item) FromCountryPopularStations

func (t *PlaceContent_Content_Item) FromCountryPopularStations(v CountryPopularStations) error

func (*PlaceContent_Content_Item) FromLocalPickStations

func (t *PlaceContent_Content_Item) FromLocalPickStations(v LocalPickStations) error

func (*PlaceContent_Content_Item) FromLocalPopularStations

func (t *PlaceContent_Content_Item) FromLocalPopularStations(v LocalPopularStations) error

func (*PlaceContent_Content_Item) FromNearbyPlaces

func (t *PlaceContent_Content_Item) FromNearbyPlaces(v NearbyPlaces) error

func (*PlaceContent_Content_Item) FromSelectedStations

func (t *PlaceContent_Content_Item) FromSelectedStations(v SelectedStations) error

func (PlaceContent_Content_Item) MarshalJSON

func (t PlaceContent_Content_Item) MarshalJSON() ([]byte, error)

func (*PlaceContent_Content_Item) UnmarshalJSON

func (t *PlaceContent_Content_Item) UnmarshalJSON(b []byte) error

type PlaceRef

type PlaceRef struct {
	Count     *int32  `json:"count,omitempty"`
	Map       *string `json:"map,omitempty"`
	Subtitle  *string `json:"subtitle,omitempty"`
	Title     *string `json:"title,omitempty"`
	Url       *string `json:"url,omitempty"`
	UtcOffset *int32  `json:"utcOffset,omitempty"`
}

PlaceRef defines model for PlaceRef.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Response

type Response interface {
	Status() string
	StatusCode() int
}

Response is implemented by all response types returned by ClientWithResponses.

type RightPageRef

type RightPageRef struct {
	Page        *PlaceRef `json:"page,omitempty"`
	RightDetail *string   `json:"rightDetail,omitempty"`
	Title       *string   `json:"title,omitempty"`
}

RightPageRef defines model for RightPageRef.

type SearchResult

type SearchResult struct {
	Id     *string  `json:"_id,omitempty"`
	Score  *float32 `json:"_score,omitempty"`
	Source *struct {
		Code     *string `json:"code,omitempty"`
		Subtitle *string `json:"subtitle,omitempty"`
		Title    *string `json:"title,omitempty"`
		Type     *string `json:"type,omitempty"`
		Url      *string `json:"url,omitempty"`
	} `json:"_source,omitempty"`
}

SearchResult defines model for SearchResult.

type SearchResults

type SearchResults struct {
	Hits *struct {
		Hits *[]SearchResult `json:"hits,omitempty"`
	} `json:"hits,omitempty"`
	Query *string `json:"query,omitempty"`
	Took  *int32  `json:"took,omitempty"`
}

SearchResults defines model for SearchResults.

type SelectedStations

type SelectedStations struct {
	Items     *[]SelectedStations_Items_Item `json:"items,omitempty"`
	ItemsType *string                        `json:"itemsType,omitempty"`
	Title     *string                        `json:"title,omitempty"`
	Type      *string                        `json:"type,omitempty"`
}

SelectedStations defines model for SelectedStations.

type SelectedStations_Items_Item

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

SelectedStations_Items_Item defines model for SelectedStations.items.Item.

func (SelectedStations_Items_Item) AsChannelRef

func (t SelectedStations_Items_Item) AsChannelRef() (ChannelRef, error)

func (SelectedStations_Items_Item) AsMoreRef

func (t SelectedStations_Items_Item) AsMoreRef() (MoreRef, error)

func (*SelectedStations_Items_Item) FromChannelRef

func (t *SelectedStations_Items_Item) FromChannelRef(v ChannelRef) error

func (*SelectedStations_Items_Item) FromMoreRef

func (t *SelectedStations_Items_Item) FromMoreRef(v MoreRef) error

func (SelectedStations_Items_Item) MarshalJSON

func (t SelectedStations_Items_Item) MarshalJSON() ([]byte, error)

func (*SelectedStations_Items_Item) UnmarshalJSON

func (t *SelectedStations_Items_Item) UnmarshalJSON(b []byte) error

type Versioned

type Versioned struct {
	ApiVersion *int32  `json:"apiVersion,omitempty"`
	Version    *string `json:"version,omitempty"`
}

Versioned defines model for Versioned.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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