Documentation ¶
Index ¶
- func CloudStorageVoiceFilePath(lessonID, voiceID int64, voiceFileKey string) string
- func Contains(s *[]string, e string) bool
- func CopyLessonThumbnail(ctx context.Context, id int64, currentStatus LessonStatus, ...) error
- func CreateAvatar(ctx context.Context, avatar *Avatar, user *User) error
- func CreateBackgroundMusic(ctx context.Context, userID int64, backgroundMusic *BackgroundMusic) error
- func CreateDeleteLessonOrderInTransaction(tx *datastore.Transaction, lessonID int64) error
- func CreateGraphics(ctx context.Context, userID int64, graphics []*Graphic) error
- func CreateInitialLessonMaterial(ctx context.Context, userID int64, avatarID int64, backgroundImageID int64, ...) (int64, error)
- func CreateIntroductionGraphics(ctx context.Context, userID int64, lessonID int64) error
- func CreateIntroductionLesson(ctx context.Context, user *User, lesson *Lesson) error
- func CreateLesson(ctx context.Context, lesson *Lesson) error
- func CreateLessonThumbnailBlankFile(ctx context.Context, id int64, isPublic bool) (string, error)
- func CreateSynthesisVoice(ctx context.Context, params *CreateSynthesisVoiceParam, voice Voice) error
- func CreateSynthesizedVoice(ctx context.Context, params *CreateSynthesisVoiceParam, ...) ([]byte, error)
- func CreateUserInTransaction(tx *datastore.Transaction, user *User) (*datastore.PendingKey, error)
- func CreateUserThumbnailBlankFile(ctx context.Context, id int64) (string, error)
- func CreateVoice(ctx context.Context, voice *Voice) error
- func DeleteGraphicByID(ctx context.Context, id int64, userID int64) error
- func DeleteLesson(ctx context.Context, id int64) error
- func DeleteLessonInTransaction(tx *datastore.Transaction, id int64) error
- func DeleteUser(ctx context.Context, id int64) error
- func GetGraphicSignedURL(ctx context.Context, graphic *Graphic) (string, error)
- func GetGraphicsByLessonID(ctx context.Context, lessonID int64, graphics *[]*Graphic) error
- func GetLessonMaterial(ctx context.Context, id int64, lessonID int64, lessonMaterial *LessonMaterial) error
- func GetVoices(ctx context.Context, lessonID int64, voices *[]Voice) error
- func IncrementLessonViewCount(ctx context.Context, lessonID int64) error
- func LessonViewCountKeyPrefix(currentTime time.Time) string
- func MergeJsonToStruct(jsonDiff *map[string]interface{}, origin interface{}, allowFields *[]string)
- func ProviderID(r *http.Request) (string, error)
- func ReserveUserProviderIDInTransaction(tx *datastore.Transaction, providerID string) error
- func SetLessonThumbnailURL(ctx context.Context, lesson *Lesson) error
- func TopLevelStructKeys(target interface{}) []string
- func UUIDWithoutHypen() (string, error)
- func UpdateLesson(ctx context.Context, lesson *Lesson) error
- func UpdateLessonAndMaterial(ctx context.Context, user *User, lesson *Lesson, needsCopyThumbnail bool, ...) error
- func UpdateLessonMaterial(ctx context.Context, id int64, lessonID int64, ...) error
- func UpdateUser(ctx context.Context, user *User) error
- func UpdateUserByJson(ctx context.Context, user *User, jsonBody *map[string]interface{}, ...) error
- func ValidTokenClaims(r *http.Request) (map[string]interface{}, error)
- type AuthErrorCode
- type Avatar
- func GetCurrentUsersAvatarByID(ctx context.Context, id int64, userID int64) (Avatar, error)
- func GetCurrentUsersAvatars(ctx context.Context, userID int64) ([]Avatar, error)
- func GetPublicAvatarByID(ctx context.Context, id int64) (Avatar, error)
- func GetPublicAvatars(ctx context.Context) ([]Avatar, error)
- type AvatarAnimation
- type AvatarConfig
- type AvatarErrorCode
- type AvatarRotation
- type BackgroundImage
- type BackgroundImageErrorCode
- type BackgroundMusic
- type Caption
- type Category
- type CategoryErrorCode
- type CreateSynthesisVoiceParam
- type DeleteOrder
- type DrawingAction
- type DrawingUnitAction
- type EmbeddingAction
- type Graphic
- type GraphicAction
- type GraphicErrorCode
- type Lesson
- type LessonAvatar
- type LessonDrawing
- type LessonDrawingStroke
- type LessonDrawingUnit
- type LessonEmbedding
- type LessonErrorCode
- type LessonGraphic
- type LessonMaterial
- type LessonMusic
- type LessonReference
- type LessonReview
- type LessonSpeech
- type LessonStatus
- type MusicAction
- type Position2D
- type PublicGraphic
- type ShortCategory
- type ShortLesson
- type Subject
- type User
- type UserErrorCode
- type UserProviderID
- type Voice
- type VoiceErrorCode
- type VoiceSynthesisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyLessonThumbnail ¶
func CopyLessonThumbnail(ctx context.Context, id int64, currentStatus LessonStatus, newStatus LessonStatus) error
func CreateAvatar ¶
CreateAvatar creates a new avatar belongs to user.
func CreateBackgroundMusic ¶
func CreateBackgroundMusic(ctx context.Context, userID int64, backgroundMusic *BackgroundMusic) error
func CreateDeleteLessonOrderInTransaction ¶
func CreateDeleteLessonOrderInTransaction(tx *datastore.Transaction, lessonID int64) error
func CreateGraphics ¶
func CreateSynthesisVoice ¶
func CreateSynthesisVoice(ctx context.Context, params *CreateSynthesisVoiceParam, voice Voice) error
CreateSynthesisVoice is creates new voice.
func CreateSynthesizedVoice ¶
func CreateUserInTransaction ¶
func CreateUserInTransaction(tx *datastore.Transaction, user *User) (*datastore.PendingKey, error)
CreateUserInTransaction creates new user.
func CreateUserThumbnailBlankFile ¶
CreateUserThumbnailBlankFile is create blank image file to public bucket.
func CreateVoice ¶
CreateVoice is creates new voice.
func DeleteLesson ¶
DeleteLessonは、idから同定したLessonを削除します。
func DeleteLessonInTransaction ¶
func DeleteLessonInTransaction(tx *datastore.Transaction, id int64) error
DeleteLessonInTransactionは、トランザクションでidから同定したLessonを削除します。
func GetGraphicSignedURL ¶
func GetGraphicsByLessonID ¶
func GetLessonMaterial ¶
func IncrementLessonViewCount ¶
IncrementLessonViewCountは、lessonIDのLessonのViewCountを1つ増分します。 増分は即座に行われず、Redisに格納されます。その後、定時バッチでLesson.ViewCountとUser.TotalLessonViewCountに反映されます。
func LessonViewCountKeyPrefix ¶
LessonViewCountKeyは、Redis内で使用されるLesson参照回数保持用のキーのプリフィックスをstringで返します。
func MergeJsonToStruct ¶
func ProviderID ¶
ProviderID is return user account provider and subject in JWT.
func ReserveUserProviderIDInTransaction ¶
func ReserveUserProviderIDInTransaction(tx *datastore.Transaction, providerID string) error
ReserveUserProviderIDInTransaction creates user's ProviderID for exclusion control.
func TopLevelStructKeys ¶
func TopLevelStructKeys(target interface{}) []string
func UUIDWithoutHypen ¶
func UpdateLessonAndMaterial ¶
func UpdateLessonAndMaterial(ctx context.Context, user *User, lesson *Lesson, needsCopyThumbnail bool, requestID string, jsonBody *map[string]interface{}, lessonFields *[]string, lessonMaterialFields *[]string) error
UpdateLessonAndMaterialは、jsonのフィールドを既存のLesson/LessonMaterialへマージし、トランザクション中で二つのエンティティを更新します。 jsonのフィールド名がlessonFieldsまたはlessonMaterialFieldsに含まれない場合、そのフィールドは無視されます。
func UpdateLessonMaterial ¶
func UpdateUser ¶
UpdateUserは、受け取ったUserでエンティティを更新します。
Types ¶
type AuthErrorCode ¶
type AuthErrorCode uint
const ( TokenNotFound AuthErrorCode = 1 UnexpectedSigningMethod AuthErrorCode = 2 InvalidToken AuthErrorCode = 3 FailedDatastoreInitialize AuthErrorCode = 4 FailedGettingUser AuthErrorCode = 5 UserNotFound AuthErrorCode = 6 )
func (AuthErrorCode) Error ¶
func (e AuthErrorCode) Error() string
type Avatar ¶
type Avatar struct { ID int64 `json:"id" datastore:"-"` Name string `json:"name"` URL string `json:"url"` Config AvatarConfig `json:"config"` Version int64 `json:"version"` IsPublic bool `json:"-"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Avatar is used for lesson.
func GetCurrentUsersAvatars ¶
GetCurrentUsersAvatars gets avatars belongs to user.
func GetPublicAvatarByID ¶
GetPublicAvatarByID gets avatar by id.
type AvatarAnimation ¶
type AvatarConfig ¶
type AvatarConfig struct { Scale float32 `json:"scale"` Positions []float32 `json:"positions"` InitialPoses []AvatarRotation `json:"initialPoses"` WalkingAnimations []AvatarAnimation `json:"walkingAnimations"` }
type AvatarErrorCode ¶
type AvatarErrorCode uint
const (
AvatarNotFound AvatarErrorCode = 1
)
func (AvatarErrorCode) Error ¶
func (e AvatarErrorCode) Error() string
type AvatarRotation ¶
type BackgroundImage ¶
type BackgroundImage struct { ID int64 `json:"id"` Name string `json:"name" datastore:",noindex"` URL string `json:"url" datastore:"-"` SortID int64 `json:"-"` }
BackgroundImage type is used in the class.
func GetAllBackgroundImages ¶
func GetAllBackgroundImages(ctx context.Context) ([]BackgroundImage, error)
GetAllBackgroundImagesはSortIDの照準でソートした全てのBackgroundImageを返します
func GetBackgroundImage ¶
func GetBackgroundImage(ctx context.Context) (BackgroundImage, error)
GetBackgroundImageは、ソートを行わずに一つだけBackGroundImageを返します
type BackgroundImageErrorCode ¶
type BackgroundImageErrorCode uint
const (
BackgroundImageNotFound BackgroundImageErrorCode = 1
)
func (BackgroundImageErrorCode) Error ¶
func (e BackgroundImageErrorCode) Error() string
type BackgroundMusic ¶
type BackgroundMusic struct { ID int64 `json:"id" datastore:"-"` Name string `json:"name" datastore:",noindex"` URL string `json:"url" datastore:"-"` SortID int64 `json:"-"` IsPublic bool `json:"-"` Created time.Time `json:"created"` }
BackgroundMusic type is used in the class.
func GetCurrentUsersBackgroundMusics ¶
func GetCurrentUsersBackgroundMusics(ctx context.Context, userID int64) ([]BackgroundMusic, error)
func GetPublicBackgroundMusics ¶
func GetPublicBackgroundMusics(ctx context.Context) ([]BackgroundMusic, error)
GetPublicBackgroundMusics is return sorted public musics.
type Category ¶
type Category struct { ID int64 `json:"id" datastore:"-"` SubjectID int64 `json:"subjectID"` SubjectName string `json:"subjectName" datastore:",noindex"` GroupName string `json:"groupName" datastore:",noindex"` Name string `json:"name" datastore:",noindex"` SortID int64 `json:"-"` }
Category of the class type.
type CategoryErrorCode ¶
type CategoryErrorCode uint
const (
CategoryNotFound CategoryErrorCode = 1
)
func (CategoryErrorCode) Error ¶
func (e CategoryErrorCode) Error() string
type CreateSynthesisVoiceParam ¶
type CreateSynthesisVoiceParam struct { LessonID int64 `json:"lessonID"` Text string `json:"text"` VoiceSynthesisConfig }
type DeleteOrder ¶
type DeleteOrder struct { ID int64 `datastore:"-"` EntityName string TargetID int64 `datastore:",noindex"` Created time.Time }
DeleteOrderはエンティティの削除予約を作成します。LessonまたはUserの関連エンティティの定時削除に使用されることを想定しています。
type DrawingAction ¶
type DrawingAction int8
const ( DrawingActionDraw DrawingAction = 0 DrawingActionClear DrawingAction = 1 DrawingActionShow DrawingAction = 2 DrawingActionHide DrawingAction = 3 )
func (DrawingAction) MarshalJSON ¶
func (r DrawingAction) MarshalJSON() ([]byte, error)
func (DrawingAction) String ¶
func (r DrawingAction) String() string
func (*DrawingAction) UnmarshalJSON ¶
func (a *DrawingAction) UnmarshalJSON(data []byte) error
type DrawingUnitAction ¶
type DrawingUnitAction int8
const ( DrawingUnitActionDraw DrawingUnitAction = 0 DrawingUnitActionUndo DrawingUnitAction = 1 )
func (DrawingUnitAction) MarshalJSON ¶
func (r DrawingUnitAction) MarshalJSON() ([]byte, error)
func (DrawingUnitAction) String ¶
func (r DrawingUnitAction) String() string
func (*DrawingUnitAction) UnmarshalJSON ¶
func (a *DrawingUnitAction) UnmarshalJSON(data []byte) error
type EmbeddingAction ¶
type EmbeddingAction int8
const ( EmbeddingActionShow EmbeddingAction = 0 EmbeddingActionHide EmbeddingAction = 1 )
func (EmbeddingAction) MarshalJSON ¶
func (r EmbeddingAction) MarshalJSON() ([]byte, error)
func (EmbeddingAction) String ¶
func (r EmbeddingAction) String() string
func (*EmbeddingAction) UnmarshalJSON ¶
func (a *EmbeddingAction) UnmarshalJSON(data []byte) error
type Graphic ¶
type Graphic struct { ID int64 `json:"id" datastore:"-"` PublicGraphicID int64 `json:"-" datastore:",noindex"` LessonID int64 `json:"lessonID"` FileType string `json:"fileType" datastore:",noindex"` URL string `json:"url" datastore:"-"` Created time.Time `json:"created"` }
Graphic is used for lesson.
func GetGraphicByID ¶
type GraphicAction ¶
type GraphicAction int8
const ( GraphicActionShow GraphicAction = 0 GraphicActionHide GraphicAction = 1 )
func (GraphicAction) MarshalJSON ¶
func (r GraphicAction) MarshalJSON() ([]byte, error)
func (GraphicAction) String ¶
func (r GraphicAction) String() string
func (*GraphicAction) UnmarshalJSON ¶
func (a *GraphicAction) UnmarshalJSON(data []byte) error
type GraphicErrorCode ¶
type GraphicErrorCode uint
const (
GraphicNotFound GraphicErrorCode = 1
)
func (GraphicErrorCode) Error ¶
func (e GraphicErrorCode) Error() string
type Lesson ¶
type Lesson struct { ID int64 `json:"id" datastore:"-"` UserID int64 `json:"userID"` Author User `json:"author" datastore:"-"` MaterialID int64 `json:"materialID"` AvatarID int64 `json:"avatarID" datastore:",noindex"` // 公開処理完了時にLessonMaterialの値で更新される AvatarLightColor string `json:"avatarLightColor" datastore:",noindex"` // 公開処理完了時にLessonMaterialの値で更新される Avatar Avatar `json:"avatar,omitempty" datastore:"-"` PrevLessonID int64 `json:"prevLessonID" datastore:",noindex"` PrevLessonTitle string `json:"prevLessonTitle" datastore:"-"` NextLessonID int64 `json:"nextLessonID" datastore:",noindex"` NextLessonTitle string `json:"nextLessonTitle" datastore:"-"` NeedsRecording bool `json:"needsRecording" datastore:",noindex"` // 収録画面での収録必要の有無 IsIntroduction bool `json:"isIntroduction"` // 自己紹介用の授業 HasThumbnail bool `json:"hasThumbnail" datastore:",noindex"` ThumbnailURL string `json:"thumbnailURL" datastore:"-"` SpeechURL string `json:"speechURL" datastore:"-"` BodyURL string `json:"bodyURL" datastore:"-"` Status LessonStatus `json:"status"` References []LessonReference `json:"references" datastore:",noindex"` Reviews []LessonReview `json:"reviews" datastore:",noindex"` SubjectID int64 `json:"subjectID"` SubjectName string `json:"subjectName" datastore:",noindex"` JapaneseCategoryID int64 `json:"japaneseCategoryID"` JapaneseCategoryName string `json:"japaneseCategoryName" datastore:",noindex"` Title string `json:"title"` Description string `json:"description"` DurationSec float32 `json:"durationSec" datastore:",noindex"` ViewCount int64 `json:"viewCount" datastore:",noindex"` ViewKey string `json:"viewKey" datastore:",noindex"` Version int32 `json:"version" datastore:",noindex"` Created time.Time `json:"created"` Updated time.Time `json:"updated" datastore:",noindex"` Published time.Time `json:"published"` // 公開処理完了時にLessonMaterialのUpdatedの値で更新される }
Lesson is the lesson infomation type.
func GetLessonsByUserID ¶
type LessonAvatar ¶
type LessonDrawing ¶
type LessonDrawing struct { ElapsedTime float32 `json:"elapsedTime"` DurationSec float32 `json:"durationSec"` Action DrawingAction `json:"action"` Units []LessonDrawingUnit `json:"units"` }
type LessonDrawingStroke ¶
type LessonDrawingStroke struct { Eraser bool `json:"eraser,omitempty"` Color string `json:"color,omitempty"` LineWidth int32 `json:"lineWidth,omitempty"` Positions []Position2D `json:"positions,omitempty"` }
type LessonDrawingUnit ¶
type LessonDrawingUnit struct { ElapsedTime float32 `json:"elapsedTime"` DurationSec float32 `json:"durationSec"` Action DrawingUnitAction `json:"action"` Stroke LessonDrawingStroke `json:"stroke"` }
type LessonEmbedding ¶
type LessonEmbedding struct { ElapsedTime float32 `json:"elapsedTime"` Action EmbeddingAction `json:"action"` ContentID string `json:"contentID"` StartAtSec int32 `json:"startAtSec"` ServiceName string `json:"serviceName"` }
type LessonErrorCode ¶
type LessonErrorCode uint
const (
AlreadyIntroductionExist LessonErrorCode = 1
)
func (LessonErrorCode) Error ¶
func (e LessonErrorCode) Error() string
type LessonGraphic ¶
type LessonGraphic struct { ElapsedTime float32 `json:"elapsedTime"` GraphicID int64 `json:"graphicID"` Action GraphicAction `json:"action"` }
type LessonMaterial ¶
type LessonMaterial struct { ID int64 `json:"id" datastore:"-"` UserID int64 `json:"userID"` AvatarID int64 `json:"avatarID"` Avatar Avatar `json:"avatar" datastore:"-"` AvatarLightColor string `json:"avatarLightColor" datastore:",noindex"` DurationSec float32 `json:"durationSec" datastore:",noindex"` BackgroundImageID int64 `json:"backgroundImageID"` BackgroundImageURL string `json:"backgroundImageURL" datastore:"-"` VoiceSynthesisConfig VoiceSynthesisConfig `json:"voiceSynthesisConfig" datastore:",noindex"` Avatars []LessonAvatar `json:"avatars" datastore:",noindex"` Graphics []LessonGraphic `json:"graphics" datastore:",noindex"` Drawings []LessonDrawing `json:"drawings" datastore:",noindex"` Embeddings []LessonEmbedding `json:"embeddings" datastore:",noindex"` Musics []LessonMusic `json:"musics" datastore:",noindex"` Speeches []LessonSpeech `json:"speeches" datastore:",noindex"` Created time.Time `json:"created" datastore:",noindex"` Updated time.Time `json:"updated" datastore:",noindex"` }
type LessonMusic ¶
type LessonReference ¶
LessonReference is link to another web page.
type LessonReview ¶
type LessonReview struct { ReviewerUserID int64 `json:"userID"` Comment string `json:"comment"` Created time.Time `json:"created"` }
LessonReview is review status of lesson by other users.
type LessonSpeech ¶
type LessonSpeech struct { ElapsedTime float32 `json:"elapsedTime"` DurationSec float32 `json:"durationSec"` VoiceID int64 `json:"voiceID"` VoiceFileKey string `json:"voiceFileKey"` Subtitle string `json:"subtitle"` Caption Caption `json:"caption"` IsSynthesis bool `json:"isSynthesis"` SynthesisConfig VoiceSynthesisConfig `json:"synthesisConfig"` }
type LessonStatus ¶
type LessonStatus int8
const ( LessonStatusDraft LessonStatus = 0 LessonStatusLimited LessonStatus = 1 LessonStatusPublic LessonStatus = 2 )
func (LessonStatus) MarshalJSON ¶
func (r LessonStatus) MarshalJSON() ([]byte, error)
func (LessonStatus) String ¶
func (r LessonStatus) String() string
func (*LessonStatus) UnmarshalJSON ¶
func (s *LessonStatus) UnmarshalJSON(data []byte) error
type MusicAction ¶
type MusicAction int8
const ( MusicActionStart MusicAction = 0 MusicActionStop MusicAction = 1 )
func (MusicAction) MarshalJSON ¶
func (r MusicAction) MarshalJSON() ([]byte, error)
func (MusicAction) String ¶
func (r MusicAction) String() string
func (*MusicAction) UnmarshalJSON ¶
func (a *MusicAction) UnmarshalJSON(data []byte) error
type Position2D ¶
type PublicGraphic ¶
type PublicGraphic struct { ID int64 `datastore:"-"` FileType string `datastore:",noindex"` ForIntroduction bool SortID int64 }
PublicGraphic is image entity used for introduction.
func GetPublicGraphicsForIntroduction ¶
func GetPublicGraphicsForIntroduction(ctx context.Context) ([]PublicGraphic, error)
type ShortCategory ¶
type ShortCategory struct { ID int64 `json:"id"` SubjectID int64 `json:"-"` SubjectName string `json:"-"` GroupName string `json:"groupName"` Name string `json:"name"` SortID int64 `json:"-"` }
func GetAllJapaneseCategories ¶
func GetAllJapaneseCategories(ctx context.Context) ([]ShortCategory, error)
GetAllJapaneseCategories is return all sorted categories.
func GetJapaneseCategories ¶
func GetJapaneseCategories(ctx context.Context, subjectID int64) ([]ShortCategory, error)
GetJapaneseCategories is return categories by the subject.
type ShortLesson ¶
type ShortLesson struct { ID int64 `json:"id" datastore:"-"` UserID int64 `json:"userID"` Title string `json:"title"` Description string `json:"description"` }
func GetLessonsByCategoryID ¶
type Subject ¶
type Subject struct { ID int64 `json:"id" datastore:"-"` Name string `json:"name" datastore:",noindex"` JapaneseName string `json:"japaneseName" datastore:",noindex"` SortID int64 `json:"-"` }
Subject of the class type.
func GetAllSubjects ¶
GetAllSubjects is return all sorted subjects.
type User ¶
type User struct { ID int64 `json:"id" datastore:"-"` ProviderID string `json:"-"` BackgroundImageID int64 `json:"-" datastore:",noindex"` BackgroundImageURL string `json:"backgroundImageURL" datastore:"-"` IntroductionID int64 `json:"introductionID" datastore:",noindex"` IsPublishedIntroduction bool `json:"isPublishedIntroduction" datastore:",noindex"` Name string `json:"name" datastore:",noindex"` Profile string `json:"profile" datastore:",noindex"` Email string `json:"email,omitempty" datastore:",noindex"` TotalLessonViewCount int64 `json:"totalLessonViewCount,omitempty" datastore:",noindex"` Created time.Time `json:"-"` Updated time.Time `json:"-" datastore:",noindex"` }
User is application registrated user
func GetCurrentUser ¶
GetCurrentUser returns user from valid token.
func GetUserByID ¶
GetUserByIDはidからユーザーを取得して返します。Emailは必ず空文字列になり、json出力時はフィールドごとなくなります。
type UserErrorCode ¶
type UserErrorCode uint
UserErrorCode is user error code.
const ( // AlreadyProviderIDExists is exists privider-id of user AlreadyProviderIDExists UserErrorCode = 1 )
func (UserErrorCode) Error ¶
func (e UserErrorCode) Error() string
type UserProviderID ¶
type UserProviderID struct {
ID int64 `datastore:"-"`
}
type Voice ¶
type Voice struct { ID int64 `json:"id" datastore:"-"` UserID int64 `json:"userID" datastore:",noindex"` LessonID int64 `json:"lessonID" datastore:",noindex"` FileKey string `json:"fileKey" datastore:",noindex"` ElapsedTime float32 `json:"elapsedTime" datastore:",noindex"` DurationSec float32 `json:"durationSec" datastore:",noindex"` Text string `json:"text" datastore:",noindex"` IsTexted bool `json:"isTexted" datastore:",noindex"` IsSynthesis bool `json:"-" datastore:",noindex"` Created time.Time `json:"created" datastore:",noindex"` Updated time.Time `json:"updated" datastore:",noindex"` }
Voice is used for lesson.
type VoiceErrorCode ¶
type VoiceErrorCode uint
const (
VoiceNotFound VoiceErrorCode = 1
)
func (VoiceErrorCode) Error ¶
func (e VoiceErrorCode) Error() string
type VoiceSynthesisConfig ¶
type VoiceSynthesisConfig struct { LanguageCode string `json:"languageCode"` // ja-JP/en-US Name string `json:"name"` // ja-JP-Wavenet-A~D/en-US-Wavenet-A~J SpeakingRate float64 `json:"speakingRate"` // 0.25 ~ 4.0 Pitch float64 `json:"pitch"` // -20.0 ~ 20.0 VolumeGainDb float64 `json:"volumeGainDb"` // -5.0 ~ 10.0 }
VoiceSynthesisConfig is synthesis voice settings. used from SynthesisVoice params and LessonSpeech. https://github.com/googleapis/go-genproto/blob/master/googleapis/cloud/texttospeech/v1beta1/cloud_tts.pb.go#L663