convert

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 8 Imported by: ? 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

Overview

Copyright 2017 - 2018 OneLedger

Convert bytes and interfaces into JSON

Convert strings (cli input) into various types.

Index

Constants

View Source
const CURRENCY = 0x123

Variables

View Source
var Domain map[string]string

Functions

func FromJSON

func FromJSON(input []byte, output interface{}) (err error)

Go's version of JSON

func GetInt

func GetInt(value string, defaultValue int) int

func GetString

func GetString(value int) string

func GetString64

func GetString64(value int64) string

func ToJSON

func ToJSON(input interface{}) (msg []byte, err error)

Go's version of JSON

Types

type Convert

type Convert struct {
	Errors map[string]error
	Index  map[string]int
	Next   int
}

Build up a list of error messages

func NewConvert

func NewConvert() *Convert

func (*Convert) AddError

func (convert *Convert) AddError(value string, err error)

func (*Convert) GetAccountKey

func (convert *Convert) GetAccountKey(value string) id.AccountKey

TODO: Should go through a set of different possibilties and settle on the best option

func (*Convert) GetChainFromCurrency added in v0.7.1

func (convert *Convert) GetChainFromCurrency(value string) data.ChainType

func (*Convert) GetCoin

func (convert *Convert) GetCoin(amountStr string, currencyStr string) data.Coin

func (*Convert) GetCurrency

func (convert *Convert) GetCurrency(value string) string

func (*Convert) GetErrors

func (convert *Convert) GetErrors() string

func (*Convert) GetHash

func (convert *Convert) GetHash(value string) []byte

func (*Convert) GetInt

func (convert *Convert) GetInt(value string) int

func (*Convert) GetInt64

func (convert *Convert) GetInt64(value string) int64

func (*Convert) GetPrivateKey

func (convert *Convert) GetPrivateKey(value string) PrivateKey

TODO: Needs to have real values

func (*Convert) GetPublicKey

func (convert *Convert) GetPublicKey(value string) PublicKey

TODO: Needs to have real values

func (*Convert) HasErrors

func (convert *Convert) HasErrors() bool

func (*Convert) HashKey

func (convert *Convert) HashKey(key PublicKey) []byte

TODO: Need to be ripeMd?

type PrivateKey

type PrivateKey = id.PrivateKey

type PublicKey

type PublicKey = id.PublicKey

Jump to

Keyboard shortcuts

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