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.2.26
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.3.0
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 24, 2021

  1. auth: fix Init method

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Mar 24, 2021
    Copy the full SHA
    8742b55 View commit details
  2. server: mask router

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Mar 24, 2021
    Copy the full SHA
    dcdf133 View commit details
Showing with 13 additions and 5 deletions.
  1. +1 −1 auth/auth.go
  2. +2 −1 auth/noop.go
  3. +8 −2 server/options.go
  4. +2 −0 server/server.go
  5. +0 −1 util/reflect/reflect.go
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ var (
// Auth provides authentication and authorization
type Auth interface {
// Init the auth
Init(opts ...Option)
Init(opts ...Option) error
// Options set for auth
Options() Options
// Generate a new account
3 changes: 2 additions & 1 deletion auth/noop.go
Original file line number Diff line number Diff line change
@@ -14,10 +14,11 @@ func (n *noopAuth) String() string {
}

// Init the auth
func (n *noopAuth) Init(opts ...Option) {
func (n *noopAuth) Init(opts ...Option) error {
for _, o := range opts {
o(&n.opts)
}
return nil
}

// Options set for auth
10 changes: 8 additions & 2 deletions server/options.go
Original file line number Diff line number Diff line change
@@ -39,8 +39,12 @@ type Options struct {
Meter meter.Meter
// Transport holds the transport
Transport transport.Transport
// Router for requests
Router Router

/*
// Router for requests
Router Router
*/

// Listener may be passed if already created
Listener net.Listener
// Wait group
@@ -262,12 +266,14 @@ func TLSConfig(t *tls.Config) Option {
}
}

/*
// WithRouter sets the request router
func WithRouter(r Router) Option {
return func(o *Options) {
o.Router = r
}
}
*/

// Wait tells the server to wait for requests to finish before exiting
// If `wg` is nil, server only wait for completion of rpc handler.
2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -65,13 +65,15 @@ type Server interface {
String() string
}

/*
// Router handle serving messages
type Router interface {
// ProcessMessage processes a message
ProcessMessage(ctx context.Context, msg Message) error
// ServeRequest processes a request to completion
ServeRequest(ctx context.Context, req Request, rsp Response) error
}
*/

// Message is an async message interface
type Message interface {
1 change: 0 additions & 1 deletion util/reflect/reflect.go
Original file line number Diff line number Diff line change
@@ -74,7 +74,6 @@ func IsEmpty(v reflect.Value) bool {
}
}
default:
fmt.Printf("%#+v\n", v)
return false
}
return true