Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbStore ¶
type DbStore struct {
// contains filtered or unexported fields
}
func NewDbStore ¶
NewDbStore will return a Storage service for files that is db based
func (*DbStore) GetFileInfo ¶
func (s *DbStore) GetFileInfo(key string) (FileResponse, error)
func (*DbStore) HydrateFileInfo ¶
func (s *DbStore) HydrateFileInfo(fi *FileResponse) (FileResponse, error)
type FileDbRecord ¶ added in v0.394.1
type FileDbRecord struct { Key string `json:"key"` Filename string `json:"filename"` ContentType string `json:"contentType"` Size int `json:"size"` }
FileDbRecord is what is stored in the database
type FileResponse ¶ added in v0.394.0
type FileResponse struct { Key string `json:"key"` Filename string `json:"filename"` ContentType string `json:"contentType"` Size int `json:"size"` URL *string `json:"url,omitempty"` }
FileResponse is what is returned from our APIs
func (*FileResponse) ToDbRecord ¶ added in v0.394.1
func (fi *FileResponse) ToDbRecord() (string, error)
func (*FileResponse) ToJSON ¶ added in v0.394.0
func (fi *FileResponse) ToJSON() (string, error)
type Storer ¶
type Storer interface { // Store will save the given file and return a FileData struct for it // // The input should be a well formed dataURL https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs // The name of the file can also be passed as a parameter of the mediaType segment; e.g. // data:application/pdf;name=MyUploadedFile.pdf;base64,xxxxxx[...] Store(dataURL string) (FileResponse, error) // GetFileInfo will return the file information for the given unique file key. // // The File info returned can contain a URL where the file can be downloaded from, if applicable; i.e. for database // storage, at the moment files cannot be retrieved via URLs. GetFileInfo(key string) (FileResponse, error) // HydrateFileInfo will take the given file info and hydrate it with the most up to date information. // // The use of this function is to generate any signed URLs for file downloads. HydrateFileInfo(fi *FileResponse) (FileResponse, error) }
Storer represents the interface for a file storing service that is used by the Keel runtime
Click to show internal directories.
Click to hide internal directories.