Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unistack-org/micro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.1
Choose a base ref
...
head repository: unistack-org/micro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.0
Choose a head ref

Commits on Nov 14, 2020

  1. metrics: minor changes to interface and set default

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 14, 2020
    Copy the full SHA
    f6c914c View commit details
  2. merics: add Init func to interface

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 14, 2020
    Copy the full SHA
    e0ef8b2 View commit details

Commits on Nov 18, 2020

  1. use metadata.Metadata (#8)

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov authored Nov 18, 2020
    Copy the full SHA
    daffa9e View commit details

Commits on Nov 23, 2020

  1. major codec upgrade

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 23, 2020
    Copy the full SHA
    c9049c3 View commit details

Commits on Nov 24, 2020

  1. add codec NewMessage helper

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 24, 2020
    Copy the full SHA
    71d82e9 View commit details

Commits on Nov 25, 2020

  1. receives only body of the message

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 25, 2020
    Copy the full SHA
    8a50a2d View commit details
  2. add Frame support in noop codec

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 25, 2020
    Copy the full SHA
    2101e99 View commit details
  3. add string support to noop codec

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 25, 2020
    Copy the full SHA
    4583883 View commit details
  4. expose codec options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 25, 2020
    Copy the full SHA
    3f68520 View commit details
  5. add some defaults

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 25, 2020
    Copy the full SHA
    0d93b2c View commit details

Commits on Nov 29, 2020

  1. fix random selector

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 29, 2020
    Copy the full SHA
    8d6eb34 View commit details

Commits on Nov 30, 2020

  1. apply micro commit 2eb19c2e97d9316438bc66cd2cda896e8c99d026

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Nov 30, 2020
    Copy the full SHA
    0ddc8de View commit details

Commits on Dec 3, 2020

  1. config package rework (#9)

    * change config interface
    * reuse codec
    * allow to modify next config based on values in current config via BeforeLoad
    
    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov authored Dec 3, 2020
    Copy the full SHA
    5279c2a View commit details
  2. fixup

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 3, 2020
    Copy the full SHA
    b5d3b69 View commit details

Commits on Dec 7, 2020

  1. add context helpers

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    c6fd9c1 View commit details
  2. default retries is always 0

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    c7ed807 View commit details
  3. config: add logger to options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    8fd745e View commit details
  4. backport micro 820f59869617dee18c9a699c8e01d7a6b080f854

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    f63ff80 View commit details
  5. lint

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    b7b28f6 View commit details
  6. gofmt

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 7, 2020
    Copy the full SHA
    e08276c View commit details

Commits on Dec 9, 2020

  1. more lint fixes

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 9, 2020
    Copy the full SHA
    a754ff7 View commit details

Commits on Dec 10, 2020

  1. store: refactor interface (#11)

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov authored Dec 10, 2020
    Copy the full SHA
    6a7433b View commit details
  2. store: remove unneded options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 10, 2020
    Copy the full SHA
    9fc0b5f View commit details
  3. store: create options helpers

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 10, 2020
    Copy the full SHA
    a13cb01 View commit details
  4. use default codec for store

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 10, 2020
    Copy the full SHA
    0a68a9c View commit details
  5. codec: fix noop codec

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 10, 2020
    Copy the full SHA
    5c6eba2 View commit details

Commits on Dec 13, 2020

  1. config: load defaults

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    a7a3c67 View commit details
  2. add defaut config parser

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    2dcd30b View commit details
  3. config: add missing codec error

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    92aec34 View commit details
  4. registry: adopt micro/micro 69b0ac2e9140fee1cde043f5ecdab438a41898ee

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    762f20d View commit details
  5. load config on service init

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    c6dfc8a View commit details
  6. fix configs options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    9973809 View commit details
  7. config: fix default config loader

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 13, 2020
    Copy the full SHA
    06c3cd6 View commit details

Commits on Dec 15, 2020

  1. server: add MaxConn option

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 15, 2020
    Copy the full SHA
    42f4d26 View commit details
  2. server: add MaxConn and Listener options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 15, 2020
    Copy the full SHA
    f14efa6 View commit details
  3. client: allow to create new client with predefined call options

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 15, 2020
    Copy the full SHA
    70a17dc View commit details

Commits on Dec 17, 2020

  1. fix context usage across codebase

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 17, 2020
    Copy the full SHA
    f6c0728 View commit details

Commits on Dec 18, 2020

  1. handle before/after inside config implementations

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 18, 2020
    Copy the full SHA
    8c504bd View commit details
  2. before/after config stuff handled by implementations

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 18, 2020
    Copy the full SHA
    565082f View commit details
  3. config: fix tests

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 18, 2020
    Copy the full SHA
    035a84e View commit details

Commits on Dec 19, 2020

  1. config: improve and export helper func

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 19, 2020
    Copy the full SHA
    150e8ad View commit details
  2. config: export method to init new empty struct

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 19, 2020
    Copy the full SHA
    b508558 View commit details
  3. guard agains not fully configured config sources

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 19, 2020
    Copy the full SHA
    6b1ed63 View commit details
  4. config: fix tests

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 19, 2020
    Copy the full SHA
    aa6afdf View commit details

Commits on Dec 20, 2020

  1. config: init before load

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 20, 2020
    Copy the full SHA
    8feab7c View commit details
  2. codec: fix interface

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Dec 20, 2020
    Copy the full SHA
    e6f870b View commit details

Commits on Jan 9, 2021

  1. api/router: extend interface

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Jan 9, 2021
    Copy the full SHA
    8930c3f View commit details

Commits on Jan 10, 2021

  1. server: fix NewHandlerOptions

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Jan 10, 2021
    Copy the full SHA
    bcf7cf1 View commit details
  2. api: fix Decode method

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Jan 10, 2021
    Copy the full SHA
    270ad1b View commit details
  3. logger: update logger interface

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Jan 10, 2021
    Copy the full SHA
    7b3a7a9 View commit details
Showing with 1,704 additions and 2,733 deletions.
  1. +14 −9 api/api.go
  2. +0 −495 api/handler/rpc/rpc.go
  3. +0 −112 api/handler/rpc/rpc_test.go
  4. +0 −263 api/handler/rpc/stream.go
  5. +6 −1 api/resolver/options.go
  6. +1 −1 api/resolver/subdomain/subdomain.go
  7. +4 −0 api/router/router.go
  8. +5 −2 api/server/acme/autocert/autocert.go
  9. +9 −18 api/server/acme/certmagic/storage.go
  10. +2 −2 api/server/http/http.go
  11. +4 −1 api/server/options.go
  12. +10 −2 auth/auth.go
  13. +16 −11 auth/noop.go
  14. +32 −4 auth/options.go
  15. +7 −2 broker/broker.go
  16. +8 −0 broker/context.go
  17. +26 −4 broker/options.go
  18. +6 −5 client/client.go
  19. +23 −0 client/client_call_options.go
  20. +8 −0 client/context.go
  21. +4 −0 client/lookup.go
  22. +36 −19 client/noop.go
  23. +21 −6 client/options.go
  24. +9 −8 client/retry.go
  25. +1 −1 client/test_request.go
  26. +36 −25 codec/codec.go
  27. +127 −0 codec/noop.go
  28. +34 −32 config/config.go
  29. +32 −0 config/context.go
  30. +193 −236 config/default.go
  31. +34 −150 config/default_test.go
  32. +0 −8 config/encoder/encoder.go
  33. +0 −26 config/encoder/hcl/hcl.go
  34. +0 −25 config/encoder/json/json.go
  35. +0 −32 config/encoder/toml/toml.go
  36. +0 −25 config/encoder/xml/xml.go
  37. +0 −24 config/encoder/yaml/yaml.go
  38. +0 −63 config/loader/loader.go
  39. +87 −12 config/options.go
  40. +0 −50 config/reader/options.go
  41. +0 −23 config/reader/preprocessor.go
  42. +0 −73 config/reader/preprocessor_test.go
  43. +0 −38 config/reader/reader.go
  44. +46 −0 config/reflect.go
  45. +26 −0 config/reflect_test.go
  46. +0 −13 config/source/changeset.go
  47. +0 −25 config/source/noop.go
  48. +0 −49 config/source/options.go
  49. +0 −35 config/source/source.go
  50. +0 −49 config/value.go
  51. +2 −1 debug/log/kubernetes/kubernetes.go
  52. +3 −1 debug/log/log.go
  53. +23 −11 errors/errors.go
  54. +3 −1 events/events.go
  55. +8 −4 events/options.go
  56. +6 −13 go.mod
  57. +0 −51 go.sum
  58. +16 −0 logger/context.go
  59. +4 −3 logger/level.go
  60. +57 −36 logger/logger.go
  61. +6 −4 logger/logger_test.go
  62. +32 −29 logger/micro.go
  63. +14 −20 logger/options.go
  64. +1 −0 metadata/metadata.go
  65. +47 −0 metrics/noop.go
  66. +0 −37 metrics/noop/reporter.go
  67. +0 −20 metrics/noop/reporter_test.go
  68. +19 −5 metrics/options.go
  69. +10 −7 metrics/reporter.go
  70. +17 −0 metrics/reporter_test.go
  71. +4 −5 metrics/wrapper/metrics_wrapper.go
  72. +7 −1 micro.go
  73. +1 −1 model/options.go
  74. +34 −0 network/transport/context.go
  75. +1 −0 network/transport/noop.go
  76. +3 −3 network/transport/options.go
  77. +3 −1 network/transport/transport.go
  78. +2 −2 network/tunnel/broker/broker.go
  79. +1 −1 network/tunnel/tunnel.go
  80. +34 −83 options.go
  81. +1 −1 proxy/options.go
  82. +2 −2 proxy/proxy.go
  83. +34 −0 registry/context.go
  84. +18 −3 registry/extractor.go
  85. +17 −17 registry/extractor_test.go
  86. +3 −1 registry/options.go
  87. +7 −5 registry/registry.go
  88. +1 −1 resolver/registry/registry.go
  89. +3 −1 router/route.go
  90. +4 −2 runtime/runtime.go
  91. +1 −1 selector/random/random.go
  92. +3 −1 selector/roundrobin/roundrobin.go
  93. +17 −8 selector/roundrobin/roundrobin_test.go
  94. +7 −1 server/context.go
  95. +30 −39 server/noop.go
  96. +36 −11 server/options.go
  97. +4 −3 server/request.go
  98. +33 −19 server/server.go
  99. +19 −21 server/subscriber.go
  100. +26 −35 service.go
  101. +34 −0 store/context.go
  102. +8 −3 store/noop.go
  103. +60 −47 store/options.go
  104. +15 −15 store/store.go
  105. +11 −5 tracer/context.go
  106. +14 −2 tracer/options.go
  107. +3 −1 tracer/trace.go
  108. +3 −2 util/auth/auth.go
  109. +0 −25 util/client/client.go
  110. +0 −84 util/client/client_test.go
  111. +1 −1 util/kubernetes/api/request.go
  112. +8 −7 util/kubernetes/client/client.go
  113. +1 −1 util/kubernetes/client/util_test.go
  114. +11 −4 util/mdns/server.go
  115. +6 −5 util/router/parse.go
  116. +2 −1 util/router/parse_test.go
  117. +11 −10 util/router/runtime.go
  118. +5 −5 util/scope/scope.go
  119. +3 −3 util/stream/stream.go
  120. +3 −7 util/sync/manager.go
  121. +8 −4 util/sync/sync.go
  122. +4 −9 util/token/basic/basic.go
  123. +2 −1 util/token/jwt/jwt.go
23 changes: 14 additions & 9 deletions api/api.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import (
"regexp"
"strings"

"github.com/unistack-org/micro/v3/metadata"
"github.com/unistack-org/micro/v3/registry"
"github.com/unistack-org/micro/v3/server"
)
@@ -102,19 +103,23 @@ func Encode(e *Endpoint) map[string]string {
}

// Decode decodes endpoint metadata into an endpoint
func Decode(e map[string]string) *Endpoint {
func Decode(e metadata.Metadata) *Endpoint {
if e == nil {
return nil
}

return &Endpoint{
Name: e["endpoint"],
Description: e["description"],
Method: slice(e["method"]),
Path: slice(e["path"]),
Host: slice(e["host"]),
Handler: e["handler"],
}
ep := &Endpoint{}
ep.Name, _ = e.Get("endpoint")
ep.Description, _ = e.Get("description")
epmethod, _ := e.Get("method")
ep.Method = []string{epmethod}
eppath, _ := e.Get("path")
ep.Path = []string{eppath}
ephost, _ := e.Get("host")
ep.Host = []string{ephost}
ep.Handler, _ = e.Get("handler")

return ep
}

// Validate validates an endpoint to guarantee it won't blow up when being served
Loading