helper

package
v0.0.0-...-904e1da Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Response func(d Res) (data []byte) = func(d Res) (data []byte) {
	data, err := json.Marshal(d)
	if err != nil {
		log.Fatalln("Unable to convert to JSON", err)
	}
	return data
}

Response has the data :param: A Res data type. :return: A JSON string for the Res data type.

Functions

func GetKey

func GetKey(l int) (k string)

GetKey function :param: Length of required key. :return: The key of the length passed as (l int).

func LenQuery

func LenQuery(u *url.URL) (l int)

LenQuery returns the query for "len"

Types

type Res

type Res struct {
	Number int    `json:"number"`
	Key    string `json:"key"`
}

Res is a response data type.

Jump to

Keyboard shortcuts

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