keys

package
v0.19.1-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Index

Constants

View Source
const KeyDBName = "keys"

KeyDBName is the directory under root where we store the keys

Variables

This section is empty.

Functions

func AddNewKeyRequestHandler

func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request)

add new key REST handler

func Commands

func Commands() *cobra.Command

Commands registers a sub-tree of commands to interact with local private key storage.

func DeleteKeyRequestHandler

func DeleteKeyRequestHandler(w http.ResponseWriter, r *http.Request)

delete key REST handler

func GetKeyBase

func GetKeyBase() (keys.Keybase, error)

initialize a keybase based on the configuration

func GetKeyBaseFromDir added in v0.16.0

func GetKeyBaseFromDir(rootDir string) (keys.Keybase, error)

initialize a keybase based on the configuration

func GetKeyRequestHandler

func GetKeyRequestHandler(w http.ResponseWriter, r *http.Request)

get key REST handler

func MarshalJSON

func MarshalJSON(o interface{}) ([]byte, error)

marshal keys

func QueryKeysRequestHandler

func QueryKeysRequestHandler(w http.ResponseWriter, r *http.Request)

query key list REST handler

func RegisterRoutes

func RegisterRoutes(r *mux.Router)

resgister REST routes

func SeedRequestHandler

func SeedRequestHandler(w http.ResponseWriter, r *http.Request)

Seed REST request handler

func SetKeyBase

func SetKeyBase(kb keys.Keybase)

used to set the keybase manually in test

func UnmarshalJSON added in v0.16.0

func UnmarshalJSON(bz []byte, ptr interface{}) error

unmarshal json

func UpdateKeyRequestHandler

func UpdateKeyRequestHandler(w http.ResponseWriter, r *http.Request)

update key REST handler

Types

type DeleteKeyBody

type DeleteKeyBody struct {
	Password string `json:"password"`
}

delete key request REST body

type KeyOutput

type KeyOutput struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	PubKey  string `json:"pub_key"`
	Seed    string `json:"seed,omitempty"`
}

used for outputting keys.Info over REST

func Bech32KeyOutput added in v0.19.0

func Bech32KeyOutput(info keys.Info) (KeyOutput, error)

create a KeyOutput in bech32 format

func Bech32KeysOutput added in v0.19.0

func Bech32KeysOutput(infos []keys.Info) ([]KeyOutput, error)

create a list of KeyOutput in bech32 format

type NewKeyBody

type NewKeyBody struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Seed     string `json:"seed"`
}

new key request REST body

type UpdateKeyBody

type UpdateKeyBody struct {
	NewPassword string `json:"new_password"`
	OldPassword string `json:"old_password"`
}

update key request REST body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL