Skip to content

Commit

Permalink
Define a component behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nappex authored Nov 4, 2023
2 parents 4874162 + d2919a9 commit 59a6535
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/onigumo/component.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defmodule Onigumo.Component do
@doc "Runs the component."
@callback main(root_path :: String.t()) :: :ok
end
2 changes: 2 additions & 0 deletions lib/onigumo/downloader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ defmodule Onigumo.Downloader do
@moduledoc """
Web scraper
"""
@behaviour Onigumo.Component

@impl Onigumo.Component
def main(root_path) do
http_client().start()

Expand Down

0 comments on commit 59a6535

Please sign in to comment.