Documentation
¶
Index ¶
- Constants
- func CompareVersions(v1, v2 string) int
- func IsNewerVersion(currentVersion, latestVersion string) bool
- type Client
- func (c *Client) Search(ctx context.Context, params SearchParams) ([]Station, error)
- func (c *Client) SearchAdvanced(ctx context.Context, params SearchParams) ([]Station, error)
- func (c *Client) SearchByCountry(ctx context.Context, country string) ([]Station, error)
- func (c *Client) SearchByLanguage(ctx context.Context, language string) ([]Station, error)
- func (c *Client) SearchByName(ctx context.Context, name string) ([]Station, error)
- func (c *Client) SearchByState(ctx context.Context, state string) ([]Station, error)
- func (c *Client) SearchByTag(ctx context.Context, tag string) ([]Station, error)
- func (c *Client) Vote(ctx context.Context, stationUUID string) (*VoteResult, error)
- type InstallInfo
- type InstallMethod
- type ReleaseInfo
- type SearchParams
- type SearchType
- type Station
- type VersionChecker
- type VoteResult
Constants ¶
const (
// ReleasePageURL is the URL users can visit to download
ReleasePageURL = "https://github.com/shinokada/tera/releases/latest"
)
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶ added in v1.1.0
CompareVersions compares two version strings Returns: -1 if v1 < v2, 0 if v1 == v2, 1 if v1 > v2
func IsNewerVersion ¶ added in v1.1.0
IsNewerVersion checks if latestVersion is newer than currentVersion
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SearchAdvanced ¶
SearchAdvanced performs an advanced search with multiple criteria
func (*Client) SearchByCountry ¶
SearchByCountry searches for stations by country code
func (*Client) SearchByLanguage ¶
SearchByLanguage searches for stations by language
func (*Client) SearchByName ¶
SearchByName searches for stations by name
func (*Client) SearchByState ¶
SearchByState searches for stations by state
func (*Client) SearchByTag ¶
type InstallInfo ¶ added in v1.3.0
type InstallInfo struct {
Method InstallMethod
UpdateCommand string
Description string
}
InstallInfo contains information about the installation
func DetectInstallMethod ¶ added in v1.3.0
func DetectInstallMethod() InstallInfo
DetectInstallMethod detects how tera was installed
type InstallMethod ¶ added in v1.3.0
type InstallMethod int
InstallMethod represents how tera was installed
const ( InstallMethodUnknown InstallMethod = iota InstallMethodHomebrew InstallMethodGo InstallMethodScoop InstallMethodWinget InstallMethodAPT InstallMethodRPM InstallMethodManual )
type ReleaseInfo ¶ added in v1.1.0
type ReleaseInfo struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
HTMLURL string `json:"html_url"`
PublishedAt time.Time `json:"published_at"`
Body string `json:"body"`
}
ReleaseInfo contains information about a GitHub release
type SearchParams ¶
type SearchParams struct {
Tag string
Name string
Language string
Country string
CountryCode string
State string
// Advanced search can combine multiple parameters
TagExact bool
NameExact bool
Order string // votes, clickcount, bitrate, name
Reverse bool
Limit int
Offset int
HideBroken bool
}
SearchParams holds parameters for search requests
type SearchType ¶
type SearchType int
SearchType represents the type of search query
const ( SearchByTag SearchType = iota SearchByName SearchByLanguage SearchByCountry SearchByState SearchAdvanced )
type Station ¶
type Station struct {
StationUUID string `json:"stationuuid"`
Name string `json:"name"`
URLResolved string `json:"url_resolved"`
Tags string `json:"tags"`
Country string `json:"country"`
CountryCode string `json:"countrycode"`
State string `json:"state"`
Language string `json:"language"`
Votes int `json:"votes"`
Codec string `json:"codec"`
Bitrate int `json:"bitrate"`
Volume *int `json:"volume,omitempty"` // Per-station volume (0-100), nil means use default
}
Station represents a radio station from Radio Browser API
type VersionChecker ¶ added in v1.1.0
type VersionChecker struct {
// contains filtered or unexported fields
}
VersionChecker checks for new versions on GitHub
func NewVersionChecker ¶ added in v1.1.0
func NewVersionChecker() *VersionChecker
NewVersionChecker creates a new version checker
func (*VersionChecker) GetLatestRelease ¶ added in v1.1.0
func (vc *VersionChecker) GetLatestRelease(ctx context.Context) (*ReleaseInfo, error)
GetLatestRelease fetches the latest release info from GitHub
type VoteResult ¶
VoteResult represents the response from voting for a station