feat(client-go): add WriteArrayElements default-fill helper and document semantics
Regenerate Go proto types from mxaccess_gateway.proto so MxSparseArray, MxSparseElement, and MxValue_SparseArrayValue appear in the generated package; add MxSparseArray/MxSparseElement type aliases to types.go; add Session.WriteArrayElements and the unexported buildSparseArrayValue builder; add three unit tests covering the sparse oneof structure, empty-map case, and the round-trip through WriteArrayElements; update README with default-fill reset semantics and auto-normalize note.
This commit is contained in:
@@ -145,6 +145,18 @@ the unchanged elements included. For example, to change 2 elements of a
|
||||
the 2 new ones). Sending only the 2 changed values overwrites the attribute
|
||||
with a 2-element array.
|
||||
|
||||
`Session.WriteArrayElements` offers a default-fill shorthand: pass only the
|
||||
indices you want to set along with a `totalLength`. The gateway expands the
|
||||
sparse representation into a full array before forwarding to MXAccess — every
|
||||
unmentioned index receives the element type's zero value (boolean `false`,
|
||||
integer `0`, float `0.0`, string `""`, time = Unix epoch). This is a **RESET**
|
||||
of unmentioned indices, not a preserve of existing values. Use the full-array
|
||||
form (read-modify-write) when existing element values must be preserved.
|
||||
|
||||
`AddItem` (and `AddItem2`) now auto-normalize a bare attribute name to the `[]`
|
||||
array address form expected by MXAccess, so callers do not need to append `[]`
|
||||
themselves. Both forms are accepted; duplicates are deduplicated by the gateway.
|
||||
|
||||
## Galaxy Repository browse
|
||||
|
||||
The `GalaxyRepository` service (proto package `galaxy_repository.v1`) is a
|
||||
|
||||
Reference in New Issue
Block a user