aqs

package module
v0.0.0-...-76f603f Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: ISC Imports: 5 Imported by: 0

README

aqs

Anime quotes generator, used for test data.

Source: https://github.com/jiashengc/anime-quote-generator-v2/

Usage

package main

import (
	"fmt"

	"github.com/diamondburned/aqs"
	_ "github.com/diamondburned/aqs/data"
)

func main() {
	var character = aqs.RandomCharacter()
	fmt.Printf("%s once said: %q\n", character.Name, character.RandomQuote())
}

Disclaimer

This package contains possibly copyrighted content not owned by me.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Saturation is the default saturation used for name color generation.
	Saturation = 0.70
	// Luminance is the default luminance used for name color generation.
	Luminance = 0.80
)

These variables contain the saturation and luminance used for name color generation. By default, they use pastel-esque numbers.

View Source
var Characters []Character

Characters stores multiple anime characters. This slice is empty by default. To fill them up with default data, add this to the imports:

_ "github.com/diamondburned/aqs/data"

Functions

This section is empty.

Types

type Character

type Character struct {
	Name     string   `json:"name"`
	Anime    string   `json:"anime"`
	ImageURL string   `json:"image"`
	Quotes   []string `json:"quotes"`
}

Character represents a single anime character.

func RandomCharacter

func RandomCharacter() Character

RandomCharacter returns a random character, or a zero-value if there's none.

func SearchCharacter

func SearchCharacter(name string) Character

SearchCharacter searches for a character using exact match. A zero-value is returned if none is found.

func (Character) NameColor

func (c Character) NameColor() colorful.Color

NameColor returns a consistent name color for the character.

func (Character) RandomQuote

func (c Character) RandomQuote() string

RandomQuote returns a random quote from the character.

Directories

Path Synopsis
cmd
Package data contains autogenerated data for aqs, the list of data involving anime characters, quotes, and such.
Package data contains autogenerated data for aqs, the list of data involving anime characters, quotes, and such.
Package incr implements a global random incremental map for characters.
Package incr implements a global random incremental map for characters.

Jump to

Keyboard shortcuts

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