trait Service[Alg[_[_, _, _, _, _]]] extends FunctorK5[Alg] with HasId
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.
- Alphabetic
- By Inheritance
- Service
- HasId
- FunctorK5
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type BiFunctorEndpointCompiler[F[_, _]] = PolyFunction5[Endpoint, [I, E, O, SI, SO](I) => F[E, O]]
A EndpointCompiler specialised for effects of kind
* -> (*, *)
, like Either or bifunctor IO - type BiFunctorInterpreter[F[_, _]] = PolyFunction5[Operation, [I, E, O, SI, SO]F[E, O]]
An interpreter specialised for effects of kind
* -> (*, *)
, like Either or bifunctor IO. - type Endpoint[I, E, O, SI, SO] = smithy4s.Endpoint[Operation, I, E, O, SI, SO]
An endpoint is the set of schemas tied to types associated with an Operation.
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).
- type EndpointCompiler[F[_, _, _, _, _]] = PolyFunction5[Endpoint, [I, E, O, SI, SO](I) => F[I, E, O, SI, SO]]
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.
- type ErrorAware[F[_, _]] = Alg[[I, E, O, SI, SO]F[E, O]]
A short-hand for algebras that are specialised for effects of kind
* -> (*, *)
.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]
- type FunctorEndpointCompiler[F[_]] = PolyFunction5[Endpoint, [I, E, O, SI, SO](I) => F[O]]
A EndpointCompiler specialised for effects of kind
* -> *
, like Try or monofunctor IO - type FunctorInterpreter[F[_]] = PolyFunction5[Operation, [I, E, O, SI, SO]F[O]]
An interpreter specialised for effects of kind
* -> *
, like Try or monofunctor IO. - type Impl[F[_]] = Alg[[I, E, O, SI, SO]F[O]]
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 toWeatherGen
). - type Interpreter[F[_, _, _, _, _]] = PolyFunction5[Operation, F]
This is a polymorphic function that runs an instance of an operation and produces an effect F.
- abstract type Operation[I, E, O, SI, SO]
A datatype (typically a sealed trait) that reifies an operation call within a service.
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".
Abstract Value Members
- abstract def endpoints: IndexedSeq[Endpoint[_, _, _, _, _]]
- abstract def fromPolyFunction[P[_, _, _, _, _]](function: PolyFunction5[Operation, P]): Alg[P]
- abstract def hints: Hints
- abstract def id: ShapeId
- Definition Classes
- HasId
- abstract def input[I, E, O, SI, SO](op: Operation[I, E, O, SI, SO]): I
- abstract def mapK5[F[_, _, _, _, _], G[_, _, _, _, _]](alg: Alg[F], function: PolyFunction5[F, G]): Alg[G]
- Definition Classes
- FunctorK5
- abstract def ordinal[I, E, O, SI, SO](op: Operation[I, E, O, SI, SO]): Int
- abstract def reified: Alg[Operation]
- abstract def toPolyFunction[P[_, _, _, _, _]](algebra: Alg[P]): PolyFunction5[Operation, P]
- abstract def version: String
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def algebra[F[_, _, _, _, _]](compiler: EndpointCompiler[F]): Alg[F]
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.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def bifunctorInterpreter[F[_, _]](compiler: BiFunctorEndpointCompiler[F]): BiFunctorInterpreter[F]
A bifunctor-specialised version of interpreter
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def endpoint[I, E, O, SI, SO](op: Operation[I, E, O, SI, SO]): Endpoint[I, E, O, SI, SO]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def errorAware[F[_, _]](compiler: BiFunctorEndpointCompiler[F]): ErrorAware[F]
A monofunctor-specialised version of algebra
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def functorInterpreter[F[_]](compiler: FunctorEndpointCompiler[F]): FunctorInterpreter[F]
A monofunctor-specialised version of interpreter
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def impl[F[_]](compiler: FunctorEndpointCompiler[F]): Impl[F]
A monofunctor-specialised version of algebra
- final def interpreter[F[_, _, _, _, _]](compiler: EndpointCompiler[F]): Interpreter[F]
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. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final val opToEndpoint: PolyFunction5[Operation, Endpoint]
- val service: Service[Alg]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()