GitHub

GeneratorService

API reference for GeneratorService.

Makes the entity tag of a file: weak ones, or strong ones.

Attributes

AttributeTypeDescription
weakbool

Functions

__init__

__init__(weak) -> None
ParameterTypeDescription
weakbool

from_file_info

from_file_info(info) -> Effect[Etag]

The tag of a file from its stat: its size and modification time in milliseconds, in hex (<size>-<mtime>, mtime 0 when unknown); weak or strong as the generator makes them. Never fails.

ParameterTypeDescription
infoFileInfo

Returns Effect[Etag]

def from_file_info(self, info: FileInfo) -> Effect[Etag]:
    """The tag of a file from its ``stat``: its size and modification
    time in milliseconds, in hex (``<size>-<mtime>``, mtime ``0`` when
    unknown); weak or strong as the generator makes them. Never
    fails."""
    return sync(lambda: self._make(value_from_file_info(info)))

from_file_web

from_file_web(file) -> Effect[Etag]

The tag of a file-like value: its size and last_modified in milliseconds, in hex (<size>-<mtime>); weak or strong as the generator makes them. Never fails.

ParameterTypeDescription
fileFileLike

Returns Effect[Etag]

def from_file_web(self, file: FileLike) -> Effect[Etag]:
    """The tag of a file-like value: its ``size`` and
    ``last_modified`` in milliseconds, in hex (``<size>-<mtime>``);
    weak or strong as the generator makes them. Never fails."""
    return sync(lambda: self._make(value_from_file_web(file)))