api

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Collection Types
	CT_DAILY_LESSON       = "DAILY_LESSON"
	CT_SPECIAL_LESSON     = "SPECIAL_LESSON"
	CT_FRIENDS_GATHERINGS = "FRIENDS_GATHERINGS"
	CT_CONGRESS           = "CONGRESS"
	CT_VIDEO_PROGRAM      = "VIDEO_PROGRAM"
	CT_LECTURE_SERIES     = "LECTURE_SERIES"
	CT_VIRTUAL_LESSONS    = "VIRTUAL_LESSONS"
	CT_CHILDREN_LESSONS   = "CHILDREN_LESSONS"
	CT_WOMEN_LESSONS      = "WOMEN_LESSONS"
	CT_MEALS              = "MEALS"
	CT_HOLIDAY            = "HOLIDAY"
	CT_PICNIC             = "PICNIC"
	CT_UNITY_DAY          = "UNITY_DAY"
	CT_CLIPS              = "CLIPS"
	CT_ARTICLES           = "ARTICLES"

	// Content Unit Types
	CT_LESSON_PART           = "LESSON_PART"
	CT_LECTURE               = "LECTURE"
	CT_VIRTUAL_LESSON        = "VIRTUAL_LESSON"
	CT_CHILDREN_LESSON       = "CHILDREN_LESSON"
	CT_WOMEN_LESSON          = "WOMEN_LESSON"
	CT_FRIENDS_GATHERING     = "FRIENDS_GATHERING"
	CT_MEAL                  = "MEAL"
	CT_VIDEO_PROGRAM_CHAPTER = "VIDEO_PROGRAM_CHAPTER"
	CT_FULL_LESSON           = "FULL_LESSON"
	CT_ARTICLE               = "ARTICLE"
	CT_EVENT_PART            = "EVENT_PART"
	CT_UNKNOWN               = "UNKNOWN"
	CT_CLIP                  = "CLIP"
	CT_TRAINING              = "TRAINING"
	CT_KITEI_MAKOR           = "KITEI_MAKOR"
	CT_PUBLICATION           = "PUBLICATION"

	// Operation Types
	OP_CAPTURE_START = "capture_start"
	OP_CAPTURE_STOP  = "capture_stop"
	OP_DEMUX         = "demux"
	OP_TRIM          = "trim"
	OP_SEND          = "send"
	OP_CONVERT       = "convert"
	OP_UPLOAD        = "upload"
	OP_IMPORT_KMEDIA = "import_kmedia"
	OP_SIRTUTIM      = "sirtutim"
	OP_INSERT        = "insert"
	OP_TRANSCODE     = "transcode"

	// Source Types
	SRC_COLLECTION = "COLLECTION"
	SRC_BOOK       = "BOOK"
	SRC_VOLUME     = "VOLUME"
	SRC_PART       = "PART"
	SRC_PARASHA    = "PARASHA"
	SRC_CHAPTER    = "CHAPTER"
	SRC_ARTICLE    = "ARTICLE"
	SRC_TITLE      = "TITLE"
	SRC_LETTER     = "LETTER"
	SRC_ITEM       = "ITEM"

	// Content Role types
	CR_LECTURER = "LECTURER"

	// Persons patterns
	P_RAV = "rav"

	// Security levels
	SEC_PUBLIC    = int16(0)
	SEC_SENSITIVE = int16(1)
	SEC_PRIVATE   = int16(2)

	// Languages
	LANG_ENGLISH    = "en"
	LANG_HEBREW     = "he"
	LANG_RUSSIAN    = "ru"
	LANG_SPANISH    = "es"
	LANG_ITALIAN    = "it"
	LANG_GERMAN     = "de"
	LANG_DUTCH      = "nl"
	LANG_FRENCH     = "fr"
	LANG_PORTUGUESE = "pt"
	LANG_TURKISH    = "tr"
	LANG_POLISH     = "pl"
	LANG_ARABIC     = "ar"
	LANG_HUNGARIAN  = "hu"
	LANG_FINNISH    = "fi"
	LANG_LITHUANIAN = "lt"
	LANG_JAPANESE   = "ja"
	LANG_BULGARIAN  = "bg"
	LANG_GEORGIAN   = "ka"
	LANG_NORWEGIAN  = "no"
	LANG_SWEDISH    = "sv"
	LANG_CROATIAN   = "hr"
	LANG_CHINESE    = "zh"
	LANG_PERSIAN    = "fa"
	LANG_ROMANIAN   = "ro"
	LANG_HINDI      = "hi"
	LANG_UKRAINIAN  = "ua"
	LANG_MACEDONIAN = "mk"
	LANG_SLOVENIAN  = "sl"
	LANG_LATVIAN    = "lv"
	LANG_SLOVAK     = "sk"
	LANG_CZECH      = "cs"
	LANG_MULTI      = "zz"
	LANG_UNKNOWN    = "xx"
)
View Source
const (
	DEFAULT_PAGE_SIZE = 50
	MAX_PAGE_SIZE     = 1000

	SEARCH_IN_FILES         = 1
	SEARCH_IN_CONTENT_UNITS = 2
	SEARCH_IN_COLLECTIONS   = 3
)
View Source
const AUTHORS_SOURCES_SQL = `` /* 514-byte string literal not displayed */
View Source
const FILES_TREE_WITH_OPERATIONS = `` /* 751-byte string literal not displayed */
View Source
const FILE_ANCESTORS_SQL = `` /* 181-byte string literal not displayed */
View Source
const SOURCE_HIERARCHY_SQL = `` /* 1182-byte string literal not displayed */

args: 0,1,3,4 language 2 roots clause, "parent_id is NULL", "id = 8392", etc... 5 depth (int)

View Source
const SOURCE_PATH_SQL = `` /* 169-byte string literal not displayed */
View Source
const TAG_HIERARCHY_SQL = `` /* 684-byte string literal not displayed */

