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:
5
pkg/utils/constraints/constraints.go
Normal file
5
pkg/utils/constraints/constraints.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package constraints
|
||||
|
||||
type Bytes interface {
|
||||
~string | ~[]byte
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user