Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
blatyo committed Aug 30, 2018
1 parent 97d3e69 commit 19d9070
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/conduit/broker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ defmodule Conduit.Broker do
Map.new(subscribe_routes, fn route ->
{route.name, route.opts}
end)

topology =
Enum.map(topology, fn
%Conduit.Topology.Exchange{} = exchange -> {:exchange, exchange.name, exchange.opts}
Expand Down
3 changes: 2 additions & 1 deletion lib/conduit/publish_route.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Conduit.PublishRoute do
@type pipelines :: [atom]
@type t :: %__MODULE__{
name: atom,
opts: Keyword.t,
opts: Keyword.t(),
pipelines: [atom]
}

Expand All @@ -16,6 +16,7 @@ defmodule Conduit.PublishRoute do
@spec new(name, pipelines, opts) :: t()
def new(name, pipelines \\ [], opts \\ [])
def new(name, pipelines, opts) when is_function(opts), do: new(name, pipelines, opts.())

def new(name, pipelines, opts) when is_atom(name) and is_list(pipelines) and is_list(opts) do
%__MODULE__{
name: name,
Expand Down
3 changes: 3 additions & 0 deletions lib/conduit/subscribe_route.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ defmodule Conduit.SubscribeRoute do
defstruct name: nil, subscriber: nil, opts: [], pipelines: []

@spec new(name, subscriber, pipelines, opts) :: t()
def new(name, subscriber, pipelines \\ [], opts \\ [])

def new(name, subscriber, pipelines, opts) when is_function(opts) do
new(name, subscriber, pipelines, opts.())
end

def new(name, subscriber, pipelines, opts)
when is_atom(name) and is_atom(subscriber) and is_list(pipelines) and is_list(opts) do
%__MODULE__{name: name, subscriber: subscriber, pipelines: pipelines, opts: opts}
Expand Down
7 changes: 4 additions & 3 deletions lib/conduit/topology/exchange.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule Conduit.Topology.Exchange do
@type t :: %__MODULE__{
name: String.t(),
opts: Keyword.t()
}
name: String.t(),
opts: Keyword.t()
}
@type name :: String.t() | (() -> String.t())
@type opts :: Keyword.t() | (() -> Keyword.t())

Expand All @@ -11,6 +11,7 @@ defmodule Conduit.Topology.Exchange do
@spec new(name, opts) :: t()
def new(name, opts) when is_function(name), do: new(name.(), opts)
def new(name, opts) when is_function(opts), do: new(name, opts.())

def new(name, opts) when is_binary(name) and is_list(opts) do
%__MODULE__{name: name, opts: opts}
end
Expand Down
7 changes: 4 additions & 3 deletions lib/conduit/topology/queue.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule Conduit.Topology.Queue do
@type t :: %__MODULE__{
name: String.t(),
opts: Keyword.t()
}
name: String.t(),
opts: Keyword.t()
}
@type name :: String.t() | (() -> String.t())
@type opts :: Keyword.t() | (() -> Keyword.t())

Expand All @@ -11,6 +11,7 @@ defmodule Conduit.Topology.Queue do
@spec new(name, opts) :: t()
def new(name, opts) when is_function(name), do: new(name.(), opts)
def new(name, opts) when is_function(opts), do: new(name, opts.())

def new(name, opts) when is_binary(name) and is_list(opts) do
%__MODULE__{name: name, opts: opts}
end
Expand Down

0 comments on commit 19d9070

Please sign in to comment.