Documentation ¶
Index ¶
- func GenerateRandomFileName() string
- func GetFileName(filename string) (string, error)
- type BillingClient
- type BillingClientConfig
- type BillingService
- func (s BillingService) CreateBudget(ctx context.Context) (*budgetspb.Budget, error)
- func (s BillingService) CreateOrUpdateBudget(ctx context.Context) (*budgetspb.Budget, error)
- func (s BillingService) EditBudget(ctx context.Context, budget *budgetspb.Budget) (*budgetspb.Budget, error)
- func (s BillingService) GetBillingInfo() (*cloudbilling.ProjectBillingInfo, error)
- func (s BillingService) GetBudgetCreateUpdateRequest() *budgetspb.Budget
- func (s BillingService) GetExistingBudgetList(ctx context.Context) (*budgetspb.Budget, error)
- type BucketClient
- type BucketClientConfig
- type BudgetClient
- type BudgetClientConfig
- type StorageBucketService
- func (service StorageBucketService) GetImageUrl(ctx context.Context, image multipart.File, ...) (uploadedUrl string, err error)
- func (service StorageBucketService) RemoveObject(objectName string) error
- func (service StorageBucketService) UploadBinary(ctx context.Context, file []byte, fileName string) (string, error)
- func (service StorageBucketService) UploadFile(ctx context.Context, file io.Reader, fileName string) (string, error)
- func (service StorageBucketService) UploadThumbnailFile(ctx context.Context, file image.Image, fileName string, extension string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomFileName ¶
func GenerateRandomFileName() string
GenerateRandomFileName genrates the fileName with unique time
func GetFileName ¶
Types ¶
type BillingClient ¶
type BillingClient struct {
*cloudbilling.APIService
}
func NewGCPBillingClient ¶
func NewGCPBillingClient(config BillingClientConfig) BillingClient
NewGCPBillingClient creates a new gcp billing api client
type BillingClientConfig ¶
type BillingClientConfig struct { Logger billingClientLogger ClientOption *option.ClientOption }
type BillingService ¶
type BillingService struct { ProjectName string BillingAccountID string BudgetDisplayName string BudgetAmount int64 Logger billingServiceLogger GcpBilling BillingClient BudgetClient BudgetClient }
BillingService -> handles the gcp billing related functions
func NewGCPBillingService ¶
func NewGCPBillingService( configService BillingService, ) BillingService
NewGCPBillingService for the GCPBilling struct
func (BillingService) CreateBudget ¶
func (BillingService) CreateOrUpdateBudget ¶
func (BillingService) EditBudget ¶
func (BillingService) GetBillingInfo ¶
func (s BillingService) GetBillingInfo() (*cloudbilling.ProjectBillingInfo, error)
GetBillingInfo Get Billing info for certain date
func (BillingService) GetBudgetCreateUpdateRequest ¶
func (s BillingService) GetBudgetCreateUpdateRequest() *budgetspb.Budget
func (BillingService) GetExistingBudgetList ¶
GetExistingBudgetList Get Billing info for certain date
type BucketClient ¶
func NewGCPBucketClient ¶
func NewGCPBucketClient(config BucketClientConfig) BucketClient
NewGCPBucketClient creates a new gcp bucket api client
type BucketClientConfig ¶
type BucketClientConfig struct { Logger bucketClientLogger StorageBucketName string ClientOption *option.ClientOption }
type BudgetClient ¶
type BudgetClient struct {
*budgets.BudgetClient
}
func NewGCPBudgetClient ¶
func NewGCPBudgetClient(clientConfig BudgetClientConfig) BudgetClient
type BudgetClientConfig ¶
type BudgetClientConfig struct { Logger budgetClientLogger ClientOption *option.ClientOption }
type StorageBucketService ¶
type StorageBucketService struct { Client BucketClient Logger storageBucketLogger StorageBucketName string }
StorageBucketService the file upload/download functions
func NewStorageBucketService ¶
func NewStorageBucketService( client BucketClient, logger storageBucketLogger, storageBucketName string, ) StorageBucketService
NewStorageBucketService for the StorageBucketService struct
func (StorageBucketService) GetImageUrl ¶
func (service StorageBucketService) GetImageUrl( ctx context.Context, image multipart.File, imageFileHeader *multipart.FileHeader, ) (uploadedUrl string, err error)
func (StorageBucketService) RemoveObject ¶
func (service StorageBucketService) RemoveObject(objectName string) error
RemoveObject removes the file from the storage bucket
func (StorageBucketService) UploadBinary ¶
func (service StorageBucketService) UploadBinary( ctx context.Context, file []byte, fileName string, ) (string, error)
UploadBinary the binary to the cloud storage
func (StorageBucketService) UploadFile ¶
func (service StorageBucketService) UploadFile( ctx context.Context, file io.Reader, fileName string, ) (string, error)
UploadFile uploads the file to the cloud storage