Options
All
  • Public
  • Public/Protected
  • All
Menu

Unit service that loads and creates Filesystem drivers from config. The filesystems will automatically be opened when the app starts, and closed when it stops.

example

Filesystems can be defined in the server.filesystems config. For example:

import {basePath} from "@extollo/lib"
import {LocalFilesystem, LocalFilesystemConfig} from "@extollo/util"

export default {
    // ... other configs ...
    filesystems: {
        default: {
            driver: LocalFilesystem,
            config: {
                baseDir: basePath('..', 'uploads').toLocal,
            } as LocalFilesystemConfig,
        },
    },
}

The config key should be an instance of the config interface for the driver in question.

example

Filesystems can then be accessed from the Files service:

if ( files.hasFilesystem('default') ) {
    const filesystem = files.getFilesystem('default')
    // ... do something with the filesystem ...
}

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly config

config: Config

Protected Optional defaultFilesystem

defaultFilesystem: Filesystem

Protected filesystems

filesystems: {} = {}

Type declaration

Protected Readonly logging

logging: Logging

status

status: UnitStatus = ...

The current status of the unit.

Accessors

Private appClassApplication

Methods

Protected app

Protected container

down

  • down(): Promise<void>

getBoundMethod

  • getBoundMethod(methodName: string): (...args: any[]) => any
  • Get the method with the given name from this class, bound to this class.

    Parameters

    • methodName: string

    Returns (...args: any[]) => any

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

getFilesystem

hasFilesystem

  • hasFilesystem(key?: string): boolean
  • Returns true if a filesystem with the given name exists.

    Parameters

    • Optional key: string

    Returns boolean

Protected make

  • make<T>(target: any, ...parameters: any[]): T
  • Call the make() method on the global container.

    Type parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

registerFilesystem

  • registerFilesystem(key: string, fs: Filesystem): void

up

  • up(): Promise<void>
Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.