model

package
v0.0.0-...-1814500 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryTypeCodeMax       = 24
	CategoryTypeNameMax       = 24
	CategoryTypeOrderBysMax   = 3
	CategoryTypePaginationDef = 10
	CategoryTypePaginationMax = 50
	DBCategoryType            = donoengine.ID + "." + "category_type"
	DBCategoryTypeCode        = "code"
	DBCategoryTypeName        = "name"
)
View Source
const (
	CategoryCodeMax       = 32
	CategoryNameMax       = 32
	CategoryOrderBysMax   = 3
	CategoryPaginationDef = 10
	CategoryPaginationMax = 50
	DBCategory            = donoengine.ID + "." + "category"
	DBCategoryTypeID      = "type_id"
	DBCategoryCode        = "code"
	DBCategoryName        = "name"
)
View Source
const (
	DBCategoryGenericCategoryID   = "category_id"
	CategoryRelationOrderBysMax   = 3
	CategoryRelationPaginationDef = 10
	CategoryRelationPaginationMax = 50
	DBCategoryRelation            = donoengine.ID + "." + "category_relation"
	DBCategoryRelationParentID    = "parent_id"
	DBCategoryRelationChildID     = "child_id"
)
View Source
const (
	ComicCodeLength      = 8
	ComicOrderBysMax     = 5
	ComicPaginationDef   = 10
	ComicPaginationMax   = 30
	DBComic              = donoengine.ID + "." + "comic"
	DBComicCode          = "code"
	DBComicPublishedFrom = "published_from"
	DBComicPublishedTo   = "published_to"
	DBComicTotalChapter  = "total_chapter"
	DBComicTotalVolume   = "total_volume"
	DBComicNSFW          = "nsfw"
	DBComicNSFL          = "nsfl"
	DBComicAdditionals   = "additionals"
)
View Source
const (
	ComicGenericRIDLength          = 4
	DBComicGenericComicID          = "comic_id"
	DBComicGenericRID              = "rid"
	ComicTitleTitleMax             = 255
	ComicTitleOrderBysMax          = 3
	ComicTitlePaginationDef        = 10
	ComicTitlePaginationMax        = 50
	DBComicTitle                   = donoengine.ID + "." + "comic_title"
	DBComicTitleTitle              = "title"
	DBComicTitleSynonym            = "synonym"
	DBComicTitleRomanized          = "romanized"
	ComicCoverRelativeURLMax       = 128
	ComicCoverOrderBysMax          = 3
	ComicCoverPaginationDef        = 10
	ComicCoverPaginationMax        = 50
	DBComicCover                   = donoengine.ID + "." + "comic_cover"
	DBComicCoverRelativeURL        = "relative_url"
	DBComicCoverPriority           = "priority"
	ComicSynopsisSynopsisMax       = 2048
	ComicSynopsisVersionMax        = 12
	ComicSynopsisOrderBysMax       = 3
	ComicSynopsisPaginationDef     = 10
	ComicSynopsisPaginationMax     = 50
	DBComicSynopsis                = donoengine.ID + "." + "comic_synopsis"
	DBComicSynopsisSynopsis        = "synopsis"
	DBComicSynopsisVersion         = "version"
	DBComicSynopsisRomanized       = "romanized"
	ComicExternalRelativeURLMax    = 128
	ComicExternalOrderBysMax       = 3
	ComicExternalPaginationDef     = 10
	ComicExternalPaginationMax     = 50
	DBComicExternal                = donoengine.ID + "." + "comic_external"
	DBComicExternalRelativeURL     = "relative_url"
	DBComicExternalOfficial        = "official"
	ComicCategoryOrderBysMax       = 3
	ComicCategoryPaginationDef     = 10
	ComicCategoryPaginationMax     = 50
	DBComicCategory                = donoengine.ID + "." + "comic_category"
	ComicTagOrderBysMax            = 3
	ComicTagPaginationDef          = 10
	ComicTagPaginationMax          = 50
	DBComicTag                     = donoengine.ID + "." + "comic_tag"
	ComicRelationTypeCodeMax       = 24
	ComicRelationTypeNameMax       = 24
	ComicRelationTypeOrderBysMax   = 3
	ComicRelationTypePaginationDef = 10
	ComicRelationTypePaginationMax = 50
	DBComicRelationType            = donoengine.ID + "." + "comic_relation_type"
	DBComicRelationTypeCode        = "code"
	DBComicRelationTypeName        = "name"
	ComicRelationOrderBysMax       = 3
	ComicRelationPaginationDef     = 10
	ComicRelationPaginationMax     = 50
	DBComicRelation                = donoengine.ID + "." + "comic_relation"
	DBComicRelationTypeID          = "type_id"
	DBComicRelationParentID        = "parent_id"
	DBComicRelationChildID         = "child_id"
)
View Source
const (
	ComicChapterChapterMax    = 64
	ComicChapterVersionMax    = 32
	ComicChapterVolumeMax     = 24
	ComicChapterOrderBysMax   = 5
	ComicChapterPaginationDef = 10
	ComicChapterPaginationMax = 50
	DBComicChapter            = donoengine.ID + "." + "comic_chapter"
	DBComicChapterChapter     = "chapter"
	DBComicChapterVersion     = "version"
	DBComicChapterVolume      = "volume"
	DBComicChapterReleasedAt  = "released_at"
)
View Source
const (
	LanguageIETFMax       = 12
	LanguageNameMax       = 24
	LanguageOrderBysMax   = 3
	LanguagePaginationDef = 10
	LanguagePaginationMax = 50
	DBLanguage            = donoengine.ID + "." + "language"
	DBLanguageIETF        = "ietf"
	DBLanguageName        = "name"
)
View Source
const (
	SecretString       = "*****"
	DBGenericID        = "id"
	DBGenericCreatedAt = "created_at"
	DBGenericUpdatedAt = "updated_at"
)
View Source
const (
	TagTypeCodeMax       = 24
	TagTypeNameMax       = 24
	TagTypeOrderBysMax   = 3
	TagTypePaginationDef = 10
	TagTypePaginationMax = 50
	DBTagType            = donoengine.ID + "." + "tag_type"
	DBTagTypeCode        = "code"
	DBTagTypeName        = "name"
)
View Source
const (
	TagCodeMax       = 32
	TagNameMax       = 32
	TagOrderBysMax   = 3
	TagPaginationDef = 10
	TagPaginationMax = 50
	DBTag            = donoengine.ID + "." + "tag"
	DBTagTypeID      = "type_id"
	DBTagCode        = "code"
	DBTagName        = "name"
)
View Source
const (
	WebsiteDomainMax     = 32
	WebsiteNameMax       = 48
	WebsiteOrderBysMax   = 3
	WebsitePaginationDef = 10
	WebsitePaginationMax = 50
	DBWebsite            = donoengine.ID + "." + "website"
	DBWebsiteDomain      = "domain"
	DBWebsiteName        = "name"
)
View Source
const (
	DBWebsiteGenericWebsiteID     = "website_id"
	DBWebsiteGenericWebsiteDomain = "website_domain"
)
View Source
const DBLanguageGenericLanguageID = "language_id"
View Source
const DBTagGenericTagID = "tag_id"

