Steel/steel.go

40 lines
561 B
Go
Raw Normal View History

package main
import (
"cimeyclust.com/steel/pkg/cmd"
"cimeyclust.com/steel/pkg/net"
"context"
"sync"
)
func main() {
// Channel for stopping the program
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
var wg sync.WaitGroup
// Start the console handler
wg.Add(1)
go func() {
defer wg.Done()
defer cancel()
cmd.Run(ctx)
}()
// Start the network server
wg.Add(1)
go func() {
defer wg.Done()
net.Run(ctx, "localhost:8080")
}()
2023-12-16 20:52:05 +01:00
cmd.Logger.Info("Started")
// Wait for all components to finish
wg.Wait()
}