micro-logger-service/options.go
Vasiliy Tolstov 6032dfbadc initial import
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-13 08:11:44 +03:00

22 lines
474 B
Go

package service
import (
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/logger"
"github.com/unistack-org/micro/v3/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)
}