Add utils and config

This commit is contained in:
Miguel de la Cruz 2021-09-12 00:06:03 +02:00
parent 5d82d485c8
commit 96bd6a8602
24 changed files with 10121 additions and 0 deletions

29
server/server.go Normal file
View file

@ -0,0 +1,29 @@
package server
import (
"fmt"
"git.ctrlz.es/mgdelacroix/rmsn/model"
)
type Server struct {
Config *model.Config
}
func NewServer(config *model.Config) (*Server, error) {
if err := config.IsValid(); err != nil {
return nil, fmt.Errorf("config is not valid: %w", err)
}
srv := &Server{Config: config}
return srv, nil
}
func (s *Server) Start() error {
return nil
}
func (s *Server) Close() error {
return nil
}