Documentation
¶
Index ¶
- Constants
- func CleanCache(cacheDuration time.Duration)
- func Clear()
- func CreateFile(rootDir string, filename string)
- func GetCacheDir(folderName string) string
- func GetUserInput(message string) int
- func Greeting(userName string)
- func OptionIsValid(anime []entity.Anime, selectedOption int)
- func PlayVideo(videoUrl, nameEpisode string)
- func ReadFile(rootDir string, fileName string)
- type UserConfig
Constants ¶
const MESSAGE = "! Seja bem-vindo de volta ao Gophimation"
Variables ¶
This section is empty.
Functions ¶
func CleanCache ¶
CleanCache clears the cache, expecting a parameter named cacheDuration of type time.Duration that determines the maximum duration a cache file is allowed to exist before being deleted.
func CreateFile ¶
CreateFile prompts the user to enter their name, creates a new file with the specified name, and writes the user's name to the file as JSON data in a UserConfig struct format.
func GetCacheDir ¶
GetCacheDir retrieves the cache directory. It expects a parameter 'folderName' that specifies the desired folder name.
func GetUserInput ¶
GetUserInput retrieves user input by displaying a message in the console.
func Greeting ¶
func Greeting(userName string)
Greeting is a function that takes a user name and outputs a greeting message based on the time of day. It gets the current hour using the time package and uses a switch statement to determine the appropriate message. The function then prints the greeting message to the console.
func OptionIsValid ¶
OptionIsValid checks if the option selected by the user is valid for a given list of anime.
Types ¶
type UserConfig ¶
type UserConfig struct {
Name string `json:"name"`
}
UserConfig stores user configuration information, including their name.