mongo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJoke

func AddJoke(ctx context.Context, joke JokeDB) (id primitive.ObjectID, err error)

func AddNewJokesFromHumorAPI

func AddNewJokesFromHumorAPI(ctx context.Context)

func CloseDb

func CloseDb()

func GetSingleTypeJoke

func GetSingleTypeJoke(ctx context.Context, category types.JokeCategory) (types.JokeContainer, error)

func GetTwoPartsTypeJoke

func GetTwoPartsTypeJoke(ctx context.Context, category types.JokeCategory) (types.JokeTwoPartsContainer, error)

Types

type HumorAPIJokeDB

type HumorAPIJokeDB struct {
	Category types.JokeCategory
	Joke     joke.HumorAPIRes
}

type JokeDB

type JokeDB struct {
	Question   string             `bson:"question"`
	ContentRes string             `bson:"content"`
	Type       types.JokeType     `bson:"type"`
	Category   types.JokeCategory `bson:"category"`
	GuildID    string             `bson:"guild_id"`
	ExternalID int64              `bson:"externalID"`
	// contains filtered or unexported fields
}

func (JokeDB) Content

func (j JokeDB) Content() string

func (JokeDB) ContentTwoPart

func (j JokeDB) ContentTwoPart() (string, string)

type JokeSearch

type JokeSearch struct {
	Type     types.JokeType
	Category types.JokeCategory
}

Jump to

Keyboard shortcuts

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