Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/luno/weld

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/luno/weld

  • v0.0.0-20241028145956-bff60a22a788
  • Source
  • Go
  • Socket score

Version published
Created
Source

Quality Gate Status Coverage Bugs Security Rating Vulnerabilities Duplicated Lines (%) Go Report Card GoDoc

Weld

Weld is a golang package that contains directives for "state and backends" dependency injection using compile time code generation.

Weld is heavily based on github.com/google/wire, borrowing its syntax and concepts, but tailoring it for backends-based dependency injection pattern.

Unlike wire, weld:

  • Supports multiple providers for the same type by selecting the first provider found in the set using depth-first search.
  • Supports transitive "backends-type" cyclic dependencies by adding these interfaces to the generated implementation.
  • Is much less dynamic & has fewer features: it takes a provider set as input and a backends as output and generates a Make function that returns an implementation of that backends interface.

For convenience it can also generate an aggregate Backends interface from the union of a slice of backends since golang doesn't support embedding interfaces with the same name or overlapping methods.

Relation to wire syntax:

  • Supported functions and types:
    • wire.Bind
    • wire.Binding
    • wire.NewSet
    • wire.ProviderSet
  • Unsupported functions and types:
    • wire.Build
    • wire.FieldsOf
    • wire.InterfaceValue
    • wire.Struct
    • wire.Value

Example

FAQs

Package last updated on 28 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc