data

package
v0.0.0-...-a51a4c6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoryDatPath = "stories.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLDataProvider

type SQLDataProvider struct {
	// contains filtered or unexported fields
}

func MakeSQLDataProvider

func MakeSQLDataProvider(connectionString string) *SQLDataProvider

func (*SQLDataProvider) AddStory

func (f *SQLDataProvider) AddStory(story, prompt string, storyType jokegen.StoryType) error

func (*SQLDataProvider) Close

func (f *SQLDataProvider) Close() error

func (*SQLDataProvider) GetMostRecentStory

func (f *SQLDataProvider) GetMostRecentStory(storyType jokegen.StoryType) (jokegen.StoryResult, error)

func (*SQLDataProvider) GetRandomString

func (f *SQLDataProvider) GetRandomString(dataType jokegen.StoryDataType, storyType jokegen.StoryType) (string, error)

type StoriesData

type StoriesData struct {
	Stories []*StoryData
}

type StoryData

type StoryData struct {
	Key                string
	Title              string
	StoryType          string
	Story              string
	BackgroundColor    string
	LogoFontLink       template.URL
	LogoFontFamilyName string
	LogoFontStyle      string
	LogoFontWeight     int
	LogoFontSerif      string
}

func FindStoryData

func FindStoryData(dataList []*StoryData, storyType string) (*StoryData, error)

func LoadStoryData

func LoadStoryData() ([]*StoryData, error)

Jump to

Keyboard shortcuts

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