Documentation ¶
Index ¶
- Constants
- func AddBucketName(file *models.File)
- func DeleteObject(file models.File) (bool, error)
- func Download(writer io.WriterAt, file models.File) (int64, error)
- func FileExists(file models.File) (bool, int64, error)
- func GetDefaultBucketName() string
- func Init(config models.AwsConfig) bool
- func IsAvailable() bool
- func IsCorsCorrectlySet(bucket, gokapiUrl string) (bool, error)
- func IsValidLogin(config models.AwsConfig) (bool, error)
- func LogOut()
- func ServeFile(w http.ResponseWriter, r *http.Request, file models.File, forceDownload bool) (bool, error)
- func Upload(input io.Reader, file models.File) (string, error)
Constants ¶
const IsIncludedInBuild = true
IsIncludedInBuild is true if Gokapi has been compiled with AWS support or the API is being mocked
const IsMockApi = false
IsMockApi is true if the API is being mocked and therefore can only be used for testing purposes
Variables ¶
This section is empty.
Functions ¶
func AddBucketName ¶
AddBucketName adds the bucket name to the file to be stored
func DeleteObject ¶
DeleteObject deletes a file from S3
func FileExists ¶
FileExists returns true if the object is stored in S3
func GetDefaultBucketName ¶
func GetDefaultBucketName() string
GetDefaultBucketName returns the default bucketname where new files are stored
func IsAvailable ¶
func IsAvailable() bool
IsAvailable returns true if valid credentials have been passed
func IsCorsCorrectlySet ¶
IsCorsCorrectlySet returns true if CORS rules allow download from Gokapi
func IsValidLogin ¶
IsValidLogin checks if a valid login was provided
func ServeFile ¶ added in v1.8.3
func ServeFile(w http.ResponseWriter, r *http.Request, file models.File, forceDownload bool) (bool, error)
ServeFile either redirects the user to a pre-signed download url (default) or downloads the file and serves it as a proxy (depending on configuration). Returns true if blocking operation (in order to set download status) or false if non-blocking.
Types ¶
This section is empty.