Class Binary<T>
Type parameters
Hierarchy
-
Service<T>
- Binary
Constructors
Properties
Methods
Constructors
Properties
Service name
Webda Core object
Logger with class context
Hold the parameters for your service
It will be bring from the webda.config.json
Methods
-
Clean the service data, can only be used in test mode
Returns Promise<any>
-
Parameters
-
name: any
-
property: any
Returns void
-
-
Parameters
-
info: any
Returns ReadableStream
-
-
Parameters
-
req: any
Returns any
-
-
Parameters
-
buffer: any
Returns any
-
-
Parameters
-
info: any
-
ctx: Context
Returns void
-
-
This is used to allow subclasses to add more route
Returns boolean
-
Parameters
-
file: any
Returns void
-
-
Parameters
-
challenge: any
Returns boolean
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Add a route dynamicaly
Parameters
-
url: string
of the route can contains dynamic part like {uuid}
-
methods: HttpMethodType[]
-
executer: Function
Method to execute for this route
-
Default value openapi: object = {}
-
Default value allowPath: boolean = false
Returns void
-
-
Parameters
-
info: any
-
uuid: any
Returns void
-
-
Parameters
-
hash: any
-
challenge: any
Returns boolean
-
-
Used to compute or derivate input parameter to attribute
Returns void
-
Update a binary
Parameters
-
targetStore: any
The store that handles the object to attach binary to
-
object: any
The object uuid to get from the store
-
property: any
The object property to add the file to
-
index: any
The index of the file to change in the property
Returns Promise<CoreModel>
-
-
Parameters
-
targetStore: any
-
object: any
-
property: any
-
index: any
Returns any
-
-
Download a binary to a file
Parameters
-
info: any
The reference stored in your target object
-
filename: any
Returns Promise<void>
-
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
-
-
Emit the event with data and wait for Promise to finish if listener returned a Promise
Parameters
-
event: any
-
data: any
Returns Promise<any[]>
-
-
Returns Array<string | symbol>
-
Get a binary
Parameters
-
info: any
The reference stored in your target object
Returns Promise<ReadableStream<any>>
-
-
Returns number
-
Get service name
Returns string
-
Get the service parameters
Returns T
-
Return a webda service
Type parameters
Parameters
-
service: string
name to retrieve
Returns T
-
-
The store can retrieve how many time a binary has been used
Parameters
-
hash: any
Returns Promise<number>
-
-
Return WebdaCore
Returns Core
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
map: any
Returns void
-
-
Parameters
-
obj: any
Returns BinaryMap
-
-
Init the Binary system routes
Returns void
-
Parameters
-
type: string | symbol
Returns number
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Load parameters
Parameters
-
params: any
Returns ServiceParameters
-
-
Parameters
-
level: WorkerLogLevel
to log
-
Rest ...args: any[]
Returns void
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Listen to an event as on(...) would do except that it will be asynchronous
Parameters
-
event: any
-
callback: any
-
Default value queue: string = undefined
Name of queue to use, can be undefined, queue name are used to define differents priorities
Returns void
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
ctx: Context
Returns Promise<string>
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Parameters
-
config: any
new parameters for the service
Returns Promise<void>
-
-
Parameters
-
Optional event: string | symbol
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Resolve parameters Call initRoutes and initBeanRoutes
Returns void
-
Parameters
-
n: number
Returns this
-
-
When you store a binary to be able to retrieve it you need to store the information into another object
If you have a User object define like this : User = {'name': 'Remi', 'uuid': 'Loopingz'} You will call the store(userStore, 'Loopingz', 'images', filedata, {'type':'profile'}) After a successful call the object will look like User = {'name': 'Remi', 'uuid': 'Loopingz', 'images': [{'type':'profile','hash':'a12545...','size':1245,'mime':'application/octet'}]}
Parameters
-
targetStore: any
The store that handles the object to attach binary to
-
object: any
The object uuid to get from the store
-
property: any
The object property to add the file to
-
file: any
The file by itself
-
metadatas: any
to add to the binary object
-
Default value index: string = "add"
Returns Promise<any>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Convert an object to JSON using the Webda json filter
Parameters
-
object: any
The object to export
Returns string
The export of the strip object ( removed all attribute with _ )
-
-
Update a binary
Parameters
-
targetStore: any
The store that handles the object to attach binary to
-
object: any
The object uuid to get from the store
-
property: any
The object property to add the file to
-
index: any
The index of the file to change in the property
-
file: any
The file by itself
-
metadatas: any
to add to the binary object
Returns Promise<CoreModel>
-
-
Parameters
-
targetStore: any
-
object: any
-
property: any
-
index: any
-
file: any
-
metadatas: any
Returns Promise<any>
-
-
Return the Modda definition if any
Returns ModdaDefinition | void
-
Parameters
-
emitter: EventEmitter
-
event: string | symbol
Returns number
-
Generated using TypeDoc
This is an abstract service to represent a storage of files The binary allow you to expose this service as HTTP ( therefore is an executor ) It needs an object to attach the binary too
The Binary storage should store only once a binary and reference every object that are used by this binary, so it can be cleaned.
FileBinary
S3Binary