convert

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

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) GetChain added in v0.5.0

func (convert *Convert) GetChain(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