30 lines
428 B
Go
30 lines
428 B
Go
|
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
|
||
|
}
|