Documentation
¶
Index ¶
- Constants
- func GenerateUrlFromPath(baseUrl string, filePath string) string
- func GetFullPath(path string, name string) string
- func MD5BytesToString(bytes []byte) string
- func ObjectToUrl(baseUrl string, objAttrs *storage.ObjectAttrs) string
- type DownloadedFile
- type File
- type FileAttr
- type GCSConfig
- type GoGCSClient
- type GoGSCClient
- func (s GoGSCClient) DownloadFiles(downloads []DownloadedFile) error
- func (s GoGSCClient) FileAttrs(files []File) ([]FileAttr, error)
- func (s GoGSCClient) GenerateImageResizable(ctx context.Context, image string) (*string, error)
- func (s GoGSCClient) RemoveFiles(downloads []DownloadedFile) error
- func (s GoGSCClient) UploadFiles(files []File) ([]UploadedFile, error)
- func (s GoGSCClient) ValidAdultContent(body io.Reader, unAcceptLikelihoods []string) (bool, error)
- type UploadedFile
Constants ¶
View Source
const ( LikelihoodsUnKnown = "UNKNOWN" LikelihoodsVeryUnLikely = "VERY_UNLIKELY" LikelihoodsUnLikely = "UNLIKELY" LikelihoodsPossible = "POSSIBLE" LikelihoodsLikely = "LIKELY" LikelihoodsVeryLikely = "VERY_LIKELY" )
Variables ¶
This section is empty.
Functions ¶
func GenerateUrlFromPath ¶
func GetFullPath ¶
func MD5BytesToString ¶
func ObjectToUrl ¶
func ObjectToUrl(baseUrl string, objAttrs *storage.ObjectAttrs) string
Types ¶
type DownloadedFile ¶
type GCSConfig ¶
type GCSConfig struct { Bucket string `envconfig:"GCS_BUCKET" required:"true"` ProjectID string `envconfig:"GCS_PROJECT_ID" required:"true"` BaseUrl string `envconfig:"GCS_BASE_URL" required:"true"` }
func LoadGSCConfig ¶
func LoadGSCConfig() GCSConfig
type GoGCSClient ¶
type GoGCSClient interface { UploadFiles(files []File) ([]UploadedFile, error) DownloadFiles(downloads []DownloadedFile) error RemoveFiles(downloads []DownloadedFile) error GenerateImageResizable(ctx context.Context, image string) (*string, error) ValidAdultContent(body io.Reader, unAcceptLikelihoods []string) (bool, error) FileAttrs(files []File) ([]FileAttr, error) }
type GoGSCClient ¶
type GoGSCClient struct { StorageClient *storage.Client ImageAnnotatorClient *vision.ImageAnnotatorClient ProjectID string Bucket string BaseUrl string Context context.Context }
func NewGCSClient ¶
func NewGCSClient(ctx context.Context) (*GoGSCClient, error)
func (GoGSCClient) DownloadFiles ¶
func (s GoGSCClient) DownloadFiles(downloads []DownloadedFile) error
func (GoGSCClient) GenerateImageResizable ¶
func (GoGSCClient) RemoveFiles ¶
func (s GoGSCClient) RemoveFiles(downloads []DownloadedFile) error
func (GoGSCClient) UploadFiles ¶
func (s GoGSCClient) UploadFiles(files []File) ([]UploadedFile, error)
func (GoGSCClient) ValidAdultContent ¶
type UploadedFile ¶
Click to show internal directories.
Click to hide internal directories.