message

package
v0.0.0-...-c4c190d Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMessage

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

FileMessage provides messages from internal storage

func NewFileMessage

func NewFileMessage(path string) (*FileMessage, error)

NewFileMessage creates new message repository access entity

func (*FileMessage) GetCurse

func (m *FileMessage) GetCurse() string

GetCurse returns a farewell message from file

func (*FileMessage) GetGreeting

func (m *FileMessage) GetGreeting() string

GetGreeting returns a greeting message from file

func (*FileMessage) GetRoll

func (m *FileMessage) GetRoll() string

GetRoll returns a topic message from file

type ShuffleStringSlice

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

ShuffleStringSlice is a string slice with counter and shuffle methods

func (*ShuffleStringSlice) GetNext

func (s *ShuffleStringSlice) GetNext() string

GetNext returns a next string from a shuffled slice it will begin from the first element if the counter will reach the end of the slice

func (*ShuffleStringSlice) UnmarshalYAML

func (s *ShuffleStringSlice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML parses string array into a slice and initializes a counter

type StorageModel

type StorageModel struct {
	Greeting ShuffleStringSlice `yaml:"greeting"`
	Curse    ShuffleStringSlice `yaml:"curse"`
	Roll     ShuffleStringSlice `yaml:"roll"`
}

StorageModel format of message file

Jump to

Keyboard shortcuts

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