Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StorageAdapter

Storage adapter class, extended to connect brain with external storage provider. Methods are just raw endpoints to be extended.

Hierarchy

Index

Constructors

constructor

  • new StorageAdapter(bot: "/home/circleci/repo/src/index"): StorageAdapter
  • Create an adapter instance. Adapter modules should provide a .use method that accepts the bot, to provide to their adapter class constructor, returning the instance.

    Parameters

    • bot: "/home/circleci/repo/src/index"

      The current bBot instance

    Returns StorageAdapter

Properties

bot

bot: "/home/circleci/repo/src/index"

The current bBot instance

name

name: string = "storage-adapter"

Methods

Abstract find

  • find(collection: string, params: any): Promise<any>

Abstract findOne

  • findOne(collection: string, params: any): Promise<any>
  • Query subset of collection from storage provider, returning single item

    Parameters

    • collection: string
    • params: any

    Returns Promise<any>

Abstract keep

  • keep(collection: string, data: any): Promise<void>

Abstract loadMemory

  • loadMemory(): Promise<any>

Abstract lose

  • lose(collection: string, params: any): Promise<void>
  • Remove anything from collection in storage that matches params

    Parameters

    • collection: string
    • params: any

    Returns Promise<void>

Abstract saveMemory

  • saveMemory(data: any): Promise<void>

Abstract shutdown

  • shutdown(): Promise<void>

Abstract start

  • start(): Promise<void>

Generated using TypeDoc