Packages

t

izumi.distage.config

ConfigModuleDefNoMeta

trait ConfigModuleDefNoMeta extends ConfigModuleDef with DisableConfigMeta

Disable generation of DIConfigMeta's used to generate JSON Schema for config in izumi.distage.roles.bundled.ConfigWriter

Use this if DIConfigMeta generation fails for your types and/or you don't use config JSON Schema / ConfigWriter.

See also

izumi.distage.roles.bundled.JsonSchemaGenerator

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigModuleDefNoMeta
  2. DisableConfigMeta
  3. ConfigModuleDef
  4. ModuleDef
  5. ModuleDefDSL
  6. TagsDSL
  7. IncludesDSL
  8. AbstractBindingDefDSL
  9. AbstractBindingDefDSLMacro
  10. Module
  11. ModuleBase
  12. CachedHashcode
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class MutationContext extends AnyRef

    Use this to create utility functions that add bindings mutably to the current module, as opposed to creating new modules and including them.

    Use this to create utility functions that add bindings mutably to the current module, as opposed to creating new modules and including them.

    Example:

    import distage.{ClassConstructor, Tag, ModuleDef}
    import izumi.distage.model.definition.dsl.ModuleDefDSL
    
    trait RegisteredComponent
    class RegisteredComponentImpl extends RegisteredComponent
    
    def addAndRegister[T <: RegisteredComponent: Tag: ClassConstructor](implicit mutateModule: ModuleDefDSL#MutationContext): Unit = {
      new mutateModule.dsl {
        make[T]
    
        many[RegisteredComponent]
          .weak[T]
      }
    }
    
    new ModuleDef {
      addAndRegister[RegisteredComponentImpl]
    }
    Definition Classes
    AbstractBindingDefDSL

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit final def FromConfig[T](dsl: MakeDSL[T]): FromConfig[T]
    Definition Classes
    ConfigModuleDef
    Annotations
    @inline()
  5. def _initialIncludes: ArrayBuffer[Include]
    Attributes
    protected
    Definition Classes
    IncludesDSL
  6. def _initialState: ArrayBuffer[BindingRef]
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  7. def _initialTags: Set[BindingTag]
    Attributes
    protected
    Definition Classes
    TagsDSL
  8. final def _make[T](provider: Functoid[T])(implicit arg0: Tag[T], pos: CodePositionMaterializer): MakeDSL[T]
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  9. def _registered[T <: BindingRef](bindingRef: T): T
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  10. final def addImplicit[T](implicit arg0: Tag[T], instance: T, pos: CodePositionMaterializer): MakeDSLUnnamedAfterFrom[T]

    Same as make[T].from(implicitly[T]) *

    Same as make[T].from(implicitly[T]) *

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. final def bindings: Set[Binding]
    Definition Classes
    ModuleDefDSL
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. implicit final def disableMeta[T]: DIConfigMeta[T]
    Definition Classes
    DisableConfigMeta
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def equals(obj: Any): Boolean
    Definition Classes
    ModuleBase → AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def hash: Int
    Attributes
    protected
    Definition Classes
    ModuleBaseCachedHashcode
  20. final lazy val hashCode: Int
    Definition Classes
    CachedHashcode → AnyRef → Any
  21. final def include(that: ModuleBase, tagMergeStrategy: TagMergePolicy = TagMergePolicy.MergePreferInner): Unit

    Add all bindings in that module into this module

    Add all bindings in that module into this module

    WILL add outer tags / axis values from TagsDSL#tag to included bindings, unless they're overridden by tags / axis values in the included module.

    Attributes
    protected
    Definition Classes
    IncludesDSL
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def iterator: Iterator[Binding]
    Definition Classes
    ModuleDefDSL
  24. final def keys: Set[DIKey]
    Definition Classes
    ModuleBase
  25. final def keysIterator: Iterator[DIKey]
    Definition Classes
    ModuleDefDSL
  26. final macro def make[T]: MakeDSL[T]
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSLMacro
  27. final def makeConfig[T](path: String)(implicit arg0: Tag[T], arg1: DIConfigReader[T], arg2: DIConfigMeta[T], pos: CodePositionMaterializer): MakeDSLUnnamedAfterFrom[T]
    Definition Classes
    ConfigModuleDef
  28. final def makeConfigNamed[T](path: String)(implicit arg0: Tag[T], arg1: DIConfigReader[T], arg2: DIConfigMeta[T], pos: CodePositionMaterializer): MakeDSLNamedAfterFrom[T]
    Definition Classes
    ConfigModuleDef
  29. final def makeConfigWithDefault[T](path: String)(default: => T)(implicit arg0: Tag[T], arg1: DIConfigReader[T], arg2: DIConfigMeta[T], pos: CodePositionMaterializer): MakeDSLUnnamedAfterFrom[T]
    Definition Classes
    ConfigModuleDef
  30. final def makeFactory[T](implicit arg0: Tag[T], arg1: FactoryConstructor[T]): MakeDSLUnnamedAfterFrom[T]

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
    See also

    Auto-Factories feature

  31. final def makeSubcontext[T](implicit arg0: Tag[T]): SubcontextDSL[T]

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
    See also

    Subcontexts feature

  32. final def makeSubcontext[T](submodule: ModuleBase)(implicit arg0: Tag[T]): SubcontextDSL[T]

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
    See also

    Subcontexts feature

  33. final def makeTrait[T](implicit arg0: Tag[T], arg1: TraitConstructor[T]): MakeDSLUnnamedAfterFrom[T]

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
    See also

    Auto-Traits feature

  34. final def many[T](implicit tag: Tag[Set[T]], pos: CodePositionMaterializer): SetDSL[T]

    Set bindings are useful for implementing event listeners, plugins, hooks, http routes, etc.

    Set bindings are useful for implementing event listeners, plugins, hooks, http routes, etc.

    To define a multibinding use .many and .add methods in ModuleDef DSL:

    import cats.effect._, org.http4s._, org.http4s.dsl.io._, scala.concurrent.ExecutionContext.Implicits.global
    import distage._
    
    object HomeRouteModule extends ModuleDef {
      many[HttpRoutes[IO]].add {
        HttpRoutes.of[IO] { case GET -> Root / "home" => Ok(s"Home page!") }
      }
    }

    Set bindings defined in different modules will be merged together into a single Set. You can summon a created Set by type Set[T]:

    import cats.implicits._, org.http4s.server.blaze._, org.http4s.implicits._
    
    object BlogRouteModule extends ModuleDef {
      many[HttpRoutes[IO]].add {
        HttpRoutes.of[IO] { case GET -> Root / "blog" / post => Ok("Blog post ``$post''!") }
      }
    }
    
    class HttpServer(routes: Set[HttpRoutes[IO]]) {
      val router = routes.foldK
    
      def serve = BlazeBuilder[IO]
        .bindHttp(8080, "localhost")
        .mountService(router, "/")
        .start
    }
    
    val objects = Injector().produce(HomeRouteModule ++ BlogRouteModule)
    val server = objects.get[HttpServer]
    
    val testRouter = server.router.orNotFound
    
    testRouter.run(Request[IO](uri = uri("/home"))).flatMap(_.as[String]).unsafeRunSync
    // Home page!
    
    testRouter.run(Request[IO](uri = uri("/blog/1"))).flatMap(_.as[String]).unsafeRunSync
    // Blog post ``1''!
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
    See also

    Guice wiki on Multibindings: https://github.com/google/guice/wiki/Multibindings

  35. final def modify[T]: ModifyDSL[T, MakeDSL, MakeDSLUnnamedAfterFrom, SetDSL]

    Modify a value bound at T.

    Modify a value bound at T. Modifiers stack and are all applied before T is added to the object graph; only the final instance is observable.

    import distage.{Injector, ModuleDef}
    
    Injector().produceGet[Int](new ModuleDef {
      make[Int].from(1)
      modify[Int](_ + 1)
      modify[Int](_ + 1)
    }).use(i => println(s"Got `Int` $i"))
    // Got `Int` 3

    You can also modify while summoning additional dependencies:

    modify[Int]("named").by(_.flatAp {
      (adder: Adder, multiplier: Multiplier) =>
        int: Int =>
          multiplier.multiply(adder.add(int, 1), 10)
    })
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  36. implicit final lazy val mutationContext: MutationContext
    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  41. final def tag(tags: BindingTag*): Unit

    Add tags to all bindings in this module, except for included bindings

    Add tags to all bindings in this module, except for included bindings

    Attributes
    protected
    Definition Classes
    TagsDSL
  42. final def toString(): String
    Definition Classes
    ModuleBase → AnyRef → Any
  43. final def todo[T](implicit arg0: Tag[T], pos: CodePositionMaterializer): MakeDSLUnnamedAfterFrom[T]

    Create a dummy binding that throws an exception with an error message when it's created.

    Create a dummy binding that throws an exception with an error message when it's created.

    Useful for prototyping.

    Attributes
    protected
    Definition Classes
    AbstractBindingDefDSL
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  47. final def wireConfig[T](path: String)(implicit arg0: Tag[T], arg1: DIConfigReader[T]): Functoid[T]
    Definition Classes
    ConfigModuleDef
    Annotations
    @inline()
  48. final def wireConfigWithDefault[T](path: String)(default: => T)(implicit arg0: Tag[T], arg1: DIConfigReader[T], arg2: DIConfigMeta[T]): Functoid[T]
    Definition Classes
    ConfigModuleDef
    Annotations
    @inline()

Deprecated Value Members

  1. final def includeApplyTags(that: ModuleBase): Unit
    Attributes
    protected
    Definition Classes
    IncludesDSL
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.9) Outer module's tags are now added to included module by default, use regular include

Inherited from DisableConfigMeta

Inherited from ConfigModuleDef

Inherited from ModuleDef

Inherited from ModuleDefDSL

Inherited from TagsDSL

Inherited from IncludesDSL

Inherited from Module

Inherited from ModuleBase

Inherited from CachedHashcode

Inherited from AnyRef

Inherited from Any

Ungrouped