model

package
v0.0.0-...-2af310e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJoke

func NewJoke(s JokeSource) *joke

Types

type Joke

type Joke struct {
	Id       string
	Title    string
	Body     string
	Category string
	Source   string
}

func GetAllJokes

func GetAllJokes() []Joke

GetAllJokes return all jokes

func (Joke) GetKey

func (i Joke) GetKey() string

GetKey is used to get jokes uniq key

type JokeSource

type JokeSource struct {
	Source string
	Api    string
}

JokeSource is the source of joke, contains source name and source api The Api response content must be an array, and every object has contains `title` or `body` field eg: [

{
   "title": "joke's title"
   "body": "joke's body"
}

]

Jump to

Keyboard shortcuts

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