Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TestChannelID1 - uuid of channel 1 for testing TestChannelID1 = uuid.MustParse("df1555f5-7046-4f7a-adcc-195b73949723") // TestChannelID2 - uuid of channel 2 for testing TestChannelID2 = uuid.MustParse("c4eba06b-1ab3-4367-93e1-da584b96fcc8") )
var ( // TestEventID1 - uuid of event 1 for testing TestEventID1 = uuid.MustParse("bff61adc-76d5-4beb-aab0-3ef11b337204") // TestEventID2 - uuid of event 2 for testing TestEventID2 = uuid.MustParse("4abb3a05-60a3-4be5-a6aa-323b9755e0b5") )
var ( TestRecording1ID = uuid.MustParse("542685cb-3693-e720-a957-f008f5dae3ee") TestRecording1IDLang1 = uuid.MustParse("03d33e6a-151f-47d9-be79-a726e0f9a859") TestRecording1IDFormat1 = uuid.MustParse("3a4f9157-65bf-4d15-a82b-1cd9295d07e0") )
var ( TestStreamID1 = uuid.MustParse("728edaf7-9ad9-f972-4d09-ba5940cd43f9") TestStream1IDLang1 = uuid.MustParse("acdf7eb1-0cb9-4900-a918-a411f9afc38d") TestStream1IDSpeaker1 = uuid.MustParse("0030a199-c771-489a-88a7-258f80db2bce") )
uuid of streams for testing
var ( // TestTagBuchvorstellungID - uuid for tag buchvorstellung TestTagBuchvorstellungID = uuid.MustParse("0bca0cf4-a9b9-46d7-821f-18c59c08fc1d") // TestTagDiskussionID - uuid for tag diskussion TestTagDiskussionID = uuid.MustParse("277026b0-b9d6-48d6-bfa1-96dcc7eb3451") // TestTagVortragID - uuid for tag vortrag TestTagVortragID = uuid.MustParse("7297a654-71f9-43be-8120-69b8152f01fc") // TestTagKonzertID - uuid for tag konzert TestTagKonzertID = uuid.MustParse("71082693-c58d-43b7-86ff-6b240c643a83") // TestTagAusstellungID - uuid for tag galerie TestTagAusstellungID = uuid.MustParse("87fb7f4b-1e5c-4c1b-8020-2860987da6bc") // TestTagInterviewID - uuid for tag interview TestTagInterviewID = uuid.MustParse("1aa3f441-4461-42da-a858-63abf5ee254c") )
var ( // TestUserID1 - uuid of initial user TestUserID1 = uuid.MustParse("88078ec0-2135-445f-bf05-632701c77695") TestUserID2 = uuid.MustParse("aca3f761-042b-4c7f-a8d1-82e972683adf") )
var (
TestRecording19ID = uuid.MustParse("bd2cb25e-6f17-453d-b947-370cd51beb18")
)
Test Recording for privat
var (
TestStreamID2 = uuid.MustParse("0801a547-59f1-4a63-946f-2ab03f62e6ee")
)
Testdata ID
Functions ¶
func SetupMigration ¶
SetupMigration - setup all data for migration
Types ¶
type Channel ¶
type Channel struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"df1555f5-7046-4f7a-adcc-195b73949723"` // attributes CommonName string `json:"common_name" gorm:"unique" example:"kukoon"` Title string `json:"title" example:"Im Kukoon"` Logo string `json:"logo" example:"https://media.kukoon.de/static/css/kukoon/logo.png"` Recordings []*Recording `json:"recordings,omitempty" gorm:"constraint:OnDelete:CASCADE" swaggerignore:"true"` Owners []User `json:"-" gorm:"many2many:user_channels;constraint:OnDelete:CASCADE"` }
Channel struct
type ConfigStream ¶
type ConfigStream struct { PosterURL string `config:"poster_url"` PreviewURL string `config:"preview_url"` }
func (*ConfigStream) GetPosterURL ¶
func (cs *ConfigStream) GetPosterURL(s *Stream) string
func (*ConfigStream) GetPreviewURL ¶
func (cs *ConfigStream) GetPreviewURL(s *Stream) string
type Event ¶
type Event struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"5f410ec2-8eb8-4afd-b1f1-5a76114cc53e"` OwnerID uuid.UUID `json:"-" gorm:"type:uuid"` // channel Owner Channel `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` Name string `json:"name"` Logo string `json:"logo,omitempty"` URL string `json:"url,omitempty"` Description string `json:"description,omitempty"` }
Event struct
type PublicStream ¶
type PublicStream struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"dffe2c0e-3713-4399-8ee2-279becbbb06e"` Channel Channel `json:"channel" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` ChannelID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_stream_channel"` Secret string `json:"-"` ListenAt time.Time `json:"-"` StartAt time.Time `json:"start_at" example:"2020-12-10T19:00:00.000000+01:00"` EndAt time.Time `json:"end_at" example:"2020-12-10T22:00:00.000000+01:00"` Chat bool `json:"chat"` Running bool `json:"running"` // attributes Poster string `` /* 147-byte string literal not displayed */ Preview string `` /* 149-byte string literal not displayed */ Lang *StreamLang `json:"lang" gorm:"foreignkey:StreamID"` EventID *uuid.UUID `json:"-" gorm:"type:uuid"` Event *Event `json:"event,omitempty"` Tags []*Tag `json:"tags,omitempty" gorm:"many2many:stream_tags"` Speakers []*Speaker `json:"speakers,omitempty" gorm:"many2many:stream_speakers"` }
PublicStream struct without secrets TODO maybe better in api model
func (PublicStream) TableName ¶
func (PublicStream) TableName() string
TableName of public stream struct (to fetch from same table then stream)
type Recording ¶
type Recording struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"dffe2c0e-3713-4399-8ee2-279becbbb06e"` CreatedAt time.Time `json:"created_at" example:"2020-12-10T19:00:00.000000+01:00"` UpdatedAt time.Time `json:"updated_at" example:"2020-12-10T22:00:00.000000+01:00"` Channel Channel `json:"channel" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` ChannelID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_recording_channel"` Formats []*RecordingFormat `json:"formats,omitempty" gorm:"constraint:OnDelete:CASCADE" swaggerignore:"true"` // attributes CommonName string `json:"common_name" gorm:"unique_index:idx_recording_channel" example:"2020-12-polizeigewalt"` Poster string `` /* 139-byte string literal not displayed */ Preview string `` /* 142-byte string literal not displayed */ Duration time.Duration `json:"duration" swaggertype:"primitive,integer"` Public bool `json:"public"` Listed bool `json:"listed"` Viewers uint64 `json:"viewers"` Lang *RecordingLang `json:"lang" gorm:"constraint:OnDelete:CASCADE"` Langs []*RecordingLang `json:"-" gorm:"constraint:OnDelete:CASCADE" swaggerignore:"true"` LangShorts []string `json:"lang_shorts,omitempty" gorm:"-"` EventID *uuid.UUID `json:"-" gorm:"type:uuid"` Event *Event `json:"event"` Tags []*Tag `json:"tags" gorm:"many2many:recording_tags;constraint:OnDelete:CASCADE"` Speakers []*Speaker `json:"speakers" gorm:"many2many:recording_speakers;constraint:OnDelete:CASCADE"` }
Recording struct
type RecordingFormat ¶
type RecordingFormat struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"3a4f9157-65bf-4d15-a82b-1cd9295d07e0"` Recording Recording `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` RecordingID uuid.UUID `json:"-" gorm:"type:uuid"` // attributes Lang string `json:"lang" gorm:"unique_index:idx_recording_lang" example:"de"` URL string `` /* 140-byte string literal not displayed */ Bytes int64 `json:"bytes"` //Quality 0: origin quality, 100: 4k, 140: 1440p, 150: 1080p, 160: 720p, 180: 480p. 200: 360p, 250: 240p, 300: 144p Quality int64 `json:"quality" example:"0"` IsVideo bool `json:"is_video" example:"true"` Resolution string `json:"resolution" example:"1920x1080"` }
RecordingFormat struct - for format
func (RecordingFormat) HasPermission ¶
HasPermission - has user permission on stream
type RecordingLang ¶
type RecordingLang struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"3a4f9157-65bf-4d15-a82b-1cd9295d07e0"` Recording Recording `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` RecordingID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_recording_lang"` // attributes Lang string `json:"lang" gorm:"unique_index:idx_recording_lang" example:"de"` Title string `json:"title" example:"Polizeigewalt – ein deutsches Problem"` Subtitle string `` /* 206-byte string literal not displayed */ Short string `` /* 189-byte string literal not displayed */ Long string `` /* 405-byte string literal not displayed */ }
RecordingLang struct - for i18n data of a
func (RecordingLang) HasPermission ¶
HasPermission - has user permission on stream
type Speaker ¶
type Speaker struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"b778369e-d44f-4d15-bf79-a9e8faec022d"` OwnerID uuid.UUID `json:"-" gorm:"type:uuid"` // channel Owner Channel `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` Name string `json:"name" example:"Dr. Jane Buoy"` Organisation string `json:"organisation,omitempty" example:"Kukoon"` }
Speaker struct
type Stream ¶
type Stream struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"dffe2c0e-3713-4399-8ee2-279becbbb06e"` Channel Channel `json:"channel" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` ChannelID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_stream_channel"` Secret string `json:"secret" example:"717897bf-198c-4f1b-bb4f-5a25cb197107"` ListenAt time.Time `json:"listen_at" example:"2020-12-10T00:00:00.000000+01:00"` StartAt time.Time `json:"start_at" example:"2020-12-10T19:00:00.000000+01:00"` EndAt time.Time `json:"end_at" example:"2020-12-10T22:00:00.000000+01:00"` Chat bool `json:"chat"` Running bool `json:"running"` // attributes CommonName string `json:"common_name" gorm:"unique_index:idx_stream_channel" example:"2020-12-polizeigewalt"` Poster string `` /* 139-byte string literal not displayed */ Preview string `` /* 142-byte string literal not displayed */ Lang *StreamLang `json:"lang" gorm:"constraint:OnDelete:CASCADE"` EventID *uuid.UUID `json:"-" gorm:"type:uuid"` Event *Event `json:"event,omitempty"` Tags []*Tag `json:"tags,omitempty" gorm:"many2many:stream_tags;constraint:OnDelete:CASCADE"` Speakers []*Speaker `json:"speakers,omitempty" gorm:"many2many:stream_speakers;constraint:OnDelete:CASCADE"` }
Stream struct
func (*Stream) GetPublic ¶
func (s *Stream) GetPublic(cs *ConfigStream) *PublicStream
func (Stream) HasPermission ¶
HasPermission - has user permission on stream
type StreamLang ¶
type StreamLang struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"3a4f9157-65bf-4d15-a82b-1cd9295d07e0"` CreatedAt time.Time `json:"created_at" example:"2020-12-10T19:00:00.000000+01:00"` UpdatedAt time.Time `json:"updated_at" example:"2020-12-10T22:00:00.000000+01:00"` Stream Stream `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` StreamID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_stream_lang"` // attributes Lang string `json:"lang" gorm:"unique_index:idx_stream_lang" example:"de"` Title string `json:"title" example:"Pushbacks, Internierung, Zugangshürden"` Subtitle string `json:"subtitle" example:"Zum Stand des europäischen Migrations- und Grenzregimes"` Short string `` /* 213-byte string literal not displayed */ Long string `` /* 206-byte string literal not displayed */ }
StreamLang struct - for i18n data of a stream
func (StreamLang) HasPermission ¶
HasPermission - has user permission on stream
type Tag ¶
type Tag struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"df1555f5-7046-4f7a-adcc-195b73949723"` Lang *TagLang `json:"lang"` }
Tag struct
type TagLang ¶
type TagLang struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"df1555f5-7046-4f7a-adcc-195b73949723"` Tag Tag `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` TagID uuid.UUID `json:"-" gorm:"type:uuid;unique_index:idx_tag_lang"` // attributes Lang string `json:"lang" gorm:"unique_index:idx_tag_lang" example:"de"` Name string `json:"name" example:"Buchvorstellung"` }
TagLang struct
type User ¶
type User struct { ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()" example:"88078ec0-2135-445f-bf05-632701c77695"` Username string `json:"username" gorm:"unique" example:"kukoon"` Password string `json:"-" example:"super secret password"` ForgetCode *uuid.UUID `json:"-" gorm:"forget_code;type:uuid"` Channels []Channel `json:"-" gorm:"many2many:user_channels;"` }
User struct
Source Files
¶
- channel.go
- event.go
- main.go
- recording.go
- recording_testdata01.go
- recording_testdata02.go
- recording_testdata03.go
- recording_testdata04.go
- recording_testdata05.go
- recording_testdata06.go
- recording_testdata07.go
- recording_testdata08.go
- recording_testdata09.go
- recording_testdata10.go
- recording_testdata11.go
- recording_testdata12.go
- recording_testdata13.go
- recording_testdata14.go
- recording_testdata15.go
- recording_testdata16.go
- recording_testdata17.go
- recording_testdata18.go
- recording_testdata19.go
- recording_testdata20.go
- recording_testdata21.go
- recording_testdata22.go
- speaker.go
- stream.go
- stream_config.go
- stream_testdata.go
- stream_testdata01.go
- stream_testdata02.go
- stream_testdata03.go
- stream_testdata04.go
- stream_testdata05.go
- stream_testdata06.go
- stream_testdata07.go
- stream_testdata08.go
- stream_testdata09.go
- stream_testdata10.go
- stream_testdata11.go
- stream_testdata12.go
- stream_testdata13.go
- stream_testdata14.go
- stream_testdata15.go
- stream_testdata16.go
- stream_testdata17.go
- stream_testdata18.go
- stream_testdata19.go
- stream_testdata20.go
- stream_testdata21.go
- stream_testdata22.go
- tag.go
- user.go