NetStorage.Config (netstorage v0.2.2)

Configuration struct

set-global-configurations

Set Global Configurations

To set configurations globally, add your configurations to your config.exs file.

# config/config.exs

config :netstorage,
  content_provider_code: "123,
  host: "example.akamaihd.net",
  key: "secret-key",
  account_id: "accountid"

request-specific-configurations

Request Specific Configurations

To set configurations per request, pass your configurations as an option to NetStorage.request/2.

iex> NetStorage.request(operation, [config: [content_provider_code: "123"]])

Link to this section Summary

Functions

Returns a Config struct with values populated from the application configs.

Returns a Config struct with the specified fields.

Link to this section Types

Link to this type

account_id()

@type account_id() :: binary()
Link to this type

content_provider_code()

@type content_provider_code() :: binary()
@type host() :: binary()
@type key() :: binary()
@type t() :: %NetStorage.Config{
  account_id: account_id(),
  content_provider_code: content_provider_code(),
  host: host(),
  key: key()
}

Link to this section Functions

@spec new() :: t()

Returns a Config struct with values populated from the application configs.

@spec new(fields :: keyword()) :: t()

Returns a Config struct with the specified fields.