api

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Results []Result `json:"list"`
	Tags    []string `json:"tags"`
	Type    string   `json:"result_type"`
}

Response describes the data structure that comes back from the Urban Dictionary API.

func Define

func Define(word string) (response *Response, err error)

Define returns the definitions from Urban Dictionary for a given word.

type Result

type Result struct {
	ID         int64  `json:"defid"`
	Author     string `json:"author"`
	Definition string `json:"definition"`
	Link       string `json:"permalink"`
	ThumbsDown int64  `json:"thumbs_down"`
	ThumbsUp   int64  `json:"thumbs_up"`
	Word       string `json:"word"`
}

Result holds the information for a given definition.

Jump to

Keyboard shortcuts

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