~bigbes/core-go

ref: cc7fd1d7d60de614649d14fbf5e3fe04ece8f80b core-go/model/rid.go -rw-r--r-- 1.7 KiB
cc7fd1d7 — Simon Martin 2 months ago
model: support "unset" RID values

This will allow supporting empty RID attributes in GraphQL, for example
to unset a resource identified by its RID, like in [1].

Signed-off-by: Simon Martin <simon@nasilyan.com>

[1] https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/69497#%3CDISLPAS09WFR.1KQUECIN0GPM@ddevault.org%3E
0c56cc14 — Simon Martin 6 months ago
model: support unmarshalling RIDs from string

hub stores list/repo/tracker RIDs as strings in its database, and I want
to return those as GQL IDs, not strings, in the upcoming GQL API. This
is not possible without this patch since those strings are not UUIDs but
marshalled ones.

Signed-off-by: Simon Martin <simon@nasilyan.com>
34c2db68 — Drew DeVault 6 months ago
model: rename ID => RID, implement sql Valuer

As in "Resource" ID. I also changed the base32 alphabet to lowercase,
because I subjectively think it looks nicer.
39c3fd1e — Conrad Hoffmann 9 months ago
Run modernize

See https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

It's mostly interface{} -> any, but also two quite useful applications
of slices.Contains.
e359a4d5 — Drew DeVault 9 months ago
gofmt
565df04e — Drew DeVault 10 months ago
model: introduce ID type

Based on UUIDv7 but represented to users in a more compact base32 form,
though all of that are internal implementation details.