error.go 614 B

123456789101112131415161718192021222324252627282930
  1. package config
  2. import "fmt"
  3. // UnsupportedDirective error.
  4. type UnsupportedDirective struct {
  5. text string
  6. }
  7. // Error implements the error interface for unsupported directives.
  8. func (e UnsupportedDirective) Error() string {
  9. return e.text
  10. }
  11. // Invalid config error.
  12. type Invalid struct {
  13. text string
  14. }
  15. // Error implements the error interface for invalid config error.
  16. func (e Invalid) Error() string {
  17. return e.text
  18. }
  19. // InvalidErrorf creates a new Invalid error.
  20. func InvalidErrorf(format string, a ...interface{}) Invalid {
  21. return Invalid{
  22. text: fmt.Sprintf("invalid krb5 config "+format, a...),
  23. }
  24. }