mirror of
https://github.com/jeremyd/ergo.git
synced 2026-08-04 13:13:06 -07:00
eb43ff69c4
Rebuilt the nostr registration feature cleanly on top of current ergo mainline (origin/master), dropping the stale ergo reversions that were entangled in the original squashed branch. - New irc/nostr package: NIP-04/NIP-17 DMs, NIP-05 resolution, relay connect/auth, and identifier helpers. - Registration/verification via nostr: parseCallback auto-detects nostr identifiers (NIP-05, npub, hex pubkey) and dispatches a verification DM. - Nostr-based cloaked hostnames for accounts (opt-in via ip-cloaking.nostr-hostnames), applied at the account-cloak sites. - Config: accounts.registration.nostr-verification and the nostr-hostnames cloak option, with matching default.yaml and help text. - Adds github.com/nbd-wtf/go-nostr and vendored dependencies.
33 lines
799 B
Go
33 lines
799 B
Go
package easyjson
|
|
|
|
import (
|
|
jlexer "github.com/mailru/easyjson/jlexer"
|
|
"github.com/mailru/easyjson/jwriter"
|
|
)
|
|
|
|
// UnknownFieldsProxy implemets UnknownsUnmarshaler and UnknownsMarshaler
|
|
// use it as embedded field in your structure to parse and then serialize unknown struct fields
|
|
type UnknownFieldsProxy struct {
|
|
unknownFields map[string][]byte
|
|
}
|
|
|
|
func (s *UnknownFieldsProxy) UnmarshalUnknown(in *jlexer.Lexer, key string) {
|
|
if s.unknownFields == nil {
|
|
s.unknownFields = make(map[string][]byte, 1)
|
|
}
|
|
s.unknownFields[key] = in.Raw()
|
|
}
|
|
|
|
func (s UnknownFieldsProxy) MarshalUnknowns(out *jwriter.Writer, first bool) {
|
|
for key, val := range s.unknownFields {
|
|
if first {
|
|
first = false
|
|
} else {
|
|
out.RawByte(',')
|
|
}
|
|
out.String(string(key))
|
|
out.RawByte(':')
|
|
out.Raw(val, nil)
|
|
}
|
|
}
|