View Source Frugality.Generator behaviour (Frugality v0.1.0)

A behaviour for producing HTTP document metadata.

Defines two callbacks - Frugality.Generator.etag/1 and Frugality.Generator.last_modified/1.

Request preconditions are evaluated agains at least one of two pieces of metadata - an entity-tag and a last-modified timestamp.

Link to this section Summary

Link to this section Types

@type datetime() :: DateTime.t() | NaiveDateTime.t()
@type etag() ::
  {:weak | :strong, binary()}
  | {:source, iolist()}
  | {:source, iolist(), Access.t()}
@type t() :: module()

Link to this section Callbacks

@callback etag(map()) :: etag() | nil
@callback last_modified(map()) :: datetime() | nil