Esempio n. 1
0
func main() {
	flag.Parse()

	if len(*password) == 0 {
		log.Fatal("password must not be empty")
	}

	m, err := model.NewModel("localhost", "hackcessangels")
	if err != nil {
		log.Fatal("Unable to create model: ", err)
	}

	user, err := m.GetUserByEmail(*account)
	if err != nil {
		log.Fatal("Unable to get user: "******"Unable to set password: "******"Unable to save modified user: ", err)
	}
}
Esempio n. 2
0
func (s *Server) init() error {
	var err error
	s.model, err = model.NewModel(s.DatabaseServer, s.Database)
	if err != nil {
		return err
	}
	err = s.model.ResetAndLoadStationsFromFile()
	if err != nil {
		return err
	}
	s.service, err = service.NewAgentService(s.model)
	if err != nil {
		return err
	}
	s.model.RegisterHelpRequestObserver(s.service)

	return nil
}