Skip to content

Commit

Permalink
Fix typespecs
Browse files Browse the repository at this point in the history
  • Loading branch information
szajbus committed May 23, 2024
1 parent efdfe2c commit b842d38
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions lib/etcd_ex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,20 @@ defmodule EtcdEx do
alias EtcdEx.Types

@type start_opt ::
{:options, [option]}
| {:transport, transport}
| {:transport_opts, transport_opts}
{:endpoint, endpoint()}
| {:keep_alive_interval, pos_integer}
| {:keep_alive_timeout, pos_integer}
| GenServer.option()

@type option ::
{:mode, :connect_all | :random}
| {:name, String.t()}
| {:password, String.t()}
| {:retry, non_neg_integer}
| {:retry_timeout, pos_integer}
| {:connect_timeout, timeout}
| {:auto_sync_interval_ms, timeout}
| extended_options

@type transport :: :tcp | :tls | :ssl

@type transport_opts :: [:gen_tcp.connect_option()] | [:ssl.tls_client_option()]

@type extended_options :: {atom, any}
@typedoc """
See `Mint.HTTP.connect/4` for the options available.
"""
@type endpoint :: {
Mint.Types.scheme(),
Mint.Types.address(),
:inet.port_number(),
keyword
}

@type conn :: EtcdEx.Connection.t()

Expand All @@ -66,7 +61,7 @@ defmodule EtcdEx do
Returns a specification to start `EtcdEx` under a supervisor.
"""
@spec child_spec([start_opt]) :: Supervisor.child_spec()
defdelegate child_spec(init_opts), to: EtcdEx.Connection
defdelegate child_spec(start_opts), to: EtcdEx.Connection

@doc """
Starts the `EtcdEx` client as a worker process.
Expand Down

0 comments on commit b842d38

Please sign in to comment.