Variables

View Source
var (
	ErrGeneric  GenericError
	ErrNotFound notFoundError
	ErrDatabase DatabaseError
	ErrCache    cacheError
)
View Source
var (
	CategoryTypeOrderByAllow = []string{
		DBCategoryTypeCode,
		DBCategoryTypeName,
	}

	DBCategoryTypeCodeToID = func(code string) DBQueryValue {
		return DBQueryValue{
			Table:      DBCategoryType,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: DBConditionalKV{Key: DBCategoryTypeCode, Value: code},
		}
	}
)
View Source
var (
	CategoryOrderByAllow = []string{
		DBCategoryCode,
		DBCategoryName,
	}

	DBCategorySIDToID = func(sid CategorySID) DBQueryValue {
		var typeID any
		switch {
		case sid.TypeID != nil:
			typeID = sid.TypeID
		case sid.TypeCode != nil:
			typeID = DBCategoryTypeCodeToID(*sid.TypeCode)
		}
		return DBQueryValue{
			Table:      DBCategory,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: map[string]any{
				DBCategoryTypeID: typeID,
				DBCategoryCode:   sid.Code,
			},
		}
	}
)
View Source
var (
	ComicTitleOrderByAllow = []string{
		DBComicGenericRID,
		DBLanguageGenericLanguageID,
		DBComicTitleTitle,
		DBComicTitleSynonym,
		DBComicTitleRomanized,
	}
	ComicTitleSetNullAllow = []string{
		DBComicTitleSynonym,
		DBComicTitleRomanized,
	}

	ComicCoverOrderByAllow = []string{
		DBComicGenericRID,
		DBWebsiteGenericWebsiteID,
		DBComicCoverRelativeURL,
		DBComicCoverPriority,
	}
	ComicCoverSetNullAllow = []string{
		DBComicCoverPriority,
	}

	ComicSynopsisOrderByAllow = []string{
		DBComicGenericRID,
		DBLanguageGenericLanguageID,
		DBComicSynopsisSynopsis,
		DBComicSynopsisVersion,
		DBComicSynopsisRomanized,
	}
	ComicSynopsisSetNullAllow = []string{
		DBComicSynopsisVersion,
		DBComicSynopsisRomanized,
	}

	ComicExternalOrderByAllow = []string{
		DBComicGenericRID,
		DBWebsiteGenericWebsiteID,
		DBWebsiteGenericWebsiteDomain,
		DBComicExternalRelativeURL,
		DBComicExternalOfficial,
	}
	ComicExternalSetNullAllow = []string{
		DBComicExternalRelativeURL,
		DBComicExternalOfficial,
	}

	ComicCategoryOrderByAllow = []string{
		DBCategoryGenericCategoryID,
	}

	ComicTagOrderByAllow = []string{
		DBTagGenericTagID,
	}

	ComicRelationTypeOrderByAllow = []string{
		DBComicRelationTypeCode,
		DBComicRelationTypeName,
	}
	DBComicRelationTypeCodeToID = func(code string) DBQueryValue {
		return DBQueryValue{
			Table:      DBComicRelationType,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: DBConditionalKV{Key: DBComicRelationTypeCode, Value: code},
		}
	}

	ComicRelationOrderByAllow = []string{
		DBComicRelationTypeID,
		DBComicRelationChildID,
	}
)
View Source
var (
	ComicChapterOrderByAllow = []string{
		DBComicGenericComicID,
		DBComicChapterChapter,
		DBComicChapterVersion,
		DBComicChapterVolume,
		DBComicChapterReleasedAt,
	}

	ComicChapterSetNullAllow = []string{
		DBComicChapterChapter,
		DBComicChapterVersion,
		DBComicChapterVolume,
	}

	DBComicChapterSIDToID = func(sid ComicChapterSID) DBQueryValue {
		var comicID any
		switch {
		case sid.ComicID != nil:
			comicID = sid.ComicID
		case sid.ComicCode != nil:
			comicID = DBComicCodeToID(*sid.ComicCode)
		}
		var version any
		switch {
		case sid.Version != nil:
			version = sid.Version
		default:
			version = DBIsNull{}
		}
		return DBQueryValue{
			Table:      DBComicChapter,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: map[string]any{
				DBComicGenericComicID: comicID,
				DBComicChapterChapter: sid.Chapter,
				DBComicChapterVersion: version,
			},
		}
	}
)
View Source
var (
	LanguageOrderByAllow = []string{
		DBLanguageIETF,
		DBLanguageName,
	}

	DBLanguageIETFToID = func(ietf string) DBQueryValue {
		return DBQueryValue{
			Table:      DBLanguage,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: DBConditionalKV{Key: DBLanguageIETF, Value: ietf},
		}
	}
)
View Source
var (
	EmptyString         = ""
	GenericOrderByAllow = []string{DBGenericID, DBGenericCreatedAt, DBGenericUpdatedAt}
)
View Source
var (
	TagTypeOrderByAllow = []string{
		DBCategoryTypeCode,
		DBCategoryTypeName,
	}

	DBTagTypeCodeToID = func(code string) DBQueryValue {
		return DBQueryValue{
			Table:      DBTagType,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: DBConditionalKV{Key: DBTagTypeCode, Value: code},
		}
	}
)
View Source
var (
	TagOrderByAllow = []string{
		DBTagCode,
		DBTagName,
	}

	DBTagSIDToID = func(sid TagSID) DBQueryValue {
		var typeID any
		switch {
		case sid.TypeID != nil:
			typeID = sid.TypeID
		case sid.TypeCode != nil:
			typeID = DBTagTypeCodeToID(*sid.TypeCode)
		}
		return DBQueryValue{
			Table:      DBTag,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: map[string]any{
				DBTagTypeID: typeID,
				DBTagCode:   sid.Code,
			},
		}
	}
)
View Source
var (
	WebsiteOrderByAllow = []string{
		DBWebsiteDomain,
		DBWebsiteName,
	}

	DBWebsiteDomainToID = func(domain string) DBQueryValue {
		return DBQueryValue{
			Table:      DBWebsite,
			Expression: DBGenericID,
			ZeroValue:  0,
			Conditions: DBConditionalKV{Key: DBWebsiteDomain, Value: domain},
		}
	}
)
View Source
var CategoryRelationOrderByAllow = []string{
	DBCategoryRelationChildID,
}

