Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToPrivateKey(keyBytes []byte) (*ecies.PrivateKey, error)
- func CraftErrorResponse(err error) map[string]interface{}
- func CreateEncClient(hostRPCBindAddr string, addressBytes []byte, privateKeyBytes []byte, ...) (*rpc.EncRPCClient, error)
- func GetUserIDbyte(userID string) ([]byte, error)
- func NewFileLogger() gethlog.Logger
- func PrivateKeyToCompressedPubKey(prvKey *ecies.PrivateKey) []byte
- type AccountDB
- type JSONError
- type JSONRPCMessage
- type RPCRequest
- type UserDB
Constants ¶
View Source
const ( Localhost = "127.0.0.1" JSONKeyAddress = "address" JSONKeyData = "data" JSONKeyErr = "error" JSONKeyFrom = "from" JSONKeyID = "id" JSONKeyMethod = "method" JSONKeyParams = "params" JSONKeyResult = "result" JSONKeyRoot = "root" JSONKeyRPCVersion = "jsonrpc" JSONKeySignature = "signature" JSONKeySubscription = "subscription" JSONKeyCode = "code" JSONKeyMessage = "message" )
View Source
const ( PathRoot = "/" PathReady = "/ready/" PathViewingKeys = "/viewingkeys/" PathGenerateViewingKey = "/generateviewingkey/" PathSubmitViewingKey = "/submitviewingkey/" PathJoin = "/join/" PathAuthenticate = "/authenticate/" PathQuery = "/query/" PathRevoke = "/revoke/" PathObscuroGateway = "/" PathHealth = "/health/" PathNetworkHealth = "/network-health/" WSProtocol = "ws://" HTTPProtocol = "http://" DefaultUser = "defaultUser" UserQueryParameter = "u" EncryptedTokenQueryParameter = "token" AddressQueryParameter = "a" MessageUserIDLen = 40 EthereumAddressLen = 42 GetStorageAtUserIDRequestMethodName = "getUserID" SuccessMsg = "success" APIVersion1 = "/v1" MethodEthSubscription = "eth_subscription" PathVersion = "/version/" DeduplicationBufferSize = 20 )
Variables ¶
View Source
var ReaderHeadTimeout = 10 * time.Second
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(keyBytes []byte) (*ecies.PrivateKey, error)
BytesToPrivateKey converts []bytes to *ecies.PrivateKey
func CraftErrorResponse ¶
func CreateEncClient ¶
func GetUserIDbyte ¶
GetUserIDbyte converts userID from string to correct byte format
func NewFileLogger ¶ added in v0.21.0
NewFileLogger is a logger factory function
func PrivateKeyToCompressedPubKey ¶
func PrivateKeyToCompressedPubKey(prvKey *ecies.PrivateKey) []byte
PrivateKeyToCompressedPubKey converts *ecies.PrivateKey to compressed PubKey ([]byte with length 33)
Types ¶
type JSONRPCMessage ¶
type JSONRPCMessage struct { Version string `json:"jsonrpc,omitempty"` ID json.RawMessage `json:"id,omitempty"` Method string `json:"method,omitempty"` Params json.RawMessage `json:"params,omitempty"` Error *JSONError `json:"error,omitempty"` Result json.RawMessage `json:"result,omitempty"` }
JSONRPCMessage value of this type can a JSON-RPC request, notification, successful response or error response. Which one it is depends on the fields.
type RPCRequest ¶
type RPCRequest struct { ID json.RawMessage Method string Params []interface{} }
func (*RPCRequest) Clone ¶
func (r *RPCRequest) Clone() *RPCRequest
Clone returns a new instance of the *RPCRequest
Click to show internal directories.
Click to hide internal directories.