Skip to content

PJSoftware/go-api-chuck

Repository files navigation

go-api-chuck

The Chuck Norris API is a simple web API with several endpoints, which returns Chuck Norris jokes. It has no authentication requirements, and hence is a good starting point for the development of the go-api package.

This go-api-chuck package provides an interface for the Chuck Norris API, using go-api to communicate with the API.

Chuck Norris API

EndPoints

  • /random returns a random joke.
  • /categories returns a list of available categories.
  • /random?category={category} returns a random joke from the named category.
  • /search?query={query} returns a list of jokes matching the query string.

cmd/chuck

The chuck command uses go-api-chuck to query the Chuck Norris API. You can run it with:

go run ./cmd/chuck

Alternatively, if you have task installed, you can use:

task chuck

Command Line Flags

  • bin/chuck.exe returns a random Chuck Norris joke.
  • bin/chuck.exe -list returns a list of available categories.
  • bin/chuck.exe -cat <cat> returns a random joke from the specified category.
  • bin/chuck.exe -find <str> lists all jokes containing the specified string.

About

Interface to chucknorris.io API, developed to test go-api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages