gcs

package
v0.0.0-...-98df1b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileUploadResponse

type FileUploadResponse struct {
	EID         string `json:"eid,omitempty"`
	Domain      string `json:"domain,omitempty"`
	Department  string `json:"department,omitempty"`
	DocName     string `json:"doc_name,omitempty"`
	DocCategory string `json:"doc_category,omitempty"`
	DocType     string `json:"doc_type,omitempty"`
	DocPath     string `json:"doc_path,omitempty"`
}

type StorageConnection

type StorageConnection struct {
	Client *storage.Client
}

func NewStorageConnection

func NewStorageConnection() *StorageConnection

GetGCSClient gets singleton object for Google Storage

func (*StorageConnection) CreateBucket

func (a *StorageConnection) CreateBucket(domain string) error

func (*StorageConnection) DownloadFile

func (a *StorageConnection) DownloadFile(w http.ResponseWriter, r *http.Request, domain string) error

Download gets a file from GCS bucket, Takes file path as a path param from request

func (*StorageConnection) UploadFile

func (a *StorageConnection) UploadFile(r *http.Request, domain string) (FileUploadResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL