-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package mappers | ||
|
||
import ( | ||
"github.com/twirapp/twir/apps/api-gql/internal/delivery/gql/gqlmodel" | ||
"github.com/twirapp/twir/apps/api-gql/internal/entity" | ||
) | ||
|
||
func RHVoiceTo(e entity.TTSRHVoice) gqlmodel.RHVoice { | ||
return gqlmodel.RHVoice{ | ||
Country: e.Country, | ||
Gender: e.Gender, | ||
Lang: e.Lang, | ||
Name: e.Name, | ||
Code: e.Code, | ||
} | ||
} |
204 changes: 204 additions & 0 deletions
204
apps/api-gql/internal/delivery/gql/resolvers/overlays-tts.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
|
||
"github.com/99designs/gqlgen/graphql" | ||
) | ||
|
||
func MarshalBytes(b []byte) graphql.Marshaler { | ||
return graphql.WriterFunc( | ||
func(w io.Writer) { | ||
_, _ = fmt.Fprintf(w, "%q", string(b)) | ||
}, | ||
) | ||
} | ||
|
||
func UnmarshalBytes(v interface{}) ([]byte, error) { | ||
switch v := v.(type) { | ||
case string: | ||
return []byte(v), nil | ||
case *string: | ||
return []byte(*v), nil | ||
case []byte: | ||
return v, nil | ||
default: | ||
return nil, fmt.Errorf("%T is not []byte", v) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package entity | ||
|
||
type TTSRHVoice struct { | ||
Code string | ||
Country string | ||
Gender string | ||
Lang string | ||
Name string | ||
No int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package server | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/twirapp/twir/apps/api-gql/internal/server/gincontext" | ||
) | ||
|
||
func SetHeader(ctx context.Context, key, value string) error { | ||
gin, err := gincontext.GetGinContext(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
gin.Header(key, value) | ||
|
||
return nil | ||
} |
Oops, something went wrong.