Skip to content

Commit

Permalink
doc(README): few fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
miyamo2 committed Aug 29, 2024
1 parent a3b981c commit 452ade1
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,22 @@ for i, v := range FooSlice(s).IntFieldGt(1).StringFieldNe("c") {

For the actual generated code, see the [example](https://github.com/miyamo2/filtgen/tree/main/example).

## Features
## What codes to be generated?

### Types to be generated
### Types

`filtgen` generates the following defined-types.

- `XxxSlice`(`[]T`)

- `XxxMap[K]`(`map[K compareble]T`)

- `XxxSeq[T]`(`iter.Seq[T]`)

- `XxxSeq2[T]`(`iter.Seq2[T, U]`)

Type name is determined by the struct name; e.g. `User` -> `UserSlice`.

To use the generated methods, cast must be performed.
```go
s := []User{
Expand All @@ -118,17 +128,20 @@ for i, v := range UserSlice(s).NameEq("Alice") {
}
```

`XxxSlice`(`[]T`)

`XxxMap[K]`(`map[K compareble]T`)

`XxxSeq[T]`(`iter.Seq[T]`)
### Methods

`XxxSeq2[T]`(`iter.Seq2[T, U]`)
Following methods are generated by `filtgen`.

### Methods to be generated
- [`XxxEq`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxeq)
- [`XxxNe`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxne)
- [`XxxGt`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxgt)
- [`XxxLt`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxlt)
- [`XxxGe`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxge)
- [`XxxLe`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxle)
- [`XxxMatches`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxmatches)
- [`XxxIs`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxis)
- [`XxxIsnt`](https://github.com/miyamo2/filtgen/tree/main/README.md#xxxisnt)

Following methods are generated by `filtgen`.
Method name is determined by the field name; e.g. `Name` -> `NameEq`.

#### `XxxEq`
Expand Down

0 comments on commit 452ade1

Please sign in to comment.