Add utils and config
This commit is contained in:
parent
5d82d485c8
commit
96bd6a8602
24 changed files with 10121 additions and 0 deletions
29
server/server.go
Normal file
29
server/server.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue