/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/libkb/proof_icon.go
54 строки
1 KB
zoom-ua
gofumpt (#28710)
17 дек 2025, 17:16
Не верифицирован
17 дек 2025, 17:16
cda510b
Код
Авторство
О чём код?
package libkb import ( "fmt" "strings" "github.com/keybase/client/go/protocol/keybase1" ) func normalizeIconKey(key string) string { switch key { case "bitcoin": return "btc" case "zcash.t", "zcash.z", "zcash.s": return "zcash" case "http", "https", "dns": return "web" default: return key } } const ( ProofIconTypeSmall = "logo_black" ProofIconTypeSmallDarkmode = "logo_white" ProofIconTypeFull = "logo_full" ProofIconTypeFullDarkmode = "logo_full_darkmode" ) func MakeProofIcons(mctx MetaContext, serviceKey, iconType string, size int) (res []keybase1.SizedImage) { for _, factor := range []int{1, 2} { factorix := "" if factor > 1 { factorix = fmt.Sprintf("@%vx", factor) } site := SiteURILookup[mctx.G().Env.GetRunMode()] if mctx.G().Env.GetRunMode() == DevelRunMode { site = strings.Replace(site, "localhost", "127.0.0.1", 1) } res = append(res, keybase1.SizedImage{ Path: strings.Join([]string{ site, "images/paramproofs/services", normalizeIconKey(serviceKey), // The 'c' query parameter is just for cache busting. It's ignored by the server. fmt.Sprintf("%v_%v%v.png?c=3", iconType, size, factorix), }, "/"), Width: size * factor, }) } return res }