29 lines
561 B
Go
29 lines
561 B
Go
|
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)
|
||
|
|
||
|
}
|