Functions

func CacheError

func CacheError(err error) error

func NotFoundError

func NotFoundError(err error) error

func WrappedError

func WrappedError(err error, msg string) error

Types

type AddCategory

type AddCategory struct {
	TypeID   *uint
	TypeCode *string
	Code     string
	Name     string
}

func (AddCategory) Validate

func (m AddCategory) Validate() error

type AddCategoryRelation

type AddCategoryRelation struct {
	TypeID     *uint
	TypeCode   *string
	ParentID   *uint
	ParentCode *string
	ChildID    *uint
	ChildCode  *string
}

func (AddCategoryRelation) Validate

func (m AddCategoryRelation) Validate() error

type AddCategoryType

type AddCategoryType struct {
	Code string
	Name string
}

func (AddCategoryType) Validate

func (m AddCategoryType) Validate() error

type AddComic

type AddComic struct {
	Code          *string
	LanguageID    *uint
	LanguageIETF  *string
	PublishedFrom *time.Time
	PublishedTo   *time.Time
	TotalChapter  *int
	TotalVolume   *int
	NSFW          *int
	NSFL          *int
	Additionals   map[string]any
}

func (AddComic) Validate

func (m AddComic) Validate() error

type AddComicCategory

type AddComicCategory struct {
	ComicID          *uint
	ComicCode        *string
	CategoryID       *uint
	CategoryTypeID   *uint
	CategoryTypeCode *string
	CategoryCode     *string
}