args: 0,2 language 1 roots clause, "parent_id is NULL", "id = 8392", etc... 3 depth (int)

View Source
const TAG_PATH_SQL = `` /* 163-byte string literal not displayed */
View Source
const UPCHAIN_OPERATION_SQL = `` /* 592-byte string literal not displayed */

Variables

View Source
var (
	CONTENT_TYPE_REGISTRY      = &ContentTypeRegistry{}
	OPERATION_TYPE_REGISTRY    = &OperationTypeRegistry{}
	CONTENT_ROLE_TYPE_REGISTRY = &ContentRoleTypeRegistry{}
	PERSON_REGISTRY            = &PersonRegistry{}
	AUTHOR_REGISTRY            = &AuthorRegistry{}
	SOURCE_TYPE_REGISTRY       = &SourceTypeRegistry{}
	MEDIA_TYPE_REGISTRY        = &MediaTypeRegistry{}

	ALL_LANGS = []string{
		LANG_UNKNOWN, LANG_MULTI, LANG_ENGLISH, LANG_HEBREW, LANG_RUSSIAN, LANG_SPANISH, LANG_ITALIAN,
		LANG_GERMAN, LANG_DUTCH, LANG_FRENCH, LANG_PORTUGUESE, LANG_TURKISH, LANG_POLISH, LANG_ARABIC,
		LANG_HUNGARIAN, LANG_FINNISH, LANG_LITHUANIAN, LANG_JAPANESE, LANG_BULGARIAN, LANG_GEORGIAN,
		LANG_NORWEGIAN, LANG_SWEDISH, LANG_CROATIAN, LANG_CHINESE, LANG_PERSIAN, LANG_ROMANIAN, LANG_HINDI,
		LANG_MACEDONIAN, LANG_SLOVENIAN, LANG_LATVIAN, LANG_SLOVAK, LANG_CZECH, LANG_UKRAINIAN,
	}

	KNOWN_LANGS = regexp.MustCompile(strings.Join(ALL_LANGS, "|"))

	// kmedia - select concat('"',code3,'": "',locale,'",') from languages;
	LANG_MAP = map[string]string{
		"":    LANG_UNKNOWN,
		"MLT": LANG_MULTI,
		"ENG": LANG_ENGLISH,
		"HEB": LANG_HEBREW,
		"RUS": LANG_RUSSIAN,
		"SPA": LANG_SPANISH,
		"ITA": LANG_ITALIAN,
		"GER": LANG_GERMAN,
		"DUT": LANG_DUTCH,
		"FRE": LANG_FRENCH,
		"POR": LANG_PORTUGUESE,
		"TRK": LANG_TURKISH,
		"POL": LANG_POLISH,
		"ARB": LANG_ARABIC,
		"HUN": LANG_HUNGARIAN,
		"FIN": LANG_FINNISH,
		"LIT": LANG_LITHUANIAN,
		"JPN": LANG_JAPANESE,
		"BUL": LANG_BULGARIAN,
		"GEO": LANG_GEORGIAN,
		"NOR": LANG_NORWEGIAN,
		"SWE": LANG_SWEDISH,
		"HRV": LANG_CROATIAN,
		"CHN": LANG_CHINESE,
		"FAR": LANG_PERSIAN,
		"RON": LANG_ROMANIAN,
		"HIN": LANG_HINDI,
		"MKD": LANG_MACEDONIAN,
		"SLV": LANG_SLOVENIAN,
		"LAV": LANG_LATVIAN,
		"SLK": LANG_SLOVAK,
		"CZE": LANG_CZECH,
		"UKR": LANG_UKRAINIAN,
	}

	ALL_CONTENT_TYPES = []string{
		CT_DAILY_LESSON, CT_SPECIAL_LESSON, CT_FRIENDS_GATHERINGS, CT_CONGRESS, CT_VIDEO_PROGRAM,
		CT_LECTURE_SERIES, CT_VIRTUAL_LESSONS, CT_CHILDREN_LESSONS, CT_WOMEN_LESSONS, CT_MEALS, CT_HOLIDAY, CT_PICNIC,
		CT_UNITY_DAY, CT_CLIPS, CT_ARTICLES, CT_LESSON_PART, CT_LECTURE, CT_CHILDREN_LESSON, CT_WOMEN_LESSON,
		CT_VIRTUAL_LESSON, CT_FRIENDS_GATHERING, CT_MEAL, CT_VIDEO_PROGRAM_CHAPTER, CT_FULL_LESSON, CT_ARTICLE,
		CT_EVENT_PART, CT_UNKNOWN, CT_CLIP, CT_TRAINING, CT_KITEI_MAKOR, CT_PUBLICATION,
	}

	ALL_OPERATION_TYPES = []string{
		OP_CAPTURE_START, OP_CAPTURE_STOP, OP_DEMUX, OP_TRIM, OP_SEND, OP_CONVERT, OP_UPLOAD, OP_IMPORT_KMEDIA,
		OP_SIRTUTIM, OP_INSERT, OP_TRANSCODE,
	}

	// Types of various, secondary, content slots in big events like congress, unity day, etc...
	// This list is not part of content_types to prevent explosion of that list.
	// This came to life for mdb-cit UI only Ease of Use. (prevent typing errors and keep consistency)
	// We keep it here so CCU's would have some information.
	// This list should be kept in sync with mdb-cit (consts.js)
	MISC_EVENT_PART_TYPES = [8]string{
		"TEKES_PTIHA",
		"TEKES_SIYUM",
		"EREV_PATUAH",
		"EREV_TARBUT",
		"ATZAGAT_PROEKT",
		"HAANAKAT_TEUDOT",
		"HATIMAT_SFARIM",
		"EVENT",
	}

	// kmedia - select asset_type, count(*) from file_assets group by asset_type order by count(*) desc;
	ALL_MEDIA_TYPES = []*MediaType{
		{Extension: "mp4", Type: "video", SubType: "", MimeType: "video/mp4"},
		{Extension: "wmv", Type: "video", SubType: "", MimeType: "video/x-ms-wmv"},
		{Extension: "flv", Type: "video", SubType: "", MimeType: "video/x-flv"},
		{Extension: "mov", Type: "video", SubType: "", MimeType: "video/quicktime"},
		{Extension: "asf", Type: "video", SubType: "", MimeType: "video/x-ms-asf"},
		{Extension: "mpg", Type: "video", SubType: "", MimeType: "video/mpeg"},
		{Extension: "avi", Type: "video", SubType: "", MimeType: "video/x-msvideo"},
		{Extension: "mp3", Type: "audio", SubType: "", MimeType: "audio/mpeg"},
		{Extension: "wma", Type: "audio", SubType: "", MimeType: "audio/x-ms-wma"},
		{Extension: "mid", Type: "audio", SubType: "", MimeType: "audio/midi"},
		{Extension: "wav", Type: "audio", SubType: "", MimeType: "audio/x-wav"},
		{Extension: "aac", Type: "audio", SubType: "", MimeType: "audio/aac"},
		{Extension: "jpg", Type: "image", SubType: "", MimeType: "image/jpeg"},
		{Extension: "png", Type: "image", SubType: "", MimeType: "image/png"},
		{Extension: "gif", Type: "image", SubType: "", MimeType: "image/gif"},
		{Extension: "bmp", Type: "image", SubType: "", MimeType: "image/bmp"},
		{Extension: "tif", Type: "image", SubType: "", MimeType: "image/tiff"},
		{Extension: "zip", Type: "image", SubType: "", MimeType: "application/zip"},
		{Extension: "7z", Type: "image", SubType: "", MimeType: "application/x-7z-compressed"},
		{Extension: "rar", Type: "image", SubType: "", MimeType: "application/x-rar-compressed"},
		{Extension: "sfk", Type: "image", SubType: "", MimeType: ""},
		{Extension: "doc", Type: "text", SubType: "", MimeType: "application/msword"},
		{Extension: "docx", Type: "text", SubType: "", MimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
		{Extension: "htm", Type: "text", SubType: "", MimeType: "text/html"},
		{Extension: "html", Type: "text", SubType: "", MimeType: "text/html"},
		{Extension: "pdf", Type: "text", SubType: "", MimeType: "application/pdf"},
		{Extension: "epub", Type: "text", SubType: "", MimeType: "application/epub+zip"},
		{Extension: "rtf", Type: "text", SubType: "", MimeType: "text/rtf"},
		{Extension: "txt", Type: "text", SubType: "", MimeType: "text/plain"},
		{Extension: "fb2", Type: "text", SubType: "", MimeType: "text/xml"},
		{Extension: "rb", Type: "text", SubType: "", MimeType: "application/x-rocketbook"},
		{Extension: "xls", Type: "sheet", SubType: "", MimeType: "application/vnd.ms-excel"},
		{Extension: "swf", Type: "banner", SubType: "", MimeType: "application/x-shockwave-flash"},
		{Extension: "ppt", Type: "presentation", SubType: "", MimeType: "application/vnd.ms-powerpoint"},
		{Extension: "pptx", Type: "presentation", SubType: "", MimeType: "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
		{Extension: "pps", Type: "presentation", SubType: "", MimeType: "application/vnd.ms-powerpoint"},
	}
)
View Source
var CDescribers = map[string]CollectionDescriber{}
View Source
var CUDescribers = map[string]ContentUnitDescriber{
	CT_LESSON_PART:           new(LessonPartDescriber),
	CT_VIDEO_PROGRAM_CHAPTER: new(VideoProgramChapterDescriber),
	CT_MEAL:                  new(MealDescriber),
}
View Source
var I18n map[string]map[string]string
View Source
var TAGS_WITH_CONST_NAMES = [...]string{"lfq8P1du", "iWPWpSNy"}

Functions

func AuthorsHandler

func AuthorsHandler(c *gin.Context)

func CaptureStartHandler

func CaptureStartHandler(c *gin.Context)

Start capture of AV file, i.e. morning lesson, tv program, etc...

func CaptureStopHandler

func CaptureStopHandler(c *gin.Context)

Stop capture of AV file, ending a matching capture_start event. This is the first time a physical file is created in the studio.

func CollectionActivateHandler

func CollectionActivateHandler(c *gin.Context)

Toggle the active flag of a single container

func CollectionContentUnitsHandler

func CollectionContentUnitsHandler(c *gin.Context)

func CollectionHandler

func CollectionHandler(c *gin.Context)

func CollectionI18nHandler

func CollectionI18nHandler(c *gin.Context)

func CollectionsListHandler

func CollectionsListHandler(c *gin.Context)

func ContentUnitCollectionsHandler

func ContentUnitCollectionsHandler(c *gin.Context)

func ContentUnitDerivativesHandler

func ContentUnitDerivativesHandler(c *gin.Context)

func ContentUnitFilesHandler

func ContentUnitFilesHandler(c *gin.Context)

func ContentUnitHandler

func ContentUnitHandler(c *gin.Context)

func ContentUnitI18nHandler

func ContentUnitI18nHandler(c *gin.Context)

func ContentUnitOriginsHandler

func ContentUnitOriginsHandler(c *gin.Context)

func ContentUnitPersonsHandler

func ContentUnitPersonsHandler(c *gin.Context)

func ContentUnitPublishersHandler added in v0.9.2

func ContentUnitPublishersHandler(c *gin.Context)

func ContentUnitSourcesHandler

func ContentUnitSourcesHandler(c *gin.Context)

func ContentUnitTagsHandler

func ContentUnitTagsHandler(c *gin.Context)

func ContentUnitsListHandler

func ContentUnitsListHandler(c *gin.Context)

func ConvertHandler

func ConvertHandler(c *gin.Context)

Files converted to low resolution web formats, language splitting, etc...

func CreateCollection

func CreateCollection(exec boil.Executor, contentType string, properties map[string]interface{}) (*models.Collection, error)

func CreateContentUnit

func CreateContentUnit(exec boil.Executor, contentType string, properties map[string]interface{}) (*models.ContentUnit, error)

func CreateFile

func CreateFile(exec boil.Executor, parent *models.File, f File, properties map[string]interface{}) (*models.File, error)

func CreateOperation

func CreateOperation(exec boil.Executor, name string, o Operation, properties map[string]interface{}) (*models.Operation, error)

func DemuxHandler

func DemuxHandler(c *gin.Context)

Demux manifest file to original and low resolution proxy

func DescribeCollection

func DescribeCollection(exec boil.Executor, c *models.Collection) error

func DescribeContentUnit

func DescribeContentUnit(exec boil.Executor, cu *models.ContentUnit, metadata CITMetadata) error

func FileHandler

func FileHandler(c *gin.Context)

func FileStoragesHandler

func FileStoragesHandler(c *gin.Context)

func FilesListHandler

func FilesListHandler(c *gin.Context)

func FilesWithOperationsTreeHandler

func FilesWithOperationsTreeHandler(c *gin.Context)

func FindAuthorBySourceID

func FindAuthorBySourceID(exec boil.Executor, id int64) (*models.Author, error)

func FindCollectionByCaptureID

func FindCollectionByCaptureID(exec boil.Executor, cid interface{}) (*models.Collection, error)

func FindFileAncestors

func FindFileAncestors(exec boil.Executor, id int64) ([]*models.File, error)

func FindFileBySHA1

func FindFileBySHA1(exec boil.Executor, sha1 string) (*models.File, []byte, error)

func FindSourceByUID

func FindSourceByUID(exec boil.Executor, uid string) (*models.Source, error)

func FindSourcePath

func FindSourcePath(exec boil.Executor, id int64) ([]*models.Source, error)

func FindTagByUID

func FindTagByUID(exec boil.Executor, uid string) (*models.Tag, error)

func FindTagPath

func FindTagPath(exec boil.Executor, id int64) ([]*models.Tag, error)

func FindUpChainOperation

func FindUpChainOperation(exec boil.Executor, fileID int64, opType string) (*models.Operation, error)

func GetFreeUID

func GetFreeUID(exec boil.Executor, checker UIDChecker) (uid string, err error)

func GetI18ns

func GetI18ns(key string) (map[string]string, error)

func GetNextPositionInCollection

func GetNextPositionInCollection(exec boil.Executor, id int64) (position int, err error)

func InitTypeRegistries

func InitTypeRegistries(exec boil.Executor) error

func InsertHandler

func InsertHandler(c *gin.Context)

Insert new file to archive

func OperationFilesHandler

func OperationFilesHandler(c *gin.Context)

func OperationItemHandler

func OperationItemHandler(c *gin.Context)

func OperationsListHandler

func OperationsListHandler(c *gin.Context)

func PersonHandler

func PersonHandler(c *gin.Context)

func PersonI18nHandler

func PersonI18nHandler(c *gin.Context)

func PersonsListHandler

func PersonsListHandler(c *gin.Context)

func ProcessCITMetadata

func ProcessCITMetadata(exec boil.Executor, metadata CITMetadata, original, proxy *models.File) ([]events.Event, error)

Do all stuff for processing metadata coming from Content Identification Tool.

  1. Update properties for original and proxy (film_date, capture_date)
  2. Update language of original
  3. Create content_unit (content_type, dates)
  4. Describe content unit (i18ns)
  5. Add files to new unit
  6. Add ancestor files to unit
  7. Associate unit with sources, tags, and persons
  8. Get or create collection
  9. Update collection (content_type, dates, number) if full lesson or new lesson
  10. Associate collection and unit
  11. Associate unit and derived units
  12. Set default permissions ?!

func PublisherHandler added in v0.9.2

func PublisherHandler(c *gin.Context)

func PublisherI18nHandler added in v0.9.2

func PublisherI18nHandler(c *gin.Context)

func PublishersHandler

func PublishersHandler(c *gin.Context)

func SendHandler

func SendHandler(c *gin.Context)

Final files sent from studio

func SetupRoutes

func SetupRoutes(router *gin.Engine)

func SirtutimHandler

func SirtutimHandler(c *gin.Context)

Sirtutim archive file generated

func SourceHandler

func SourceHandler(c *gin.Context)

func SourceI18nHandler

func SourceI18nHandler(c *gin.Context)

func SourcesHandler

func SourcesHandler(c *gin.Context)

func SourcesHierarchyHandler

func SourcesHierarchyHandler(c *gin.Context)

func StdLang

func StdLang(lang string) string

Return standard language or LANG_UNKNOWN

if len(lang) = 2 we assume it's an MDB language code and check KNOWN_LANGS.
if len(lang) = 3 we assume it's a workflow / kmedia lang code and check LANG_MAP.

func StoragesHandler

func StoragesHandler(c *gin.Context)

func T

func T(key, language string) (string, error)

func TagHandler

func TagHandler(c *gin.Context)

func TagI18nHandler

func TagI18nHandler(c *gin.Context)

func TagsHandler

func TagsHandler(c *gin.Context)

func TagsHierarchyHandler

func TagsHierarchyHandler(c *gin.Context)

func TranscodeHandler

func TranscodeHandler(c *gin.Context)

A file in archive has been transcoded

func TrimHandler

func TrimHandler(c *gin.Context)

Trim demuxed files at certain points

func UpdateCollectionProperties

func UpdateCollectionProperties(exec boil.Executor, collection *models.Collection, props map[string]interface{}) error

func UpdateContentUnitProperties

func UpdateContentUnitProperties(exec boil.Executor, unit *models.ContentUnit, props map[string]interface{}) error

func UpdateFile

func UpdateFile(exec boil.Executor, obj *models.File, parent *models.File, f File, properties map[string]interface{}) error

func UpdateFileProperties

func UpdateFileProperties(exec boil.Executor, file *models.File, props map[string]interface{}) error

func UploadHandler

func UploadHandler(c *gin.Context)

File uploaded to a public accessible URL

Types

type AVFile

type AVFile struct {
	File
	Duration float64 `json:"duration"`
}

type Author

type Author struct {
	models.Author
	I18n    map[string]*models.AuthorI18n `json:"i18n"`
	Sources []*Source                     `json:"sources"`
}

type AuthorH

type AuthorH struct {
	Code     string      `json:"code"`
	Name     string      `json:"name"`
	FullName null.String `json:"full_name,omitempty"`
	Children []*SourceH  `json:"children,omitempty"`
}

type AuthorRegistry

type AuthorRegistry struct {
	ByCode map[string]*models.Author
}

func (*AuthorRegistry) Init

func (r *AuthorRegistry) Init(exec boil.Executor) error

type AuthorsResponse

type AuthorsResponse struct {
	ListResponse
	Authors []*Author `json:"data"`
}

type CITMetadata

type CITMetadata struct {
	ContentType    string            `json:"content_type" binding:"required"`
	CaptureDate    Date              `json:"capture_date" binding:"required"`
	FinalName      string            `json:"final_name" binding:"required,max=255"`
	Language       string            `json:"language" binding:"required,min=2,max=3"`
	Lecturer       string            `json:"lecturer" binding:"required"`
	AutoName       string            `json:"auto_name"`
	ManualName     string            `json:"manual_name"`
	WeekDate       *Date             `json:"week_date"`
	Number         null.Int          `json:"number"`
	Part           null.Int          `json:"part"`
	Sources        []string          `json:"sources" binding:"omitempty,dive,len=8"`
	Tags           []string          `json:"tags" binding:"omitempty,dive,len=8"`
	ArtifactType   null.String       `json:"artifact_type"`
	HasTranslation bool              `json:"has_translation"`
	RequireTest    bool              `json:"require_test"`
	CollectionUID  null.String       `json:"collection_uid" binding:"omitempty,len=8"`
	Episode        null.String       `json:"episode"`
	PartType       null.Int          `json:"part_type"`
	Major          *CITMetadataMajor `json:"major" binding:"omitempty"`
	LabelID        null.String       `json:"label_id"`
	FilmDate       *Date             `json:"film_date"`
}

type CITMetadataMajor

type CITMetadataMajor struct {
	Type string `json:"type" binding:"omitempty,eq=source|eq=tag"`
	Idx  int    `json:"idx" binding:"omitempty,gte=0"`
}

type CaptureStartRequest

type CaptureStartRequest struct {
	Operation
	FileName      string `json:"file_name" binding:"max=255"`
	CaptureSource string `json:"capture_source"`
	CollectionUID string `json:"collection_uid"`
}

type CaptureStopRequest

type CaptureStopRequest struct {
	Operation
	File
	CaptureSource string `json:"capture_source"`
	CollectionUID string `json:"collection_uid"`
	Part          string `json:"part"`
}

type Collection

type Collection struct {
	models.Collection
	I18n map[string]*models.CollectionI18n `json:"i18n"`
}

type CollectionContentUnit

type CollectionContentUnit struct {
	Collection  *Collection  `json:"collection,omitempty"`
	ContentUnit *ContentUnit `json:"content_unit,omitempty"`
	Name        string       `json:"name"`
	Position    int          `json:"position"`
}

type CollectionDescriber

type CollectionDescriber interface {
	DescribeCollection(*models.Collection) ([]*models.CollectionI18n, error)
}

type CollectionNotFound

type CollectionNotFound struct {
	CaptureID interface{}
}

func (CollectionNotFound) Error

func (x CollectionNotFound) Error() string

type CollectionUIDChecker

type CollectionUIDChecker struct{}

func (*CollectionUIDChecker) Check

func (c *CollectionUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type CollectionsResponse

type CollectionsResponse struct {
	ListResponse
	Collections []*Collection `json:"data"`
}

func NewCollectionsResponse

func NewCollectionsResponse() *CollectionsResponse

type ContentRoleTypeRegistry

type ContentRoleTypeRegistry struct {
	ByName map[string]*models.ContentRoleType
}

func (*ContentRoleTypeRegistry) Init

type ContentTypeRegistry

type ContentTypeRegistry struct {
	ByName map[string]*models.ContentType
	ByID   map[int64]*models.ContentType
}

func (*ContentTypeRegistry) Init

func (r *ContentTypeRegistry) Init(exec boil.Executor) error

type ContentTypesFilter

type ContentTypesFilter struct {
	ContentTypes []string `json:"content_types" form:"content_type" binding:"omitempty"`
}

type ContentUnit

type ContentUnit struct {
	models.ContentUnit
	I18n map[string]*models.ContentUnitI18n `json:"i18n"`
}

type ContentUnitDerivation

type ContentUnitDerivation struct {
	Source  *ContentUnit `json:"source,omitempty"`
	Derived *ContentUnit `json:"derived,omitempty"`
	Name    string       `json:"name"`
}

type ContentUnitDescriber

type ContentUnitDescriber interface {
	DescribeContentUnit(boil.Executor, *models.ContentUnit, CITMetadata) ([]*models.ContentUnitI18n, error)
}

func GetCUDescriber

func GetCUDescriber(exec boil.Executor, cu *models.ContentUnit, metadata CITMetadata) (ContentUnitDescriber, error)

type ContentUnitPerson

type ContentUnitPerson struct {
	ContentUnit *ContentUnit `json:"content_unit,omitempty"`
	Person      *Person      `json:"person,omitempty"`
	RoleID      int64        `json:"role_id,omitempty"`
}

type ContentUnitUIDChecker

type ContentUnitUIDChecker struct{}

func (*ContentUnitUIDChecker) Check

func (c *ContentUnitUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type ContentUnitsResponse

type ContentUnitsResponse struct {
	ListResponse
	ContentUnits []*ContentUnit `json:"data"`
}

func NewContentUnitsResponse

func NewContentUnitsResponse() *ContentUnitsResponse

type ConvertRequest

type ConvertRequest struct {
	Operation
	Sha1   string   `json:"sha1" binding:"required,len=40,hexadecimal"`
	Output []AVFile `json:"output"`
}

type CreateSourceRequest

type CreateSourceRequest struct {
	Source
	AuthorID null.Int64 `json:"author"`
}

type Date

type Date struct {
	time.Time
}

A time.Time like structure with date part only JSON marshalling

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) error

type DateRangeFilter

type DateRangeFilter struct {
	StartDate string `json:"start_date" form:"start_date" binding:"omitempty"`
	EndDate   string `json:"end_date" form:"end_date" binding:"omitempty"`
}

func (*DateRangeFilter) Range

func (drf *DateRangeFilter) Range() (time.Time, time.Time, error)

type DemuxRequest

type DemuxRequest struct {
	Operation
	Sha1          string `json:"sha1" binding:"required,len=40,hexadecimal"`
	Original      AVFile `json:"original"`
	Proxy         AVFile `json:"proxy"`
	CaptureSource string `json:"capture_source"`
}

type EventPartDescriber

type EventPartDescriber struct{}

func (EventPartDescriber) DescribeContentUnit

func (d EventPartDescriber) DescribeContentUnit(exec boil.Executor,
	cu *models.ContentUnit,
	metadata CITMetadata) ([]*models.ContentUnitI18n, error)

type File

type File struct {
	FileName  string     `json:"file_name" binding:"required,max=255"`
	Sha1      string     `json:"sha1" binding:"required,len=40,hexadecimal"`
	Size      int64      `json:"size" binding:"required"`
	CreatedAt *Timestamp `json:"created_at" binding:"required"`
	Type      string     `json:"type" binding:"max=16"`
	SubType   string     `json:"sub_type" binding:"max=16"`
	MimeType  string     `json:"mime_type" binding:"max=255"`
	Language  string     `json:"language" binding:"omitempty,min=2,max=3"`
}

type FileNotFound

type FileNotFound struct {
	Sha1 string
}

func (FileNotFound) Error

func (x FileNotFound) Error() string

type FilePublishedChangeImpact

type FilePublishedChangeImpact struct {
	ChangedContentUnit *models.ContentUnit
	ChangedCollections []*models.Collection
}

func PublishFile

func PublishFile(exec boil.Executor, file *models.File) (*FilePublishedChangeImpact, error)

func RemoveFile

func RemoveFile(exec boil.Executor, file *models.File) (*FilePublishedChangeImpact, error)

type FileUIDChecker

type FileUIDChecker struct{}

func (*FileUIDChecker) Check

func (c *FileUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type FilesResponse

type FilesResponse struct {
	ListResponse
	Files []*MFile `json:"data"`
}

func NewFilesResponse

func NewFilesResponse() *FilesResponse

type GenericDescriber

type GenericDescriber struct{}

func (GenericDescriber) DescribeCollection

func (d GenericDescriber) DescribeCollection(c *models.Collection) ([]*models.CollectionI18n, error)

func (GenericDescriber) DescribeContentUnit

func (d GenericDescriber) DescribeContentUnit(exec boil.Executor,
	cu *models.ContentUnit,
	metadata CITMetadata) ([]*models.ContentUnitI18n, error)

type HierarchyRequest

type HierarchyRequest struct {
	Language string `json:"language" form:"language" binding:"omitempty,len=2"`
	RootUID  string `json:"root" form:"root" binding:"omitempty,len=8"`
	Depth    int    `json:"depth" form:"depth"`
}

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 IDsFilter

type IDsFilter struct {
	IDs []int64 `json:"ids" form:"id" binding:"omitempty"`
}

type InsertRequest

type InsertRequest struct {
	Operation
	AVFile
	InsertType     string `json:"insert_type" binding:"required"`
	ContentUnitUID string `json:"content_unit_uid" binding:"required,len=8"`
	ParentSha1     string `json:"parent_sha1" binding:"omitempty,len=40,hexadecimal"`
	Mode           string `json:"mode" binding:"required"`
	OldSha1        string `json:"old_sha1" binding:"omitempty,len=40,hexadecimal"`
	PublisherUID   string `json:"publisher_uid" binding:"omitempty,len=8"`
}

type LessonPartDescriber

type LessonPartDescriber struct{}

func (LessonPartDescriber) DescribeContentUnit

func (d LessonPartDescriber) DescribeContentUnit(exec boil.Executor,
	cu *models.ContentUnit,
	metadata CITMetadata) ([]*models.ContentUnitI18n, error)

type LettersNamer

type LettersNamer struct {
	PrefaceNamer
}

func (LettersNamer) GetName

func (n LettersNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>. <leaf node in path - cleaned of (...) suffixes>

type ListRequest

type ListRequest struct {
	PageNumber int    `json:"page_no" form:"page_no" binding:"omitempty,min=1"`
	PageSize   int    `json:"page_size" form:"page_size" binding:"omitempty,min=1"`
	StartIndex int    `json:"start_index" form:"start_index" binding:"omitempty,min=1"`
	StopIndex  int    `json:"stop_index" form:"stop_index" binding:"omitempty,min=1"`
	OrderBy    string `json:"order_by" form:"order_by" binding:"omitempty"`
}

type ListResponse

type ListResponse struct {
	Total int64 `json:"total"`
}

type MFile

type MFile struct {
	models.File
	Sha1Str      string           `json:"sha1"`
	OperationIds types.Int64Array `json:"operations"`
}

Marshalable File

func FindFileTreeWithOperations

func FindFileTreeWithOperations(exec boil.Executor, fileID int64) ([]*MFile, error)

func NewMFile

func NewMFile(f *models.File) *MFile

type MaybeFile

type MaybeFile struct {
	FileName  string     `json:"file_name" binding:"omitempty,max=255"`
	Sha1      string     `json:"sha1" binding:"omitempty,len=40,hexadecimal"`
	Size      int64      `json:"size" binding:"omitempty"`
	CreatedAt *Timestamp `json:"created_at" binding:"omitempty"`
	Type      string     `json:"type" binding:"max=16"`
	SubType   string     `json:"sub_type" binding:"max=16"`
	MimeType  string     `json:"mime_type" binding:"max=255"`
	Language  string     `json:"language" binding:"omitempty,min=2,max=3"`
}

same as File but all fields are optional

func (MaybeFile) AsFile

func (mf MaybeFile) AsFile() File

type MealDescriber

type MealDescriber struct{}

func (MealDescriber) DescribeContentUnit

func (d MealDescriber) DescribeContentUnit(exec boil.Executor,
	cu *models.ContentUnit,
	metadata CITMetadata) ([]*models.ContentUnitI18n, error)

type MediaType

type MediaType struct {
	Extension string
	Type      string
	SubType   string
	MimeType  string
}

type MediaTypeRegistry

type MediaTypeRegistry struct {
	ByExtension map[string]*MediaType
	ByMime      map[string]*MediaType
}

func (*MediaTypeRegistry) Init

func (r *MediaTypeRegistry) Init(exec boil.Executor) error

type MissingI18n

type MissingI18n struct {
	Key      string
	Language string
}

func (MissingI18n) Error

func (e MissingI18n) Error() string

type Operation

type Operation struct {
	Station    string `json:"station" binding:"required"`
	User       string `json:"user" binding:"required,email"`
	WorkflowID string `json:"workflow_id"`
}

type OperationHandler

type OperationHandler func(boil.Executor, interface{}) (*models.Operation, []events.Event, error)

type OperationTypeRegistry

type OperationTypeRegistry struct {
	ByName map[string]*models.OperationType
}

func (*OperationTypeRegistry) Init

func (r *OperationTypeRegistry) Init(exec boil.Executor) error

type OperationTypesFilter

type OperationTypesFilter struct {
	OperationTypes []string `json:"operation_types" form:"operation_type" binding:"omitempty"`
}

type OperationUIDChecker

type OperationUIDChecker struct{}

func (*OperationUIDChecker) Check

func (c *OperationUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type OperationsRequest

type OperationsRequest struct {
	ListRequest
	DateRangeFilter
	OperationTypesFilter
}

type OperationsResponse

type OperationsResponse struct {
	ListResponse
	Operations []*models.Operation `json:"data"`
}

func NewOperationsResponse

func NewOperationsResponse() *OperationsResponse

type PartialCollection

type PartialCollection struct {
	models.Collection
	Secure null.Int16 `json:"secure"`
}

type PartialContentUnit

type PartialContentUnit struct {
	models.ContentUnit
	Secure null.Int16 `json:"secure"`
}

type PartialFile

type PartialFile struct {
	models.File
	Type    null.String `json:"type,omitempty"`
	SubType null.String `json:"sub_type,omitempty"`
	Secure  null.Int16  `json:"secure"`
}

type PatternsFilter

type PatternsFilter struct {
	Patterns []string `json:"patterns" form:"pattern" binding:"omitempty"`
}

type Person

type Person struct {
	models.Person
	I18n map[string]*models.PersonI18n `json:"i18n"`
}

type PersonRegistry

type PersonRegistry struct {
	ByPattern map[string]*models.Person
}

func (*PersonRegistry) Init

func (r *PersonRegistry) Init(exec boil.Executor) error

type PersonUIDChecker

type PersonUIDChecker struct{}

func (*PersonUIDChecker) Check

func (c *PersonUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type PersonsRequest

type PersonsRequest struct {
	ListRequest
	IDsFilter
	UIDsFilter
	PatternsFilter
}

type PersonsResponse

type PersonsResponse struct {
	ListResponse
	Persons []*Person `json:"data"`
}

func NewPersonsResponse

func NewPersonsResponse() *PersonsResponse

type PlainNamer

type PlainNamer struct{}

func (PlainNamer) GetName

func (n PlainNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>, <path...>

type PrefaceNamer

type PrefaceNamer struct{}

func (PrefaceNamer) GetName

func (n PrefaceNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>. <leaf node in path>

type PublishedFilter

type PublishedFilter struct {
	Published string `json:"published" form:"published" binding:"omitempty"`
}

type Publisher

type Publisher struct {
	models.Publisher
	I18n map[string]*models.PublisherI18n `json:"i18n"`
}

type PublisherUIDChecker

type PublisherUIDChecker struct{}

func (*PublisherUIDChecker) Check

func (c *PublisherUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type PublishersRequest

type PublishersRequest struct {
	ListRequest
	IDsFilter
	UIDsFilter
	PatternsFilter
}

type PublishersResponse

type PublishersResponse struct {
	ListResponse
	Publishers []*Publisher `json:"data"`
}

func NewPublishersResponse

func NewPublishersResponse() *PublishersResponse

type RBArticlesNamer

type RBArticlesNamer struct{}

func (RBArticlesNamer) GetName

func (n RBArticlesNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>. <leaf.name>. <number (year)>

type RBRecordsNamer

type RBRecordsNamer struct{}

func (RBRecordsNamer) GetName

func (n RBRecordsNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>. Record <position>. <leaf node in path>

type Rename

type Rename struct {
	Sha1     string `json:"sha1" binding:"required,len=40,hexadecimal"`
	FileName string `json:"file_name" binding:"required,max=255"`
}

type SHA1sFilter

type SHA1sFilter struct {
	SHA1s []string `json:"sha1s" form:"sha1" binding:"omitempty"`
}

type SearchTermFilter

type SearchTermFilter struct {
	Query string `json:"query" form:"query" binding:"omitempty"`
}

type SecureFilter

type SecureFilter struct {
	Levels []int16 `json:"security_levels" form:"secure" binding:"omitempty"`
}

type SendRequest

type SendRequest struct {
	Operation
	Original Rename      `json:"original"`
	Proxy    Rename      `json:"proxy"`
	Metadata CITMetadata `json:"metadata"`
}

type ShamatiNamer

type ShamatiNamer struct{}

func (ShamatiNamer) GetName

func (n ShamatiNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<author>. path[0].name, <path[1]'s number (heb gimatria)>. path[1].name

type SirtutimRequest

type SirtutimRequest struct {
	Operation
	File
	OriginalSha1 string `json:"original_sha1" binding:"omitempty,len=40,hexadecimal"`
}

type Source

type Source struct {
	models.Source
	I18n map[string]*models.SourceI18n `json:"i18n"`
}

type SourceH

type SourceH struct {
	ID          int64       `json:"id"`
	UID         string      `json:"uid"`
	ParentID    null.Int64  `json:"parent_id"`
	Type        string      `json:"type"`
	Position    null.Int    `json:"position"`
	Pattern     null.String `json:"pattern,omitempty"`
	Name        null.String `json:"name"`
	Description null.String `json:"description,omitempty"`
	Children    []*SourceH  `json:"children,omitempty"`
}

type SourceTypeRegistry

type SourceTypeRegistry struct {
	ByName map[string]*models.SourceType
	ByID   map[int64]*models.SourceType
}

func (*SourceTypeRegistry) Init

func (r *SourceTypeRegistry) Init(exec boil.Executor) error

type SourceUIDChecker

type SourceUIDChecker struct{}

func (*SourceUIDChecker) Check

func (c *SourceUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type SourcesFilter

type SourcesFilter struct {
	Authors []string `json:"authors" form:"author" binding:"omitempty"`
	Sources []int64  `json:"sources" form:"source" binding:"omitempty"`
}

type SourcesHierarchyRequest

type SourcesHierarchyRequest struct {
	HierarchyRequest
}

type SourcesRequest

type SourcesRequest struct {
	ListRequest
}

type SourcesResponse

type SourcesResponse struct {
	ListResponse
	Sources []*Source `json:"data"`
}

func NewSourcesResponse

func NewSourcesResponse() *SourcesResponse

type Storage

type Storage struct {
	models.Storage
}

type StoragesRequest

type StoragesRequest struct {
	ListRequest
}

type StoragesResponse

type StoragesResponse struct {
	ListResponse
	Storages []*models.Storage `json:"data"`
}

func NewStoragesResponse

func NewStoragesResponse() *StoragesResponse

type Tag

type Tag struct {
	models.Tag
	I18n map[string]*models.TagI18n `json:"i18n"`
}

type TagH

type TagH struct {
	ID       int64       `json:"id"`
	UID      string      `json:"uid"`
	ParentID null.Int64  `json:"parent_id"`
	Pattern  null.String `json:"pattern,omitempty"`
	Label    null.String `json:"label"`
	Children []*TagH     `json:"children,omitempty"`
}

type TagUIDChecker

type TagUIDChecker struct{}

func (*TagUIDChecker) Check

func (c *TagUIDChecker) Check(exec boil.Executor, uid string) (exists bool, err error)

type TagsFilter

type TagsFilter struct {
	Tags []int64 `json:"tags" form:"tag" binding:"omitempty"`
}

type TagsHierarchyRequest

type TagsHierarchyRequest struct {
	HierarchyRequest
}

type TagsRequest

type TagsRequest struct {
	ListRequest
}

type TagsResponse

type TagsResponse struct {
	ListResponse
	Tags []*Tag `json:"data"`
}

func NewTagsResponse

func NewTagsResponse() *TagsResponse

type Timestamp

type Timestamp struct {
	time.Time
}

A time.Time like structure with Unix timestamp JSON marshalling

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

type TranscodeRequest

type TranscodeRequest struct {
	Operation
	MaybeFile
	OriginalSha1 string `json:"original_sha1" binding:"omitempty,len=40,hexadecimal"`
	Message      string `json:"message" binding:"omitempty"`
}

type TrimRequest

type TrimRequest struct {
	Operation
	OriginalSha1  string    `json:"original_sha1" binding:"required,len=40,hexadecimal"`
	ProxySha1     string    `json:"proxy_sha1" binding:"required,len=40,hexadecimal"`
	Original      AVFile    `json:"original"`
	Proxy         AVFile    `json:"proxy"`
	In            []float64 `json:"in"`
	Out           []float64 `json:"out"`
	CaptureSource string    `json:"capture_source"`
}

type TypeRegistry

type TypeRegistry interface {
	Init(exec boil.Executor) error
}

type UIDChecker

type UIDChecker interface {
	Check(exec boil.Executor, uid string) (exists bool, err error)
}

type UIDsFilter

type UIDsFilter struct {
	UIDs []string `json:"uids" form:"uid" binding:"omitempty"`
}

type UpChainOperationNotFound

type UpChainOperationNotFound struct {
	FileID int64
	// contains filtered or unexported fields
}

func (UpChainOperationNotFound) Error

func (x UpChainOperationNotFound) Error() string

type UploadRequest

type UploadRequest struct {
	Operation
	AVFile
	Url string `json:"url" binding:"required"`
}

type VideoProgramChapterDescriber

type VideoProgramChapterDescriber struct{}

func (VideoProgramChapterDescriber) DescribeContentUnit

func (d VideoProgramChapterDescriber) DescribeContentUnit(exec boil.Executor,
	cu *models.ContentUnit,
	metadata CITMetadata) ([]*models.ContentUnitI18n, error)

type ZoharNamer

type ZoharNamer struct{}

func (ZoharNamer) GetName

func (n ZoharNamer) GetName(author *models.Author, path []*models.Source) (map[string]string, error)

<path[0]>, <path[1].description>, <path[2:]>

Jump to

Keyboard shortcuts

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