Add a LevelDB database

This commit is contained in:
nemunaire 2022-10-05 20:26:37 +02:00
commit 444d064ba9
8 changed files with 136 additions and 75 deletions

View file

@ -11,9 +11,9 @@ func (i *Identifier) ToString() string {
return base64.RawURLEncoding.EncodeToString(*i)
}
func (i *Identifier) MarshalJSON() (dst []byte, err error) {
dst = make([]byte, base64.RawURLEncoding.EncodedLen(len(*i)))
base64.RawURLEncoding.Encode(dst, *i)
func (i Identifier) MarshalJSON() (dst []byte, err error) {
dst = make([]byte, base64.RawURLEncoding.EncodedLen(len(i)))
base64.RawURLEncoding.Encode(dst, i)
dst = append([]byte{'"'}, dst...)
dst = append(dst, '"')
return