Documentation ¶
Overview ¶
Package cached provides caching layer for domain services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GreetingMaker ¶
type GreetingMaker struct {
// contains filtered or unexported fields
}
GreetingMaker uses cached value if available of fallbacks to upstream.
func NewGreetingMaker ¶
func NewGreetingMaker(upstream greeting.Maker, cache *cache.FailoverOf[string]) *GreetingMaker
NewGreetingMaker creates an instance of cached greeting maker.
func (*GreetingMaker) GreetingMaker ¶
func (g *GreetingMaker) GreetingMaker() greeting.Maker
GreetingMaker is a service provider.
type NaiveGreetingMaker ¶
type NaiveGreetingMaker struct {
// contains filtered or unexported fields
}
NaiveGreetingMaker produces simple greetings.
func NewNaiveGreetingMaker ¶
func NewNaiveGreetingMaker(upstream greeting.Maker, ttl time.Duration, stats stats.Tracker) *NaiveGreetingMaker
NewNaiveGreetingMaker creates naive greeting maker.
func (*NaiveGreetingMaker) GreetingMaker ¶
func (g *NaiveGreetingMaker) GreetingMaker() greeting.Maker
GreetingMaker is a service provider.
Click to show internal directories.
Click to hide internal directories.