サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
災害への備え
blog.questionable.services
Update (June 2019): kubectl v1.15 now provides a rollout restart sub-command that allows you to restart Pods in a Deployment - taking into account your surge/unavailability config - and thus have them pick up changes to a referenced ConfigMap, Secret or similar. It’s worth noting that you can use this with clusters older than v1.15, as it’s implemented in the client. Example usage: kubectl rollout
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) Testing Your (HTTP) Handlers in Go ••• You’re building a web (HTTP) service in Go, and you want to unit test your handler functions. You’ve got a grip on Go’s net/http package, but you’re not sure where to start with testing that your handlers return the correct HTTP status codes, HTTP he
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) http.Handler and Error Handling in Go ••• I wrote an article a while back on implementing custom handler types to avoid a few common problems with the existing http.HandlerFunc—the func MyHandler(w http.ResponseWriter, r *http.Request) signature you often see. It’s a useful “general purpo
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) HTTP Request Contexts & Go ••• Updated (2020): The approaches discussed here were once all valid options, but Go has matured significantly since then! You should use Go’s http.Request.WithContext() method for per-request contexts, passing a context.Background() around as needed. For outbo
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) Custom Handlers and Avoiding Globals in Go Web Applications ••• Note: I’ve also published a second article about custom handlers that builds on the foundations here. Might be worth reading after you finish this! Go’s net/http package is extremely flexible, thanks to the fact that it centr
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) Approximating html/template Inheritance ••• Go’s html/template package is fairly minimal compared to templating packages associated with other languages (Jinja, Mustache, even Django’s templates), although it makes up for this with security and great docs. There are however a few “tricks”
questionable services Technical writings about computing infrastructure, HTTP & security. (by Matt Silverlock) Generating Secure Random Numbers Using crypto/rand ••• You’re writing an application and you need to generate some session keys, CSRF tokens, and HMACs. For all of these activities, you need a crytographically secure pseudo-random number generator (CSPRNG). Or, in other words, a source of
このページを最初にブックマークしてみませんか?
『blog.questionable.services』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く