micro-logger-service/options.go
Vasiliy Tolstov 5ce0755cae move to micro v4
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-05-07 19:19:01 +03:00

29 lines
599 B
Go

package service
import (
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/logger"
"go.unistack.org/micro/v4/store"
)
type clientKey struct{}
// Client to call logger service
func Client(c client.Client) logger.Option {
return logger.SetOption(clientKey{}, c)
}
type storeKey struct{}
// Store to hold messages while logger service is unavailable
func Store(s store.Store) logger.Option {
return logger.SetOption(storeKey{}, s)
}
type serviceKey struct{}
// Service name to call logger service
func Service(n string) logger.Option {
return logger.SetOption(serviceKey{}, n)
}