Object - cache : AbstractCache

The cache:AbstractCache object is used for custom implementations of the Ballerina cache. Any custom cache implementation should be object-wise similar.

put

(string key, any value, int maxAgeInSeconds)

returns Error?

Parameters

  • key string
  • value any
  • maxAgeInSeconds int (default -1)

get

(string key)

returns any | Error

Parameters

  • key string
  • Return Type

    (any | Error)

invalidate

(string key)

returns Error?

Parameters

  • key string

invalidateAll

()

returns Error?

hasKey

(string key)

returns boolean

Parameters

  • key string
  • Return Type

    (boolean)

keys

()

returns string[]
  • Return Type

    (string[])

size

()

returns int
  • Return Type

    (int)

capacity

()

returns int
  • Return Type

    (int)