Documentation
¶
Index ¶
- Variables
- func CheckS3Ass(ctx context.Context, obj io.ReadSeeker, size int64) (karaberus_tools.DakaraCheckSubResultsOutput, error)
- func CheckS3Inst(ctx context.Context, obj io.ReadSeeker, size int64) karaberus_tools.DakaraCheckResultsOutput
- func CheckS3Video(ctx context.Context, obj io.ReadSeeker, size int64) karaberus_tools.DakaraCheckResultsOutput
- func CheckValidFiletype(type_directory string) bool
- func Closer(closer io.Closer)
- func ContentDispositionHeaderContent(kara KaraInfoDB, filetype string) string
- func CreateJwtForUser(ctx context.Context, sub string, expiresAt *time.Time, info *oidc.UserInfo) (*jwt.Token, string, error)
- func CreateTempFile(ctx context.Context, tempfile *UploadTempFile, reader io.Reader) error
- func CurrentArtists(tx *gorm.DB) *gorm.DB
- func CurrentKaras(tx *gorm.DB) *gorm.DB
- func CurrentMedias(tx *gorm.DB) *gorm.DB
- func DBErrToHumaErr(err error) error
- func Do(client *http.Client, req *http.Request) (*http.Response, error)
- func DownloadFile(ctx context.Context, input *DownloadInput) (*huma.StreamResponse, error)
- func DownloadFont(ctx context.Context, input *DownloadFontInput) (*huma.StreamResponse, error)
- func FileTypeExtension(filetype string) string
- func GetDB(ctx context.Context) *gorm.DB
- func GetFontObject(ctx context.Context, id uint) (*minio.Object, error)
- func GetKaraLyrics(ctx context.Context, kara KaraInfoDB) (string, error)
- func GetKaraObject(ctx context.Context, kara KaraInfoDB, filetype string) (*minio.Object, error)
- func GetObject(ctx context.Context, filename string) (*minio.Object, error)
- func MakeCli()
- func MugenDownload(ctx context.Context, tx *gorm.DB, mugen_import MugenImport)
- func PostWebhooks(kara KaraInfoDB)
- func RedownloadSubs(ctx context.Context) bool
- func RefreshMugen(ctx context.Context, input *RefreshMugenInput) (*struct{}, error)
- func RunKaraberus(app *fiber.App, api huma.API)
- func S256CodeChallenge(code_verifier string) string
- func SaveFontToS3(ctx context.Context, fd io.Reader, id uint, filesize int64) error
- func StartDakaraSync(ctx context.Context, input *struct{}) (*struct{}, error)
- func SyncDakara(ctx context.Context)
- func SyncDakaraLoop(ctx context.Context)
- func SyncDakaraNotify()
- func SyncMugen(ctx context.Context)
- func UploadHookGitlab(tx *gorm.DB, ki *KaraInfoDB) error
- func UploadToS3(ctx context.Context, file io.Reader, filename string, filesize int64, ...) error
- func UploadedKaras(db *gorm.DB) *gorm.DB
- func Warn(msg string)
- func WithAssociationsUpdate(tx *gorm.DB) *gorm.DB
- func WithNewKaraUpdate(tx *gorm.DB) *gorm.DB
- type APIToken
- type AdditionalName
- type AllArtistsInput
- type AllArtistsOutput
- type AllAuthorOutput
- type AllMediaTypesOutput
- type AllMediasInput
- type AllMediasOutput
- type AllTags
- type Artist
- type ArtistInfo
- type ArtistOutput
- func CreateArtist(ctx context.Context, input *CreateArtistInput) (*ArtistOutput, error)
- func FindArtist(ctx context.Context, input *FindArtistInput) (*ArtistOutput, error)
- func GetArtist(ctx context.Context, input *GetArtistInput) (*ArtistOutput, error)
- func UpdateArtist(ctx context.Context, input *UpdateArtistInput) (*ArtistOutput, error)
- type AudioTag
- type AudioTagDB
- type AudioTagsOutput
- type AuthorInfo
- type AuthorOutput
- func CreateAuthor(ctx context.Context, input *CreateAuthorInput) (*AuthorOutput, error)
- func FindAuthor(ctx context.Context, input *FindAuthorInput) (*AuthorOutput, error)
- func GetAuthor(ctx context.Context, input *GetAuthorInput) (*AuthorOutput, error)
- func UpdateAuthor(ctx context.Context, input *UpdateAuthorInput) (*AuthorOutput, error)
- type BasicAuthConfig
- type CheckKaraOutput
- func CheckKara(ctx context.Context, kara KaraInfoDB) (*CheckKaraOutput, error)
- func SaveFileToS3WithMetadata(ctx context.Context, tx *gorm.DB, fd io.Reader, kara *KaraInfoDB, ...) (*CheckKaraOutput, error)
- func SaveMugenResponseToS3(ctx context.Context, tx *gorm.DB, resp *http.Response, kara MugenImport, ...) (*CheckKaraOutput, error)
- func SaveTempFileToS3(ctx context.Context, tx *gorm.DB, tempfile UploadTempFile, kara *KaraInfoDB, ...) (*CheckKaraOutput, error)
- func SaveTempFileToS3WithMetadata(ctx context.Context, tx *gorm.DB, tempfile UploadTempFile, kara *KaraInfoDB, ...) (*CheckKaraOutput, error)
- type CheckS3FileOutput
- type CreateArtistInput
- type CreateAuthorInput
- type CreateKaraInput
- type CreateMediaInput
- type CreateTokenInput
- type CreateTokenOutput
- type DakaraArtist
- type DakaraArtistBody
- type DakaraGetArtistsResponse
- type DakaraGetSongsResponse
- type DakaraGetTagsResponse
- type DakaraGetWorkTypesResponse
- type DakaraGetWorksResponse
- type DakaraLyricsPreview
- type DakaraOutput
- type DakaraPaginatedResponse
- type DakaraPagination
- type DakaraSong
- type DakaraSongBody
- type DakaraSongWork
- type DakaraTag
- type DakaraTagBody
- type DakaraWork
- type DakaraWorkBody
- type DakaraWorkType
- type DakaraWorkTypeBody
- type DeleteArtistResponse
- type DeleteAuthorResponse
- type DeleteInput
- type DeleteKaraResponse
- type DeleteMediaResponse
- type DeleteMugenImportInput
- type DeleteMugenImportOutput
- type DeleteOutput
- type DeleteTokenInput
- type DeleteTokenOutput
- type DiscordEmbed
- type DiscordEmbedAuthor
- type DiscordWebhook
- type DownloadFontInput
- type DownloadHeadOutput
- type DownloadInput
- type Editor
- type FileSender
- type FindArtistInput
- type FindAuthorInput
- type FindMediaInput
- type Font
- type GetAllFontsOutput
- type GetAllKarasBody
- type GetAllKarasInput
- type GetAllKarasOutput
- type GetAllTokensOutput
- type GetArtistInput
- type GetAuthorInput
- type GetKaraHistoryOutput
- type GetKaraInput
- type GetMediaInput
- type GetMugenImportsOutput
- type GetUserInput
- type GetUserOutput
- type GitlabAuthCallbackInput
- type GitlabAuthCallbackOutput
- type GitlabAuthOutput
- type GitlabAuthorizationState
- type GitlabIssuesInput
- type GitlabIssuesResponse
- type HasName
- type ImportMugenKaraInput
- type ImportMugenKaraOutput
- type KaraInfo
- type KaraInfoDB
- func (ki *KaraInfoDB) AfterUpdate(tx *gorm.DB) error
- func (k KaraInfoDB) AudioFilename() string
- func (ki *KaraInfoDB) BeforeSave(tx *gorm.DB) error
- func (ki *KaraInfoDB) BeforeUpdate(tx *gorm.DB) error
- func (k KaraInfoDB) FriendlyName() string
- func (k KaraInfoDB) SubsFilename() string
- func (k KaraInfoDB) VideoFilename() string
- type KaraOutput
- type KaraberusAuthType
- type KaraberusAuthorization
- type KaraberusClaims
- type KaraberusConfig
- type KaraberusDBConfig
- type KaraberusDakaraConfig
- type KaraberusError
- type KaraberusInit
- type KaraberusListenConfig
- type KaraberusMugenConfig
- type KaraberusMugenGitlabConfig
- type KaraberusOIDCConfig
- type KaraberusS3Config
- type Media
- type MediaDB
- type MediaInfo
- type MediaOutput
- func CreateMedia(ctx context.Context, input *CreateMediaInput) (*MediaOutput, error)
- func FindMedia(ctx context.Context, input *FindMediaInput) (*MediaOutput, error)
- func GetMedia(ctx context.Context, input *GetMediaInput) (*MediaOutput, error)
- func UpdateMedia(ctx context.Context, input *UpdateMediaInput) (*MediaOutput, error)
- type MediaType
- type MugenExport
- type MugenExportInput
- type MugenExportOutput
- type MugenImport
- type NewKaraUpdate
- type OAuthToken
- type OAuthTokenResponse
- type RedownloadSubsKey
- type RefreshMugenInput
- type RouteSecurity
- type Scopes
- type SetKaraUploadTimeInput
- type TagInterface
- type TagType
- type TestedClient
- type TimingAuthor
- type TokenV2
- type UpdateArtistInput
- type UpdateAssociations
- type UpdateAuthorInput
- type UpdateKaraInput
- type UpdateMeAuthorInput
- type UpdateMeAuthorOutput
- type UpdateMediaInput
- type UpdateUserAuthorInput
- type UploadData
- type UploadFontInput
- type UploadFontInputDefinition
- type UploadFontOutput
- type UploadInfo
- type UploadInput
- type UploadInputDefinition
- type UploadOutput
- type UploadTempFile
- type User
- type VideoTag
- type VideoTagDB
- type VideoTagsOutput
- type Webhook
- type WebhookTemplateContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ANIMATION_MUGEN_TAG_ID = "0377db02-3af6-43b8-9b08-c759df3d25c3"
View Source
var ANIME_TYPE = getMediaType("ANIME")
View Source
var AudioTags = []AudioTag{ {ID: "OP", Name: "Opening", Hue: 280, MugenTags: []string{"f02ad9b3-0bd9-4aad-85b3-9976739ba0e4"}, HasSongOrder: true}, {ID: "ED", Name: "Ending", Hue: 280, MugenTags: []string{"38c77c56-2b95-4040-b676-0994a8cb0597"}, HasSongOrder: true}, {ID: "INS", Name: "Insert", Hue: 280, MugenTags: []string{"5e5250d9-351a-4a82-98eb-55db50ad8962"}, HasSongOrder: true}, {ID: "IS", Name: "Image Song", Hue: 280, MugenTags: []string{"10a1ad3e-a05c-4f5c-84b6-f491e3e3a92e"}, HasSongOrder: true}, {ID: "LIVE", Name: "Live performance", Hue: 240, MugenTags: []string{"a0167949-580c-4de3-bf13-497e462e02f3", "55ce3d79-dcc2-453c-b00a-60ce0c1eba1c"}}, {ID: "REMIX", Name: "Remix/Cover", Hue: 220, MugenTags: []string{"03e1e1d2-8641-47b7-bbcb-39a3df9ff21c", "188a5c46-63ff-4e9f-89e4-763468b6ea4a"}}, }
Audio tags
View Source
var BASIC_AUTH_PREFIX string = "Basic "
View Source
var CARTOON_TYPE = getMediaType("CARTOON")
View Source
var CONFIG = getKaraberusConfig()
View Source
var COVER_MUGEN_TAG_ID = "03e1e1d2-8641-47b7-bbcb-39a3df9ff21c"
View Source
var ErrUnknownUser error = errors.New("unknown user")
View Source
var GAME_TYPE = getMediaType("GAME")
View Source
var GitlabStates map[string]*GitlabAuthorizationState = map[string]*GitlabAuthorizationState{}
user ID to token state
View Source
var JWT_AUTH_PREFIX string = "JWT "
View Source
var LIVE_TYPE = getMediaType("LIVE")
View Source
var MediaTypes []MediaType = []MediaType{
{ID: "ANIME", Name: "Anime", IconName: "tv"},
{ID: "GAME", Name: "Game", IconName: "gamepad"},
{ID: "LIVE", Name: "Live action", IconName: "film"},
{ID: "CARTOON", Name: "Cartoon", IconName: "globe"},
}
Media types
View Source
var MugenDownloadSemaphore = semaphore.NewWeighted(5)
View Source
var S3_BEST_CLIENT *minio.Client
View Source
var STATE_CLOSED = "closed"
View Source
var VIDEO_GAME_MUGEN_TAG_ID = "dbedd6b3-d125-4cd8-aa32-c4175e4ca3a3"
View Source
var VideoTags = []VideoTag{ {ID: "FANMADE", Name: "Fanmade", Hue: 140, MugenTags: []string{"a6c79ce5-89ee-4d50-afe8-3abd7317f6c2"}}, {ID: "STREAM", Name: "Stream", Hue: 160, MugenTags: []string{"55ce3d79-dcc2-453c-b00a-60ce0c1eba1c"}}, {ID: "CONCERT", Name: "Concert", Hue: 260, MugenTags: []string{"a0167949-580c-4de3-bf13-497e462e02f3"}}, {ID: "AD", Name: "Advertisement", Hue: 120, MugenTags: []string{"2ddb5358-e674-46fa-a6e1-7f5c5d56f8fa"}}, {ID: "NSFW", Name: "Not Safe For Work", Hue: 0, MugenTags: []string{"e82ce681-6d7b-4fb6-abe4-daa8aaa9bbf9"}}, {ID: "SPOILER", Name: "Spoiler", Hue: 20, MugenTags: []string{"24371984-5e4c-4485-a937-fb0c480ca23b"}}, {ID: "EPILEPSY", Name: "Epilepsy", Hue: 0, MugenTags: []string{"51288600-29e0-4e41-a42b-77f0498e5691"}}, {ID: "MV", Name: "Music Video", Hue: 120, MugenTags: []string{"7be1b15c-cff8-4b37-a649-5c90f3d569a9"}}, }
Video tags
View Source
var WEST_MUGEN_TAG_ID = "efe171c0-e8a1-4d03-98c0-60ecf741ad52"
Functions ¶
func CheckS3Ass ¶
func CheckS3Ass(ctx context.Context, obj io.ReadSeeker, size int64) (karaberus_tools.DakaraCheckSubResultsOutput, error)
func CheckS3Inst ¶
func CheckS3Inst(ctx context.Context, obj io.ReadSeeker, size int64) karaberus_tools.DakaraCheckResultsOutput
func CheckS3Video ¶
func CheckS3Video(ctx context.Context, obj io.ReadSeeker, size int64) karaberus_tools.DakaraCheckResultsOutput
func CheckValidFiletype ¶
func ContentDispositionHeaderContent ¶
func ContentDispositionHeaderContent(kara KaraInfoDB, filetype string) string
func CreateJwtForUser ¶
func CreateTempFile ¶
func DBErrToHumaErr ¶
func DownloadFile ¶
func DownloadFile(ctx context.Context, input *DownloadInput) (*huma.StreamResponse, error)
func DownloadFont ¶
func DownloadFont(ctx context.Context, input *DownloadFontInput) (*huma.StreamResponse, error)
func FileTypeExtension ¶
func GetKaraLyrics ¶
func GetKaraLyrics(ctx context.Context, kara KaraInfoDB) (string, error)
func GetKaraObject ¶
func MugenDownload ¶
func MugenDownload(ctx context.Context, tx *gorm.DB, mugen_import MugenImport)
func PostWebhooks ¶
func PostWebhooks(kara KaraInfoDB)
func RedownloadSubs ¶
func RefreshMugen ¶
func RefreshMugen(ctx context.Context, input *RefreshMugenInput) (*struct{}, error)
func S256CodeChallenge ¶
func SaveFontToS3 ¶
func StartDakaraSync ¶
func SyncDakara ¶
func SyncDakaraLoop ¶
func UploadHookGitlab ¶
func UploadHookGitlab(tx *gorm.DB, ki *KaraInfoDB) error
func UploadToS3 ¶
Types ¶
type AdditionalName ¶
func (*AdditionalName) BeforeSave ¶
func (name *AdditionalName) BeforeSave(tx *gorm.DB) error
type AllArtistsInput ¶
type AllArtistsInput struct {
IfNoneMatch string `header:"If-None-Match"`
}
type AllArtistsOutput ¶
type AllArtistsOutput struct {
ETag string `header:"ETag"`
Status int
Body []Artist `json:"artists"`
}
func GetAllArtists ¶
func GetAllArtists(ctx context.Context, input *AllArtistsInput) (*AllArtistsOutput, error)
type AllAuthorOutput ¶
type AllAuthorOutput struct {
Body []TimingAuthor `json:"authors"`
}
func GetAllAuthors ¶
func GetAllAuthors(ctx context.Context, input *struct{}) (*AllAuthorOutput, error)
type AllMediaTypesOutput ¶
type AllMediaTypesOutput struct {
Body []MediaType `json:"media_types"`
}
func GetAllMediaTypes ¶
func GetAllMediaTypes(ctx context.Context, input *struct{}) (*AllMediaTypesOutput, error)
type AllMediasInput ¶
type AllMediasInput struct {
IfNoneMatch string `header:"If-None-Match"`
}
type AllMediasOutput ¶
type AllMediasOutput struct {
ETag string `header:"ETag"`
Status int
Body []MediaDB `json:"medias"`
}
func GetAllMedias ¶
func GetAllMedias(ctx context.Context, input *AllMediasInput) (*AllMediasOutput, error)
type AllTags ¶
type AllTags struct {
Authors []TimingAuthor
Artists []Artist
Video []VideoTagDB
Audio []AudioTagDB
Media []MediaDB
}
type Artist ¶
type ArtistInfo ¶
type ArtistOutput ¶
type ArtistOutput struct {
Body struct {
Artist Artist `json:"artist"`
}
}
func CreateArtist ¶
func CreateArtist(ctx context.Context, input *CreateArtistInput) (*ArtistOutput, error)
func FindArtist ¶
func FindArtist(ctx context.Context, input *FindArtistInput) (*ArtistOutput, error)
func GetArtist ¶
func GetArtist(ctx context.Context, input *GetArtistInput) (*ArtistOutput, error)
func UpdateArtist ¶
func UpdateArtist(ctx context.Context, input *UpdateArtistInput) (*ArtistOutput, error)
type AudioTagDB ¶
type AudioTagDB struct {
ID string
}
type AudioTagsOutput ¶
type AudioTagsOutput struct {
Body []AudioTag `json:"audio_tags"`
}
func GetAudioTags ¶
func GetAudioTags(ctx context.Context, input *struct{}) (*AudioTagsOutput, error)
type AuthorInfo ¶
type AuthorOutput ¶
type AuthorOutput struct {
Body struct {
Author TimingAuthor `json:"author"`
}
}
func CreateAuthor ¶
func CreateAuthor(ctx context.Context, input *CreateAuthorInput) (*AuthorOutput, error)
func FindAuthor ¶
func FindAuthor(ctx context.Context, input *FindAuthorInput) (*AuthorOutput, error)
func GetAuthor ¶
func GetAuthor(ctx context.Context, input *GetAuthorInput) (*AuthorOutput, error)
func UpdateAuthor ¶
func UpdateAuthor(ctx context.Context, input *UpdateAuthorInput) (*AuthorOutput, error)
type BasicAuthConfig ¶
type BasicAuthConfig struct {
Username string `envkey:"USERNAME"`
Password string `envkey:"PASSWORD"`
}
func (BasicAuthConfig) Token ¶
func (basic BasicAuthConfig) Token() string
type CheckKaraOutput ¶
type CheckKaraOutput struct {
Video *karaberus_tools.DakaraCheckResultsOutput
Instrumental *karaberus_tools.DakaraCheckResultsOutput
Subtitles *karaberus_tools.DakaraCheckSubResultsOutput
}
func CheckKara ¶
func CheckKara(ctx context.Context, kara KaraInfoDB) (*CheckKaraOutput, error)
func SaveMugenResponseToS3 ¶
func SaveTempFileToS3 ¶
func SaveTempFileToS3(ctx context.Context, tx *gorm.DB, tempfile UploadTempFile, kara *KaraInfoDB, type_directory string) (*CheckKaraOutput, error)
func SaveTempFileToS3WithMetadata ¶
func SaveTempFileToS3WithMetadata(ctx context.Context, tx *gorm.DB, tempfile UploadTempFile, kara *KaraInfoDB, type_directory string, user_metadata map[string]string) (*CheckKaraOutput, error)
type CheckS3FileOutput ¶
type CheckS3FileOutput struct {
Passed bool `json:"passed" example:"true" doc:"true if file passed all checks"`
}
type CreateArtistInput ¶
type CreateArtistInput struct {
Body ArtistInfo
}
type CreateAuthorInput ¶
type CreateAuthorInput struct {
Body AuthorInfo
}
type CreateKaraInput ¶
type CreateKaraInput struct {
Body KaraInfo
}
type CreateMediaInput ¶
type CreateMediaInput struct {
Body MediaInfo
}
type CreateTokenInput ¶
type CreateTokenOutput ¶
type CreateTokenOutput struct {
Body struct {
Token string `json:"token"`
}
}
func CreateToken ¶
func CreateToken(ctx context.Context, input *CreateTokenInput) (*CreateTokenOutput, error)
type DakaraArtist ¶
type DakaraArtist struct {
DakaraArtistBody
ID int `json:"id"`
SongCount int `json:"song_count"`
}
type DakaraArtistBody ¶
type DakaraArtistBody struct {
Name string `json:"name"`
}
type DakaraGetArtistsResponse ¶
type DakaraGetArtistsResponse struct {
DakaraPaginatedResponse
Results []DakaraArtist `json:"results"`
}
type DakaraGetSongsResponse ¶
type DakaraGetSongsResponse struct {
DakaraPaginatedResponse
Results []DakaraSong `json:"results"`
}
type DakaraGetTagsResponse ¶
type DakaraGetTagsResponse struct {
DakaraPaginatedResponse
Results []DakaraTag `json:"results"`
}
type DakaraGetWorkTypesResponse ¶
type DakaraGetWorkTypesResponse struct {
DakaraPaginatedResponse
Results []DakaraWorkType `json:"results"`
}
type DakaraGetWorksResponse ¶
type DakaraGetWorksResponse struct {
DakaraPaginatedResponse
Results []DakaraWork `json:"results"`
}
type DakaraLyricsPreview ¶
type DakaraOutput ¶
type DakaraPaginatedResponse ¶
type DakaraPaginatedResponse struct {
Pagination DakaraPagination `json:"pagination"`
Count int `json:"count" example:"99"`
}
type DakaraPagination ¶
type DakaraSong ¶
type DakaraSong struct {
ID int `json:"id"`
Title string `json:"title"`
Filename string `json:"filename"` // basically our ID
Duration int32 `json:"duration"`
Directory string `json:"directory"`
Version string `json:"version"`
Detail string `json:"detail"`
DetailVideo string `json:"detail_video"`
Tags []DakaraTag `json:"tags"`
Artists []DakaraArtist `json:"artists"`
Works []DakaraSongWork `json:"works"`
LyricsPreview DakaraLyricsPreview `json:"lyrics_preview"`
HasInstrumental bool `json:"has_instrumental"`
DateCreated time.Time `json:"date_created"`
DateUpdated time.Time `json:"date_updated"`
}
type DakaraSongBody ¶
type DakaraSongBody struct {
Title string `json:"title"`
Filename string `json:"filename"` // basically our ID
Duration int32 `json:"duration"`
Directory string `json:"directory"`
Version string `json:"version"`
Detail string `json:"detail"`
DetailVideo string `json:"detail_video"`
Tags []DakaraTag `json:"tags"`
Artists []DakaraArtist `json:"artists"`
Works []DakaraSongWork `json:"works"`
Lyrics string `json:"lyrics"`
HasInstrumental bool `json:"has_instrumental"`
}
func (DakaraSongBody) HasChanged ¶
func (body DakaraSongBody) HasChanged(ref DakaraSong) bool
type DakaraSongWork ¶
type DakaraSongWork struct {
Work DakaraWork `json:"work"`
LinkType string `json:"link_type"`
LinkTypeNumber *uint `json:"link_type_number"`
}
type DakaraTagBody ¶
type DakaraWork ¶
type DakaraWorkBody ¶
type DakaraWorkBody struct {
Title string `json:"title"`
WorkType DakaraWorkTypeBody `json:"work_type"`
}
type DakaraWorkType ¶
type DakaraWorkType struct {
DakaraWorkTypeBody
}
type DakaraWorkTypeBody ¶
type DeleteArtistResponse ¶
type DeleteArtistResponse struct {
Status int
}
func DeleteArtist ¶
func DeleteArtist(ctx context.Context, input *GetArtistInput) (*DeleteArtistResponse, error)
type DeleteAuthorResponse ¶
type DeleteAuthorResponse struct {
Status int
}
func DeleteAuthor ¶
func DeleteAuthor(ctx context.Context, input *GetArtistInput) (*DeleteAuthorResponse, error)
type DeleteInput ¶
type DeleteKaraResponse ¶
type DeleteKaraResponse struct {
Status int
}
func DeleteKara ¶
func DeleteKara(ctx context.Context, input *GetKaraInput) (*DeleteKaraResponse, error)
type DeleteMediaResponse ¶
type DeleteMediaResponse struct {
Status int
}
func DeleteMedia ¶
func DeleteMedia(ctx context.Context, input *GetMediaInput) (*DeleteMediaResponse, error)
type DeleteMugenImportInput ¶
type DeleteMugenImportOutput ¶
type DeleteMugenImportOutput struct {
Status int
}
func DeleteMugenImport ¶
func DeleteMugenImport(ctx context.Context, input *DeleteMugenImportInput) (*DeleteMugenImportOutput, error)
type DeleteOutput ¶
type DeleteOutput struct {
Body struct {
Deleted string `json:"deleted"`
}
}
func DeleteKaraFile ¶
func DeleteKaraFile(ctx context.Context, input *DownloadInput) (*DeleteOutput, error)
type DeleteTokenInput ¶
type DeleteTokenInput struct {
TokenID uint `path:"token"`
}
type DeleteTokenOutput ¶
type DeleteTokenOutput struct {
Body struct {
Message string `json:"message" example:"Token 123 deleted."`
}
}
func DeleteToken ¶
func DeleteToken(ctx context.Context, input *DeleteTokenInput) (*DeleteTokenOutput, error)
type DiscordEmbed ¶
type DiscordEmbed struct {
Author DiscordEmbedAuthor `json:"author,omitempty"`
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description"`
Color uint `json:"color"`
}
type DiscordEmbedAuthor ¶
type DiscordWebhook ¶
type DiscordWebhook struct {
Embeds []DiscordEmbed `json:"embeds"`
}
type DownloadFontInput ¶
type DownloadHeadOutput ¶
type DownloadHeadOutput struct {
AcceptRange string `header:"Accept-Range"`
ContentLength int64 `header:"Content-Length"`
ContentType string `header:"Content-Type"`
ContentDisposition string `header:"Content-Disposition"`
}
func DownloadHead ¶
func DownloadHead(ctx context.Context, input *DownloadInput) (*DownloadHeadOutput, error)
type DownloadInput ¶
type FileSender ¶
type FileSender struct {
// Reader should be already at the Range.Start location
Fd io.ReadCloser
Range httputils.Range
BytesRead uint64
}
func (*FileSender) Close ¶
func (f *FileSender) Close() error
type FindArtistInput ¶
type FindArtistInput struct {
Name string `query:"name"`
}
type FindAuthorInput ¶
type FindAuthorInput struct {
Name string `query:"name"`
}
type FindMediaInput ¶
type FindMediaInput struct {
Name string `query:"name"`
}
type GetAllFontsOutput ¶
type GetAllFontsOutput struct {
Body struct {
Fonts []Font
}
}
func GetAllFonts ¶
func GetAllFonts(ctx context.Context, input *struct{}) (*GetAllFontsOutput, error)
type GetAllKarasBody ¶
type GetAllKarasBody struct {
}
type GetAllKarasInput ¶
type GetAllKarasInput struct {
IfNoneMatch string `header:"If-None-Match"`
}
type GetAllKarasOutput ¶
type GetAllKarasOutput struct {
ETag string `header:"ETag"`
Status int
Body struct {
Karas []KaraInfoDB
}
}
func GetAllKaras ¶
func GetAllKaras(ctx context.Context, input *GetAllKarasInput) (*GetAllKarasOutput, error)
type GetAllTokensOutput ¶
type GetAllTokensOutput struct {
Body []APIToken
}
func GetAllUserTokens ¶
func GetAllUserTokens(ctx context.Context, input *struct{}) (*GetAllTokensOutput, error)
type GetArtistInput ¶
type GetArtistInput struct {
Id uint `path:"id" example:"1"`
}
type GetAuthorInput ¶
type GetAuthorInput struct {
Id uint `path:"id" example:"1"`
}
type GetKaraHistoryOutput ¶
type GetKaraHistoryOutput struct {
Body struct {
History []KaraInfoDB `json:"history"`
}
}
func GetKaraHistory ¶
func GetKaraHistory(ctx context.Context, input *GetKaraInput) (*GetKaraHistoryOutput, error)
type GetKaraInput ¶
type GetKaraInput struct {
Id uint `path:"id"`
}
type GetMediaInput ¶
type GetMediaInput struct {
Id uint `path:"id" example:"1"`
}
type GetMugenImportsOutput ¶
type GetMugenImportsOutput struct {
Body struct {
Imports []MugenImport `json:"imports"`
}
}
func GetMugenImports ¶
func GetMugenImports(ctx context.Context, input *struct{}) (*GetMugenImportsOutput, error)
type GetUserInput ¶
type GetUserInput struct {
ID string `path:"id"`
}
type GetUserOutput ¶
type GetUserOutput struct {
Body User
}
func GetUser ¶
func GetUser(ctx context.Context, input *GetUserInput) (*GetUserOutput, error)
type GitlabAuthCallbackInput ¶
type GitlabAuthCallbackOutput ¶
func GitlabCallback ¶
func GitlabCallback(ctx context.Context, input *GitlabAuthCallbackInput) (*GitlabAuthCallbackOutput, error)
type GitlabAuthOutput ¶
func GitlabAuth ¶
func GitlabAuth(ctx context.Context, _ *struct{}) (*GitlabAuthOutput, error)
type GitlabIssuesInput ¶
type GitlabIssuesResponse ¶
type ImportMugenKaraInput ¶
type ImportMugenKaraOutput ¶
type ImportMugenKaraOutput struct {
Status int
Body struct {
Import MugenImport `json:"import"`
}
}
func ImportMugenKara ¶
func ImportMugenKara(ctx context.Context, input *ImportMugenKaraInput) (*ImportMugenKaraOutput, error)
type KaraInfo ¶
type KaraInfo struct {
// Main name of the karaoke
Title string `json:"title" example:"Zankoku na Tenshi no These"`
// More names relating to this karaoke
ExtraTitles []string `json:"title_aliases" example:"[\"A Cruel Angel's Thesis\"]"`
// Karaoke authors
Authors []uint `json:"authors" example:"[1]"`
// Artists of the original song
Artists []uint `json:"artists" example:"[1]"`
// Name of the Media
SourceMedia uint `json:"source_media" example:"1"`
// Number of the track related to the media.
SongOrder uint `json:"song_order" example:"0"`
// Medias related to the karaoke
Medias []uint `json:"medias"`
// Audio tags
AudioTags []string `json:"audio_tags" example:"[\"Opening\"]"`
// Video tags
VideoTags []string `json:"video_tags" example:"[\"Opening\"]"`
// Generic comment
Comment string `json:"comment" example:"From https://youtu.be/dQw4w9WgXcQ"`
// Version (8-bit, Episode 12, ...)
Version string `json:"version" example:"iykyk"`
// Language (FR, EN, ...)
Language string `json:"language" example:"FR"`
KaraokeCreationDate *int64 `json:"karaoke_creation_time,omitempty" example:"42"`
IsHardsub *bool `json:"is_hardsub,omitempty" example:"false"`
Private bool `json:"private,omitempty" example:"false"`
}
type KaraInfoDB ¶
type KaraInfoDB struct {
gorm.Model
Authors []TimingAuthor `gorm:"many2many:kara_authors_tags"`
Artists []Artist `gorm:"many2many:kara_artist_tags"`
VideoTags []VideoTagDB `gorm:"many2many:kara_video_tags"`
AudioTags []AudioTagDB `gorm:"many2many:kara_audio_tags"`
SourceMediaID *uint
SourceMedia *MediaDB `gorm:"foreignKey:SourceMediaID;references:ID"`
Medias []MediaDB `gorm:"many2many:kara_media_tags"`
Title string
ExtraTitles []AdditionalName `gorm:"many2many:kara_info_additional_name"`
Private bool
Version string
Comment string
SongOrder uint
Language string
UploadInfo
// Can't be set by users
CurrentKaraInfoID *uint
CurrentKaraInfo *KaraInfoDB
Editor
}
func GetKaraByID ¶
func GetKaraByID(db *gorm.DB, kara_id uint) (KaraInfoDB, error)
func (*KaraInfoDB) AfterUpdate ¶
func (ki *KaraInfoDB) AfterUpdate(tx *gorm.DB) error
func (KaraInfoDB) AudioFilename ¶
func (k KaraInfoDB) AudioFilename() string
func (*KaraInfoDB) BeforeSave ¶
func (ki *KaraInfoDB) BeforeSave(tx *gorm.DB) error
func (*KaraInfoDB) BeforeUpdate ¶
func (ki *KaraInfoDB) BeforeUpdate(tx *gorm.DB) error
func (KaraInfoDB) FriendlyName ¶
func (k KaraInfoDB) FriendlyName() string
try not to go over 255 chars
func (KaraInfoDB) SubsFilename ¶
func (k KaraInfoDB) SubsFilename() string
func (KaraInfoDB) VideoFilename ¶
func (k KaraInfoDB) VideoFilename() string
type KaraOutput ¶
type KaraOutput struct {
Body struct {
Kara KaraInfoDB `json:"kara"`
}
}
func CreateKara ¶
func CreateKara(ctx context.Context, input *CreateKaraInput) (*KaraOutput, error)
func GetKara ¶
func GetKara(ctx context.Context, input *GetKaraInput) (*KaraOutput, error)
func UpdateKara ¶
func UpdateKara(ctx context.Context, input *UpdateKaraInput) (*KaraOutput, error)
type KaraberusAuthType ¶
type KaraberusAuthType string
var KaraberusBasicAuth KaraberusAuthType = "Basic"
var KaraberusBearerAuth KaraberusAuthType = "Bearer"
var KaraberusJWTAuth KaraberusAuthType = "Cookie"
type KaraberusAuthorization ¶
type KaraberusAuthorization struct {
Type KaraberusAuthType
Value string
}
type KaraberusClaims ¶
type KaraberusConfig ¶
type KaraberusConfig struct {
S3 KaraberusS3Config `env_prefix:"S3"`
OIDC KaraberusOIDCConfig `env_prefix:"OIDC"`
Listen KaraberusListenConfig `env_prefix:"LISTEN"`
DB KaraberusDBConfig `env_prefix:"DB"`
Dakara KaraberusDakaraConfig `env_prefix:"DAKARA"`
Mugen KaraberusMugenConfig `env_prefix:"MUGEN"`
UIDistDir string `envkey:"UI_DIST_DIR" default:"/usr/share/karaberus/ui_dist"`
Webhooks []string `envkey:"WEBHOOKS" separator:" " example:"discord=<url1> discord=<url2> json=<url3>"`
}
type KaraberusDBConfig ¶
type KaraberusDakaraConfig ¶
type KaraberusError ¶
type KaraberusError struct {
Message string
}
func (*KaraberusError) Error ¶
func (m *KaraberusError) Error() string
type KaraberusInit ¶
type KaraberusInit struct{}
type KaraberusListenConfig ¶
type KaraberusListenConfig struct {
Host string `envkey:"HOST" default:"127.0.0.1"`
Port int `envkey:"PORT" default:"8888"`
BaseURL string `envkey:"BASE_URL"`
Profiling bool `envkey:"PROFILING"`
}
func (KaraberusListenConfig) Addr ¶
func (c KaraberusListenConfig) Addr() string
type KaraberusMugenConfig ¶
type KaraberusMugenConfig struct {
Gitlab KaraberusMugenGitlabConfig `env_prefix:"GITLAB"`
BasicAuth BasicAuthConfig `env_prefix:"BASIC"`
}
type KaraberusMugenGitlabConfig ¶
type KaraberusMugenGitlabConfig struct {
Server string `envkey:"SERVER" default:"https://gitlab.com"`
ProjectID string `envkey:"PROJECT_ID"`
ClientID string `envkey:"CLIENT_ID"`
ClientSecret string `envkey:"CLIENT_SECRET"`
Scopes []string `envkey:"SCOPES" separator:" " default:"api"`
ImportTag string `envkey:"IMPORT_TAG" default:"Import Japan7"`
IssueLabels []string `envkey:"LABELS" separator:"," default:"To Add"`
}
func (KaraberusMugenGitlabConfig) IsSetup ¶
func (conf KaraberusMugenGitlabConfig) IsSetup() bool
type KaraberusOIDCConfig ¶
type KaraberusOIDCConfig struct {
Issuer string `envkey:"ISSUER"`
ClientID string `envkey:"CLIENT_ID"`
ClientSecret string `envkey:"CLIENT_SECRET"`
Scopes []string `envkey:"SCOPES" separator:" " default:"openid profile email groups"`
IDClaim string `envkey:"ID_CLAIM"`
GroupsClaim string `envkey:"GROUPS_CLAIM" default:"groups"`
AdminGroup string `envkey:"ADMIN_GROUP" default:"admin"`
JwtSignKey string `envkey:"JWT_SIGN_KEY"`
}
func (KaraberusOIDCConfig) Validate ¶
func (c KaraberusOIDCConfig) Validate() error
type KaraberusS3Config ¶
type MediaDB ¶
type MediaDB struct {
gorm.Model
Name string `` /* 138-byte string literal not displayed */
Type string `` /* 129-byte string literal not displayed */
AdditionalNames []AdditionalName `json:"additional_name" gorm:"many2many:media_additional_name"`
CurrentMediaID *uint
CurrentMedia *MediaDB
Editor
}
func (*MediaDB) Description ¶
type MediaOutput ¶
type MediaOutput struct {
Body struct {
Media MediaDB `json:"media"`
}
}
func CreateMedia ¶
func CreateMedia(ctx context.Context, input *CreateMediaInput) (*MediaOutput, error)
func FindMedia ¶
func FindMedia(ctx context.Context, input *FindMediaInput) (*MediaOutput, error)
func GetMedia ¶
func GetMedia(ctx context.Context, input *GetMediaInput) (*MediaOutput, error)
func UpdateMedia ¶
func UpdateMedia(ctx context.Context, input *UpdateMediaInput) (*MediaOutput, error)
type MugenExport ¶
type MugenExport struct {
KaraID uint `gorm:"primarykey" json:"kid"`
Kara KaraInfoDB `gorm:"foreignKey:KaraID;references:ID;constraint:OnDelete:CASCADE" json:"kara"`
GitlabIssue int `json:"gitlab_issue"`
GitlabIssueIID int `json:"gitlab_issue_iid"`
Closed bool `json:"closed"`
}
type MugenExportInput ¶
type MugenExportInput struct {
ID uint `path:"id"`
}
type MugenExportOutput ¶
type MugenExportOutput struct {
Body MugenExport
}
func MugenExportKara ¶
func MugenExportKara(ctx context.Context, input *MugenExportInput) (*MugenExportOutput, error)
type MugenImport ¶
type MugenImport struct {
MugenKID uuid.UUID `gorm:"primarykey"`
KaraID uint
Kara KaraInfoDB `gorm:"foreignKey:KaraID;references:ID;constraint:OnDelete:CASCADE"`
}
type NewKaraUpdate ¶
type NewKaraUpdate struct{}
type OAuthToken ¶
type OAuthTokenResponse ¶
type RedownloadSubsKey ¶
type RedownloadSubsKey struct{}
type RefreshMugenInput ¶
type RefreshMugenInput struct {
Body struct {
RedownloadSubs bool `json:"redownload_subs"`
}
}
type SetKaraUploadTimeInput ¶
type TagInterface ¶
type TagInterface interface {
// contains filtered or unexported methods
}
type TestedClient ¶
type TimingAuthor ¶
type TimingAuthor struct {
gorm.Model
Name string `gorm:"uniqueIndex:idx_timing_author_name"`
MugenID *uuid.UUID `gorm:"uniqueIndex:idx_timing_author_mugen_id"`
PublicName string
}
func GetAuthorById ¶
func GetAuthorById(tx *gorm.DB, Id uint) (*TimingAuthor, error)
func (*TimingAuthor) BeforeSave ¶
func (name *TimingAuthor) BeforeSave(tx *gorm.DB) error
type TokenV2 ¶
type TokenV2 struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
Token string `gorm:"uniqueIndex:idx_token" json:"token"`
UserID string `json:"user_id"`
User User `gorm:"foreignKey:UserID;references:ID" json:"user"`
Name string `json:"name"`
Scopes Scopes `gorm:"embedded" json:"scopes"`
}
type UpdateArtistInput ¶
type UpdateArtistInput struct {
Id uint `path:"id"`
Body ArtistInfo
}
type UpdateAssociations ¶
type UpdateAssociations struct{}
type UpdateAuthorInput ¶
type UpdateAuthorInput struct {
Id uint `path:"id"`
Body AuthorInfo
}
type UpdateKaraInput ¶
type UpdateMeAuthorInput ¶
type UpdateMeAuthorInput struct {
Body struct {
Id *uint `json:"id"`
}
}
type UpdateMeAuthorOutput ¶
type UpdateMeAuthorOutput struct {
Status int
}
func UpdateMeAuthor ¶
func UpdateMeAuthor(ctx context.Context, input *UpdateMeAuthorInput) (*UpdateMeAuthorOutput, error)
func UpdateUserAuthor ¶
func UpdateUserAuthor(ctx context.Context, input *UpdateUserAuthorInput) (*UpdateMeAuthorOutput, error)
type UpdateMediaInput ¶
type UpdateUserAuthorInput ¶
type UpdateUserAuthorInput struct {
ID string `path:"id"`
UpdateMeAuthorInput
}
type UploadData ¶
type UploadFontInput ¶
type UploadFontInput struct {
File UploadTempFile
}
type UploadFontInputDefinition ¶
type UploadFontInputDefinition struct {
RawBody huma.MultipartFormFiles[UploadData]
}
type UploadFontOutput ¶
type UploadFontOutput struct {
Body struct {
Font Font `json:"font"`
}
}
func UploadFont ¶
func UploadFont(ctx context.Context, input *UploadFontInput) (*UploadFontOutput, error)
type UploadInfo ¶
type UploadInfo struct {
VideoUploaded bool
VideoModTime time.Time
VideoSize int64
VideoCRC32 uint32
InstrumentalUploaded bool
InstrumentalModTime time.Time
InstrumentalSize int64
InstrumentalCRC32 uint32
SubtitlesUploaded bool
SubtitlesModTime time.Time
SubtitlesSize int64
SubtitlesCRC32 uint32
Hardsubbed bool
Duration int32
// date of the first upload of the sub file
KaraokeCreationTime time.Time
}
type UploadInput ¶
type UploadInput struct {
KID uint `path:"id" example:"1"`
FileType string `path:"filetype" enum:"video,sub,inst" example:"video"`
File UploadTempFile
}
type UploadInputDefinition ¶
type UploadInputDefinition struct {
KID uint `path:"id" example:"1"`
FileType string `path:"filetype" example:"video"`
RawBody huma.MultipartFormFiles[UploadData]
}
type UploadOutput ¶
type UploadOutput struct {
Body struct {
KID uint `json:"file_id" example:"1" doc:"karaoke ID"`
CheckResults CheckKaraOutput `json:"check_results"`
}
}
func UploadKaraFile ¶
func UploadKaraFile(ctx context.Context, input *UploadInput) (*UploadOutput, error)
type UploadTempFile ¶
type User ¶
type User struct {
ID string `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
Admin bool `json:"admin"`
TimingProfileID *uint `json:"timing_profile_id"`
TimingProfile *TimingAuthor `gorm:"foreignKey:TimingProfileID;references:ID" json:"timing_profile"`
}
Users
type VideoTagDB ¶
type VideoTagDB struct {
ID string
}
type VideoTagsOutput ¶
type VideoTagsOutput struct {
Body []VideoTag `json:"video_tags"`
}
func GetVideoTags ¶
func GetVideoTags(ctx context.Context, input *struct{}) (*VideoTagsOutput, error)
type WebhookTemplateContext ¶
type WebhookTemplateContext struct {
Kara KaraInfoDB
Server string
Title string
Description string
Resource string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.