Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chubin/wttr.in
/ functions
Functions
405 in github.com/chubin/wttr.in
⨍
Functions
405
◇
Types & classes
112
↓ 2 callers
Function
loadAndSetFont
(dc *gg.Context, cat string)
internal/formatter/ansitopng/fonts.go:72
↓ 2 callers
Function
localizedRain
()
internal/renderer/v1/locale.go:10
↓ 2 callers
Function
localizedVis
()
internal/renderer/v1/locale.go:31
↓ 2 callers
Function
localizedWind
()
internal/renderer/v1/locale.go:52
↓ 2 callers
Function
makeQuery
(url string, result interface{})
internal/location/nominatim.go:53
↓ 2 callers
Function
mustParseFloat
(s string)
internal/location/cache.go:439
↓ 2 callers
Function
parseHHMMSS
parseHHMM parses "15:04" style string into hours and minutes
internal/renderer/oneline/render_solar.go:194
↓ 2 callers
Function
parseTimeToMinutes
parseTimeToMinutes converts "0", "300", "600", ..., "2100" into minutes since midnight
internal/renderer/v1/helpers.go:34
↓ 2 callers
Method
processValue
( lines *[]string, metricName, helpText, forDay, value string, alreadySeen map[string]bool, )
internal/renderer/renderer_p1.go:138
↓ 2 callers
Method
putToLRU
(key string, val *Location)
internal/location/cache.go:416
↓ 2 callers
Method
renderCurrent
renderCurrent renders one block (current or forecast day)
internal/renderer/renderer_p1.go:94
↓ 2 callers
Function
reverse
(s string)
internal/renderer/v1/helpers.go:61
↓ 2 callers
Function
simpleTextualFallback
simpleTextualFallback
internal/renderer/v2/block_textualinformation.go:223
↓ 2 callers
Function
slicesMin
(s []float64)
internal/renderer/v2/helpers.go:52
↓ 2 callers
Function
speedToColor
speedToColor returns colored wind speed text based on speed value.
internal/renderer/v1/format.go:48
↓ 2 callers
Function
sunriseTime
sunriseTime returns local sunrise time in "HH:MM" format (24h) Uses github.com/nathan-osman/go-sunrise for accurate calculation
internal/renderer/oneline/render_solar.go:15
↓ 2 callers
Function
sunsetTime
(ctx *RenderContext)
internal/renderer/oneline/render_solar.go:42
↓ 2 callers
Function
unitRain
(unit bool, lang string)
internal/renderer/v1/locale.go:100
↓ 2 callers
Function
unitTemp
()
internal/renderer/v1/locale.go:3
↓ 2 callers
Function
validIP4
(ipAddress string)
internal/ip/ip.go:248
↓ 2 callers
Function
validateAndSetFlag
validateAndSetFlag validates and sets a single flag option.
internal/query/parse.go:105
↓ 2 callers
Function
windDir
windDir returns ANSI-colored arrow for wind direction.
internal/renderer/v1/format.go:15
↓ 2 callers
Function
windInRightUnits
windInRightUnits converts wind speed to the requested unit (km/h, mph, or m/s).
internal/renderer/v1/format.go:37
↓ 1 callers
Function
AppendToFile
AppendToFile appends a string to the specified file with a timestamp
internal/weather/locator_adapter.go:114
↓ 1 callers
Function
ApplyAutoFixes
(opts *options.Options)
internal/query/fromrequest.go:120
↓ 1 callers
Function
ConvertWeather
ConvertWeather converts domain.Weather to v1.resp
internal/renderer/v1/converter.go:8
↓ 1 callers
Function
DrawColoredTemperatureDiagram
DrawColoredTemperatureDiagram returns the Braille temperature plot with color gradient + high/low temperature labels.
internal/renderer/v2/block_temperature_colorized.go:59
↓ 1 callers
Method
Flush
Flush forces a flush of the current buffer. Useful for graceful shutdown.
internal/logging/logging.go:128
↓ 1 callers
Function
FromDomainOptions
FromDomainOptions converts from the main wttr.in options.Options to PNGOptions
internal/formatter/ansitopng/options.go:42
↓ 1 callers
Function
FromRequest
FromRequest creates an options.Options struct based on the provided HTTP request. It processes the URL path, domain name, and headers according to the
internal/query/fromrequest.go:17
↓ 1 callers
Function
GenerateOptionsAndParser
GenerateOptionsAndParser is the main entry point
internal/generate/options.go:217
↓ 1 callers
Method
Get
Get returns a valid, non-expired cache entry or nil if not found/expired.
internal/cache/lru.go:53
↓ 1 callers
Method
Get
Get returns a valid (non-expired) cache entry.
internal/cache/disk.go:86
↓ 1 callers
Function
GetEmojiProfile
GetEmojiProfile returns the active emoji profile name based on options.
internal/renderer/oneline/render_emoji.go:81
↓ 1 callers
Method
GetIPData
(ip string)
internal/weather/weather.go:30
↓ 1 callers
Method
GetLocation
(location string)
internal/weather/weather.go:35
↓ 1 callers
Function
GetStringValue
GetStringValue — convenience wrapper for the most common case (strings & numbers)
internal/renderer/oneline/jq.go:38
↓ 1 callers
Function
GetValue
GetValue executes a jq query and returns the first result as interface{} Use this when you expect exactly one value (most common for weather fields)
internal/renderer/oneline/jq.go:13
↓ 1 callers
Method
HasLegacyCert
HasLegacyCert returns true if the old single certificate fields are populated.
internal/server/config.go:72
↓ 1 callers
Function
HasPrefixInSlice
(what string, where []string, prefix string)
internal/util/strings.go:14
↓ 1 callers
Method
InitDB
ConvertCache converts files-based cache into the DB-based cache. If reset is true, the DB cache is created from scratch. nolint:funlen,cyclop
internal/location/convert.go:15
↓ 1 callers
Method
IsDisk
()
internal/cache/config.go:52
↓ 1 callers
Method
IsInProgress
IsInProgress checks whether the key is currently being processed.
internal/cache/lru.go:118
↓ 1 callers
Function
LoadFromYAML
LoadFromYAML loads configuration from a YAML file and returns a pointer to Config
internal/config/config.go:47
↓ 1 callers
Function
MakeWeatherCacheKey
MakeWeatherCacheKey generates a normalized, stable cache key for weather requests. Lat/lon are rounded to ~100m precision to avoid cache fragmentation
internal/weather/weatherer_wwo_cached.go:16
↓ 1 callers
Method
MarshalYAML
()
internal/config/config.go:66
↓ 1 callers
Function
NewCache
NewCache creates a new cache instance according to the configuration.
internal/location/cache.go:84
↓ 1 callers
Function
NewCache
NewCache returns new cache reader for the specified config.
internal/ip/ip.go:54
↓ 1 callers
Function
NewCacheLocator
NewCacheLocator creates a Locator backed by wttr.in-style location cache
internal/weather/locator_adapter.go:27
↓ 1 callers
Function
NewCachedWeatherClient
NewCachedWeatherClient creates a new caching wrapper around a WeatherClient.
internal/weather/weatherer_wwo_cached.go:38
↓ 1 callers
Function
NewDiskCacher
NewDiskCacher creates a new disk-backed cache. dir will be created if it doesn't exist.
internal/cache/disk.go:33
↓ 1 callers
Function
NewHTMLFormatter
NewHTMLFormatter loads the embedded template and CSS.
internal/formatter/html.go:21
↓ 1 callers
Function
NewIPCacheLocator
(cache *Cache)
internal/ip/iplocator_adapter.go:14
↓ 1 callers
Function
NewIPLocatorGeoIP2
NewIPLocatorGeoIP2 creates a new IPLocator using the given GeoIP2-City.mmdb (or GeoLite2-City.mmdb) file. Call Close() when you're done with it (or us
internal/ip/geoip2.go:20
↓ 1 callers
Function
NewLogSuppressor
NewLogSuppressor creates a new LogSuppressor for specified filename and lines to be suppressed. If filename is empty, log entries will be printed to
internal/logging/suppress.go:24
↓ 1 callers
Function
NewNominatim
(name, typ, url, token string)
internal/location/nominatim.go:25
↓ 1 callers
Function
NewPNGFormatter
NewPNGFormatter creates a new PNG formatter.
internal/formatter/png.go:14
↓ 1 callers
Function
NewPNGOptions
NewPNGOptions returns sensible defaults matching original wttr.in behavior
internal/formatter/ansitopng/options.go:29
↓ 1 callers
Function
NewPageRenderer
()
internal/renderer/renderer_page.go:16
↓ 1 callers
Function
NewPrometheusRenderer
NewPrometheusRenderer creates a new Prometheus renderer
internal/renderer/renderer_p1.go:56
↓ 1 callers
Function
NewRenderer
NewRenderer creates a new subprocess renderer with the given routing rules. The slice order determines matching priority (first match wins).
internal/renderer/subprocess/subprocess.go:56
↓ 1 callers
Function
NewSearcher
NewSearcher returns a new Searcher for the specified config.
internal/location/search.go:15
↓ 1 callers
Function
NewUplinkProcessor
(cfg *Config)
internal/uplink/uplink.go:27
↓ 1 callers
Function
NewWeatherClient
NewWeatherClient creates a new WeatherClient with proper connection pooling.
internal/weather/weatherer_wwo.go:33
↓ 1 callers
Function
NewWeatherService
NewWeatherService initializes a new pipeline based on the provided options.
internal/weather/weather.go:114
↓ 1 callers
Method
Parse
Parse implements QueryParser.Parse
internal/query/queryparser.go:29
↓ 1 callers
Function
ParseOptionsInFilename
ParseOptionsInFilename converts a wttr.in-style PNG filename into *options.Options using the same parsing/validation pipeline as normal ?query=string
internal/query/fromrequest.go:220
↓ 1 callers
Method
Put
Put stores the location in the configured backend (now uses batching for DB)
internal/location/cache.go:344
↓ 1 callers
Method
Put
(addr string, loc *Address)
internal/ip/ip.go:114
↓ 1 callers
Method
Query
(*Nominatim, string)
internal/location/nominatim.go:22
↓ 1 callers
Method
Read
Read fetches location from cache (LRU already checked in Resolve).
internal/location/cache.go:275
↓ 1 callers
Function
RemoveANSI
(text []byte)
internal/util/termutil/termutil.go:81
↓ 1 callers
Function
RemoveFileIfExists
RemoveFileIfExists removes filename if exists, or does nothing if the file is not there. Returns an error, if it occurred during deletion.
internal/util/files.go:7
↓ 1 callers
Method
Render
Render implements the weather.Renderer interface.
internal/renderer/v1/renderer.go:33
↓ 1 callers
Function
RenderANSI
RenderANSI renders ANSI text to PNG using strongly-typed PNGOptions.
internal/formatter/ansitopng/ansitopng.go:31
↓ 1 callers
Function
RenderConditionFullName
────────────────────────────────────────────────────────────────────────────── All render functions — same signature ─────────────────────────────────
internal/renderer/oneline/render.go:15
↓ 1 callers
Function
RenderHumidity
(ctx *RenderContext)
internal/renderer/oneline/render.go:93
↓ 1 callers
Function
RenderMoonPhaseEmoji
RenderMoonPhaseEmoji — improved to better match visual expectation + Python spirit
internal/renderer/oneline/render_moon.go:30
↓ 1 callers
Function
RenderPressure
(ctx *RenderContext)
internal/renderer/oneline/render.go:115
↓ 1 callers
Function
RenderSolarNoon
(ctx *RenderContext)
internal/renderer/oneline/render.go:150
↓ 1 callers
Function
RenderTemperature
(ctx *RenderContext)
internal/renderer/oneline/render.go:35
↓ 1 callers
Function
RenderWind
(ctx *RenderContext)
internal/renderer/oneline/render.go:65
↓ 1 callers
Method
Route
(opts *options.Options, r *http.Request, ipData *domain.IPData, location *domain.Location)
internal/weather/weather.go:76
↓ 1 callers
Method
Search
Search makes queries through all known providers, and returns response, as soon as it is not nil. If all responses were nil, the last response is retu
internal/location/search.go:29
↓ 1 callers
Function
Serve
(conf *Config, logConf *logging.Config, ws *weather.WeatherService)
internal/server/server.go:229
↓ 1 callers
Function
SplitCamelCase
SplitCamelCase splits a CamelCase string into words and joins them with spaces.
internal/weather/locator_adapter.go:138
↓ 1 callers
Method
String
()
internal/logging/logging.go:30
↓ 1 callers
Function
ToANSI
ToANSI converts a go-te Screen back into a colored ANSI string that can be printed directly to a terminal.
internal/renderer/teansi/teansi.go:14
↓ 1 callers
Function
TolerantUnescape
TolerantUnescape decodes a string by replacing percent-encoded sequences (%XX) with their corresponding byte values, where XX is a two-digit hexadecim
internal/renderer/oneline/oneline.go:217
↓ 1 callers
Function
TranslateWeather
TranslateWeather translates weather descriptions and adds both lang_xx and lang_{lang} keys.
internal/localization/weatherer_translate.go:10
↓ 1 callers
Function
TruecolorTo256
TruecolorTo256 converts all 24-bit truecolor ANSI sequences ([38;2;R;G;Bm and [48;2;R;G;Bm) into the closest 256-color equivalents ([38;5;NNNm and
internal/util/termutil/termutil.go:15
↓ 1 callers
Function
Validate
(opts *options.Options)
internal/query/fromrequest.go:325
↓ 1 callers
Method
WeatherHandler
WeatherHandler handles weather requests with proper cache coalescing.
internal/weather/weather.go:168
↓ 1 callers
Method
WroteHeader
()
internal/server/server.go:122
↓ 1 callers
Function
addFrame
=================================================================== Remaining drawing functions (not in helpers.go) ==================================
internal/renderer/v2/renderer.go:111
↓ 1 callers
Function
ansi256ToColor
ansi256ToColor maps common 256-color values used by wttr.in
internal/formatter/ansitopng/colors.go:47
↓ 1 callers
Function
applyValidationRule
applyValidationRule applies a single validation rule (e.g., "length 6", "regexp [0-9a-fA-F]{6}").
internal/query/parse.go:198
↓ 1 callers
Method
batchWriter
── Batch Writer ─────────────────────────────────────────────────────────────
internal/location/cache.go:143
↓ 1 callers
Function
box
box — exact port of Python _box
internal/renderer/v2/block_rain.go:75
↓ 1 callers
Function
buildCacheKey
buildCacheKey generates a cache signature very similar to original wttr.in logic
internal/weather/cache.go:56
← previous
next →
101–200 of 405, ranked by callers