otter-space-sdk/pkg/error/validation.go
SoXX f70879cf8d
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 3m0s
feat(database): validation
- added more validation for IDsi
2024-10-15 12:36:56 +02:00

50 lines
1.6 KiB
Go

package error
import "fmt"
const (
SourceListIsEmpty = "sourceList cannot be empty"
SourceIDIsEmpty = "SourceID cannot be empty"
SourceIDIsWrongLength = "sourceID has the wrong length"
SourceDomainIsEmpty = "source Domain cannot be empty"
UserSourceIDIsEmpty = "userSourceID cannot be empty"
UserSourceIsWrongLength = "userSourceID has the wrong length"
TagNameIsEmpty = "tagName cannot be empty"
TagTypeIsEmpty = "tagType cannot be empty"
TagListIsEmpty = "tagList cannot be empty"
TagAliasNameIsEmpty = "tagAliasName cannot be empty"
TagAliasListIsEmpty = "tagAliasList cannot be empty"
TagGroupListIsEmpty = "tagGroupList cannot be empty"
TagGroupNameIsEmpty = "tagGroupName cannot be empty"
UserFavoriteListIsEmpty = "userFavoriteList cannot be empty"
UserFavoriteIDIsEmpty = "userFavoriteID cannot be empty"
UserFavoriteIsWrongLength = "userFavoriteID has the wrong length"
PostListIsEmpty = "userFavoriteList cannot be empty"
PostIDIsEmpty = "userFavoriteID cannot be empty"
PostIDIsWrongLength = "PostID has the wrong length"
BatchSizeIsEmpty = "batchSize cannot be empty"
PoolIDIsEmpty = "PoolID cannot be empty"
PoolIDIsWrongLength = "PoolID has the wrong length"
PoolURLIsEmpty = "PoolURL cannot be empty"
ScrapeTaskIDIsEmpty = "ScrapeTaskID cannot be empty"
ScrapeTaskIDIsWrongLength = "ScrapeTaskID has the wrong length, needs to be 25 characters long"
)
type EntityValidationFailed struct {
Reason string
}
func (e EntityValidationFailed) Error() string {
return fmt.Sprintf("Entity validation failed: %s", e.Reason)
}