MustLoad binds a filename (fullpath) configuration yaml or json and constructs a new Auth instance. It panics on error.
(filename string)
| 88 | // MustLoad binds a filename (fullpath) configuration yaml or json |
| 89 | // and constructs a new Auth instance. It panics on error. |
| 90 | func MustLoad[T User](filename string) *Auth[T] { |
| 91 | var config Configuration |
| 92 | if err := config.BindFile(filename); err != nil { |
| 93 | panic(err) |
| 94 | } |
| 95 | |
| 96 | return Must(New[T](config)) |
| 97 | } |
| 98 | |
| 99 | // Must is a helper that wraps a call to a function returning (*Auth[T], error) |
| 100 | // and panics if the error is non-nil. It is intended for use in variable |