AssetStorageStrategy

AssetStorageStrategy

Documentation generated from asset-storage-strategy.ts on Feb 19 2019 at 16:20

The AssetPersistenceStrategy determines how Asset files are physically stored and retrieved.

Signature

interface AssetStorageStrategy {
  writeFileFromBuffer(fileName: string, data: Buffer): Promise<string>;
  writeFileFromStream(fileName: string, data: Stream): Promise<string>;
  readFileToBuffer(identifier: string): Promise<Buffer>;
  readFileToStream(identifier: string): Promise<Stream>;
  fileExists(fileName: string): Promise<boolean>;
  toAbsoluteUrl?(reqest: Request, identifier: string): string;
}

Members

writeFileFromBuffer

method
type:
(fileName: string, data: Buffer) => Promise<string>

writeFileFromStream

method
type:
(fileName: string, data: Stream) => Promise<string>

readFileToBuffer

method
type:
(identifier: string) => Promise<Buffer>

readFileToStream

method
type:
(identifier: string) => Promise<Stream>

fileExists

method
type:
(fileName: string) => Promise<boolean>

toAbsoluteUrl

method
type:
(reqest: Request, identifier: string) => string
alpha