tome_matrix/main.go

29 lines
561 B
Go
Raw Normal View History

2021-11-27 17:13:27 -05:00
package main
import (
"log"
"github.com/google/uuid"
"github.com/spf13/viper"
)
func main() {
viper.AddConfigPath(".")
err := viper.ReadInConfig()
if err != nil {
log.Fatalf("Fatal error config file: %v \n", err)
}
viper.SetConfigType("yaml")
homeserver := viper.GetString("homeserver")
viper.SetDefault("domain", homeserver)
username := viper.GetString("username")
password := viper.GetString("password")
dealer := &Dealer{
Matches: make(map[uuid.UUID]string),
Client: nil,
}
dealer.ConnectToMatrix(homeserver, username, password)
}