View Source Pika (pika v0.3.0)

Summary

Functions

Deconstructs a Pika ID and returns it's metadata

Generates an ID given a prefix (which should be configured).

Functions

Deconstructs a Pika ID and returns it's metadata:

  • prefix
  • tail
  • snowflake
  • timestamp
  • prefix_record
  • epoch
  • node_id
  • seq
@spec gen(binary()) :: {:error, binary()} | {:ok, binary()}

Generates an ID given a prefix (which should be configured).

This function will return an {:error, binary()} if one of the follow conditions are met:

  1. The prefix isn't valid
  2. The prefix isn't configured
@spec gen!(binary()) :: binary()