Add logging config and add some helper functions

This commit is contained in:
Gary Kramlich
2021-11-20 04:58:59 -06:00
parent e27846c25b
commit 8086ad1708
5 changed files with 125 additions and 0 deletions

View File

@@ -31,3 +31,16 @@ func (cfg *Config) CopyToRegistration(registration *as.Registration) error {
return nil
}
func (cfg *Config) getRegistration() (*as.Registration, error) {
registration := as.CreateRegistration()
if err := cfg.CopyToRegistration(registration); err != nil {
return nil, err
}
registration.AppToken = cfg.Appservice.ASToken
registration.ServerToken = cfg.Appservice.HSToken
return registration, nil
}