-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/control: Add registration status to node status
This updates the response returned by the `GetStatus` method exposed by the node controller service to include a `Registration` field that contains information about the node's current registration.
- Loading branch information
Showing
8 changed files
with
127 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
go/control: Add registration status to node status | ||
|
||
This updates the response returned by the `GetStatus` method exposed by the | ||
node controller service to include a `Registration` field that contains | ||
information about the node's current registration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package node | ||
|
||
import ( | ||
"context" | ||
|
||
control "github.com/oasisprotocol/oasis-core/go/control/api" | ||
) | ||
|
||
var _ control.ControlledNode = (*Node)(nil) | ||
|
||
// Implements control.ControlledNode. | ||
func (n *Node) RequestShutdown() (<-chan struct{}, error) { | ||
if err := n.RegistrationWorker.RequestDeregistration(); err != nil { | ||
return nil, err | ||
} | ||
// This returns only the registration worker's event channel, | ||
// otherwise the caller (usually the control grpc server) will only | ||
// get notified once everything is already torn down - perhaps | ||
// including the server. | ||
return n.RegistrationWorker.Quit(), nil | ||
} | ||
|
||
// Implements control.ControlledNode. | ||
func (n *Node) Ready() <-chan struct{} { | ||
return n.readyCh | ||
} | ||
|
||
// Implements control.ControlledNode. | ||
func (n *Node) GetRegistrationStatus(ctx context.Context) (*control.RegistrationStatus, error) { | ||
return n.RegistrationWorker.GetRegistrationStatus(ctx) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters