コンテンツにスキップ

JsonFileDataAdapter

このコンテンツはまだ日本語訳がありません。

Cache database using JSON file

Implements

Constructors

new JsonFileDataAdapter()

new JsonFileDataAdapter(options?): JsonFileDataAdapter

Parameters

options?: JsonFileDataAdapterOptions

Returns

JsonFileDataAdapter

Defined in

src/extras/JsonFileDataAdapter.ts:53

Properties

dbDir

dbDir: string

Defined in

src/extras/JsonFileDataAdapter.ts:39


dbFile

dbFile: string

Defined in

src/extras/JsonFileDataAdapter.ts:38


dbPath

dbPath: string = ":memory:"

Defined in

src/extras/JsonFileDataAdapter.ts:45


debounce

debounce: number

Defined in

src/extras/JsonFileDataAdapter.ts:41


files

files: ImgProcFileRecord[] = []

Defined in

src/extras/JsonFileDataAdapter.ts:47


isInMemory

isInMemory: boolean

Defined in

src/extras/JsonFileDataAdapter.ts:40


retentionCount

retentionCount: null | number

Defined in

src/extras/JsonFileDataAdapter.ts:44


retentionPeriod

retentionPeriod: null | number = 10

Defined in

src/extras/JsonFileDataAdapter.ts:43

Methods

close()

close(): void

Close database

Returns

void

Implementation of

ImgProcDataAdapter.close

Defined in

src/extras/JsonFileDataAdapter.ts:223


countdown()

countdown(): void

Countdown all records

Returns

void

Implementation of

ImgProcDataAdapter.countdown

Defined in

src/extras/JsonFileDataAdapter.ts:184


delete()

delete(criteria): void

Delete the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void

Implementation of

ImgProcDataAdapter.delete

Defined in

src/extras/JsonFileDataAdapter.ts:152


deleteExpiredRecords()

deleteExpiredRecords(now): null | Set<string>

Delete expired records

Parameters

now: number = ...

Unixtime (milliseconds)

Returns

null | Set<string>

Deleted hashes or null

Implementation of

ImgProcDataAdapter.deleteExpiredRecords

Defined in

src/extras/JsonFileDataAdapter.ts:197


fetch()

fetch(criteria): null | ImgProcFileRecord

Fetch single record

  • To fetch a record with category source, specify hash.
  • To fetch a record with category variant or placeholder, specify source and profile.

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

null | ImgProcFileRecord

Implementation of

ImgProcDataAdapter.fetch

Defined in

src/extras/JsonFileDataAdapter.ts:108


initialize()

initialize(options): void

Initialize database

Parameters

options: ImgProcDataAdapterInitOptions

Returns

void

Implementation of

ImgProcDataAdapter.initialize

Defined in

src/extras/JsonFileDataAdapter.ts:66


insert()

insert(data): void

Insert the record

Parameters

data: ImgProcFile

Returns

void

Implementation of

ImgProcDataAdapter.insert

Defined in

src/extras/JsonFileDataAdapter.ts:122


list()

list(): Set<string>

List all hashes

Returns

Set<string>

Implementation of

ImgProcDataAdapter.list

Defined in

src/extras/JsonFileDataAdapter.ts:118


renew()

renew(criteria): void

Renew the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void

Implementation of

ImgProcDataAdapter.renew

Defined in

src/extras/JsonFileDataAdapter.ts:164


updateMetadata()

updateMetadata(data): void

Update the record for remote file

Parameters

data

data.b?: number

data.expiresAt?: number

data.format: string

data.g?: number

data.hash: string

data.height: number

data.r?: number

data.width: number

Returns

void

Implementation of

ImgProcDataAdapter.updateMetadata

Defined in

src/extras/JsonFileDataAdapter.ts:132