fieldalignment

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-25 12:02:18 +03:00
parent ec5af022b3
commit a215521821
6 changed files with 28 additions and 30 deletions

View File

@ -28,19 +28,19 @@ var (
)
type patHandler struct {
pat rutil.Pattern
mtype *methodType
name string
rcvr reflect.Value
name string
pat rutil.Pattern
}
type httpHandler struct {
name string
opts server.HandlerOptions
sopts server.Options
eps []*register.Endpoint
hd interface{}
handlers map[string][]patHandler
name string
eps []*register.Endpoint
sopts server.Options
sync.RWMutex
}

14
http.go
View File

@ -24,20 +24,18 @@ import (
)
type httpServer struct {
sync.RWMutex
opts server.Options
handlers map[string]server.Handler
hd server.Handler
rsvc *register.Service
handlers map[string]server.Handler
exit chan chan error
subscribers map[*httpSubscriber][]broker.Subscriber
// used for first registration
registered bool
// register service instance
rsvc *register.Service
init bool
errorHandler func(context.Context, server.Handler, http.ResponseWriter, *http.Request, error, int)
pathHandlers map[*regexp.Regexp]http.HandlerFunc
contentTypeHandlers map[string]http.HandlerFunc
opts server.Options
sync.RWMutex
registered bool
init bool
}
func (h *httpServer) newCodec(ct string) (codec.Codec, error) {

View File

@ -6,12 +6,12 @@ import (
)
type httpMessage struct {
topic string
payload interface{}
contentType string
header metadata.Metadata
body []byte
codec codec.Codec
header metadata.Metadata
topic string
contentType string
body []byte
}
func (r *httpMessage) Topic() string {

View File

@ -9,25 +9,25 @@ import (
type rpcRequest struct {
rw io.ReadWriter
service string
method string
endpoint string
target string
contentType string
payload interface{}
codec codec.Codec
header metadata.Metadata
method string
endpoint string
contentType string
service string
target string
body []byte
stream bool
payload interface{}
}
type rpcMessage struct {
payload interface{}
codec codec.Codec
header metadata.Metadata
topic string
contentType string
payload interface{}
header metadata.Metadata
body []byte
codec codec.Codec
}
func (r *rpcRequest) ContentType() string {

View File

@ -11,10 +11,10 @@ import (
)
type methodType struct {
method reflect.Method
ArgType reflect.Type
ReplyType reflect.Type
ContextType reflect.Type
method reflect.Method
stream bool
}

View File

@ -21,9 +21,9 @@ const (
var typeOfError = reflect.TypeOf((*error)(nil)).Elem()
type handler struct {
method reflect.Value
reqType reflect.Type
ctxType reflect.Type
method reflect.Value
}
type httpSubscriber struct {