func (AddComicCategory) Validate

func (m AddComicCategory) Validate() error

type AddComicChapter

type AddComicChapter struct {
	ComicID    *uint
	ComicCode  *string
	Chapter    string
	Version    *string
	Volume     *string
	ReleasedAt time.Time
}

func (AddComicChapter) Validate

func (m AddComicChapter) Validate() error

type AddComicCover

type AddComicCover struct {
	ComicID       *uint
	ComicCode     *string
	RID           *string
	WebsiteID     *uint
	WebsiteDomain *string
	RelativeURL   string
	Priority      *int
}

func (AddComicCover) Validate

func (m AddComicCover) Validate() error

type AddComicExternal

type AddComicExternal struct {
	ComicID       *uint
	ComicCode     *string
	RID           *string
	WebsiteID     *uint
	WebsiteDomain *string
	RelativeURL   *string
	Official      *bool
}

func (AddComicExternal) Validate

func (m AddComicExternal) Validate() error

type AddComicRelation

type AddComicRelation struct {
	ParentID   *uint
	ParentCode *string
	TypeID     *uint
	TypeCode   *string
	ChildID    *uint
	ChildCode  *string
}

func (AddComicRelation) Validate

func (m AddComicRelation) Validate() error

type AddComicRelationType

type AddComicRelationType struct {
	Code string
	Name string
}

