View Source Nex.Messages.Tag (Nex v0.1.0-beta.1)

Nostr Tag schema.

A Nostr Tag is simply a list of strings. This module defines the type and provides convinience functions for finding tags or conveting a tag to a map of parameters.

Link to this section Summary

Types

t()

Tag

Functions

Filters the list of tags by the given name.

Finds the first tag from the list by the given name.

Returns the first two elements of the tag as a map of name and value.

Link to this section Types

Link to this section Functions

Link to this function

filter_by_name(tags, name)

View Source
@spec filter_by_name([t()], String.t()) :: t() | nil

Filters the list of tags by the given name.

Link to this function

find_by_name(tags, name)

View Source
@spec find_by_name([t()], String.t()) :: t() | nil

Finds the first tag from the list by the given name.

@spec to_map(t()) :: map()

Returns the first two elements of the tag as a map of name and value.