diff --git a/README.md b/README.md index f0b8af3..6ff2065 100644 --- a/README.md +++ b/README.md @@ -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{ @@ -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`