Stetson
This is the entry point into the Stetson wrapper You'll want to call Stetson.configure and then follow the types..
#configure
configure :: StetsonConfig NoArguments NoArguments
Creates a blank stetson config with default settings and no routes
#cowboyRoutes
cowboyRoutes :: forall t a. List Path -> StetsonConfig t a -> StetsonConfig t a
Introduce a list of native Erlang cowboy handlers to this config
#routes
routes :: forall t' a' t a rep r. Generic a rep => GDispatch rep r => RouteDuplex t a -> Record r -> StetsonConfig t' a' -> StetsonConfig t a
#routes2
routes2 :: forall t a rep r. Generic a rep => GDispatch rep r => RouteDuplex t a -> Record r -> RouteConfig t a
#port
port :: forall t a. Port -> StetsonConfig t a -> StetsonConfig t a
Set the port that this http listener will listen to
#bindTo
bindTo :: forall t a. Ip4Address -> StetsonConfig t a -> StetsonConfig t a
Set the IP that this http listener will bind to (default: 0.0.0.0)
#streamHandlers
streamHandlers :: forall t a. List NativeModuleName -> StetsonConfig t a -> StetsonConfig t a
Supply a list of modules to act as native stream handlers in cowboy
#middlewares
middlewares :: forall t a. List NativeModuleName -> StetsonConfig t a -> StetsonConfig t a
Supply a list of modules to act as native middlewares in cowboy
#tcpOptions
tcpOptions :: forall t a. Record ListenOptions -> StetsonConfig t a -> StetsonConfig t a
Supply tcp transport options for cowboy/ranch
#tlsOptions
tlsOptions :: forall t a. Record ListenOptions -> StetsonConfig t a -> StetsonConfig t a
Supply tls/ssl transport options for cowboy/ranch
#startClear
startClear :: forall t a. String -> StetsonConfig t a -> Effect (Either Foreign Unit)
Start the listener with the specified name
#startTls
Re-exports from Stetson.Types
#WebSocketInitHandler
type WebSocketInitHandler msg state = state -> WebSocketResult msg (WebSocketCallResult state)
Callback used to kick off the WebSocket handler This is a good time to get hold of 'self' and set up subscriptions
#WebSocketInfoHandler
type WebSocketInfoHandler msg state = msg -> state -> WebSocketResult msg (WebSocketCallResult state)
Callback used to handle messages sent from Erlang (hopefully via the router) so they'll be of the right type
#WebSocketHandleHandler
type WebSocketHandleHandler msg state = Frame -> state -> WebSocketResult msg (WebSocketCallResult state)
Callback used to handle messages sent from the client in the form of 'Frames' which will need unpacking/decoding/parsing etc
#WebSocketCallResult
#StetsonHandler
data StetsonHandler msg state
A builder containing the complete set of callbacks for any sort of request
Constructors
StetsonHandler (StetsonHandlerCallbacks msg state)
#StetsonConfig
type StetsonConfig t a = { bindAddress :: Ip4Address, bindPort :: Port, cowboyRoutes :: List Path, middlewares :: Maybe (List NativeModuleName), routes :: RouteConfig t a, streamHandlers :: Maybe (List NativeModuleName), tcpOptions :: Maybe (Record ListenOptions), tlsOptions :: Maybe (Record ListenOptions) }
#StaticAssetLocation
#SimpleStetsonHandler
type SimpleStetsonHandler state = StetsonHandler Unit state
A type alias for StetsonHandler, but with no ability to receive messages
#RouteHandler
#RouteConfig
type RouteConfig t a = { dispatch :: a -> RouteHandler, routing :: RouteDuplex t a }
#RestResult
data RestResult reply state
The return type of most of the callbacks invoked as part of the REST workflow
Constructors
RestOk reply Req state
RestStop Req state
RestSwitch CowboyHandler Req state
#ProvideHandler
type ProvideHandler state = Req -> state -> Effect (RestResult IOData state)
A callback invoked to 'provide' a specific content type
#LoopCallResult
#InitResult
#InitHandler
type InitHandler state = Req -> Effect (InitResult state)
The callback invoked to kick off the REST workflow
#HttpMethod
#HandlerArgs
data HandlerArgs
#CowboyHandler
data CowboyHandler
The different handlers exposed by Cowboy and loosely mapping onto the Rest/Loop/WebSocket namespaces
Constructors
#Authorized
#AcceptHandlerResult
data AcceptHandlerResult
The return result of an AcceptHandler (success/failure/success with url)
#AcceptHandler
type AcceptHandler state = Req -> state -> Effect (RestResult AcceptHandlerResult state)
A callback invoked to 'accept' a specific content type
#runStetsonRoute
runStetsonRoute :: forall z. (forall b c. StetsonHandler b c -> z) -> Exists StetsonRouteInner -> z
#mkStetsonRoute
mkStetsonRoute :: forall a s. StetsonHandler a s -> Exists StetsonRouteInner
#emptyHandler
emptyHandler :: forall msg state. InitHandler state -> StetsonHandler msg state
#acceptSuccessLocation
acceptSuccessLocation :: String -> AcceptHandlerResult
The resource was accepted succesfully And here is the URI of its new location
#acceptSuccess
acceptSuccess :: AcceptHandlerResult
The resource was accepted succesfully
#acceptFailure
acceptFailure :: AcceptHandlerResult
The resource was not accepted
Packages
assert
catenable-lists
const
convertable-options
datetime-parsing
debug
distributive
erl-atom
erl-gun
erl-lager
erl-logger
erl-maps
erl-modules
erl-nativerefs
erl-opentelemetry
- OpenTelemetry.Metrics
- OpenTelemetry.Metrics.Counter
- OpenTelemetry.Metrics.Meter
- OpenTelemetry.Metrics.SumObserver
- OpenTelemetry.Metrics.UpDownCounter
- OpenTelemetry.Metrics.UpDownSumObserver
- OpenTelemetry.Metrics.ValueObserver
- OpenTelemetry.Metrics.ValueRecorder
- OpenTelemetry.Tracing
- OpenTelemetry.Tracing.Baggage
- OpenTelemetry.Tracing.Ctx
- OpenTelemetry.Tracing.Propagator.TextMap
- OpenTelemetry.Tracing.Span
- OpenTelemetry.Tracing.Tracer
- Tracing.Attributes
erl-process
erl-queue
erl-ranch
erl-simplebus
erl-ssl
erl-test-eunit
erl-test-eunit-discovery
erl-tuples
erl-untagged-union
exceptions
exists
expect-inferred
functions
graphs
heterogeneous
identity
integers
invariant
js-uri
lazy
lcg
math
media-types
newtype
nonempty
nullable
ordered-collections
partial
prelude
- Control.Applicative
- Control.Apply
- Control.Bind
- Control.Category
- Control.Monad
- Control.Semigroupoid
- Data.Boolean
- Data.BooleanAlgebra
- Data.Bounded
- Data.Bounded.Generic
- Data.CommutativeRing
- Data.DivisionRing
- Data.Eq
- Data.Eq.Generic
- Data.EuclideanRing
- Data.Field
- Data.Function
- Data.Functor
- Data.Generic.Rep
- Data.HeytingAlgebra
- Data.HeytingAlgebra.Generic
- Data.Monoid
- Data.Monoid.Additive
- Data.Monoid.Conj
- Data.Monoid.Disj
- Data.Monoid.Dual
- Data.Monoid.Endo
- Data.Monoid.Generic
- Data.Monoid.Multiplicative
- Data.NaturalTransformation
- Data.Ord
- Data.Ord.Generic
- Data.Ordering
- Data.Ring
- Data.Ring.Generic
- Data.Semigroup
- Data.Semigroup.First
- Data.Semigroup.Generic
- Data.Semigroup.Last
- Data.Semiring
- Data.Semiring.Generic
- Data.Show
- Data.Show.Generic
- Data.Symbol
- Data.Unit
- Data.Void
- Record.Unsafe
- Type.Data.Row
- Type.Data.RowList
- Type.Proxy
profunctor-lenses
- Data.Lens.AffineTraversal
- Data.Lens.At
- Data.Lens.Common
- Data.Lens.Fold
- Data.Lens.Fold.Partial
- Data.Lens.Getter
- Data.Lens.Grate
- Data.Lens.Index
- Data.Lens.Indexed
- Data.Lens.Internal.Bazaar
- Data.Lens.Internal.Exchange
- Data.Lens.Internal.Focusing
- Data.Lens.Internal.Forget
- Data.Lens.Internal.Grating
- Data.Lens.Internal.Indexed
- Data.Lens.Internal.Market
- Data.Lens.Internal.Re
- Data.Lens.Internal.Shop
- Data.Lens.Internal.Stall
- Data.Lens.Internal.Tagged
- Data.Lens.Internal.Wander
- Data.Lens.Internal.Zipping
- Data.Lens.Iso
- Data.Lens.Iso.Newtype
- Data.Lens.Lens
- Data.Lens.Lens.Product
- Data.Lens.Lens.Tuple
- Data.Lens.Lens.Unit
- Data.Lens.Lens.Void
- Data.Lens.Prism
- Data.Lens.Prism.Coproduct
- Data.Lens.Prism.Either
- Data.Lens.Prism.Maybe
- Data.Lens.Record
- Data.Lens.Setter
- Data.Lens.Traversal
- Data.Lens.Types
- Data.Lens.Zoom
psci-support
quickcheck-laws
- Test.QuickCheck.Laws
- Test.QuickCheck.Laws.Control.Alt
- Test.QuickCheck.Laws.Control.Alternative
- Test.QuickCheck.Laws.Control.Applicative
- Test.QuickCheck.Laws.Control.Apply
- Test.QuickCheck.Laws.Control.Bind
- Test.QuickCheck.Laws.Control.Category
- Test.QuickCheck.Laws.Control.Comonad
- Test.QuickCheck.Laws.Control.Extend
- Test.QuickCheck.Laws.Control.Monad
- Test.QuickCheck.Laws.Control.MonadPlus
- Test.QuickCheck.Laws.Control.MonadZero
- Test.QuickCheck.Laws.Control.Plus
- Test.QuickCheck.Laws.Control.Semigroupoid
- Test.QuickCheck.Laws.Data.BooleanAlgebra
- Test.QuickCheck.Laws.Data.Bounded
- Test.QuickCheck.Laws.Data.BoundedEnum
- Test.QuickCheck.Laws.Data.CommutativeRing
- Test.QuickCheck.Laws.Data.DivisionRing
- Test.QuickCheck.Laws.Data.Eq
- Test.QuickCheck.Laws.Data.EuclideanRing
- Test.QuickCheck.Laws.Data.Field
- Test.QuickCheck.Laws.Data.Foldable
- Test.QuickCheck.Laws.Data.Functor
- Test.QuickCheck.Laws.Data.FunctorWithIndex
- Test.QuickCheck.Laws.Data.HeytingAlgebra
- Test.QuickCheck.Laws.Data.Monoid
- Test.QuickCheck.Laws.Data.Ord
- Test.QuickCheck.Laws.Data.Ring
- Test.QuickCheck.Laws.Data.Semigroup
- Test.QuickCheck.Laws.Data.Semiring
random
rationals
record-prefix
refs
safe-coerce
semirings
simple-json
strings
- Data.Char
- Data.Char.Gen
- Data.String.CaseInsensitive
- Data.String.CodePoints
- Data.String.CodeUnits
- Data.String.Common
- Data.String.Gen
- Data.String.NonEmpty.CaseInsensitive
- Data.String.NonEmpty.CodePoints
- Data.String.NonEmpty.CodeUnits
- Data.String.NonEmpty.Internal
- Data.String.Pattern
- Data.String.Regex
- Data.String.Regex.Flags
- Data.String.Regex.Unsafe
- Data.String.Unsafe
tailrec
transformers
- Control.Comonad.Env
- Control.Comonad.Env.Class
- Control.Comonad.Env.Trans
- Control.Comonad.Store
- Control.Comonad.Store.Class
- Control.Comonad.Store.Trans
- Control.Comonad.Traced
- Control.Comonad.Traced.Class
- Control.Comonad.Traced.Trans
- Control.Comonad.Trans.Class
- Control.Monad.Cont
- Control.Monad.Cont.Class
- Control.Monad.Cont.Trans
- Control.Monad.Error.Class
- Control.Monad.Except
- Control.Monad.Except.Trans
- Control.Monad.Identity.Trans
- Control.Monad.List.Trans
- Control.Monad.Maybe.Trans
- Control.Monad.RWS
- Control.Monad.RWS.Trans
- Control.Monad.Reader
- Control.Monad.Reader.Class
- Control.Monad.Reader.Trans
- Control.Monad.State
- Control.Monad.State.Class
- Control.Monad.State.Trans
- Control.Monad.Trans.Class
- Control.Monad.Writer
- Control.Monad.Writer.Class
- Control.Monad.Writer.Trans
type-equality
undefinable
unfoldable
unsafe-coerce
unsafe-reference
uri
- URI.AbsoluteURI
- URI.Authority
- URI.Common
- URI.Extra.MultiHostPortPair
- URI.Extra.QueryPairs
- URI.Extra.UserPassInfo
- URI.Fragment
- URI.HierarchicalPart
- URI.Host
- URI.Host.Gen
- URI.Host.IPv4Address
- URI.Host.IPv6Address
- URI.Host.RegName
- URI.HostPortPair
- URI.HostPortPair.Gen
- URI.Path
- URI.Path.Absolute
- URI.Path.NoScheme
- URI.Path.Rootless
- URI.Path.Segment
- URI.Port
- URI.Port.Gen
- URI.Query
- URI.RelativePart
- URI.RelativeRef
- URI.Scheme
- URI.Scheme.Common
- URI.URI
- URI.URIRef
- URI.UserInfo