func (AddComicRelationType) Validate

func (m AddComicRelationType) Validate() error

type AddComicSynopsis

type AddComicSynopsis struct {
	ComicID      *uint
	ComicCode    *string
	RID          *string
	LanguageID   *uint
	LanguageIETF *string
	Synopsis     string
	Version      *string
	Romanized    *bool
}

func (AddComicSynopsis) Validate

func (m AddComicSynopsis) Validate() error

type AddComicTag

type AddComicTag struct {
	ComicID     *uint
	ComicCode   *string
	TagID       *uint
	TagTypeID   *uint
	TagTypeCode *string
	TagCode     *string
}

func (AddComicTag) Validate

func (m AddComicTag) Validate() error

type AddComicTitle

type AddComicTitle struct {
	ComicID      *uint
	ComicCode    *string
	RID          *string
	LanguageID   *uint
	LanguageIETF *string
	Title        string
	Synonym      *bool
	Romanized    *bool
}

func (AddComicTitle) Validate

func (m AddComicTitle) Validate() error

type AddLanguage

type AddLanguage struct {
	IETF string
	Name string
}

func (AddLanguage) Validate

func (m AddLanguage) Validate() error

type AddTag

type AddTag struct {
	TypeID   *uint
	TypeCode *string
	Code     string
	Name     string
}

func (AddTag) Validate

func (m AddTag) Validate() error

type AddTagType

type AddTagType struct {
	Code string
	Name string
}

func (AddTagType) Validate

func (m AddTagType) Validate() error

type AddWebsite

type AddWebsite struct {
	Domain string
	Name   string
}

func (AddWebsite) Validate

func (m AddWebsite) Validate() error

type Category

type Category struct {
	ID        uint                `json:"id"`
	TypeID    uint                `json:"typeID"`
	TypeCode  string              `json:"typeCode"`
	Code      string              `json:"code"`
	Name      string              `json:"name"`
	Relations []*CategoryRelation `db:"-" json:"relations"`
	CreatedAt time.Time           `json:"createdAt"`
	UpdatedAt *time.Time          `json:"updatedAt"`
}

type CategoryRelation

