Lasa is a stateless proxy that generates a RSS or an Atom feed from a Standard.site publication. lasa.anhgelus.world
rss atom atprotocol standard-site atproto
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(config): default one

+77
+54
config/config.go
··· 1 + package config 2 + 3 + import ( 4 + "fmt" 5 + "os" 6 + 7 + "github.com/BurntSushi/toml" 8 + "github.com/valkey-io/valkey-go" 9 + ) 10 + 11 + const DefaultPath = "/etc/lasad.toml" 12 + 13 + type Config struct { 14 + Domain string `toml:"domain"` 15 + Port uint `toml:"port"` 16 + Cache *Cache `toml:"cache"` 17 + } 18 + 19 + type Cache struct { 20 + Host string `toml:"host"` 21 + Port uint `toml:"port"` 22 + DB uint `toml:"db"` 23 + Duration uint `toml:"duration"` 24 + Auth CacheAuth `toml:"auth"` 25 + } 26 + 27 + type CacheAuth struct { 28 + Username string `toml:"username"` 29 + Password string `toml:"password"` 30 + ClientName string `toml:"client_name"` 31 + } 32 + 33 + func (c *Cache) Connect() (valkey.Client, error) { 34 + addr := c.Host 35 + if c.Port > 0 { 36 + addr += fmt.Sprintf(":%d", c.Port) 37 + } 38 + return valkey.NewClient(valkey.ClientOption{ 39 + InitAddress: []string{addr}, 40 + SelectDB: int(c.DB), 41 + Username: c.Auth.Username, 42 + Password: c.Auth.Password, 43 + ClientName: c.Auth.ClientName, 44 + }) 45 + } 46 + 47 + func Load(path string) (*Config, error) { 48 + b, err := os.ReadFile(path) 49 + if err != nil { 50 + return nil, err 51 + } 52 + var cfg Config 53 + return &cfg, toml.Unmarshal(b, cfg) 54 + }
+7
go.mod
··· 1 1 module tangled.org/anhgelus.world/lasa 2 2 3 3 go 1.26.1 4 + 5 + require ( 6 + github.com/BurntSushi/toml v1.6.0 7 + github.com/valkey-io/valkey-go v1.0.73 8 + ) 9 + 10 + require golang.org/x/sys v0.42.0 // indirect
+16
go.sum
··· 1 + github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= 2 + github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= 3 + github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 4 + github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 5 + github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM= 6 + github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4= 7 + github.com/valkey-io/valkey-go v1.0.73 h1:lztOPT0amtR6mwUkeNDcLepdYFdgVpJe/99EohfrmJ4= 8 + github.com/valkey-io/valkey-go v1.0.73/go.mod h1:VGhZ6fs68Qrn2+OhH+6waZH27bjpgQOiLyUQyXuYK5k= 9 + go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= 10 + go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= 11 + golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= 12 + golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= 13 + golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= 14 + golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= 15 + golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= 16 + golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=