Skip to content

Commit

Permalink
start with ideal function structure
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Nov 2, 2023
1 parent 44b9086 commit d9f2a01
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dev/v1.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
defmodule Inngest.Dev.EventFn2 do
@moduledoc false

use Inngest.V1.Function
alias Inngest.Function.{Opts, Trigger}

@fn_opts %Opts{name: "test func v2"}
@trigger %Trigger{event: "test/hello"}

def run(args) do
{:ok, "Hello world"}
end
end
17 changes: 17 additions & 0 deletions lib/inngest/v1/function.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmodule Inngest.V1.Function do

Check warning on line 1 in lib/inngest/v1/function.ex

View workflow job for this annotation

GitHub Actions / Linter

Modules should have a @moduledoc tag.
alias Inngest.Config

Check warning on line 2 in lib/inngest/v1/function.ex

View workflow job for this annotation

GitHub Actions / Dialyzer

unused alias Config

Check warning on line 2 in lib/inngest/v1/function.ex

View workflow job for this annotation

GitHub Actions / Test

unused alias Config
end

defmodule Inngest.Function.Opts do

Check warning on line 5 in lib/inngest/v1/function.ex

View workflow job for this annotation

GitHub Actions / Linter

Modules should have a @moduledoc tag.
defstruct [
:id,
:name,
:retries
]

@type t() :: %__MODULE__{
id: binary(),
name: binary(),
retries: number()
}
end

0 comments on commit d9f2a01

Please sign in to comment.