mirror of
https://github.com/nil2x/cheburnet.git
synced 2026-08-24 15:55:49 +00:00
22 lines
436 B
Go
22 lines
436 B
Go
package transform
|
|
|
|
import (
|
|
"github.com/nil2x/cheburnet/internal/config"
|
|
)
|
|
|
|
// Init should be called at the program start to complete package initialization.
|
|
//
|
|
// cfg is a parsed config but not yet validated. Init will modify it.
|
|
func Init(cfg *config.Config) error {
|
|
if len(cfg.Session.Secret) > 0 {
|
|
key, err := SecretToKey(cfg.Session.Secret)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
cfg.Session.SecretKey = key
|
|
}
|
|
|
|
return nil
|
|
}
|