mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-12 08:42:29 +08:00
doc: update doc styles
This commit is contained in:
@@ -33,7 +33,7 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../api_doc.css">
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -47,7 +47,7 @@ import (
|
||||
type Channel[T any] struct
|
||||
func NewChannel[T any]() *Channel[T]
|
||||
```
|
||||
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
|
||||
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -71,7 +71,7 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T
|
||||
```
|
||||
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</b>
|
||||
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/qmWSy1NVF-Y)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -123,7 +123,7 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T
|
||||
```
|
||||
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/2VYFMexEvTm)</b>
|
||||
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/2VYFMexEvTm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -157,7 +157,7 @@ func main() {
|
||||
|
||||
<p>Create channel, put values into the channel repeatly until cancel the context.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/k5N_ALVmYjE)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/k5N_ALVmYjE)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T
|
||||
@@ -201,7 +201,7 @@ func main() {
|
||||
```go
|
||||
func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T
|
||||
```
|
||||
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
|
||||
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -234,7 +234,7 @@ func main() {
|
||||
|
||||
<p>Create a channel, excutes fn repeatly, and put the result into the channel, until close context.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/4J1zAWttP85)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/4J1zAWttP85)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T
|
||||
@@ -276,7 +276,7 @@ func main() {
|
||||
|
||||
<p>Read one or more channels into one channel, will close when any readin channel is closed.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/Wqz9rwioPww)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/Wqz9rwioPww)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) Or(channels ...<-chan T) <-chan T
|
||||
@@ -319,7 +319,7 @@ func main() {
|
||||
|
||||
<p>Read a channel into another channel, will close until cancel context.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/lm_GoS6aDjo)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/lm_GoS6aDjo)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T
|
||||
@@ -357,7 +357,7 @@ func main() {
|
||||
|
||||
<p>Create a channel whose values are taken from another channel with limit number.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/9Utt-1pDr2J)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/9Utt-1pDr2J)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T
|
||||
@@ -403,7 +403,7 @@ func main() {
|
||||
|
||||
<p>Split one chanel into two channels, until cancel the context.</p>
|
||||
|
||||
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/3TQPKnCirrP)</b>
|
||||
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/3TQPKnCirrP)</span></b>
|
||||
|
||||
```go
|
||||
func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T)
|
||||
|
||||
Reference in New Issue
Block a user