49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
// VulcanizeDB
|
|
// Copyright © 2023 Vulcanize
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package nitro
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
// TODO: Implement
|
|
// Struct representing the in-process Nitro node
|
|
type NitroNode struct {
|
|
// Used to signal shutdown of the node
|
|
QuitChan chan bool
|
|
}
|
|
|
|
func NewNitroNode() (NitroNode, error) {
|
|
// TODO: Implement
|
|
return NitroNode{}, nil
|
|
}
|
|
|
|
func (n *NitroNode) Start(wg *sync.WaitGroup) {
|
|
// TODO: Implement
|
|
go func() {
|
|
wg.Add(1)
|
|
defer wg.Done()
|
|
<-n.QuitChan
|
|
}()
|
|
}
|
|
|
|
func (n *NitroNode) Stop() error {
|
|
// TODO: Implement
|
|
close(n.QuitChan)
|
|
return nil
|
|
}
|