many improvements with options and noop stuff
* add many options helpers * fix noop client to allow publish messages to topic in broker * fix noop server to allow registering in registry * fix noop server to allow subscribe to topic in broker * fix new service initialization Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -2,24 +2,24 @@ package tracer
|
||||
|
||||
import "context"
|
||||
|
||||
type noop struct{}
|
||||
type NoopTracer struct{}
|
||||
|
||||
func (n *noop) Init(...Option) error {
|
||||
func (n *NoopTracer) Init(...Option) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *noop) Start(ctx context.Context, name string) (context.Context, *Span) {
|
||||
func (n *NoopTracer) Start(ctx context.Context, name string) (context.Context, *Span) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (n *noop) Finish(*Span) error {
|
||||
func (n *NoopTracer) Finish(*Span) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *noop) Read(...ReadOption) ([]*Span, error) {
|
||||
func (n *NoopTracer) Read(...ReadOption) ([]*Span, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func newTracer(opts ...Option) Tracer {
|
||||
return &noop{}
|
||||
func NewTracer(opts ...Option) Tracer {
|
||||
return &NoopTracer{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user