Generic representation of a service, as a list of "endpoints" (mapping to smithy operations).
This abstraction lets us retrieve all information necessary to the generic implementation of protocols, as well as transform implementations of finally-encoded interfaces into interpreters (polymorphic functions) that operate on initially-encoded GADTs.
Type parameters
- Alg:
-
a finally-encoded interface (commonly called algebra) that works against an abstract "effect" that takes 5 type parameters: Input, Error, Output, StreamedInput, StreamedOutput
- Op:
-
an initially encoded version of the finally-encoded interface. Typically, a GADT that acts as a reification of the operations. Passing the reified versions around makes it drastically easier to implement logic generically, without involving metaprogramming.
Attributes
- Companion
- object
- Graph
-
- Supertypes
- Known subtypes
-
trait Reflective[Op]
Members list
Type members
Types
A EndpointCompiler specialised for effects of kind * -> (*, *)
, like Either or bifunctor IO
A EndpointCompiler specialised for effects of kind * -> (*, *)
, like Either or bifunctor IO
Attributes
An interpreter specialised for effects of kind * -> (*, *)
, like Either or bifunctor IO.
An interpreter specialised for effects of kind * -> (*, *)
, like Either or bifunctor IO.
Attributes
An endpoint is the set of schemas tied to types associated with an Operation. It has a method to wrap the input in an operation instance I => Operation[I, E, O, SI, SO].
An endpoint is the set of schemas tied to types associated with an Operation. It has a method to wrap the input in an operation instance I => Operation[I, E, O, SI, SO].
You can think of the endpoint as a "template for an Operation". It contains everything needed to decode/encode operation calls to/from low-level representations (like http requests).
Attributes
A polymorphic function that can take an Endpoint (associated to this service) and produces an handler for it, namely a function that takes the input type of the operation, and produces an effect.
A polymorphic function that can take an Endpoint (associated to this service) and produces an handler for it, namely a function that takes the input type of the operation, and produces an effect.
Attributes
A short-hand for algebras that are specialised for effects of kind * -> (*, *)
. This is meant to be used in userland, e.g:
A short-hand for algebras that are specialised for effects of kind * -> (*, *)
. This is meant to be used in userland, e.g:
val myService = MyService.ErrorAware[Either]
Attributes
A EndpointCompiler specialised for effects of kind * -> *
, like Try or monofunctor IO
An interpreter specialised for effects of kind * -> *
, like Try or monofunctor IO.
An interpreter specialised for effects of kind * -> *
, like Try or monofunctor IO.
Attributes
A short-hand for algebras that are specialised for effects of kind * -> *
.
A short-hand for algebras that are specialised for effects of kind * -> *
.
NB: this alias should be used in polymorphic implementations. When using the Smithy4s code generator, equivalent aliases that are named after the service are generated (e.g. Weather
corresponding to WeatherGen
).
Attributes
This is a polymorphic function that runs an instance of an operation and produces an effect F.
This is a polymorphic function that runs an instance of an operation and produces an effect F.
Attributes
A datatype (typically a sealed trait) that reifies an operation call within a service. It essentially captures the input and type indexes that the operation deals with. It also typically captures an input value.
A datatype (typically a sealed trait) that reifies an operation call within a service. It essentially captures the input and type indexes that the operation deals with. It also typically captures an input value.
It is possible to think of Operation as an "applied Endpoint", or a "call to an Endpoint".
Type parameters
- E:
-
the error type associated to the operation (typically represented as a sealed-trait)
- I:
-
the input of the operation
- O:
-
the output of the operation
- SI:
-
the streamed input of an operation. Operations can have unary components and streamed components. For instance, an http call can send headers (unary
I
) and a stream of bytes (streamedSI
) to the server. - SO:
-
the streamed output of the operation.
Attributes
Value members
Abstract methods
Concrete methods
A function that takes an endpoint compiler and produces an Algebra (typically an instance of the generated interfaces), backed by an interpreter.
A function that takes an endpoint compiler and produces an Algebra (typically an instance of the generated interfaces), backed by an interpreter.
This is useful for writing generic functions that result in the instantiation of a client instance that abides by the service interface.
Attributes
A bifunctor-specialised version of interpreter
A monofunctor-specialised version of interpreter
Given a generic way to turn an endpoint into some handling function (like I => F[I, E, O, SI, SO]
), this method takes care of the logic necessary to produce an interpreter that takes an Operation associated to the service and routes it to the correct function, returning the result.
Given a generic way to turn an endpoint into some handling function (like I => F[I, E, O, SI, SO]
), this method takes care of the logic necessary to produce an interpreter that takes an Operation associated to the service and routes it to the correct function, returning the result.