Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnonymousTemplate ¶
type AnonymousTemplate struct{}
AnonymousTemplate represents the templater interface implementation using anonymous functions
func (*AnonymousTemplate) ExecuteAlgorithm ¶
func (a *AnonymousTemplate) ExecuteAlgorithm(f func() string) string
ExecuteAlgorithm accepts MessageRetriever as argument and returns the full algorithm: a single string done by joining the strings returned by the first(), Message() string and third() methods
type MessageRetriever ¶
type MessageRetriever interface {
Message() string
}
MessageRetriever represents a message which will be returned to the user
func MessageRetrieverAdapter ¶
func MessageRetrieverAdapter(f func() string) MessageRetriever
MessageRetrieverAdapter returns a MessageRetriever type
type Template ¶
type Template struct{}
Template represents the templater interface implementation
func (*Template) ExecuteAlgorithm ¶
func (t *Template) ExecuteAlgorithm(m MessageRetriever) string
ExecuteAlgorithm accepts MessageRetriever as argument and returns the full algorithm: a single string done by joining the strings returned by the first(), Message() string and third() methods
type Templater ¶
type Templater interface { ExecuteAlgorithm(MessageRetriever) string // contains filtered or unexported methods }
Templater describes the behavior of algorithm to be executed