fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-03-06 19:45:13 +03:00
parent cb70dfa664
commit bbbcb22565
65 changed files with 667 additions and 671 deletions

View File

@@ -32,9 +32,9 @@ func (t *noopTracer) Name() string {
}
type noopSpan struct {
name string
ctx context.Context
tracer Tracer
name string
}
func (s *noopSpan) Finish(opts ...SpanOption) {

View File

@@ -14,10 +14,10 @@ type EventOption func(o *EventOptions)
// Options struct
type Options struct {
// Logger used for logging
Logger logger.Logger
// Name of the tracer
Name string
// Logger is the logger for messages
Logger logger.Logger
}
// Option func

View File

@@ -36,30 +36,30 @@ type Span interface {
}
type Label struct {
key string
val interface{}
key string
}
func Any(k string, v interface{}) Label {
return Label{k, v}
return Label{key: k, val: v}
}
func String(k string, v string) Label {
return Label{k, v}
return Label{key: k, val: v}
}
func Int(k string, v int) Label {
return Label{k, v}
return Label{key: k, val: v}
}
func Int64(k string, v int64) Label {
return Label{k, v}
return Label{key: k, val: v}
}
func Float64(k string, v float64) Label {
return Label{k, v}
return Label{key: k, val: v}
}
func Bool(k string, v bool) Label {
return Label{k, v}
return Label{key: k, val: v}
}

View File

@@ -12,11 +12,11 @@ import (
)
type tWrapper struct {
opts Options
client.Client
serverHandler server.HandlerFunc
serverSubscriber server.SubscriberFunc
clientCallFunc client.CallFunc
client.Client
opts Options
}
type ClientCallObserver func(context.Context, client.Request, interface{}, []client.CallOption, tracer.Span, error)