Documentation

Index

Constants

View Source
const (
	RetryDelay      = 2 * time.Hour
	NewRequestDelay = 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	// Type is how block must be rendered
	Type storefront_block.Type

	// Title is user facing title for page block
	Title storefront_block.Title

	// Filter is query to catalog for 'view more' button
	Filter string

	// GameIDs is list of games identifiers
	GameIDs []string
}

    Block is storefront template page block

    func (*Block) Validate

    func (b *Block) Validate() error

    type Developer

    type Developer struct {
    	ID   uint
    	Name string
    }

    type DeveloperArray

    type DeveloperArray struct {
    	// contains filtered or unexported fields
    }

    func NewDeveloperArray

    func NewDeveloperArray(items []Developer) *DeveloperArray

    func (*DeveloperArray) IDs

    func (a *DeveloperArray) IDs() []uint

    func (*DeveloperArray) Size

    func (a *DeveloperArray) Size() int

    type Discount

    type Discount struct {
    	ID             uint
    	TechnicalTitle string
    	StartDate      time.Time
    	EndDate        time.Time
    	Type           discount.Type
    	Status         discount.Status
    	OwnerID        string
    	CreatedAt      time.Time
    	UpdatedAt      time.Time
    	PublishedAt    *time.Time
    }

    type Document

    type Document struct {
    	ID          uint
    	Title       string
    	Text        string
    	Reason      string
    	Type        document.Type
    	Language    language.Language
    	Version     string
    	CreatedBy   string
    	ActivatedBy string
    	CreatedAt   time.Time
    	UpdatedAt   *time.Time
    	ActivatedAt *time.Time
    }

    type DocumentArray

    type DocumentArray []Document

    func NewDocumentArray

    func NewDocumentArray(items []Document) DocumentArray

    func (DocumentArray) IDs

    func (a DocumentArray) IDs() []uint

    type DocumentSignature

    type DocumentSignature struct {
    	ID         uint
    	UserID     string
    	DocumentID uint
    	CreatedAt  time.Time
    }

    type DocumentSignatureArray

    type DocumentSignatureArray []DocumentSignature

    func NewDocumentSignatureArray

    func NewDocumentSignatureArray(items []DocumentSignature) *DocumentSignatureArray

    func (*DocumentSignatureArray) DocumentIDs

    func (a *DocumentSignatureArray) DocumentIDs() []uint

    func (*DocumentSignatureArray) IDs

    func (a *DocumentSignatureArray) IDs() []uint

    type DocumentSigned

    type DocumentSigned struct {
    	Document
    	SignedAt time.Time
    }

    type Feature

    type Feature struct {
    	ID   uint
    	Name string
    	Icon game.Icon
    }

    type FeatureArray

    type FeatureArray struct {
    	// contains filtered or unexported fields
    }

    func NewFeatureArray

    func NewFeatureArray(items []Feature) *FeatureArray

    func (*FeatureArray) IDs

    func (a *FeatureArray) IDs() []uint

    func (*FeatureArray) Size

    func (a *FeatureArray) Size() int

    type Game

    type Game struct {
    	ID               string
    	Title            string
    	Slug             string
    	Type             game.Type
    	ParentID         *string
    	FirstPublishedAt *time.Time
    	PurchasesCount   uint
    	OwnerID          string
    	SKU              string
    	ApplicationID    string
    }

    type GameDiscount

    type GameDiscount struct {
    	ID         uint
    	GameID     string
    	DiscountID uint
    	OwnerID    string
    	Discount   uint
    }

    type GameEx

    type GameEx struct {
    	Game
    	Revision *GameRevisionEx
    }

    type GameLicense

    type GameLicense struct {
    	ID        uint
    	GameID    string
    	UserID    string
    	CreatedAt time.Time
    }

    type GameMedia

    type GameMedia struct {
    	ID         uint
    	Type       media.Type
    	FilePath   string
    	IsUploaded bool
    	CreatedAt  time.Time
    }

    type GameMediaArray

    type GameMediaArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameMediaArray

    func NewGameMediaArray(items []GameMedia) *GameMediaArray

    func (*GameMediaArray) IDs

    func (a *GameMediaArray) IDs() []uint

    func (*GameMediaArray) Size

    func (a *GameMediaArray) Size() int

    type GameRevision

    type GameRevision struct {
    	ID          uint
    	GameID      string
    	Summary     string
    	Description string
    	License     string
    	Publisher   *string
    	Developer   *string
    	PlayTime    uint
    	PublishedAt *time.Time
    
    	ReleaseDate          time.Time
    	ReleaseDateCountDown bool
    
    	SystemRequirements []SystemRequirements
    	SocialLinks        []SocialLink
    	L10n               []GameRevisionL10n
    
    	Status    game_revision.Status
    	Platforms game.PlatformArray
    }

    type GameRevisionArray

    type GameRevisionArray []GameRevision

    func NewGameRevisionArray

    func NewGameRevisionArray(items []GameRevision) GameRevisionArray

    func (GameRevisionArray) GameIDs

    func (a GameRevisionArray) GameIDs() []string

    func (GameRevisionArray) IDs

    func (a GameRevisionArray) IDs() []uint

    type GameRevisionDeveloper

    type GameRevisionDeveloper struct {
    	ID             uint
    	GameRevisionID uint
    	DeveloperID    uint
    }

    type GameRevisionDeveloperArray

    type GameRevisionDeveloperArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameRevisionDeveloperArray

    func NewGameRevisionDeveloperArray(items []GameRevisionDeveloper) *GameRevisionDeveloperArray

    func (*GameRevisionDeveloperArray) DeveloperIDs

    func (a *GameRevisionDeveloperArray) DeveloperIDs() []uint

    func (*GameRevisionDeveloperArray) IDs

    func (a *GameRevisionDeveloperArray) IDs() []uint

    func (*GameRevisionDeveloperArray) Size

    func (a *GameRevisionDeveloperArray) Size() int

    type GameRevisionEx

    type GameRevisionEx struct {
    	GameRevision
    	Tags         []Tag
    	Features     []Feature
    	Genres       []Genre
    	Localization []Localization
    	Rating       []Rating
    	Review       []Review
    	Prices       []GameRevisionPrice
    }

    type GameRevisionExArray

    type GameRevisionExArray []GameRevisionEx

    func NewGameRevisionExArray

    func NewGameRevisionExArray(items []GameRevisionEx) GameRevisionExArray

    func (GameRevisionExArray) GameIDs

    func (a GameRevisionExArray) GameIDs() []string

    func (GameRevisionExArray) IDs

    func (a GameRevisionExArray) IDs() []uint

    type GameRevisionFeature

    type GameRevisionFeature struct {
    	ID             uint
    	GameRevisionID uint
    	FeatureID      uint
    }

    type GameRevisionFeatureArray

    type GameRevisionFeatureArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameRevisionFeatureArray

    func NewGameRevisionFeatureArray(items []GameRevisionFeature) *GameRevisionFeatureArray

    func (*GameRevisionFeatureArray) FeatureIDs

    func (a *GameRevisionFeatureArray) FeatureIDs() []uint

    func (*GameRevisionFeatureArray) IDs

    func (a *GameRevisionFeatureArray) IDs() []uint

    func (*GameRevisionFeatureArray) Size

    func (a *GameRevisionFeatureArray) Size() int

    type GameRevisionGenre

    type GameRevisionGenre struct {
    	ID             uint
    	GameRevisionID uint
    	GenreID        uint
    }

    type GameRevisionGenreArray

    type GameRevisionGenreArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameRevisionGenreArray

    func NewGameRevisionGenreArray(items []GameRevisionGenre) *GameRevisionGenreArray

    func (*GameRevisionGenreArray) GenreIDs

    func (a *GameRevisionGenreArray) GenreIDs() []uint

    func (*GameRevisionGenreArray) IDs

    func (a *GameRevisionGenreArray) IDs() []uint

    func (*GameRevisionGenreArray) Size

    func (a *GameRevisionGenreArray) Size() int

    type GameRevisionL10n

    type GameRevisionL10n struct {
    	ID             uint
    	LanguageID     uint
    	GameRevisionID uint
    
    	Summary                     *string
    	Description                 *string
    	CoverWideSliderMediaID      *uint
    	CoverVerticalMediaID        *uint
    	CoverHorizontalMediaID      *uint
    	CoverHorizontalSmallMediaID *uint
    	CoverLargeSingleMediaID     *uint
    	CoverCatalogMediaID         *uint
    	CoverIconMediaID            *uint
    	ScreenshotMediaIDs          []uint
    	DescriptionMediaIDs         []uint
    	Trailers                    []string
    }

    type GameRevisionL10nArray

    type GameRevisionL10nArray []GameRevisionL10n

    func (GameRevisionL10nArray) IDs

    func (a GameRevisionL10nArray) IDs() []uint

    type GameRevisionPrice

    type GameRevisionPrice struct {
    	ID               uint
    	GameID           string
    	GameRevisionID   uint
    	RegionCurrencyID uint
    	BaseAmount       float64
    	FinalAmount      float64
    	Discount         uint
    	Discounts        []uint
    	CreatedAt        time.Time
    	UpdatedAt        time.Time
    }

    type GameRevisionPublisher

    type GameRevisionPublisher struct {
    	ID             uint
    	GameRevisionID uint
    	PublisherID    uint
    }

    type GameRevisionPublisherArray

    type GameRevisionPublisherArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameRevisionPublisherArray

    func NewGameRevisionPublisherArray(items []GameRevisionPublisher) *GameRevisionPublisherArray

    func (*GameRevisionPublisherArray) IDs

    func (a *GameRevisionPublisherArray) IDs() []uint

    func (*GameRevisionPublisherArray) PublisherIDs

    func (a *GameRevisionPublisherArray) PublisherIDs() []uint

    func (*GameRevisionPublisherArray) Size

    func (a *GameRevisionPublisherArray) Size() int

    type GameRevisionTag

    type GameRevisionTag struct {
    	ID             uint
    	GameRevisionID uint
    	TagID          uint
    }

    type GameRevisionTagArray

    type GameRevisionTagArray struct {
    	// contains filtered or unexported fields
    }

    func NewGameRevisionTagArray

    func NewGameRevisionTagArray(items []GameRevisionTag) *GameRevisionTagArray

    func (*GameRevisionTagArray) IDs

    func (a *GameRevisionTagArray) IDs() []uint

    func (*GameRevisionTagArray) Size

    func (a *GameRevisionTagArray) Size() int

    func (*GameRevisionTagArray) TagIDs

    func (a *GameRevisionTagArray) TagIDs() []uint

    type GameStorePublish

    type GameStorePublish struct {
    	ID        uint
    	GameID    string
    	Body      string
    	Status    game_publish.Status
    	CreatedAt time.Time
    }

    type Genre

    type Genre struct {
    	ID   uint
    	Name string
    }

    type GenreArray

    type GenreArray struct {
    	// contains filtered or unexported fields
    }

    func NewGenreArray

    func NewGenreArray(items []Genre) *GenreArray

    func (*GenreArray) IDs

    func (a *GenreArray) IDs() []uint

    func (*GenreArray) Size

    func (a *GenreArray) Size() int

    type Language

    type Language struct {
    	ID       uint
    	Language string
    }

    type LanguageArray

    type LanguageArray struct {
    	// contains filtered or unexported fields
    }

    func NewLanguageArray

    func NewLanguageArray(items []Language) *LanguageArray

    func (*LanguageArray) IDs

    func (a *LanguageArray) IDs() []uint

    func (*LanguageArray) Size

    func (a *LanguageArray) Size() int

    type Localization

    type Localization struct {
    	ID             uint
    	GameRevisionID uint
    	LanguageID     uint
    	Interface      bool
    	Audio          bool
    	Subtitles      bool
    }

    type LocalizationLanguage

    type LocalizationLanguage struct {
    	ID       uint
    	Code     string
    	Language string
    }

    type LocalizationLanguageArray

    type LocalizationLanguageArray struct {
    	// contains filtered or unexported fields
    }

    func NewLocalizationLanguageArray

    func NewLocalizationLanguageArray(items []LocalizationLanguage) *LocalizationLanguageArray

    func (*LocalizationLanguageArray) IDs

    func (a *LocalizationLanguageArray) IDs() []uint

    func (*LocalizationLanguageArray) Size

    func (a *LocalizationLanguageArray) Size() int

    type Media

    type Media struct {
    	ID             uint
    	Type           media.Type
    	FilePath       string
    	RetinaFilePath *string
    	IsUploaded     bool
    	CreatedAt      time.Time
    }

    type MediaArray

    type MediaArray struct {
    	// contains filtered or unexported fields
    }

    func NewMediaArray

    func NewMediaArray(items []Media) *MediaArray

    func (*MediaArray) IDs

    func (a *MediaArray) IDs() []uint

    func (*MediaArray) Size

    func (a *MediaArray) Size() int

    type NygmaIntegration

    type NygmaIntegration struct {
    	IsEnabled bool
    	ProjectID string
    	SecretKey string
    }

    type Order

    type Order struct {
    	ID               uint
    	UserID           string
    	GameID           string
    	GameLicenseID    uint
    	BaseAmount       float64
    	FinalAmount      float64
    	Discount         uint
    	RegionCurrencyID uint
    	ResultAmount     float64
    	ResultTax        float64
    	ResultSrc        string
    	CreatedAt        time.Time
    }

    type PaymentMethods

    type PaymentMethods struct {
    	Nygma NygmaIntegration
    }

    type Post

    type Post struct {
    	ID          uint
    	Slug        string
    	Status      post.Status
    	Cover       string
    	CreatedAt   time.Time
    	PublishedAt *time.Time
    }

    type PostArray

    type PostArray []Post

    func NewPostArray

    func NewPostArray(items []Post) PostArray

    func (PostArray) IDs

    func (a PostArray) IDs() []uint

    type PostEx

    type PostEx struct {
    	Post
    	L10n []PostL10n
    }

    type PostL10n

    type PostL10n struct {
    	ID         uint
    	PostID     uint
    	LanguageID uint
    	Title      string
    	Summary    string
    	Body       string
    }

    type PostMedia

    type PostMedia struct {
    	ID      uint
    	PostID  uint
    	MediaID uint
    }

    type Price

    type Price struct {
    	Currency RegionCurrency
    	Amount   float64
    }

    type PriceTable

    type PriceTable struct {
    	RegionID uint
    	Ranges   []PriceTableRange
    }

    type PriceTableRange

    type PriceTableRange struct {
    	ID       uint
    	RegionID uint
    	Position int32
    	From     float64
    	To       float64
    }

    type Publisher

    type Publisher struct {
    	ID   uint
    	Name string
    }

    type PublisherArray

    type PublisherArray struct {
    	// contains filtered or unexported fields
    }

    func NewPublisherArray

    func NewPublisherArray(items []Publisher) *PublisherArray

    func (*PublisherArray) IDs

    func (a *PublisherArray) IDs() []uint

    func (*PublisherArray) Size

    func (a *PublisherArray) Size() int

    type Rating

    type Rating struct {
    	ID                       uint
    	GameRevisionID           uint
    	Agency                   game_rating.Agency
    	Rating                   game_rating.Rating
    	Descriptors              []game_rating.Descriptor
    	DisplayOnlineNotice      bool
    	DisplayOnlineMusicNotice bool
    	ShowAgeRestrict          bool
    	AgeRestrictYears         *uint
    }

    type RecommendedPrice

    type RecommendedPrice struct {
    	Region   string
    	Currency string
    	Amount   float64
    }

    type Region

    type Region struct {
    	ID   uint
    	Code string
    }

    type RegionCurrency

    type RegionCurrency struct {
    	ID           uint
    	RegionID     uint
    	RegionCode   string
    	CurrencyCode string
    	Fraction     float64
    	UpdatedAt    time.Time
    	CreatedAt    time.Time
    
    	VatNumeric float64
    	VatString  string
    
    	// The currency is available to users in the store. Games without
    	// a price in this currency should not be published.
    	IsActiveForUsers bool
    
    	// The currency is only available in CRM for publishers. The game
    	// can be published without a price in this currency.
    	IsActiveForDevelopers bool
    
    	// If the relation between the region and the currency is standard,
    	// such as USA and USD, you do not need to highlight it in the interface.
    	IsStandardRelation bool
    
    	// Default currency for system. USD by default.
    	IsDefault bool
    }

    type RequirementsSet

    type RequirementsSet struct {
    	OS        string
    	CPU       string
    	GPU       string
    	DirectX   uint
    	DiskSpace uint
    	RAM       uint
    	Other     string
    }

    type Review

    type Review struct {
    	ID             uint
    	GameRevisionID uint
    	PressName      string
    	Link           string
    	Score          string
    	Quote          string
    }

    type Settings

    type Settings struct {
    	ID             uint
    	StoreRootURL   string
    	PaymentMethods PaymentMethods
    }
    type SocialLink struct {
    	Type game_social_link.Type
    	URL  string
    }

    type Storefront

    type Storefront struct {
    	// ID is unique identifier for storefront page template
    	ID uint
    
    	// Name is user-friendly template name
    	Name string
    
    	// IsActive is status flag
    	IsActive bool
    
    	// Version is latest template version number
    	Version uint
    
    	// Blocks are content of page
    	Blocks []Block
    
    	// CreatedAt is template creation date
    	CreatedAt time.Time
    
    	// UpdatedAt is last update date
    	UpdatedAt time.Time
    }

    type SystemRequirements

    type SystemRequirements struct {
    	Platform    game.Platform
    	Minimal     RequirementsSet
    	Recommended RequirementsSet
    }

    type Tag

    type Tag struct {
    	ID   uint
    	Name string
    }

    type TagArray

    type TagArray struct {
    	// contains filtered or unexported fields
    }

    func NewTagArray

    func NewTagArray(items []Tag) *TagArray

    func (*TagArray) IDs

    func (a *TagArray) IDs() []uint

    func (*TagArray) Size

    func (a *TagArray) Size() int

    type User

    type User struct {
    	UserID string
    
    	Username  string
    	Email     string
    	Phone     string
    	PhotoURL  string
    	FirstName string
    	LastName  string
    
    	Language string
    	Currency string
    
    	Roles user.RoleArray
    }

    type UserID

    type UserID string

    func ParseUserID

    func ParseUserID(s string) (UserID, error)

    func (UserID) String

    func (id UserID) String() string

    type UserInfoDownload

    type UserInfoDownload struct {
    	UserID    UserID
    	Status    user_info_download.Status
    	TryCount  int
    	LastTryAt time.Time
    	NextTryAt time.Time
    	CreatedAt time.Time
    }

    func NewUserInfoDownload

    func NewUserInfoDownload(userID UserID, inProgress bool) *UserInfoDownload

    func (*UserInfoDownload) Expiration

    func (s *UserInfoDownload) Expiration() time.Time

      returns result expiration time

      func (*UserInfoDownload) IsNewRequestAllowed

      func (s *UserInfoDownload) IsNewRequestAllowed(now time.Time) bool

      func (*UserInfoDownload) MarkReady

      func (s *UserInfoDownload) MarkReady() error

      func (*UserInfoDownload) NewTry

      func (s *UserInfoDownload) NewTry() error