Skip to content

Instantly share code, notes, and snippets.

View rugwirobaker's full-sized avatar
🐒
busy

Rugwiro Valentin rugwirobaker

🐒
busy
View GitHub Profile
package main
type KeyPair struct {
Key string
Value []byte
}
type KeyStore interface {
Get(k string) (*KeyPair, error)
}
@denji
denji / golang-tls.md
Last active December 23, 2024 02:18 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@enricofoltran
enricofoltran / main.go
Last active October 3, 2024 14:08
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@miguelmota
miguelmota / pubsub.go
Created October 6, 2018 21:12
Golang redis pub/sub example
package pubsub
import (
"github.com/garyburd/redigo/redis"
log "github.com/sirupsen/logrus"
)
// Service service
type Service struct {
pool *redis.Pool