micro-logger-service/options.go
Vasiliy Tolstov 7314f6829d update micro to v3.1.3
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-19 21:56:26 +03:00

29 lines
623 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)
}
type serviceKey struct{}
// Service name to call logger service
func Service(n string) logger.Option {
return logger.SetOption(serviceKey{}, n)
}