Add HandleDelete and GetSerialsFromFilter methods, integrate admin keys handling, and enhance constraints API. Include a new CLI convert tool for key translation.

This commit is contained in:
2025-09-07 13:33:25 +01:00
parent fb8593044d
commit b6ea3d5181
22 changed files with 425 additions and 63 deletions

View File

@@ -0,0 +1,5 @@
package constraints
type Bytes interface {
~string | ~[]byte
}

View File

@@ -1,6 +1,8 @@
package utils
func FastEqual[A string | []byte, B string | []byte](a A, b B) (same bool) {
import "utils.orly/constraints"
func FastEqual[A constraints.Bytes, B constraints.Bytes](a A, b B) (same bool) {
if len(a) != len(b) {
return
}

View File

@@ -11,6 +11,7 @@ import (
"encoders.orly/ints"
"lol.mleku.dev/chk"
"lol.mleku.dev/log"
"utils.orly/constraints"
)
var (
@@ -29,7 +30,7 @@ var (
// - Adds ws:// to addresses with any other port
//
// - Converts http/s to ws/s
func URL[V string | []byte](v V) (b []byte) {
func URL[V constraints.Bytes](v V) (b []byte) {
u := []byte(v)
if len(u) == 0 {
return nil