From 452ade16001bd7f5142f92f2a48467033b842cc3 Mon Sep 17 00:00:00 2001 From: miyamo2 Date: Fri, 30 Aug 2024 06:29:45 +0900 Subject: [PATCH] doc(README): few fixed --- README.md | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) 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`