miniflux_sdk

This library contains functions for talking to the miniflux API. So far only a tiny subset of the API is available.

You will need an API-key for your instance in order to use this library.

See https://miniflux.app

Types

Represents a category in Miniflux.

Categories are used to organize feeds into groups.

pub type Category {
  Category(id: Int, user_id: Int, title: String)
}

Constructors

  • Category(id: Int, user_id: Int, title: String)

Client

opaque

The Miniflux client used to make API requests.

This is an opaque type - you create it using client_from_url and pass it to the various API functions.

pub opaque type Client

Represents an entry (article) in Miniflux.

An entry is a single article or item from a feed.

pub type Entry {
  Entry(
    id: Int,
    user_id: Int,
    feed_id: Int,
    title: String,
    url: String,
    content: String,
    status: String,
    starred: Bool,
    reading_time: Int,
  )
}

Constructors

  • Entry(
      id: Int,
      user_id: Int,
      feed_id: Int,
      title: String,
      url: String,
      content: String,
      status: String,
      starred: Bool,
      reading_time: Int,
    )

Error types that can occur when using the Miniflux SDK.

  • CannotParseUrl: The provided URL could not be parsed.
  • CannotDecodeJson: The JSON response could not be decoded.
  • InvalidScheme: The URL scheme is not http or https.
  • Unauthorized: The API key is invalid (HTTP 401).
  • UnexpectedHttpStatus: An unexpected HTTP status was received.
pub type Error {
  CannotParseUrl
  CannotDecodeJson(json.DecodeError)
  InvalidScheme
  Unauthorized(response: response.Response(String))
  UnexpectedHttpStatus(response: response.Response(String))
}

Constructors

Represents a feed in Miniflux.

A feed is a source of entries, such as an RSS or Atom feed.

pub type Feed {
  Feed(
    id: Int,
    user_id: Int,
    title: String,
    site_url: String,
    feed_url: String,
    disabled: Bool,
    category: Category,
  )
}

Constructors

  • Feed(
      id: Int,
      user_id: Int,
      title: String,
      site_url: String,
      feed_url: String,
      disabled: Bool,
      category: Category,
    )

Values

pub fn category_decoder() -> decode.Decoder(Category)

Returns a decoder for parsing JSON categories from the Miniflux API.

pub fn client_from_url(
  base_url: String,
  api_key: String,
) -> Result(Client, Error)

Creates a new Miniflux client from a base URL and API key.

The base URL should be the full URL of your Miniflux instance, including the scheme (http or https) and any path prefix.

Examples

let client = miniflux_sdk.client_from_url("https://miniflux.example.com", "your-api-key")

Errors

Returns CannotParseUrl if the URL cannot be parsed. Returns InvalidScheme if the URL scheme is not http or https.

pub fn entry_decoder() -> decode.Decoder(Entry)

Returns a decoder for parsing JSON entries from the Miniflux API.

pub fn feed_decoder() -> decode.Decoder(Feed)

Returns a decoder for parsing JSON feeds from the Miniflux API.

Search Document