Documentation ¶
Overview ¶
Package urbandict provides a Go wrapper for the Urban Dictionary REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Definition ¶
type Definition struct { Author string `json:"author"` Current_vote string `json:"current_vote"` Defid int `json:"defid"` Definition string `json:"definition"` Example string `json:"example"` Permalink string `json:"permalink"` Thumbs_down int `json:"thumbs_down"` Thumbs_up int `json:"thumbs_up"` Word string `json:"word"` }
Definition represents a single urban dictionary definition.
func Define ¶
func Define(term string) (*Definition, error)
Define gets the top definition for a search term.
func WordOfTheDay ¶
func WordOfTheDay() (*Definition, error)
WordOfTheDay returns the definition for Urban Dictionary's word of the day.
func (*Definition) String ¶
func (d *Definition) String() string
type DefinitionResponse ¶
type DefinitionResponse struct { List []Definition `json:"list"` Result_type string `json:"result_type"` Sounds []string `json:"sounds"` Tags []string `json:"tags"` }
DefinitionResponse represents the JSON response from urban dictionary.
func DefineRaw ¶
func DefineRaw(term string) (*DefinitionResponse, error)
DefineRaw gets the full response object for a search query.
func RandomRaw ¶
func RandomRaw() (*DefinitionResponse, error)
RandomRaw gets a full response object for a random definition api call.
func (*DefinitionResponse) String ¶
func (d *DefinitionResponse) String() string
Click to show internal directories.
Click to hide internal directories.