Hustle.Subscription (hustle v0.1.0)

The struct and functions in this module are utilized for the subscription data returned by the browser.

Link to this section Summary

Functions

Returns the base URL for the given subscription.

Returns a Subscription struct with the provide arguments.

Link to this section Types

@type t() :: %Hustle.Subscription{auth: binary(), p256dh: binary(), url: String.t()}

Link to this section Functions

Link to this function

get_base_url(subscription)

@spec get_base_url(subscription :: t()) :: String.t()

Returns the base URL for the given subscription.

Link to this function

new(url, auth, p256dh)

@spec new(url :: String.t(), auth :: String.t(), p256dh :: String.t()) :: t()

Returns a Subscription struct with the provide arguments.

Both auth and p256dh strings are Base64 URL decode into binary before the struct is returned.