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
↓ 1 callers
Function
buildLocationString
buildLocationString builds the location line
internal/renderer/v2/block_textualinformation.go:205
↓ 1 callers
Method
buildLogOutput
buildLogOutput generates the log lines from current buffer.
internal/logging/logging.go:116
↓ 1 callers
Function
buildMainWeatherLine
buildMainWeatherLine constructs the rich first line
internal/renderer/v2/block_textualinformation.go:189
↓ 1 callers
Function
buildOptionLookups
buildOptionLookups creates lookup maps for short-to-long names and option details.
internal/query/parse.go:77
↓ 1 callers
Method
buildURL
buildURL replaces placeholders in the base URL with actual values.
internal/weather/weatherer_wwo.go:143
↓ 1 callers
Function
checkURLForPNG
checkURLForPNG returns true if the request is for a .png image but not for files in the /files/ directory.
internal/uplink/uplink.go:162
↓ 1 callers
Function
clamp
(v, min, max int)
internal/formatter/ansitopng/options.go:102
↓ 1 callers
Function
codes
()
internal/renderer/v1/icons.go:162
↓ 1 callers
Function
colorCodeForWindSpeed
(speed int)
internal/renderer/v2/block_wind.go:38
↓ 1 callers
Function
colorForTemp
colorForTemp returns a temperature-based color (cold blue → hot red). You can tweak the gradient here.
internal/renderer/v2/block_temperature_colorized.go:21
↓ 1 callers
Method
computeAndStore
(ctx context.Context, w http.ResponseWriter, r *http.Request, cacheKey string, overallStart time.Time)
internal/weather/weather.go:216
↓ 1 callers
Function
convertCondFromCurrent
Helper: convert current_condition
internal/renderer/v1/converter.go:71
↓ 1 callers
Function
convertCondFromHourly
Helper: convert hourly
internal/renderer/v1/converter.go:85
↓ 1 callers
Function
convertCurrentConditionToCond
convertCurrentConditionToCond converts domain.CurrentCondition to v1.cond
internal/renderer/v1/renderer.go:172
↓ 1 callers
Function
convertSequence
convertSequence converts a single ANSI sequence if it contains truecolor.
internal/util/termutil/termutil.go:54
↓ 1 callers
Function
createTable
(db *godb.DB, tableName string)
internal/location/convert.go:45
↓ 1 callers
Function
createTable
(db *godb.DB, tableName string)
internal/ip/convert.go:76
↓ 1 callers
Function
dawnTime
dawnTime returns civil dawn time in local HH:MM format (or "??:??" on error/failure)
internal/renderer/oneline/render_solar.go:147
↓ 1 callers
Function
debugCompareOneLineRendering
(format string, uplinkResponse string, internalResponse string)
internal/weather/weather.go:563
↓ 1 callers
Method
determineFormat
────────────────────────────────────────────────────────────────────────────── Helpers (usually kept private in the same file) ───────────────────────
internal/renderer/oneline/oneline.go:48
↓ 1 callers
Function
determineNumDays
determineNumDays extracts forecast depth logic
internal/renderer/v1/renderer.go:152
↓ 1 callers
Function
diffLines
diffLines returns a human-readable diff of two multi-line strings
internal/renderer/v1/renderer_test.go:109
↓ 1 callers
Function
drawAstronomical
drawAstronomical — exact port of the original Python draw_astronomical function
internal/renderer/v2/block_astronomical.go:14
↓ 1 callers
Function
drawDate
drawDate - respects NoCaption / NoCity indirectly through frame
internal/renderer/v2/block_date.go:14
↓ 1 callers
Function
drawRainSpark
drawRainSpark — now matches Python v2 label position (TOP of the sparkline)
internal/renderer/v2/block_rain.go:14
↓ 1 callers
Function
drawTimeScale
(loc *domain.Location)
internal/renderer/v2/block_timescale.go:16
↓ 1 callers
Function
drawWeatherEmoji
drawWeatherEmoji renders hourly weather emojis by reusing RenderConditionEmoji from the oneline package (via a minimal dummy context).
internal/renderer/v2/block_weatheremoji.go:13
↓ 1 callers
Function
drawWind
drawWind renders the two-line wind block (exactly like Python)
internal/renderer/v2/block_wind.go:48
↓ 1 callers
Function
duskTime
duskTime returns civil dusk time in local HH:MM format (or "??:??" on error/failure)
internal/renderer/oneline/render_solar.go:172
↓ 1 callers
Method
execute
execute runs the external program with the selected data in env vars.
internal/renderer/subprocess/subprocess.go:118
↓ 1 callers
Method
extractCurrent
extractCurrent extracts from CurrentCondition
internal/renderer/renderer_p1.go:158
↓ 1 callers
Function
extractQueryFromLine
extractQueryFromLine extracts the query from a log line and validates its format.
internal/query/processlog.go:85
↓ 1 callers
Method
extractWeatherDay
extractWeatherDay extracts from WeatherDay (daily + Hourly[0])
internal/renderer/renderer_p1.go:199
↓ 1 callers
Method
fetchAndCache
fetchAndCache performs the actual upstream request and stores the result.
internal/weather/weatherer_wwo_cached.go:74
↓ 1 callers
Function
fileExists
(filename string)
internal/location/convert.go:73
↓ 1 callers
Function
fixGraphemes
fixGraphemes replaces complex graphemes with "!" and returns them separately
internal/formatter/ansitopng/ansitopng.go:64
↓ 1 callers
Method
formatDate
formatDate returns localized and optionally reversed date string for the header.
internal/renderer/v1/layout.go:125
↓ 1 callers
Function
genTerm
(buf [][]te.Cell, graphemes []string, opts PNGOptions)
internal/formatter/ansitopng/ansitopng.go:171
↓ 1 callers
Function
getDebugInfo
( r *http.Request, q *domain.Query, requestedLocStr string, timetracker *TimeTracker, )
internal/weather/weather.go:462
↓ 1 callers
Method
getFromLRU
(key string)
internal/location/cache.go:402
↓ 1 callers
Function
getMapKeys
getMapKeys returns a sorted slice of keys from a map for error messages.
internal/query/parse.go:245
↓ 1 callers
Function
getSymbolWidth
(s string)
internal/formatter/ansitopng/ansitopng.go:276
↓ 1 callers
Function
getUplink
getUplink forwards the incoming request to one of the backend uplink servers and returns a cacheable response. It enriches the request with location
internal/uplink/uplink.go:97
↓ 1 callers
Method
getWeather
GetWeather fetches weather data while respecting the concurrency limit. It reuses HTTP connections thanks to the shared http.Client.
internal/weather/weatherer_wwo.go:82
↓ 1 callers
Function
getWindDirectionIndex
(degree int)
internal/renderer/oneline/render.go:198
↓ 1 callers
Function
h2m
h2m returns minutes since midnight for a cond (used in comparison)
internal/renderer/v1/helpers.go:42
↓ 1 callers
Function
handleFlagOption
handleFlagOption processes flag options (e.g., "0pq" or "m") without values.
internal/query/parse.go:90
↓ 1 callers
Function
handleValueOption
handleValueOption processes options with values (e.g., "lang=fr").
internal/query/parse.go:125
↓ 1 callers
Function
ipFromAddr
ipFromAddr extracts the IP address from an "IP:PORT" string. Returns the original string if no colon is found.
internal/uplink/uplink.go:178
↓ 1 callers
Function
isAutoDetectPath
(p string)
internal/weather/weather.go:458
↓ 1 callers
Function
isBrowserClient
isBrowserClient determines if the User-Agent indicates a web browser. All real browsers include "Mozilla/" in their User-Agent string for historical N
internal/query/fromrequest.go:356
↓ 1 callers
Function
isClientInUSA
(ipData *domain.IPData)
internal/weather/weather.go:584
↓ 1 callers
Function
isEmoji
(r rune)
internal/formatter/ansitopng/fonts.go:144
↓ 1 callers
Function
isEmptyLine
(line []te.Cell)
internal/formatter/ansitopng/ansitopng.go:109
↓ 1 callers
Method
isNumeric
(s string)
internal/renderer/renderer_p1.go:308
↓ 1 callers
Function
lineLength
(line []te.Cell)
internal/formatter/ansitopng/ansitopng.go:118
↓ 1 callers
Method
loadAll
loadAll preloads every language found in share/translations/
internal/translate/bundle.go:37
↓ 1 callers
Function
loadCertificates
loadCertificates loads all certificates and returns a map + default cert
internal/server/server.go:143
↓ 1 callers
Function
loadEmojiLib
()
internal/formatter/ansitopng/ansitopng.go:127
↓ 1 callers
Method
loadLanguage
loadLanguage loads a single language (used during initialization)
internal/translate/bundle.go:173
↓ 1 callers
Function
loadTestData
loadTestData loads the new structured testcases.json
internal/renderer/v1/renderer_test.go:149
↓ 1 callers
Function
loadWeatherRaw
=================================================================== Helpers ===================================================================
internal/renderer/v1/renderer_test.go:139
↓ 1 callers
Function
mainHandler
(ws *weather.WeatherService, logger *logging.RequestLogger)
internal/server/server.go:275
↓ 1 callers
Method
matchesLocation
(route SubprocessRoute, loc string)
internal/renderer/subprocess/subprocess.go:88
↓ 1 callers
Method
matchesSelectors
(selectors map[string]string, opts map[string]string)
internal/renderer/subprocess/subprocess.go:108
↓ 1 callers
Function
max
(a, b int)
internal/renderer/v2/block_rain.go:97
↓ 1 callers
Function
openErrorFile
openErrorFile creates and opens the error file for writing.
internal/query/processlog.go:42
↓ 1 callers
Function
openLogFile
openLogFile opens the log file for reading.
internal/query/processlog.go:33
↓ 1 callers
Function
parseColor
parseColor converts a hex string (RRGGBB) or named color to color.Color
internal/formatter/ansitopng/options.go:69
↓ 1 callers
Function
parseConditions
parseConditions parses the classic wttr.in conditions.txt format
internal/translate/bundle.go:203
↓ 1 callers
Function
preloadFontFiles
preloadFontFiles extracts fonts from embed.FS to temp files once at startup
internal/formatter/ansitopng/fonts.go:39
↓ 1 callers
Function
prettyPrintOptions
(o *options.Options)
internal/weather/weather.go:526
↓ 1 callers
Method
printDay
printDay renders a single forecast day in the classic v1 box style.
internal/renderer/v1/layout.go:20
↓ 1 callers
Function
processLogLine
processLogLine processes a single log line and writes errors to the error file.
internal/query/processlog.go:68
↓ 1 callers
Function
processLogLines
processLogLines reads and processes each line of the log file.
internal/query/processlog.go:52
↓ 1 callers
Method
putToCacheDB
(loc *Address)
internal/ip/ip.go:125
↓ 1 callers
Method
putToCacheFile
(addr string, loc *Location)
internal/location/cache.go:364
↓ 1 callers
Method
putToCacheFile
(addr string, loc fmt.Stringer)
internal/ip/ip.go:143
↓ 1 callers
Function
randInt
randInt returns a random integer in the range [min, max). Note: rand.Seed should be called once at program startup for better randomness.
internal/uplink/uplink.go:169
↓ 1 callers
Method
readFromCacheDB
(addr string)
internal/location/cache.go:319
↓ 1 callers
Method
readFromCacheDB
(addr string)
internal/ip/ip.go:102
↓ 1 callers
Method
readFromCacheFile
(name string)
internal/location/cache.go:283
↓ 1 callers
Method
readFromCacheFile
(addr string)
internal/ip/ip.go:93
↓ 1 callers
Method
readFromDisk
(key string)
internal/cache/disk.go:68
↓ 1 callers
Function
removeDBIfExists
(filename string)
internal/location/convert.go:60
↓ 1 callers
Function
renderNowWithOffset
renderNowWithOffset returns current local time with timezone offset
internal/renderer/v2/block_textualinformation.go:62
↓ 1 callers
Function
renderSections
renderSections with proper terminal display width
internal/renderer/v2/block_textualinformation.go:123
↓ 1 callers
Function
resizeImage
(src image.Image, w, h int)
internal/formatter/ansitopng/ansitopng.go:159
↓ 1 callers
Function
screenToBuffer
screenToBuffer returns the screen content as [][]te.Cell
internal/formatter/ansitopng/ansitopng.go:59
↓ 1 callers
Function
scriptCategory
(r rune)
internal/formatter/ansitopng/fonts.go:102
↓ 1 callers
Method
selectBestHourlySlots
selectBestHourlySlots picks the best matching hourly entry for each target time slot.
internal/renderer/v1/layout.go:108
↓ 1 callers
Method
selectFormatter
selectFormatter chooses the appropriate formatter based on the output format option.
internal/weather/weather.go:550
↓ 1 callers
Method
selectRenderer
selectRenderer chooses the appropriate renderer based on the format option.
internal/weather/weather.go:540
↓ 1 callers
Method
serveFreshResponse
Helper to keep the main handler clean
internal/weather/weather.go:207
↓ 1 callers
Function
serveHTTP
(mux *http.ServeMux, port int, logFile io.Writer, errs chan<- error)
internal/server/server.go:130
↓ 1 callers
Function
serveHTTPS
serveHTTPS starts HTTPS server with support for multiple certificates via SNI
internal/server/server.go:174
↓ 1 callers
Function
slotTimes
slotTimes returns the preferred times of day (in minutes since midnight) for the 4 slots.
internal/renderer/v1/layout.go:15
↓ 1 callers
Function
solarNoonTime
solarNoonTime — approximate as midpoint between sunrise & sunset
internal/renderer/oneline/render_solar.go:69
↓ 1 callers
Function
srv
(configFile string)
main.go:35
↓ 1 callers
Function
stripBuffer
(buf [][]te.Cell)
internal/formatter/ansitopng/ansitopng.go:80
← previous
next →
201–300 of 405, ranked by callers