Documentation ¶
Index ¶
- Constants
- func AppEnv() string
- func CreateBlankFileToGCS(ctx context.Context, fileID string, fileEntity string, fileRequest FileRequest) (string, error)
- func CreateBlankFileToPublicGCS(ctx context.Context, fileID string, fileEntity string, fileRequest FileRequest) (string, error)
- func CreateFileToGCS(ctx context.Context, bucketName, filePath, contentType string, contents []byte) error
- func CreateTask(ctx context.Context, name string, eta time.Time, message string) (*taskspb.Task, error)
- func GetFileFromGCS(ctx context.Context, bucketName, filePath string) ([]byte, error)
- func GetGCSSignedURL(ctx context.Context, bucket string, key string, method string, ...) (string, error)
- func GetPublicBackgroundImageURL(id string) string
- func GetPublicBackgroundMusicURL(id string) string
- func LessonCompressingTaskName(lessonID int64, currentTime time.Time, requestID string) string
- func LocationID() string
- func MaterialBucketName() string
- func OriginURL() string
- func ProjectID() string
- func PublicBucketName() string
- func ServiceAccountID() string
- func ServiceAccountName() string
- func SetAppEnv(appEnv string) error
- func StorageObjectFilePath(entity string, id string, extension string) string
- type EntityBelongToFile
- type FileRequest
- type SignedURL
- type SignedURLs
- type StorageObjectRequest
Constants ¶
View Source
const CloudStorageURL string = "https://storage.googleapis.com/"
Variables ¶
This section is empty.
Functions ¶
func AppEnv ¶
func AppEnv() string
AppEnv returns application envirionment of 'staging', 'production'.
func CreateBlankFileToGCS ¶
func CreateFileToGCS ¶
func CreateFileToGCS(ctx context.Context, bucketName, filePath, contentType string, contents []byte) error
CreateFileToGCS creates object to GCS.
func CreateTask ¶
func GetFileFromGCS ¶
GetFileFromGCS gets object from GCS.
func GetGCSSignedURL ¶
func GetGCSSignedURL(ctx context.Context, bucket string, key string, method string, contentType string) (string, error)
GetGCSSignedURL generates signed-URL for GCS object.
func GetPublicBackgroundImageURL ¶
GetPublicBackgroundImageURL returns public image file URL in GCS.
func GetPublicBackgroundMusicURL ¶
GetPublicBackgroundMusicURL returns public audio file URL in GCS.
func LocationID ¶
func LocationID() string
func MaterialBucketName ¶
func MaterialBucketName() string
MaterialBucketName is return bucket name each environments.
func PublicBucketName ¶
func PublicBucketName() string
PublicBucketName is return public bucket name each environments.
func ServiceAccountName ¶
func ServiceAccountName() string
ServiceAccountName returns email address format of google service account.
Types ¶
type EntityBelongToFile ¶
type EntityBelongToFile struct {
UserID int64
}
type FileRequest ¶
type SignedURLs ¶
type SignedURLs struct {
SignedURLs []SignedURL `json:"signedURLs"`
}
type StorageObjectRequest ¶
type StorageObjectRequest struct { LessonID int64 `json:"lessonID"` FileRequests []FileRequest `json:"fileRequests"` }
Click to show internal directories.
Click to hide internal directories.