mirror of
https://github.com/postmannen/ctrl.git
synced 2025-01-20 22:52:13 +00:00
added helloRegister and centralAuth to server
This commit is contained in:
parent
13fd48843d
commit
d69634a706
1 changed files with 17 additions and 0 deletions
17
server.go
17
server.go
|
@ -63,6 +63,11 @@ type server struct {
|
||||||
// signatures holds all the signatures,
|
// signatures holds all the signatures,
|
||||||
// and the public keys
|
// and the public keys
|
||||||
signatures *signatures
|
signatures *signatures
|
||||||
|
// helloRegister is a register of all the nodes that have sent hello messages
|
||||||
|
// to the central server
|
||||||
|
helloRegister *helloRegister
|
||||||
|
// holds the logic for the central auth services
|
||||||
|
centralAuth *centralAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
// newServer will prepare and return a server type
|
// newServer will prepare and return a server type
|
||||||
|
@ -157,6 +162,8 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
||||||
tui: tuiClient,
|
tui: tuiClient,
|
||||||
errorKernel: errorKernel,
|
errorKernel: errorKernel,
|
||||||
signatures: signatures,
|
signatures: signatures,
|
||||||
|
helloRegister: newHelloRegister(),
|
||||||
|
centralAuth: newCentralAuth(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the default data folder for where subscribers should
|
// Create the default data folder for where subscribers should
|
||||||
|
@ -178,6 +185,16 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// helloRegister is a register of all the nodes that have sent hello messages.
|
||||||
|
type helloRegister struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func newHelloRegister() *helloRegister {
|
||||||
|
h := helloRegister{}
|
||||||
|
|
||||||
|
return &h
|
||||||
|
}
|
||||||
|
|
||||||
// create socket will create a socket file, and return the net.Listener to
|
// create socket will create a socket file, and return the net.Listener to
|
||||||
// communicate with that socket.
|
// communicate with that socket.
|
||||||
func createSocket(socketFolder string, socketFileName string) (net.Listener, error) {
|
func createSocket(socketFolder string, socketFileName string) (net.Listener, error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue