Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - Icelain/jokeapi: Official golang wrapper for Sv443's jokeapi.

Official golang wrapper for Sv443's jokeapi. Contribute to Icelain/jokeapi development by creating an account on GitHub.

Visit SiteGitHub - Icelain/jokeapi: Official golang wrapper for Sv443's jokeapi.

GitHub - Icelain/jokeapi: Official golang wrapper for Sv443's jokeapi.

Official golang wrapper for Sv443's jokeapi. Contribute to Icelain/jokeapi development by creating an account on GitHub.

Powered by 0x5a.live ๐Ÿ’—

jokeapi-go

GoDoc Go Report Card Test Coverage Mentioned in Awesome Go

Official golang wrapper for Sv443's jokeapi.

Install- Add github.com/icelain/jokeapito your go.mod(recommended) or:

EXPORT GO11MODULE=off
go get -u github.com/icelain/jokeapi

Basic Usage Without Parameters-

import "github.com/icelain/jokeapi"

func main(){
  api := jokeapi.New()
  response, err := api.Fetch()
}

Response Struct-

type JokesResp struct{
	Error bool
	Category string
	JokeType string
	Joke []string
	Flags map[string] bool
	Id float64
	Lang string
}

Usage with all parameters-

import "github.com/icelain/jokeapi"

func main(){
  jt := "single"
  blacklist := []string{"nsfw"}
  ctgs := []string{"Programming","Dark"}
  
  api:= jokeapi.New()
  
  api.Set(jokeapi.Params{Blacklist: blacklist, JokeType: jt, Categories: ctgs})
  response, err := api.Fetch()
}

Config struct-

api.Set(jokeapi.Params{})

Config methods-

api.SetBlacklist(blacklist)
api.SetCategories(ctgs)
api.SetJokeType(joketype)
api.SetLang(language)

GoLang Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.