From edf1c538005542fad781a1036cdf2e987ff26476 Mon Sep 17 00:00:00 2001 From: brent saner Date: Tue, 30 Sep 2025 15:49:54 -0400 Subject: [PATCH] add to todo --- README.adoc | 14 +++++++++++-- README.html | 58 +++++++++++++++++++++++++++++++++++++++++++++++------ README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 114 insertions(+), 15 deletions(-) diff --git a/README.adoc b/README.adoc index 033c74f..ce5a40c 100644 --- a/README.adoc +++ b/README.adoc @@ -57,6 +57,16 @@ The following are a wishlist or things planned that may come in later versions. ** This of course won't work for serializing and keeping *order* of children (e.g. RG => Record); that'd still need to be ordered, but it will allow for parallel parsing *of* those children. Should benchmark, though; it may not be worth it. * `context.Context` support for `Read*` and `Write*` funcs ** This is a relatively low priority as the passed `net.Conn` will likely return an error if its own context is canceled. This can be handled in the caller downstream. -* `.Append*()` methods to append any type to any parent type. e.g. `.AppendFVP()` would append an FVP to the most recent ResponseRecord to the most recent ResponseRecordGroup (or create if they don't exist), `.AppendRecord(...)` for appending a record to most recent record group etc. * Better/more strict interfaces -* Maps should be `any`, not `interface{}` values +* Maps for generic should have `any`, not `interface{}` values +* FVP should have its own method to a map[string][]byte return value +* "Getters and Setters" (ew, I know, but compromises are made with flexibility) +** `.Append*()` methods to append any type to any parent type. e.g. `.AppendFVP()` would append an FVP to the most recent ResponseRecord to the most recent ResponseRecordGroup (or create if they don't exist), `.AppendRecord(...)` for appending a record to most recent record group etc. +** `.Get()`/`.Set()` on a Response/Request to get/set a slice of values (``) from filter criteria as struct (e.g. field name, how many, first X, last X, etc.) +** `.GetPath*()` and `.SetPath*()` to use *[`RG_N`[`R_N`[`FVP_N`]]]* indexing (e.g. `0, 0, 0` for RecordGroup 0/Record 0/FVP 0, `1, 3, 5` for RecordGroup 1/Record 3/FVP 5, etc.) multidimentional indexing +*** Allow specific lookups/sets by multidimentional array index to return FVP (`.GetIndex(idx)` where `idx` is a fixed-size array of dimensions for object's children paths); e.g. `.GetIndex(idx)`, `idx` is `[3]int` and returns FVP) +*** Allow lookups/sets by variable length index (`.GetIndexDynamic(idx)`, where `idx` is a `1` to `n`-size slice of dimensions for object's children paths (e.g. `.GetIndexDynamic([]int{0, 0})` returns `any()` but `.GetIndexDynamic([]int{0, 0, 0})` returns `any(FieldValuePair)`) +**** negative value indicates *all* children +*** Lookups/sets at fixed levels (e.g. `.GetRecord(idx)`, `idx` is `[1]int`, but `.GetFVP(idx)`, `idx` is `[2]int`) for type safety +*** All objects have `.ID()` that returns their index/"path"/"key" from the root, and `.Index()` that returns their index within their immediate parent +**** This obviously requires a `.Resolve()` first diff --git a/README.html b/README.html index d43ea29..7da659a 100644 --- a/README.html +++ b/README.html @@ -559,7 +559,7 @@ pre.rouge .gs {
Brent Saner

-Last rendered 2025-09-30 14:15:01 -0400 +Last rendered 2025-09-30 15:49:54 -0400
Table of Contents
@@ -660,13 +660,59 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  • -

    .Append*() methods to append any type to any parent type. e.g. <Response>.AppendFVP(<FieldValuePair>) would append an FVP to the most recent ResponseRecord to the most recent ResponseRecordGroup (or create if they don’t exist), <Response>.AppendRecord(…​) for appending a record to most recent record group etc.

    -
  • -
  • Better/more strict interfaces

  • -

    Maps should be any, not interface{} values

    +

    Maps for generic should have any, not interface{} values

    +
  • +
  • +

    FVP should have its own method to a map[string][]byte return value

    +
  • +
  • +

    "Getters and Setters" (ew, I know, but compromises are made with flexibility)

    +
    +
      +
    • +

      .Append*() methods to append any type to any parent type. e.g. <Response>.AppendFVP(<FieldValuePair>) would append an FVP to the most recent ResponseRecord to the most recent ResponseRecordGroup (or create if they don’t exist), <Response>.AppendRecord(…​) for appending a record to most recent record group etc.

      +
    • +
    • +

      .Get()/.Set() on a Response/Request to get/set a slice of values (<FieldValue>) from filter criteria as struct (e.g. field name, how many, first X, last X, etc.)

      +
    • +
    • +

      .GetPath*() and .SetPath*() to use [RG_N[R_N[FVP_N]]] indexing (e.g. 0, 0, 0 for RecordGroup 0/Record 0/FVP 0, 1, 3, 5 for RecordGroup 1/Record 3/FVP 5, etc.) multidimentional indexing

      +
      +
        +
      • +

        Allow specific lookups/sets by multidimentional array index to return FVP (.GetIndex(idx) where idx is a fixed-size array of dimensions for object’s children paths); e.g. <Response>.GetIndex(idx), idx is [3]int and returns FVP)

        +
      • +
      • +

        Allow lookups/sets by variable length index (.GetIndexDynamic(idx), where idx is a 1 to n-size slice of dimensions for object’s children paths (e.g. <Response>.GetIndexDynamic([]int{0, 0}) returns any(<Record>) but <Response>.GetIndexDynamic([]int{0, 0, 0}) returns any(FieldValuePair))

        +
        +
          +
        • +

          negative value indicates all children

          +
        • +
        +
        +
      • +
      • +

        Lookups/sets at fixed levels (e.g. <RecordGroup>.GetRecord(idx), idx is [1]int, but <RecordGroup>.GetFVP(idx), idx is [2]int) for type safety

        +
      • +
      • +

        All objects have .ID() that returns their index/"path"/"key" from the root, and .Index() that returns their index within their immediate parent

        +
        +
          +
        • +

          This obviously requires a .Resolve() first

          +
        • +
        +
        +
      • +
      +
      +
    • +
    +
  • @@ -675,7 +721,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND diff --git a/README.md b/README.md index a423b45..57b1707 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,55 @@ versions. likely return an error if its own context is canceled. This can be handled in the caller downstream. -- `.Append*()` methods to append any type to any parent type. e.g. - `.AppendFVP()` would append an FVP to the - most recent ResponseRecord to the most recent ResponseRecordGroup - (or create if they don’t exist), `.AppendRecord(…​)` for - appending a record to most recent record group etc. - - Better/more strict interfaces -- Maps should be `any`, not `interface{}` values +- Maps for generic should have `any`, not `interface{}` values + +- FVP should have its own method to a map\[string\]\[\]byte return + value + +- "Getters and Setters" (ew, I know, but compromises are made with + flexibility) + + - `.Append*()` methods to append any type to any parent type. e.g. + `.AppendFVP()` would append an FVP to + the most recent ResponseRecord to the most recent + ResponseRecordGroup (or create if they don’t exist), + `.AppendRecord(…​)` for appending a record to most + recent record group etc. + + - `.Get()`/`.Set()` on a Response/Request to get/set a slice of + values (``) from filter criteria as struct (e.g. + field name, how many, first X, last X, etc.) + + - `.GetPath*()` and `.SetPath*()` to use + **\[`RG_N`\[`R_N`\[`FVP_N`\]\]\]** indexing (e.g. `0, 0, 0` for + RecordGroup 0/Record 0/FVP 0, `1, 3, 5` for RecordGroup 1/Record + 3/FVP 5, etc.) multidimentional indexing + + - Allow specific lookups/sets by multidimentional array index + to return FVP (`.GetIndex(idx)` where `idx` is a fixed-size + array of dimensions for object’s children paths); e.g. + `.GetIndex(idx)`, `idx` is `[3]int` and returns + FVP) + + - Allow lookups/sets by variable length index + (`.GetIndexDynamic(idx)`, where `idx` is a `1` to `n`-size + slice of dimensions for object’s children paths (e.g. + `.GetIndexDynamic([]int{0, 0})` returns + `any()` but + `.GetIndexDynamic([]int{0, 0, 0})` returns + `any(FieldValuePair)`) + + - negative value indicates **all** children + + - Lookups/sets at fixed levels (e.g. + `.GetRecord(idx)`, `idx` is `[1]int`, but + `.GetFVP(idx)`, `idx` is `[2]int`) for type + safety + + - All objects have `.ID()` that returns their + index/"path"/"key" from the root, and `.Index()` that + returns their index within their immediate parent + + - This obviously requires a `.Resolve()` first