Documentation
¶
Index ¶
- Variables
- type Almanax
- type Bonus
- type BonusType
- type MappedAlmanax
- type Repository
- func (r *Repository) CreateBonus(bonus *Bonus) (int64, error)
- func (r *Repository) CreateBonusType(bonusType *BonusType) (int64, error)
- func (r *Repository) CreateOrUpdate(date string, almanax *dodumap.MappedMultilangNPCAlmanaxUnity) (int64, error)
- func (r *Repository) CreateTribute(tribute *Tribute) (int64, error)
- func (r *Repository) Deinit()
- func (r *Repository) GetAlmanaxByDateRange(from, to string) ([]MappedAlmanax, error)
- func (r *Repository) GetAlmanaxByDateRangeAndNameID(from, to, nameID string) ([]MappedAlmanax, error)
- func (r *Repository) GetBonusTypes() ([]BonusType, error)
- func (r *Repository) Init(ctx context.Context, workdir string) error
- func (r *Repository) UpdateAlmanax(almanax *Almanax) error
- func (r *Repository) UpdateFuture(data map[string]dodumap.MappedMultilangNPCAlmanaxUnity) error
- type SearchIndexes
- type Tribute
- type VersionT
Constants ¶
This section is empty.
Variables ¶
View Source
var DatabaseName = "almanax.db"
View Source
var Db *memdb.MemDB
View Source
var Indexes map[string]SearchIndexes
Functions ¶
This section is empty.
Types ¶
type Almanax ¶
type Almanax struct {
ID int64 `db:"id"`
BonusID int64 `db:"bonus_id"`
TributeID int64 `db:"tribute_id"`
Date string `db:"date"`
RewardKamas int64 `db:"reward_kamas"`
XpRatio float64 `db:"xp_ratio"`
OptimalLvl int `db:"optimal_lvl"`
Duration float64 `db:"duration"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt *time.Time `db:"deleted_at"`
}
type Bonus ¶
type Bonus struct {
ID int64 `db:"id"`
BonusTypeID int64 `db:"bonus_type_id"`
DescriptionEn string `db:"description_en"`
DescriptionFr string `db:"description_fr"`
DescriptionEs string `db:"description_es"`
DescriptionDe string `db:"description_de"`
DescriptionPt string `db:"description_pt"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt *time.Time `db:"deleted_at"`
}
type BonusType ¶
type BonusType struct {
ID int64 `db:"id"`
NameID string `db:"name_id"`
NameEn string `db:"name_en"`
NameFr string `db:"name_fr"`
NameEs string `db:"name_es"`
NameDe string `db:"name_de"`
NamePt string `db:"name_pt"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt *time.Time `db:"deleted_at"`
}
type MappedAlmanax ¶
type Repository ¶
func NewDatabaseRepository ¶
func NewDatabaseRepository(ctx context.Context, workdir string) *Repository
func (*Repository) CreateBonus ¶
func (r *Repository) CreateBonus(bonus *Bonus) (int64, error)
func (*Repository) CreateBonusType ¶
func (r *Repository) CreateBonusType(bonusType *BonusType) (int64, error)
func (*Repository) CreateOrUpdate ¶
func (r *Repository) CreateOrUpdate(date string, almanax *dodumap.MappedMultilangNPCAlmanaxUnity) (int64, error)
func (*Repository) CreateTribute ¶
func (r *Repository) CreateTribute(tribute *Tribute) (int64, error)
func (*Repository) Deinit ¶
func (r *Repository) Deinit()
func (*Repository) GetAlmanaxByDateRange ¶
func (r *Repository) GetAlmanaxByDateRange(from, to string) ([]MappedAlmanax, error)
func (*Repository) GetAlmanaxByDateRangeAndNameID ¶
func (r *Repository) GetAlmanaxByDateRangeAndNameID(from, to, nameID string) ([]MappedAlmanax, error)
func (*Repository) GetBonusTypes ¶
func (r *Repository) GetBonusTypes() ([]BonusType, error)
func (*Repository) UpdateAlmanax ¶
func (r *Repository) UpdateAlmanax(almanax *Almanax) error
func (*Repository) UpdateFuture ¶
func (r *Repository) UpdateFuture(data map[string]dodumap.MappedMultilangNPCAlmanaxUnity) error
type SearchIndexes ¶
type SearchIndexes struct {
AllItems meilisearch.IndexManager
Sets meilisearch.IndexManager
Mounts meilisearch.IndexManager
}
type Tribute ¶
type Tribute struct {
ID int64 `db:"id"`
ItemNameEn string `db:"item_name_en"`
ItemNameFr string `db:"item_name_fr"`
ItemNameEs string `db:"item_name_es"`
ItemNameDe string `db:"item_name_de"`
ItemNamePt string `db:"item_name_pt"`
ItemAnkamaID int64 `db:"item_ankama_id"`
ItemCategoryId int `db:"item_category_id"`
ItemDoduapiUri string `db:"item_doduapi_uri"`
Quantity int `db:"quantity"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt *time.Time `db:"deleted_at"`
}
Click to show internal directories.
Click to hide internal directories.