config env get name and value

use github.com/spf13/viper Get env data config.go type urls struct { Demo1 string `mapstructure:"demo1"` Demo2 string `mapstructure:"demo2"` } type NotifyHttps struct { Name string `mapstructure:"name"` Token string `mapstructure:"token"` Urls urls `mapstructure:"urls"` } type env struct { NotifyHttp NotifyHttps `mapstructure:"notify_https"` } .env notify_https: name: order_comfire token: 123456abcdef urls: demo1: localhost:8888 demo2: localhost:8443 notify.go refUrls := reflect.ValueOf(config.Env.NotifyHttps.Urls) urlNum := refUrls.NumField() for i := 0; i < urlNum; i++ { url := refUrls.Field(i).String() if url != "" { // notify url // record refUrls.Type().Field(i).Name be notify. } }

2024-07-18 · 1 min · 84 words · Me

copilot

現在試用了一下,發現… 一開始覺得沒用,後來好像又有用,但現在又發現無用 主要好是 預測一些你可能要做的操作,給一段程試碼,不一定會對,但對的情況下,只要按tab,就省得打 有些程式碼看起有點重覆,可以請它優化,有些寫法是ok的,按下tab也是能省一些時間 壞 只要是系統比較多功能或架構,像我試預約系統,基本上只能產生一個殼而己,更細部的都不太行,而且建議到後面 ai會自己白痴掉,自己卡自己的code 我們進階需要的是架構和整個細部,不是殼

2024-07-17 · 1 min · 9 words · Me

先進的stream server

https://github.com/ZLMediaKit/ZLMediaKit https://github.com/q191201771/lal

2024-07-08 · 1 min · 2 words · Me

Cart Rule

Cart Rule

2024-07-03 · 1 min · 2 words · Me

serversideup VPS-Benchmarks-for-Self-hosters

https://521dimensions.notion.site/VPS-Benchmarks-for-Self-hosters-c6eca7c5f16d4bb8aeb989174fc58ffe. Hetzner Cloud prohosting24 https://prohosting24.net/genoa 這間評價可,高防、效能不錯,無限流量,但用太多會限流,或是被踢掉,不能有法

2024-05-10 · 1 min · 6 words · Me