type CategoryRelation struct {
	ParentID  uint       `json:"-"`
	ChildID   uint       `json:"categoryID"`
	ChildCode string     `json:"categoryCode"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type CategoryRelationSID

type CategoryRelationSID struct {
	TypeID     *uint
	TypeCode   *string
	ParentID   *uint
	ParentCode *string
	ChildID    *uint
	ChildCode  *string
}

type CategorySID

type CategorySID struct {
	TypeID   *uint
	TypeCode *string
	Code     string
}

type CategoryType

type CategoryType struct {
	ID        uint       `json:"id"`
	Code      string     `json:"code"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type Comic

type Comic struct {
	ID            uint             `json:"id"`
	Code          string           `json:"code"`
	Titles        []*ComicTitle    `db:"-" json:"titles"`
	Covers        []*ComicCover    `db:"-" json:"covers"`
	Synopses      []*ComicSynopsis `db:"-" json:"synopses"`
	PublishedFrom *time.Time       `json:"publishedFrom"`
	PublishedTo   *time.Time       `json:"publishedTo"`
	TotalChapter  *int             `json:"totalChapter"`
	TotalVolume   *int             `json:"totalVolume"`
	NSFW          *int             `json:"nsfw"`
	NSFL          *int             `json:"nsfl"`
	LanguageID    *uint            `json:"languageID"`
	LanguageIETF  *string          `json:"languageIETF"`
	Chapters      []*ComicChapter  `db:"-" json:"chapters"`
	Externals     []*ComicExternal `db:"-" json:"externals"`
	Categories    []*Category      `db:"-" json:"categories"`
	Tags          []*Tag           `db:"-" json:"tags"`
	Relations     []*ComicRelation `db:"-" json:"relations"`
	Additionals   map[string]any   `json:"additionals"`
	CreatedAt     time.Time        `json:"createdAt"`
	UpdatedAt     *time.Time       `json:"updatedAt"`
}

type ComicCategory

type ComicCategory struct {
	ComicID        uint       `json:"-"`
	CategoryID     uint       `json:"categoryID"`
	CategoryTypeID uint       `json:"categoryTypeID"`
	CategoryCode   string     `json:"categoryCode"`
	CreatedAt      time.Time  `json:"createdAt"`
	UpdatedAt      *time.Time `json:"updatedAt"`
}

type ComicCategorySID

type ComicCategorySID struct {
	ComicID     *uint
	ComicCode   *string
	CategoryID  *uint
	CategorySID *CategorySID
}

type ComicChapter

type ComicChapter struct {
	ID         uint       `json:"id"`
	ComicID    uint       `json:"-"`
	Chapter    string     `json:"chapter"`
	Version    *string    `json:"version"`
	Volume     *string    `json:"volume"`
	ReleasedAt time.Time  `json:"releasedAt"`
	CreatedAt  time.Time  `json:"createdAt"`
	UpdatedAt  *time.Time `json:"updatedAt"`
}

type ComicChapterSID

type ComicChapterSID struct {
	ComicID   *uint
	ComicCode *string
	Chapter   string
	Version   *string
}

type ComicCover

type ComicCover struct {
	ID            uint       `json:"id"`
	ComicID       uint       `json:"-"`
	RID           string     `json:"rid"`
	WebsiteID     uint       `json:"websiteID"`
	WebsiteDomain string     `json:"websiteDomain"`
	RelativeURL   string     `json:"relativeURL"`
	Priority      *int       `json:"priority"`
	CreatedAt     time.Time  `json:"createdAt"`
	UpdatedAt     *time.Time `json:"updatedAt"`
}

type ComicExternal

type ComicExternal struct {
	ID            uint       `json:"id"`
	ComicID       uint       `json:"-"`
	RID           string     `json:"rid"`
	WebsiteID     uint       `json:"websiteID"`
	WebsiteDomain string     `json:"websiteDomain"`
	RelativeURL   *string    `json:"relativeURL"`
	Official      *bool      `json:"official"`
	CreatedAt     time.Time  `json:"createdAt"`
	UpdatedAt     *time.Time `json:"updatedAt"`
}

type ComicGenericSID

type ComicGenericSID struct {
	ComicID   *uint
	ComicCode *string
	RID       string
}

type ComicRelation

type ComicRelation struct {
	ParentID  uint       `json:"-"`
	TypeID    uint       `json:"typeID"`
	ChildID   uint       `json:"comicID"`
	ChildCode string     `json:"comicCode"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type ComicRelationSID

type ComicRelationSID struct {
	ParentID   *uint
	ParentCode *string
	TypeID     *uint
	TypeCode   *string
	ChildID    *uint
	ChildCode  *string
}

type ComicRelationType

type ComicRelationType struct {
	ID        uint       `json:"id"`
	Code      string     `json:"code"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type ComicSynopsis

type ComicSynopsis struct {
	ID           uint       `json:"id"`
	ComicID      uint       `json:"-"`
	RID          string     `json:"rid"`
	LanguageID   uint       `json:"languageID"`
	LanguageIETF string     `json:"languageIETF"`
	Synopsis     string     `json:"synopsis"`
	Version      *string    `json:"version"`
	Romanized    *bool      `json:"romanized"`
	CreatedAt    time.Time  `json:"createdAt"`
	UpdatedAt    *time.Time `json:"updatedAt"`
}

type ComicTag

type ComicTag struct {
	ComicID   uint       `json:"-"`
	TagID     uint       `json:"tagID"`
	TagTypeID uint       `json:"tagTypeID"`
	TagCode   string     `json:"tagCode"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type ComicTagSID

type ComicTagSID struct {
	ComicID   *uint
	ComicCode *string
	TagID     *uint
	TagSID    *TagSID
}

type ComicTitle

type ComicTitle struct {
	ID           uint       `json:"id"`
	ComicID      uint       `json:"-"`
	RID          string     `json:"rid"`
	LanguageID   uint       `json:"languageID"`
	LanguageIETF string     `json:"languageIETF"`
	Title        string     `json:"title"`
	Synonym      *bool      `json:"synonym"`
	Romanized    *bool      `json:"romanized"`
	CreatedAt    time.Time  `json:"createdAt"`
	UpdatedAt    *time.Time `json:"updatedAt"`
}

type DBBooleanIs

type DBBooleanIs bool

type DBBooleanIsNot

type DBBooleanIsNot bool

type DBConditionalKV

type DBConditionalKV struct {
	Key   string
	Value any
}

type DBCrossConditional

type DBCrossConditional struct {
	Table      string
	Conditions any
}

type DBInsensitiveLike

type DBInsensitiveLike string

type DBIsDistinctFrom

type DBIsDistinctFrom struct{ Value any }

type DBIsNotDistinctFrom

type DBIsNotDistinctFrom struct{ Value any }

type DBIsNotNull

type DBIsNotNull struct{}

type DBIsNull

type DBIsNull struct{}

type DBLogicalAND

type DBLogicalAND struct{}

type DBLogicalOR

type DBLogicalOR struct{}

type DBQueryValue

type DBQueryValue struct {
	Expression, Table     string
	ZeroValue, Conditions any
}

type DatabaseError

type DatabaseError struct {
	Name string
	Code string
	Err  error
}

func (DatabaseError) Error

func (e DatabaseError) Error() string

func (DatabaseError) Unwrap

func (e DatabaseError) Unwrap() error

type GenericError

type GenericError string

func (GenericError) Error

func (e GenericError) Error() string

type Language

type Language struct {
	ID        uint       `json:"id"`
	IETF      string     `json:"ietf"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type ListParams

type ListParams struct {
	Conditions any
	OrderBys   OrderBys
	Pagination *Pagination
}

func (ListParams) Validate

func (m ListParams) Validate() error

type OrderBy

type OrderBy struct {
	Field any
	Sort  string
	Null  string
}

func (OrderBy) Validate

func (ob OrderBy) Validate() error

type OrderBys

type OrderBys []OrderBy

func (OrderBys) Validate

func (obs OrderBys) Validate() error

type Pagination

type Pagination struct {
	Page  int
	Limit int
}

func (Pagination) Validate

func (p Pagination) Validate() error

type SetCategory

type SetCategory struct {
	TypeID   *uint
	TypeCode *string
	Code     *string
	Name     *string
}

func (SetCategory) Validate

func (m SetCategory) Validate() error

type SetCategoryRelation

type SetCategoryRelation struct {
	TypeID     *uint
	TypeCode   *string
	ParentID   *uint
	ParentCode *string
	ChildID    *uint
	ChildCode  *string
}

func (SetCategoryRelation) Validate

func (m SetCategoryRelation) Validate() error

type SetCategoryType

type SetCategoryType struct {
	Code *string
	Name *string
}

func (SetCategoryType) Validate

func (m SetCategoryType) Validate() error

type SetComic

type SetComic struct {
	Code          *string
	LanguageID    *uint
	LanguageIETF  *string
	PublishedFrom *time.Time
	PublishedTo   *time.Time
	TotalChapter  *int
	TotalVolume   *int
	NSFW          *int
	NSFL          *int
	Additionals   map[string]any
	SetNull       []string
}

func (SetComic) Validate

func (m SetComic) Validate() error

type SetComicCategory

type SetComicCategory struct {
	ComicID          *uint
	ComicCode        *string
	CategoryID       *uint
	CategoryTypeID   *uint
	CategoryTypeCode *string
	CategoryCode     *string
}

func (SetComicCategory) Validate

func (m SetComicCategory) Validate() error

type SetComicChapter

type SetComicChapter struct {
	ComicID    *uint
	ComicCode  *string
	Chapter    *string
	Version    *string
	Volume     *string
	ReleasedAt *time.Time
	SetNull    []string
}

func (SetComicChapter) Validate

func (m SetComicChapter) Validate() error

type SetComicCover

type SetComicCover struct {
	ComicID       *uint
	ComicCode     *string
	RID           *string
	WebsiteID     *uint
	WebsiteDomain *string
	RelativeURL   *string
	Priority      *int
	SetNull       []string
}

func (SetComicCover) Validate

func (m SetComicCover) Validate() error

type SetComicExternal

type SetComicExternal struct {
	ComicID       *uint
	ComicCode     *string
	RID           *string
	WebsiteID     *uint
	WebsiteDomain *string
	RelativeURL   *string
	Official      *bool
	SetNull       []string
}

func (SetComicExternal) Validate

func (m SetComicExternal) Validate() error

type SetComicRelation

type SetComicRelation struct {
	ParentID   *uint
	ParentCode *string
	TypeID     *uint
	TypeCode   *string
	ChildID    *uint
	ChildCode  *string
}

func (SetComicRelation) Validate

func (m SetComicRelation) Validate() error

type SetComicRelationType

type SetComicRelationType struct {
	Code *string
	Name *string
}

func (SetComicRelationType) Validate

func (m SetComicRelationType) Validate() error

type SetComicSynopsis

type SetComicSynopsis struct {
	ComicID      *uint
	ComicCode    *string
	RID          *string
	LanguageID   *uint
	LanguageIETF *string
	Synopsis     *string
	Version      *string
	Romanized    *bool
	SetNull      []string
}

func (SetComicSynopsis) Validate

func (m SetComicSynopsis) Validate() error

type SetComicTag

type SetComicTag struct {
	ComicID     *uint
	ComicCode   *string
	TagID       *uint
	TagTypeID   *uint
	TagTypeCode *string
	TagCode     *string
}

func (SetComicTag) Validate

func (m SetComicTag) Validate() error

type SetComicTitle

type SetComicTitle struct {
	ComicID      *uint
	ComicCode    *string
	RID          *string
	LanguageID   *uint
	LanguageIETF *string
	Title        *string
	Synonym      *bool
	Romanized    *bool
	SetNull      []string
}

func (SetComicTitle) Validate

func (m SetComicTitle) Validate() error

type SetLanguage

type SetLanguage struct {
	IETF *string `validate:"omitnil,bcp47_language_tag"`
	Name *string
}

func (SetLanguage) Validate

func (m SetLanguage) Validate() error

type SetTag

type SetTag struct {
	TypeID   *uint
	TypeCode *string
	Code     *string
	Name     *string
}

func (SetTag) Validate

func (m SetTag) Validate() error

type SetTagType

type SetTagType struct {
	Code *string
	Name *string
}

func (SetTagType) Validate

func (m SetTagType) Validate() error

type SetWebsite

type SetWebsite struct {
	Domain *string
	Name   *string
}

func (SetWebsite) Validate

func (m SetWebsite) Validate() error

type Tag

type Tag struct {
	ID        uint       `json:"id"`
	TypeID    uint       `json:"typeID"`
	TypeCode  string     `json:"typeCode"`
	Code      string     `json:"code"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type TagSID

type TagSID struct {
	TypeID   *uint
	TypeCode *string
	Code     string
}

type TagType

type TagType struct {
	ID        uint       `json:"id"`
	Code      string     `json:"code"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type Website

type Website struct {
	ID        uint       `json:"id"`
	Domain    string     `json:"domain"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL