MCPcopy Create free account

hub / github.com/chubin/wttr.in / functions

Functions405 in github.com/chubin/wttr.in

↓ 1 callersFunctionbuildLocationString
buildLocationString builds the location line
internal/renderer/v2/block_textualinformation.go:205
↓ 1 callersMethodbuildLogOutput
buildLogOutput generates the log lines from current buffer.
internal/logging/logging.go:116
↓ 1 callersFunctionbuildMainWeatherLine
buildMainWeatherLine constructs the rich first line
internal/renderer/v2/block_textualinformation.go:189
↓ 1 callersFunctionbuildOptionLookups
buildOptionLookups creates lookup maps for short-to-long names and option details.
internal/query/parse.go:77
↓ 1 callersMethodbuildURL
buildURL replaces placeholders in the base URL with actual values.
internal/weather/weatherer_wwo.go:143
↓ 1 callersFunctioncheckURLForPNG
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 callersFunctionclamp
(v, min, max int)
internal/formatter/ansitopng/options.go:102
↓ 1 callersFunctioncodes
()
internal/renderer/v1/icons.go:162
↓ 1 callersFunctioncolorCodeForWindSpeed
(speed int)
internal/renderer/v2/block_wind.go:38
↓ 1 callersFunctioncolorForTemp
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 callersMethodcomputeAndStore
(ctx context.Context, w http.ResponseWriter, r *http.Request, cacheKey string, overallStart time.Time)
internal/weather/weather.go:216
↓ 1 callersFunctionconvertCondFromCurrent
Helper: convert current_condition
internal/renderer/v1/converter.go:71
↓ 1 callersFunctionconvertCondFromHourly
Helper: convert hourly
internal/renderer/v1/converter.go:85
↓ 1 callersFunctionconvertCurrentConditionToCond
convertCurrentConditionToCond converts domain.CurrentCondition to v1.cond
internal/renderer/v1/renderer.go:172
↓ 1 callersFunctionconvertSequence
convertSequence converts a single ANSI sequence if it contains truecolor.
internal/util/termutil/termutil.go:54
↓ 1 callersFunctioncreateTable
(db *godb.DB, tableName string)
internal/location/convert.go:45
↓ 1 callersFunctioncreateTable
(db *godb.DB, tableName string)
internal/ip/convert.go:76
↓ 1 callersFunctiondawnTime
dawnTime returns civil dawn time in local HH:MM format (or "??:??" on error/failure)
internal/renderer/oneline/render_solar.go:147
↓ 1 callersFunctiondebugCompareOneLineRendering
(format string, uplinkResponse string, internalResponse string)
internal/weather/weather.go:563
↓ 1 callersMethoddetermineFormat
────────────────────────────────────────────────────────────────────────────── Helpers (usually kept private in the same file) ───────────────────────
internal/renderer/oneline/oneline.go:48
↓ 1 callersFunctiondetermineNumDays
determineNumDays extracts forecast depth logic
internal/renderer/v1/renderer.go:152
↓ 1 callersFunctiondiffLines
diffLines returns a human-readable diff of two multi-line strings
internal/renderer/v1/renderer_test.go:109
↓ 1 callersFunctiondrawAstronomical
drawAstronomical — exact port of the original Python draw_astronomical function
internal/renderer/v2/block_astronomical.go:14
↓ 1 callersFunctiondrawDate
drawDate - respects NoCaption / NoCity indirectly through frame
internal/renderer/v2/block_date.go:14
↓ 1 callersFunctiondrawRainSpark
drawRainSpark — now matches Python v2 label position (TOP of the sparkline)
internal/renderer/v2/block_rain.go:14
↓ 1 callersFunctiondrawTimeScale
(loc *domain.Location)
internal/renderer/v2/block_timescale.go:16
↓ 1 callersFunctiondrawWeatherEmoji
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 callersFunctiondrawWind
drawWind renders the two-line wind block (exactly like Python)
internal/renderer/v2/block_wind.go:48
↓ 1 callersFunctionduskTime
duskTime returns civil dusk time in local HH:MM format (or "??:??" on error/failure)
internal/renderer/oneline/render_solar.go:172
↓ 1 callersMethodexecute
execute runs the external program with the selected data in env vars.
internal/renderer/subprocess/subprocess.go:118
↓ 1 callersMethodextractCurrent
extractCurrent extracts from CurrentCondition
internal/renderer/renderer_p1.go:158
↓ 1 callersFunctionextractQueryFromLine
extractQueryFromLine extracts the query from a log line and validates its format.
internal/query/processlog.go:85
↓ 1 callersMethodextractWeatherDay
extractWeatherDay extracts from WeatherDay (daily + Hourly[0])
internal/renderer/renderer_p1.go:199
↓ 1 callersMethodfetchAndCache
fetchAndCache performs the actual upstream request and stores the result.
internal/weather/weatherer_wwo_cached.go:74
↓ 1 callersFunctionfileExists
(filename string)
internal/location/convert.go:73
↓ 1 callersFunctionfixGraphemes
fixGraphemes replaces complex graphemes with "!" and returns them separately
internal/formatter/ansitopng/ansitopng.go:64
↓ 1 callersMethodformatDate
formatDate returns localized and optionally reversed date string for the header.
internal/renderer/v1/layout.go:125
↓ 1 callersFunctiongenTerm
(buf [][]te.Cell, graphemes []string, opts PNGOptions)
internal/formatter/ansitopng/ansitopng.go:171
↓ 1 callersFunctiongetDebugInfo
( r *http.Request, q *domain.Query, requestedLocStr string, timetracker *TimeTracker, )
internal/weather/weather.go:462
↓ 1 callersMethodgetFromLRU
(key string)
internal/location/cache.go:402
↓ 1 callersFunctiongetMapKeys
getMapKeys returns a sorted slice of keys from a map for error messages.
internal/query/parse.go:245
↓ 1 callersFunctiongetSymbolWidth
(s string)
internal/formatter/ansitopng/ansitopng.go:276
↓ 1 callersFunctiongetUplink
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 callersMethodgetWeather
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 callersFunctiongetWindDirectionIndex
(degree int)
internal/renderer/oneline/render.go:198
↓ 1 callersFunctionh2m
h2m returns minutes since midnight for a cond (used in comparison)
internal/renderer/v1/helpers.go:42
↓ 1 callersFunctionhandleFlagOption
handleFlagOption processes flag options (e.g., "0pq" or "m") without values.
internal/query/parse.go:90
↓ 1 callersFunctionhandleValueOption
handleValueOption processes options with values (e.g., "lang=fr").
internal/query/parse.go:125
↓ 1 callersFunctionipFromAddr
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 callersFunctionisAutoDetectPath
(p string)
internal/weather/weather.go:458
↓ 1 callersFunctionisBrowserClient
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 callersFunctionisClientInUSA
(ipData *domain.IPData)
internal/weather/weather.go:584
↓ 1 callersFunctionisEmoji
(r rune)
internal/formatter/ansitopng/fonts.go:144
↓ 1 callersFunctionisEmptyLine
(line []te.Cell)
internal/formatter/ansitopng/ansitopng.go:109
↓ 1 callersMethodisNumeric
(s string)
internal/renderer/renderer_p1.go:308
↓ 1 callersFunctionlineLength
(line []te.Cell)
internal/formatter/ansitopng/ansitopng.go:118
↓ 1 callersMethodloadAll
loadAll preloads every language found in share/translations/
internal/translate/bundle.go:37
↓ 1 callersFunctionloadCertificates
loadCertificates loads all certificates and returns a map + default cert
internal/server/server.go:143
↓ 1 callersFunctionloadEmojiLib
()
internal/formatter/ansitopng/ansitopng.go:127
↓ 1 callersMethodloadLanguage
loadLanguage loads a single language (used during initialization)
internal/translate/bundle.go:173
↓ 1 callersFunctionloadTestData
loadTestData loads the new structured testcases.json
internal/renderer/v1/renderer_test.go:149
↓ 1 callersFunctionloadWeatherRaw
=================================================================== Helpers ===================================================================
internal/renderer/v1/renderer_test.go:139
↓ 1 callersFunctionmainHandler
(ws *weather.WeatherService, logger *logging.RequestLogger)
internal/server/server.go:275
↓ 1 callersMethodmatchesLocation
(route SubprocessRoute, loc string)
internal/renderer/subprocess/subprocess.go:88
↓ 1 callersMethodmatchesSelectors
(selectors map[string]string, opts map[string]string)
internal/renderer/subprocess/subprocess.go:108
↓ 1 callersFunctionmax
(a, b int)
internal/renderer/v2/block_rain.go:97
↓ 1 callersFunctionopenErrorFile
openErrorFile creates and opens the error file for writing.
internal/query/processlog.go:42
↓ 1 callersFunctionopenLogFile
openLogFile opens the log file for reading.
internal/query/processlog.go:33
↓ 1 callersFunctionparseColor
parseColor converts a hex string (RRGGBB) or named color to color.Color
internal/formatter/ansitopng/options.go:69
↓ 1 callersFunctionparseConditions
parseConditions parses the classic wttr.in conditions.txt format
internal/translate/bundle.go:203
↓ 1 callersFunctionpreloadFontFiles
preloadFontFiles extracts fonts from embed.FS to temp files once at startup
internal/formatter/ansitopng/fonts.go:39
↓ 1 callersFunctionprettyPrintOptions
(o *options.Options)
internal/weather/weather.go:526
↓ 1 callersMethodprintDay
printDay renders a single forecast day in the classic v1 box style.
internal/renderer/v1/layout.go:20
↓ 1 callersFunctionprocessLogLine
processLogLine processes a single log line and writes errors to the error file.
internal/query/processlog.go:68
↓ 1 callersFunctionprocessLogLines
processLogLines reads and processes each line of the log file.
internal/query/processlog.go:52
↓ 1 callersMethodputToCacheDB
(loc *Address)
internal/ip/ip.go:125
↓ 1 callersMethodputToCacheFile
(addr string, loc *Location)
internal/location/cache.go:364
↓ 1 callersMethodputToCacheFile
(addr string, loc fmt.Stringer)
internal/ip/ip.go:143
↓ 1 callersFunctionrandInt
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 callersMethodreadFromCacheDB
(addr string)
internal/location/cache.go:319
↓ 1 callersMethodreadFromCacheDB
(addr string)
internal/ip/ip.go:102
↓ 1 callersMethodreadFromCacheFile
(name string)
internal/location/cache.go:283
↓ 1 callersMethodreadFromCacheFile
(addr string)
internal/ip/ip.go:93
↓ 1 callersMethodreadFromDisk
(key string)
internal/cache/disk.go:68
↓ 1 callersFunctionremoveDBIfExists
(filename string)
internal/location/convert.go:60
↓ 1 callersFunctionrenderNowWithOffset
renderNowWithOffset returns current local time with timezone offset
internal/renderer/v2/block_textualinformation.go:62
↓ 1 callersFunctionrenderSections
renderSections with proper terminal display width
internal/renderer/v2/block_textualinformation.go:123
↓ 1 callersFunctionresizeImage
(src image.Image, w, h int)
internal/formatter/ansitopng/ansitopng.go:159
↓ 1 callersFunctionscreenToBuffer
screenToBuffer returns the screen content as [][]te.Cell
internal/formatter/ansitopng/ansitopng.go:59
↓ 1 callersFunctionscriptCategory
(r rune)
internal/formatter/ansitopng/fonts.go:102
↓ 1 callersMethodselectBestHourlySlots
selectBestHourlySlots picks the best matching hourly entry for each target time slot.
internal/renderer/v1/layout.go:108
↓ 1 callersMethodselectFormatter
selectFormatter chooses the appropriate formatter based on the output format option.
internal/weather/weather.go:550
↓ 1 callersMethodselectRenderer
selectRenderer chooses the appropriate renderer based on the format option.
internal/weather/weather.go:540
↓ 1 callersMethodserveFreshResponse
Helper to keep the main handler clean
internal/weather/weather.go:207
↓ 1 callersFunctionserveHTTP
(mux *http.ServeMux, port int, logFile io.Writer, errs chan<- error)
internal/server/server.go:130
↓ 1 callersFunctionserveHTTPS
serveHTTPS starts HTTPS server with support for multiple certificates via SNI
internal/server/server.go:174
↓ 1 callersFunctionslotTimes
slotTimes returns the preferred times of day (in minutes since midnight) for the 4 slots.
internal/renderer/v1/layout.go:15
↓ 1 callersFunctionsolarNoonTime
solarNoonTime — approximate as midpoint between sunrise & sunset
internal/renderer/oneline/render_solar.go:69
↓ 1 callersFunctionsrv
(configFile string)
main.go:35
↓ 1 callersFunctionstripBuffer
(buf [][]te.Cell)
internal/formatter/ansitopng/ansitopng.go:80
← previousnext →201–300 of 405, ranked by callers