diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-09-20 11:19:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 11:19:02 +0800 |
commit | 3af91d7cfdb334e602d312743a89e64cd2d369ee (patch) | |
tree | c04a148917cdd9be878ca0e5fbcd552825c18df7 /internal/db/errors/login_source.go | |
parent | b836a56e6e823eecbce2dd99121a340418f1d5b7 (diff) |
auth: decouple types and functions from db (#6320)
Diffstat (limited to 'internal/db/errors/login_source.go')
-rw-r--r-- | internal/db/errors/login_source.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/internal/db/errors/login_source.go b/internal/db/errors/login_source.go deleted file mode 100644 index db0cd1f9..00000000 --- a/internal/db/errors/login_source.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 The Gogs Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package errors - -import "fmt" - -type LoginSourceNotActivated struct { - SourceID int64 -} - -func IsLoginSourceNotActivated(err error) bool { - _, ok := err.(LoginSourceNotActivated) - return ok -} - -func (err LoginSourceNotActivated) Error() string { - return fmt.Sprintf("login source is not activated [source_id: %d]", err.SourceID) -} - -type InvalidLoginSourceType struct { - Type interface{} -} - -func IsInvalidLoginSourceType(err error) bool { - _, ok := err.(InvalidLoginSourceType) - return ok -} - -func (err InvalidLoginSourceType) Error() string { - return fmt.Sprintf("invalid login source type [type: %v]", err.Type) -} |