rest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestCreate added in v0.8.0

type RequestCreate struct {
	Name       string `json:"name,omitempty" validate:"required,min=3,printascii"`
	Passphrase string `json:"password,omitempty" validate:"required,min=10"`

	// Algo is the requested algorithm to create the key
	Algo string `json:"algo,omitempty"`
}

type RequestDelete added in v0.8.0

type RequestDelete struct {
	Name       string `json:"name,omitempty" validate:"required,min=3,printascii"`
	Passphrase string `json:"password,omitempty" validate:"required,min=10"`
}

type RequestRecover added in v0.8.0

type RequestRecover struct {
	Name       string `json:"name,omitempty" validate:"required,min=3,printascii"`
	Passphrase string `json:"password,omitempty" validate:"required,min=10"`
	Seed       string `json:"seed_phrase,omitempty" validate:"required,min=23"`

	// Algo is the requested algorithm to create the key
	Algo string `json:"algo,omitempty"`
}

type RequestSign added in v0.8.0

type RequestSign struct {
	Name     string `json:"name,omitempty" validate:"required,min=3,printascii"`
	Password string `json:"password,omitempty" validate:"required,min=10"`

	Tx sdk.Tx `json:"tx" validate:"required"`
}

type RequestUpdate added in v0.8.0

type RequestUpdate struct {
	Name    string `json:"name,omitempty" validate:"required,min=3,printascii"`
	OldPass string `json:"password,omitempty" validate:"required,min=10"`
	NewPass string `json:"new_passphrase,omitempty" validate:"required,min=10"`
}

type ResponseCreate added in v0.8.0

type ResponseCreate struct {
	Key  keys.Info `json:"key,omitempty"`
	Seed string    `json:"seed_phrase,omitempty"`
}

type ResponseRecover added in v0.8.0

type ResponseRecover struct {
	Key keys.Info `json:"key,omitempty"`
}

type ServiceKeys added in v0.8.0

type ServiceKeys struct {
	// contains filtered or unexported fields
}

ServiceKeys exposes a REST API service for managing keys and signing transactions

func NewServiceKeys added in v0.8.0

func NewServiceKeys(manager keys.Manager) *ServiceKeys

New returns a new instance of the keys service

func (*ServiceKeys) Create added in v0.8.0

func (s *ServiceKeys) Create(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) Delete added in v0.8.0

func (s *ServiceKeys) Delete(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) Get added in v0.8.0

func (s *ServiceKeys) Get(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) List added in v0.8.0

func (s *ServiceKeys) List(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) Recover added in v0.8.0

func (s *ServiceKeys) Recover(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) RegisterCRUD added in v0.8.0

func (s *ServiceKeys) RegisterCRUD(r *mux.Router) error

RegisterCRUD is a convenience method to register all CRUD for keys to allow access by methods and routes: POST: /keys POST: /keys/recover GET: /keys GET: /keys/{name} POST, PUT: /keys/{name} DELETE: /keys/{name}

func (*ServiceKeys) RegisterSignTx added in v0.8.0

func (s *ServiceKeys) RegisterSignTx(r *mux.Router) error

RegisterSignTx is a mux.Router handler that exposes POST method access to sign a transaction.

func (*ServiceKeys) SignTx added in v0.8.0

func (s *ServiceKeys) SignTx(w http.ResponseWriter, r *http.Request)

func (*ServiceKeys) Update added in v0.8.0

func (s *ServiceKeys) Update(w http.ResponseWriter, r *http.Request)

type ServiceTxs added in v0.8.0

type ServiceTxs struct {
	// contains filtered or unexported fields
}

ServiceTxs exposes a REST API service for sendings txs. It wraps a Tendermint RPC client.

func NewServiceTxs added in v0.8.0

func NewServiceTxs(c rpcclient.Client) *ServiceTxs

func (*ServiceTxs) PostTx added in v0.8.0

func (s *ServiceTxs) PostTx(w http.ResponseWriter, r *http.Request)

func (*ServiceTxs) RegisterPostTx added in v0.8.0

func (s *ServiceTxs) RegisterPostTx(r *mux.Router) error

RegisterPostTx is a mux.Router handler that exposes POST method access to post a transaction to the blockchain.

Jump to

Keyboard shortcuts

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