util

package
v0.0.0-...-901c18c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

The MIT License (MIT) Copyright (c) 2017 Arlex Martinez <@lexmartinez> https://github.com/lexmartinez/go-currency-converter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(f io.Closer) error

Close cloeses a file

func Convert

func Convert(from, to string, amount float64) float64

Convert provides currency conversion

func Copy

func Copy(src, dst string) (int64, error)

Copy copies file in src to dst

func GetPrice

func GetPrice(sym string) float64

GetPrice fetches the price of a currency

func GetPriceV2

func GetPriceV2(name string) float64

GetPriceV2 scrapes coinmarketcap.com to fetch prices

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal converts a byte array to a json to be writtrn

func Open

func Open(f string) (*os.File, error)

Open opens a file

func Read

func Read(f *os.File) ([]byte, error)

Read reads a file to byte and returns it

func Stf

func Stf(s string) float64

Stf converts string to float

func Unmarshal

func Unmarshal(bytes []byte, v interface{}) error

Unmarshal converts a Json file to an array of bytes to be read

func Write

func Write(bytes []byte, fpath string) error

Write writes given bytes to file in fpath

Types

This section is empty.

Jump to

Keyboard shortcuts

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