playlist

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApi

func NewApi(
	store Store,
	tabStore viewtab.Store,
	enforcer security.Enforcer,
	actionLogger logger.ActionLogger,
) common.CrudAPI

Types

type AggregationResult

type AggregationResult struct {
	Data       []Response `bson:"data" json:"data"`
	TotalCount int64      `bson:"total_count" json:"total_count"`
}

func (*AggregationResult) GetData

func (r *AggregationResult) GetData() interface{}

func (*AggregationResult) GetTotal

func (r *AggregationResult) GetTotal() int64

type EditRequest

type EditRequest struct {
	ID         string                    `json:"-"`
	Author     string                    `json:"author" swaggerignore:"true"`
	Name       string                    `json:"name" binding:"required,max=255"`
	Enabled    *bool                     `json:"enabled" binding:"required"`
	Fullscreen *bool                     `json:"fullscreen" binding:"required"`
	TabsList   []string                  `json:"tabs_list" binding:"required,notblank"`
	Interval   datetime.DurationWithUnit `json:"interval" binding:"required"`
}

type ListRequest

type ListRequest struct {
	pagination.FilteredQuery
	SortBy string   `json:"sort_by" form:"sort_by" binding:"oneoforempty=name enabled fullscreen"`
	Ids    []string `form:"-"`
}

type Playlist

type Playlist struct {
	ID         string                    `bson:"_id,omitempty" json:"_id"`
	Author     string                    `bson:"author" json:"author,omitempty"`
	Name       string                    `bson:"name" json:"name"`
	Enabled    bool                      `bson:"enabled" json:"enabled"`
	Fullscreen bool                      `bson:"fullscreen" json:"fullscreen"`
	TabsList   []string                  `bson:"tabs_list" json:"tabs_list"`
	Interval   datetime.DurationWithUnit `bson:"interval" json:"interval"`
	Created    datetime.CpsTime          `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"`
	Updated    datetime.CpsTime          `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"`
}

type Response

type Response struct {
	ID         string                    `bson:"_id,omitempty" json:"_id"`
	Author     *author.Author            `bson:"author" json:"author,omitempty"`
	Name       string                    `bson:"name" json:"name"`
	Enabled    bool                      `bson:"enabled" json:"enabled"`
	Fullscreen bool                      `bson:"fullscreen" json:"fullscreen"`
	TabsList   []string                  `bson:"tabs_list" json:"tabs_list"`
	Interval   datetime.DurationWithUnit `bson:"interval" json:"interval"`
	Created    datetime.CpsTime          `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"`
	Updated    datetime.CpsTime          `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"`
}

type Store

type Store interface {
	Find(ctx context.Context, r ListRequest) (*AggregationResult, error)
	GetById(ctx context.Context, id string) (*Response, error)
	Insert(ctx context.Context, userID string, r EditRequest) (*Response, error)
	Update(ctx context.Context, r EditRequest) (*Response, error)
	Delete(ctx context.Context, id string) (bool, error)
}

func NewStore

func NewStore(dbClient mongo.DbClient, authorProvider author.Provider) Store

Jump to

Keyboard shortcuts

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