View Source Bbox.Voters (bbox v0.1.2)

Link to this section Summary

Functions

Get voter by RSA Private Key.

Insert a new voter into the database.

Link to this section Functions

Link to this function

get_by_private_key!(private_key)

View Source
@spec get_by_private_key!(binary()) :: %Bbox.Voters.Voter{
  __meta__: term(),
  address: term(),
  email: term(),
  inserted_at: term(),
  private_key: term(),
  public_key: term(),
  updated_at: term(),
  username: term(),
  votes: term()
}

Get voter by RSA Private Key.

@spec insert(map()) ::
  {:ok,
   %Bbox.Voters.Voter{
     __meta__: term(),
     address: term(),
     email: term(),
     inserted_at: term(),
     private_key: term(),
     public_key: term(),
     updated_at: term(),
     username: term(),
     votes: term()
   }}
  | {:error, charlist()}

Insert a new voter into the database.