utl

package module
v0.0.0-...-185a4f1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Unlicense Imports: 27 Imported by: 6

README

utl

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(fileName string) bool

EnsureDir checks a file could be written to a path, creates the directories as needed

func FileExists

func FileExists(filePath string) bool

FileExists returns whether a file exists

func GPFiles

func GPFiles(p string) (s []string)

GPFiles reads in the list of template files

func GetIP

func GetIP(s string) (ip, port string)

GetIP reads an IP from a string (this doesn't look to me like it is correctly written)

func GetJSON

func GetJSON(completeURL string) (interface{}, error)

GetJSON reads a JSON file and returns an map containing the parsed data

func MakeSlug

func MakeSlug(text string) string

MakeSlug slugifies a string. The result will only contain lowercase letters, digits and dashes. It will not begin or end with a dash, and it will not contain runs of multiple dashes.

It is NOT forced into being ASCII, but may contain any Unicode characters, with the above restrictions.

Types

type Endpoint

type Endpoint struct {
	User     string
	Password string
	Host     string
	Port     int64
}

Endpoint is the contact details for a JSONRPC endpoint

func NewClient

func NewClient(user string, password string, host string, port int64) *Endpoint

NewClient generates a new jsonRPC client

func (*Endpoint) MakeRequest

func (c *Endpoint) MakeRequest(method string, params interface{}) (interface{}, error)

MakeRequest queries a JSONRPC endpoint and returns a map of the response

type Images

type Images struct {
	Img16  string `json:"img16"`
	Img32  string `json:"img32"`
	Img64  string `json:"img64"`
	Img128 string `json:"img128"`
	Img256 string `json:"img256"`
}

Images is the list of differently scaled logo images for each coin

func GetIMG

func GetIMG(url string) (Images, error)

GetIMG loads a logo from the database and generates the various sized icons from it

Jump to

Keyboard shortcuts

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