mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
- **docs: remove discord badge from README** - **fix: ensure go version is up-to-date** - **<no value>** - **refactor: update import paths for blocks to components** - **feat: add Hero component template** - **fix: update footer logo to svg** - **feat: add Query/Sign and Query/Verify RPC methods** - **refactor: rename Keyshares to KsVal in did/v1/state.proto**
38 lines
776 B
Go
38 lines
776 B
Go
// Code generated from Pkl module `models`. DO NOT EDIT.
|
|
package keyencoding
|
|
|
|
import (
|
|
"encoding"
|
|
"fmt"
|
|
)
|
|
|
|
type KeyEncoding string
|
|
|
|
const (
|
|
Raw KeyEncoding = "raw"
|
|
Hex KeyEncoding = "hex"
|
|
Multibase KeyEncoding = "multibase"
|
|
)
|
|
|
|
// String returns the string representation of KeyEncoding
|
|
func (rcv KeyEncoding) String() string {
|
|
return string(rcv)
|
|
}
|
|
|
|
var _ encoding.BinaryUnmarshaler = new(KeyEncoding)
|
|
|
|
// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyEncoding.
|
|
func (rcv *KeyEncoding) UnmarshalBinary(data []byte) error {
|
|
switch str := string(data); str {
|
|
case "raw":
|
|
*rcv = Raw
|
|
case "hex":
|
|
*rcv = Hex
|
|
case "multibase":
|
|
*rcv = Multibase
|
|
default:
|
|
return fmt.Errorf(`illegal: "%s" is not a valid KeyEncoding`, str)
|
|
}
|
|
return nil
|
|
}
|