Private
Public Access
1
0
Files
Kordophone/data/generators.go

119 lines
1.7 KiB
Go
Raw Normal View History

package data
import (
"math/rand"
"time"
"code.severnaya.net/kordophone-mock/v2/model"
"github.com/google/uuid"
)
func GenerateRandomName() string {
// Copilot generated these names.
names := []string{
"John",
"Jane",
"Joe",
"Jill",
"Jack",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
}
return names[rand.Intn(len(names))]
}
func GenerateRandomMessage() string {
// Copilot generated these messages.
messages := []string{
"Hello, how are you?",
"I'm doing well, how about you?",
"Good, thanks.",
"Great!",
"Awesome!",
"Wow!",
"Amazing!",
"Fantastic!",
"Stupendous!",
"Outstanding!",
"Unbelievable!",
"Unreal!",
"Whoa!",
"Rad!",
"Excellent!",
"Terrific!",
"Superb!",
"Marvelous!",
"Phenomenal!",
"Mind-blowing!",
"Incredible!",
"Extraordinary!",
}
return messages[rand.Intn(len(messages))]
}
func GenerateRandomConversation() model.Conversation {
conversation := model.Conversation{
Participants: []string{GenerateRandomName()},
UnreadCount: 0,
LastMessagePreview: GenerateRandomMessage(),
Guid: uuid.New().String(),
Date: time.Now().Add(-1 * time.Duration(rand.Intn(1000000)) * time.Second),
}
return conversation
}