Skip to content

Commit

Permalink
more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Dec 4, 2023
1 parent 2d678aa commit 4fce2a2
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@ This library implements the Dependency Injection design pattern. It may replace

**Why this name?**

I love the **short name** for such a utility library. This name is the sum of `DI` and `Go` and no Go package currently uses this name.
I love the **short name** for such a utility library. This name is the sum of `DI` and `Go` and no Go package uses this name.

## 🔥 Migration from v1 to v2

[Documentation here](https://do.samber.dev/docs/upgrading/from-v1-x-to-v2)

## 💡 Features

- Service registration:
- **📒 Service registration**
- By type inference
- By name
- Service invocation
- **🪃 Service invocation**
- Eager loading
- Lazy loading
- Transient loading
- Service aliasing
- **🧙‍♂️ Service aliasing**
- Implicit (provide struct, invoke interface)
- Explicit (provide struct, bind interface, invoke interface)
- Service lifecycle:
- **🔁 Service lifecycle**
- Health check
- Graceful unload (shutdown)
- Lifecycle hooks
- Scope (a.k.a module) tree
- **📦 Scope (a.k.a module) tree**
- Visibility control
- Dependency grouping
- Injector
- **📤 Injector**
- Dependency graph resolution and visualization
- Default injector
- Injector cloning
- Service override
- Lightweight, no dependencies
- No code generation
- Typesafe API
- **🌈 Lightweight, no dependencies**
- **🔅 No code generation**
- **😷 Typesafe API**

## 🚀 Install

Expand Down
50 changes: 50 additions & 0 deletions docs/docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: ✌️ About
description: Discover "do", the dependency injection toolkit for Go
sidebar_position: 0
---

# ✌️ About

**⚙️ A dependency injection toolkit based on Go 1.18+ Generics.**

This library implements the Dependency Injection design pattern. It may replace the `uber/dig` fantastic package. `samber/do` uses Go 1.18+ generics instead of reflection and therefore offers a typesafe API.

**See also:**

- [samber/lo](https://github.com/samber/lo): A Lodash-style Go library based on Go 1.18+ Generics
- [samber/mo](https://github.com/samber/mo): Monads based on Go 1.18+ Generics (Option, Result, Either...)

**Why this name?**

I love the **short name** for such a utility library. This name is the sum of `DI` and `Go` and no Go package uses this name.

## 💡 Features

`samber/do` is built with high attention to the developer and contributor experience.

- **📒 Service registration**
- By type inference
- By name
- **🪃 Service invocation**
- Eager loading
- Lazy loading
- Transient loading
- **🧙‍♂️ Service aliasing**
- Implicit (provide struct, invoke interface)
- Explicit (provide struct, bind interface, invoke interface)
- **🔁 Service lifecycle**
- Health check
- Graceful unload (shutdown)
- Lifecycle hooks
- **📦 Scope (a.k.a module) tree**
- Visibility control
- Dependency grouping
- **📤 Injector**
- Dependency graph resolution and visualization
- Default injector
- Injector cloning
- Service override
- **🌈 Lightweight, no dependencies**
- **🔅 No code generation**
- **😷 Typesafe API**
7 changes: 7 additions & 0 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ function HomepageHeader() {
{siteConfig.title}
</Heading>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons} style={{marginBottom: '10px'}}>
<Link
className="button button--secondary button--lg"
to="/docs/about">
Intro
</Link>
</div>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
Expand Down

0 comments on commit 4fce2a2

Please sign in to comment.