api

package
v0.0.5-37 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAndUnmarshal

func MakeAndUnmarshal(suggesterContext core.SuggesterContext, spec *core.SuggesterSpec) (*recommendations.Recommender, error)

func MoreHandler

func MoreHandler(c *gin.Context)

func RecommendHandler

func RecommendHandler(c *gin.Context)

Recommend

func SetupRoutes

func SetupRoutes(router *gin.Engine)

func ViewsHandler

func ViewsHandler(c *gin.Context)

Types

type Collection

type Collection struct {
	Item
	City            string         `json:"city,omitempty"`
	ContentUnits    []*ContentUnit `json:"content_units,omitempty"`
	Country         string         `json:"country,omitempty"`
	DefaultLanguage string         `json:"default_language,omitempty"`
	EndDate         *utils.Date    `json:"end_date,omitempty"`
	FullAddress     string         `json:"full_address,omitempty"`
	Genres          []string       `json:"genres,omitempty"`
	HolidayID       string         `json:"holiday_id,omitempty"`
	Number          int            `json:"number,omitempty"`
	SourceID        string         `json:"source_id,omitempty"`
	StartDate       *utils.Date    `json:"start_date,omitempty"`
}

type ContentUnit

type ContentUnit struct {
	Item
	Collections      map[string]*Collection  `json:"collections,omitempty"`
	DerivedUnits     map[string]*ContentUnit `json:"derived_units,omitempty"`
	Duration         float64                 `json:"duration,omitempty"`
	Files            []*File                 `json:"files,omitempty"`
	NameInCollection string                  `json:"name_in_collection,omitempty"`
	OriginalLanguage string                  `json:"original_language,omitempty"`
	Publishers       []string                `json:"publishers,omitempty"`
	SourceUnits      map[string]*ContentUnit `json:"source_units,omitempty"`
	Sources          []string                `json:"sources,omitempty"`
	Tags             []string                `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

type File

type File struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Size      int64     `json:"size"`
	Duration  float64   `json:"duration,omitempty"`
	Language  string    `json:"language,omitempty"`
	MimeType  string    `json:"mimetype,omitempty"`
	Type      string    `json:"type,omitempty"`
	SubType   string    `json:"subtype,omitempty"`
	VideoSize string    `json:"video_size,omitempty"`
	CreatedAt time.Time `json:"-"`
}

type HttpError

type HttpError struct {
	Code int
	Err  error
	Type gin.ErrorType
}

func NewBadRequestError

func NewBadRequestError(err error) *HttpError

func NewHttpError

func NewHttpError(code int, err error, t gin.ErrorType) *HttpError

func NewInternalError

func NewInternalError(err error) *HttpError

func NewNotFoundError

func NewNotFoundError() *HttpError

func (HttpError) Abort

func (e HttpError) Abort(c *gin.Context)

func (HttpError) Error

func (e HttpError) Error() string

type Item

type Item struct {
	ID          string      `json:"id"`
	ContentType string      `json:"content_type"`
	Name        string      `json:"name,omitempty"`
	Description string      `json:"description,omitempty"`
	FilmDate    *utils.Date `json:"film_date,omitempty"`
	CreatedAt   time.Time   `json:"created_at,omitempty"`
}

type ItemInterface

type ItemInterface interface {
}

type ItemsRequest

type ItemsRequest struct {
	Offset int `json:"offset,omitempty" form:"offset" binding:"omitempty,min=0"`
}

type ItemsResponse

type ItemsResponse struct {
	Total int64         `json:"total"`
	Items []interface{} `json:"items"`
}

type MoreResponse

type MoreResponse struct {
	Feed  []core.ContentItem   `json:"feed"`
	Feeds [][]core.ContentItem `json:"feeds"`
}

More

type ViewsRequest

type ViewsRequest struct {
	Uids []string `json:"uids,omitempty" form:"uids,omitempty"`
}

Views

type ViewsResponse

type ViewsResponse struct {
	Views []int64 `json:"views,omitempty" form:"views,omitempty"`
}

Jump to

Keyboard shortcuts

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