checker.go 436 B

12345678910111213141516171819202122
  1. package security
  2. // Checker represents the security package instance
  3. type Checker struct {
  4. config *Config
  5. }
  6. // New creates a new Security instance
  7. func New(config *Config) (*Checker, error) {
  8. if err := config.Validate(); err != nil {
  9. return nil, err
  10. }
  11. return &Checker{
  12. config: config,
  13. }, nil
  14. }
  15. // NewOptions creates a new security.Options instance
  16. func (s *Checker) NewOptions() Options {
  17. return s.config.DefaultOptions
  18. }