Documentation
¶
Overview ¶
Package repository contains all database logic for storage
Index ¶
- Constants
- Variables
- func NewError(err error) error
- func SetPassword(password interface{}) (string, error)
- type AggregatedCategoryCollectionsCollectiblesJSON
- type AggregatedCategoryCollectionsJSON
- type AggregatedImageJSON
- type AggregatedMenuAttributesJSON
- type AggregatedSliderItemJSON
- type CategoriesRepository
- type CategoriesRepositoryInterface
- type Category
- type CategoryCollection
- type CategoryCollectionAttributes
- type CategoryCollectionCollectible
- type CategoryCollectionCollectibleAttributes
- type Collectible
- type CollectibleDetails
- type CollectibleMetadata
- type Contract
- type ContractsRepository
- func (r *ContractsRepository) Create(ctx context.Context, contractMap map[string]interface{}) error
- func (r *ContractsRepository) GetAuctions(ctx context.Context) ([]*models.Contract, error)
- func (r *ContractsRepository) GetByAddress(ctx context.Context, address common.Address) (*models.Contract, error)
- func (r *ContractsRepository) GetCollectionsContracts(ctx context.Context) ([]*models.Contract, error)
- func (r *ContractsRepository) GetContractsByType(ctx context.Context, contractType string) ([]*models.Contract, error)
- func (r *ContractsRepository) GetOne(ctx context.Context, name string) (*models.Contract, error)
- func (r *ContractsRepository) InnerDB() *sqlx.DB
- func (r *ContractsRepository) Ping() error
- type ContractsRepositoryInterface
- type Error
- type File
- type FilesRepository
- func (r *FilesRepository) Create(ctx context.Context, fileMap map[string]interface{}) error
- func (r *FilesRepository) GetFileByID(ctx context.Context, id int64) (*models.File, error)
- func (r *FilesRepository) GetFileByName(ctx context.Context, name string) (*models.File, error)
- func (r *FilesRepository) GetFiles(ctx context.Context) ([]*models.File, error)
- func (r *FilesRepository) GetPublicFileByID(ctx context.Context, id int64) (*models.PublicFile, error)
- func (r *FilesRepository) GetPublicFileByName(ctx context.Context, name string) (*models.PublicFile, error)
- func (r *FilesRepository) GetPublicFilesByProvider(ctx context.Context, provider string) ([]*models.PublicFile, error)
- func (r *FilesRepository) InnerDB() *sqlx.DB
- func (r *FilesRepository) Ping() error
- func (r *FilesRepository) Update(ctx context.Context, fileMap map[string]interface{}) ([]*models.File, error)
- type FilesRepositoryInterface
- type Menu
- type MenuSection
- type MenusRepository
- type MenusRepositoryInterface
- type Page
- type PagesRepository
- type PagesRepositoryInterface
- type Slider
- type SlidersRepository
- func (r *SlidersRepository) Create(ctx context.Context, sliderMap map[string]interface{}) error
- func (r *SlidersRepository) GetSliderByID(ctx context.Context, id int64) (*models.Slider, error)
- func (r *SlidersRepository) GetSliderByProvider(ctx context.Context, provider string) (*models.PublicSlider, error)
- func (r *SlidersRepository) GetSliderByTitle(ctx context.Context, title string) (*models.Slider, error)
- func (r *SlidersRepository) GetSliders(ctx context.Context) ([]*models.Slider, error)
- func (r *SlidersRepository) InnerDB() *sqlx.DB
- func (r *SlidersRepository) Ping() error
- func (r *SlidersRepository) Update(ctx context.Context, sliderMap map[string]interface{}) ([]*models.Slider, error)
- type SlidersRepositoryInterface
- type User
- type UsersRepository
- func (r *UsersRepository) Create(ctx context.Context, userMap map[string]interface{}) error
- func (r *UsersRepository) GetOne(ctx context.Context, email string) (*User, error)
- func (r *UsersRepository) GetPublicUserByID(ctx context.Context, id int64) (*models.PublicUser, error)
- func (r *UsersRepository) GetUserByAddress(ctx context.Context, address string) (*User, error)
- func (r *UsersRepository) InnerDB() *sqlx.DB
- func (r *UsersRepository) Ping() error
- type UsersRepositoryInterface
Constants ¶
View Source
const PublicDir = "/api/v1/files/"
Variables ¶
View Source
var ErrDBNotInitialized = fmt.Errorf("db not initialised")
ErrDBNotInitialized - default database connection error.
Functions ¶
func SetPassword ¶
Types ¶
type AggregatedCategoryCollectionsCollectiblesJSON ¶
type AggregatedCategoryCollectionsCollectiblesJSON []CategoryCollectionCollectible
func (*AggregatedCategoryCollectionsCollectiblesJSON) Scan ¶
func (a *AggregatedCategoryCollectionsCollectiblesJSON) Scan(val interface{}) error
type AggregatedCategoryCollectionsJSON ¶
type AggregatedCategoryCollectionsJSON []CategoryCollection
func (*AggregatedCategoryCollectionsJSON) Scan ¶
func (a *AggregatedCategoryCollectionsJSON) Scan(val interface{}) error
type AggregatedImageJSON ¶
type AggregatedImageJSON models.PublicFile
func (*AggregatedImageJSON) Scan ¶
func (a *AggregatedImageJSON) Scan(val interface{}) error
type AggregatedMenuAttributesJSON ¶
type AggregatedMenuAttributesJSON models.PublicMenuAttributes
func (*AggregatedMenuAttributesJSON) Scan ¶
func (a *AggregatedMenuAttributesJSON) Scan(val interface{}) error
type AggregatedSliderItemJSON ¶
type AggregatedSliderItemJSON []*models.PublicSliderItem
func (*AggregatedSliderItemJSON) Scan ¶
func (a *AggregatedSliderItemJSON) Scan(val interface{}) error
type CategoriesRepository ¶
CategoriesRepository - repository to store frontend categories.
func NewCategoriesRepository ¶
func NewCategoriesRepository(db *sqlx.DB, tbl string) *CategoriesRepository
func (*CategoriesRepository) GetPublicCollectibleCategories ¶
func (r *CategoriesRepository) GetPublicCollectibleCategories(ctx context.Context, users UsersRepositoryInterface) ([]*models.PublicCategory, error)
func (*CategoriesRepository) InnerDB ¶
func (r *CategoriesRepository) InnerDB() *sqlx.DB
func (*CategoriesRepository) Ping ¶
func (r *CategoriesRepository) Ping() error
type CategoriesRepositoryInterface ¶
type CategoriesRepositoryInterface interface { InnerDB() *sqlx.DB Ping() error GetPublicCollectibleCategories(ctx context.Context, users UsersRepositoryInterface) ([]*models.PublicCategory, error) }
type Category ¶
type Category struct { Deleted time.Time `db:"deleted"` Updated time.Time `db:"updated"` Created time.Time `db:"created"` CreatedByID *int64 `db:"created_by_id"` ParentID *int64 `db:"parent_id"` Description *string `db:"description"` Content *string `db:"content"` ImageID *int64 `db:"image_id"` UpdatedByID *int64 `db:"updated_by_id"` OrderBy *int64 `db:"order_by"` Slug string `db:"slug"` Title string `db:"title"` Provider string `db:"provider"` Collections AggregatedCategoryCollectionsJSON `db:"collections"` ID int64 `db:"id"` Enabled bool `db:"enabled"` }
type CategoryCollection ¶
type CategoryCollection struct { Attributes CategoryCollectionAttributes ID int64 `db:"id"` }
type CategoryCollectionAttributes ¶
type CategoryCollectionAttributes struct { Deleted time.Time `db:"deleted_at"` Updated time.Time `db:"updated_at"` Description string `db:"description"` Fee string `db:"fee"` Symbol string `db:"symbol"` Name string `db:"name"` Created string `db:"created"` Address string `db:"address"` Slug string `db:"slug"` URL string `db:"url"` Logo AggregatedImageJSON `db:"logo"` Featured AggregatedImageJSON `db:"featured"` Banner AggregatedImageJSON `db:"banner"` Collectibles AggregatedCategoryCollectionsCollectiblesJSON `db:"collectibles"` Creator int64 `db:"creator"` Owner int64 `db:"owner"` MaxItems int64 `db:"max_items"` CategoryID int64 `db:"category_id"` // contains filtered or unexported fields }
type CategoryCollectionCollectible ¶
type CategoryCollectionCollectible struct { Attributes CategoryCollectionCollectibleAttributes ID int64 `db:"id"` }
type CategoryCollectionCollectibleAttributes ¶
type CategoryCollectionCollectibleAttributes struct { Created time.Time `db:"created"` Metadata CollectibleMetadata `db:"metadata"` URI string `db:"uri"` Tokens []int64 `db:"tokens"` Details CollectibleDetails `db:"details"` Item int64 `db:"item"` Collection int64 `db:"collection"` Creator int64 `db:"creator"` Owner int64 `db:"owner"` }
type Collectible ¶
type Collectible struct { Created time.Time `db:"created"` Updated time.Time `db:"updated"` Deleted time.Time `db:"deleted"` Metadata CollectibleMetadata `db:"metadata"` Creator string `db:"creator"` Owner string `db:"owner"` URI string `db:"uri"` TokenIDs []int64 `db:"token_ids"` Details CollectibleDetails `db:"details"` ID int64 `db:"id"` CollectionID int64 `db:"collection_id"` }
type CollectibleDetails ¶
type CollectibleDetails struct { StartPrice string `json:"start_price"` Tags string `json:"tags"` Collection string `json:"collection"` TotalWei string `json:"total_wei"` ReservePriceWei string `json:"reserve_price_wei"` Total string `json:"total"` PriceWei string `json:"price_wei"` FeeWei string `json:"fee_wei"` ReservePrice string `json:"reserve_price"` StartPriceWei string `json:"start_price_wei"` Price string `json:"price"` Fee string `json:"fee"` Address string `json:"address"` StartTime int64 `json:"start_time"` EndTime int64 `json:"end_time"` Quantity int64 `json:"quantity"` IsStarted bool `json:"is_started"` Cancelled bool `json:"cancelled"` Fulfilled bool `json:"fulfilled"` Auction bool `json:"auction"` }
type CollectibleMetadata ¶
type ContractsRepository ¶
UsersRepository - repository to store users.
func NewContractsRepository ¶
func NewContractsRepository(db *sqlx.DB, tbl string) *ContractsRepository
func (*ContractsRepository) Create ¶
func (r *ContractsRepository) Create(ctx context.Context, contractMap map[string]interface{}) error
func (*ContractsRepository) GetAuctions ¶
func (*ContractsRepository) GetByAddress ¶
func (*ContractsRepository) GetCollectionsContracts ¶
func (*ContractsRepository) GetContractsByType ¶
func (*ContractsRepository) InnerDB ¶
func (r *ContractsRepository) InnerDB() *sqlx.DB
func (*ContractsRepository) Ping ¶
func (r *ContractsRepository) Ping() error
type ContractsRepositoryInterface ¶
type ContractsRepositoryInterface interface { InnerDB() *sqlx.DB Ping() error Create(ctx context.Context, contractMap map[string]interface{}) error GetOne(ctx context.Context, name string) (*models.Contract, error) GetByAddress(ctx context.Context, address common.Address) (*models.Contract, error) GetCollectionsContracts(ctx context.Context) ([]*models.Contract, error) GetAuctions(ctx context.Context) ([]*models.Contract, error) }
type File ¶
type File struct { Updated strfmt.Date `db:"updated"` Created strfmt.Date `db:"created"` Deleted strfmt.Date `db:"deleted"` Metadata interface{} `db:"metadata"` Formats interface{} `db:"formats"` Provider *string `db:"provider"` Thumb string `db:"preview_url"` Hash string `db:"hash"` Ext string `db:"ext"` Caption string `db:"caption"` URL string `db:"url"` Alt string `db:"alt"` Name string `db:"name"` Mime string `db:"mime"` Height int64 `db:"height"` CreatedByID int64 `db:"created_by_id"` UpdatedByID int64 `db:"updated_by_id"` Size float64 `db:"size"` ID int64 `db:"id"` Width int64 `db:"width"` }
type FilesRepository ¶
FilesRepository - repository to store files.
func NewFilesRepository ¶
func NewFilesRepository(db *sqlx.DB, tbl string) *FilesRepository
func (*FilesRepository) Create ¶
func (r *FilesRepository) Create(ctx context.Context, fileMap map[string]interface{}) error
func (*FilesRepository) GetFileByID ¶
func (*FilesRepository) GetFileByName ¶
func (*FilesRepository) GetPublicFileByID ¶
func (r *FilesRepository) GetPublicFileByID(ctx context.Context, id int64) (*models.PublicFile, error)
func (*FilesRepository) GetPublicFileByName ¶
func (r *FilesRepository) GetPublicFileByName(ctx context.Context, name string) (*models.PublicFile, error)
func (*FilesRepository) GetPublicFilesByProvider ¶
func (r *FilesRepository) GetPublicFilesByProvider(ctx context.Context, provider string) ([]*models.PublicFile, error)
func (*FilesRepository) InnerDB ¶
func (r *FilesRepository) InnerDB() *sqlx.DB
func (*FilesRepository) Ping ¶
func (r *FilesRepository) Ping() error
type FilesRepositoryInterface ¶
type FilesRepositoryInterface interface { InnerDB() *sqlx.DB Ping() error Create(ctx context.Context, fileMap map[string]interface{}) error Update(ctx context.Context, fileMap map[string]interface{}) ([]*models.File, error) GetFiles(ctx context.Context) ([]*models.File, error) GetFileByName(ctx context.Context, name string) (*models.File, error) GetFileByID(ctx context.Context, id int64) (*models.File, error) GetPublicFilesByProvider(ctx context.Context, provider string) ([]*models.PublicFile, error) GetPublicFileByName(ctx context.Context, name string) (*models.PublicFile, error) GetPublicFileByID(ctx context.Context, id int64) (*models.PublicFile, error) }
type MenuSection ¶
type MenuSection struct { Created strfmt.Date `db:"created"` Updated strfmt.Date `db:"updated"` Deleted strfmt.Date `db:"deleted"` Title string `db:"title"` ID int64 `db:"id"` MenuID int64 `db:"menu_id"` OrderBy int64 `db:"order_by"` CreatedBy int64 `db:"created_by"` UpdatedBy int64 `db:"updated_by"` Enabled bool `db:"enabled"` }
type MenusRepository ¶
MenusRepository - repository to store frontend menus.
func NewMenusRepository ¶
func NewMenusRepository(db *sqlx.DB, tbl string) *MenusRepository
func (*MenusRepository) GetMenuByProvider ¶
func (r *MenusRepository) GetMenuByProvider(ctx context.Context, provider string) (*models.PublicMenu, error)
func (*MenusRepository) InnerDB ¶
func (r *MenusRepository) InnerDB() *sqlx.DB
func (*MenusRepository) Ping ¶
func (r *MenusRepository) Ping() error
type Page ¶
type Page struct { Created strfmt.Date `db:"created"` Deleted strfmt.Date `db:"deleted"` Updated strfmt.Date `db:"updated"` Title string `db:"title"` Slug string `db:"slug"` Description string `db:"description"` Content string `db:"content"` ImageID int64 `db:"image_id"` OrderBy int64 `db:"order_by"` CreatedBy int64 `db:"created_by"` UpdatedBy int64 `db:"updated_by"` ID int64 `db:"id"` CategoryID int64 `db:"category_id"` Enabled bool `db:"enabled"` }
type PagesRepository ¶
PagesRepository - repository to store frontend pages.
func NewPagesRepository ¶
func NewPagesRepository(db *sqlx.DB, tbl string) *PagesRepository
func (*PagesRepository) InnerDB ¶
func (r *PagesRepository) InnerDB() *sqlx.DB
func (*PagesRepository) Ping ¶
func (r *PagesRepository) Ping() error
type Slider ¶
type Slider struct { Created strfmt.Date `db:"created"` Updated strfmt.Date `db:"updated"` Deleted strfmt.Date `db:"deleted"` Provider string `db:"provider"` Title string `db:"title"` Description string `db:"description"` ID int64 `db:"id"` CreatedBy int64 `db:"created_by"` UpdatedBy int64 `db:"updated_by"` Enabled bool `db:"enabled"` }
type SlidersRepository ¶
SlidersRepository - repository to store frontend sliders.
func NewSlidersRepository ¶
func NewSlidersRepository(db *sqlx.DB, tbl string) *SlidersRepository
func (*SlidersRepository) Create ¶
func (r *SlidersRepository) Create(ctx context.Context, sliderMap map[string]interface{}) error
func (*SlidersRepository) GetSliderByID ¶
func (*SlidersRepository) GetSliderByProvider ¶
func (r *SlidersRepository) GetSliderByProvider(ctx context.Context, provider string) (*models.PublicSlider, error)
func (*SlidersRepository) GetSliderByTitle ¶
func (*SlidersRepository) GetSliders ¶
func (*SlidersRepository) InnerDB ¶
func (r *SlidersRepository) InnerDB() *sqlx.DB
func (*SlidersRepository) Ping ¶
func (r *SlidersRepository) Ping() error
type SlidersRepositoryInterface ¶
type SlidersRepositoryInterface interface { InnerDB() *sqlx.DB Ping() error Create(ctx context.Context, sliderMap map[string]interface{}) error Update(ctx context.Context, sliderMap map[string]interface{}) ([]*models.Slider, error) GetSliders(ctx context.Context) ([]*models.Slider, error) GetSliderByTitle(ctx context.Context, title string) (*models.Slider, error) GetSliderByID(ctx context.Context, id int64) (*models.Slider, error) GetSliderByProvider(ctx context.Context, provider string) (*models.PublicSlider, error) }
type User ¶
type User struct { Created strfmt.Date `db:"created"` Updated strfmt.Date `db:"updated"` Deleted strfmt.Date `db:"deleted"` PasswordResetToken *string `db:"password_reset_token"` PasswordResetExpires *int64 `db:"password_reset_expires"` RSASecret string `db:"rsa_secret"` Email string `db:"email"` Password string `db:"password"` Secret string `db:"secret"` UUID string `db:"uuid"` Username string `db:"username"` Address string `db:"address"` Nonce string `db:"nonce"` ID int64 `db:"id"` Enabled bool `db:"enabled"` }
type UsersRepository ¶
UsersRepository - repository to store users.
func NewUsersRepository ¶
func NewUsersRepository(db *sqlx.DB, tbl string) *UsersRepository
func (*UsersRepository) Create ¶
func (r *UsersRepository) Create(ctx context.Context, userMap map[string]interface{}) error
func (*UsersRepository) GetPublicUserByID ¶
func (r *UsersRepository) GetPublicUserByID(ctx context.Context, id int64) (*models.PublicUser, error)
func (*UsersRepository) GetUserByAddress ¶
func (*UsersRepository) InnerDB ¶
func (r *UsersRepository) InnerDB() *sqlx.DB
func (*UsersRepository) Ping ¶
func (r *UsersRepository) Ping() error
type UsersRepositoryInterface ¶
type UsersRepositoryInterface interface { InnerDB() *sqlx.DB Ping() error Create(ctx context.Context, userMap map[string]interface{}) error GetOne(ctx context.Context, email string) (*User, error) GetPublicUserByID(ctx context.Context, id int64) (*models.PublicUser, error) GetUserByAddress(ctx context.Context, address string) (*User, error) }
UsersRepositoryInterface - interface to store users.
Click to show internal directories.
Click to hide internal directories.