2be5051b19
Given that there is always a ton of `Entry` floating around, reordering its field to take less space is a quick/simple way to reduce miniflux' memory consumption. I kept the `ID` field as the first member, as I think it's the most important one, and moving it somewhere else would drown it in other fields. Anyway, this still provides a reduction of 32 bytes per Entry: ```console $ fieldalignment ./client/model.go 2>&1 | grep 203 ~/v2/client/model.go:203:12: struct with 280 pointer bytes could be 240 $ fieldalignment ./client/model.go 2>&1 | grep 203 ~/v2/client/model.go:203:12: struct with 248 pointer bytes could be 240 $ ``` The same optimisation pass could be applied to other structs, but since they aren't present in obviously great numbers during miniflux' life cycle, it would likely require some profiling to see if it's worth doing it. |
||
---|---|---|
.. | ||
client.go | ||
doc.go | ||
model.go | ||
README.md | ||
request.go |
Miniflux API Client
Client library for Miniflux REST API.
Installation
go get -u miniflux.app/v2/client
Example
package main
import (
"fmt"
"os"
miniflux "miniflux.app/v2/client"
)
func main() {
// Authentication with username/password:
client := miniflux.New("https://api.example.org", "admin", "secret")
// Authentication with an API Key:
client := miniflux.New("https://api.example.org", "my-secret-token")
// Fetch all feeds.
feeds, err := client.Feeds()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(feeds)
// Backup your feeds to an OPML file.
opml, err := client.Export()
if err != nil {
fmt.Println(err)
return
}
err = os.WriteFile("opml.xml", opml, 0644)
if err != nil {
fmt.Println(err)
return
}
}