Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObjectStore

Class for accessing a Fastly Object-store.

An object store is a persistent, globally consistent key-value store.

Note: Can only be used when processing requests, not during build-time initialization.

Hierarchy

  • ObjectStore

Constructors

Methods

Constructors

  • Creates a new JavaScript ObjectStore object which interacts with the Fastly Object-store named name.

    Parameters

    • name: string

      Name of the Fastly Object-store to interact with. A name cannot be empty, contain Control characters, or be longer than 255 characters.

    Returns ObjectStore

Methods

  • Gets the value associated with the key key in the Object-store. When the key is present, a resolved Promise containing an ObjectStoreEntry will be returned which contains the associated value. When the key is absent, a resolved Promise containing null is returned.

    Parameters

    • key: string

      The key to retrieve from within the Object-store. A key cannot:

      • Be any of the strings "", ".", or ".."
      • Start with the string ".well-known/acme-challenge/""
      • Contain any of the characters "#?*[]\n\r"
      • Be longer than 1024 characters

    Returns Promise<null | ObjectStoreEntry>

  • put(key: string, value: BodyInit): Promise<undefined>
  • Write the value of value into the Object-store under the key key.

    Note: Object-store is eventually consistent, this means that the updated contents associated with the key key may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key.

    Parameters

    • key: string

      The key to associate with the value. A key cannot:

      • Be any of the strings "", ".", or ".."
      • Start with the string ".well-known/acme-challenge/""
      • Contain any of the characters "#?*[]\n\r"
      • Be longer than 1024 characters
    • value: BodyInit

      The value to store within the Object-store.

    Returns Promise<undefined>

Generated using TypeDoc