Skip to content

lobs.source

Sheepolution edited this page Jan 25, 2024 · 2 revisions

lobs.source

lobs.source.doesSourceExistWithID

function source.doesSourceExistWithID(id: string)
  -> exists: boolean

Check if a source exists with a certain ID.

@param id — The ID of the source.

@return exists — True if the source exists, false otherwise.

lobs.source.doesSourceExistWithName

function source.doesSourceExistWithName(name: string)
  -> exists: boolean

Check if a source exists with a certain name.

@param name — The name of the source.

@return exists — True if the source exists, false otherwise.

lobs.source.getSourceById

function source.getSourceById(id: string)
  -> source: Source?

Get a Source by ID.

@param id — The ID of the Source.

@return source — The Source if found, nil otherwise.

lobs.source.getSourceByName

function source.getSourceByName(name: string)
  -> source: Source?

Get a Source by name.

@param name — The name of the Source.

@return source — The Source if found, nil otherwise.

lobs.source.newFilter

function source.newFilter(name: string, filterType: FilterType, properties?: table)
  -> filter: Filter

Create a new Filter.

@param name — The name of the filter.

@param filterType — The type of the filter.

@param properties — Optional. The settings of the filter.

@return filter — The new Filter.

lobs.source.newSource

function source.newSource(name: string, sourceType: SourceType, properties?: table, callback?: function)
  -> source: Source

Create a new Source.

@param name — The name of the Source.

@param sourceType — The type of the Source.

@param properties — Optional. The properties of the Source.

@param callback — Optional. The callback to use the Source in.

@return source — The new Source.

lobs.source.useSourceByID

function source.useSourceByID(id: any, callback: function)
  -> success: boolean

Use a Source found by ID in a callback to fetch the Source only once, optimizing performance.

@param callback — The callback to use the Source in.

@return success — True if the Source was used successfully, false otherwise.

lobs.source.useSourceByName

function source.useSourceByName(name: any, callback: function)
  -> success: boolean

Use a Source found by name in a callback to fetch the Source only once, optimizing performance.

@param callback — The callback to use the Source in.

@return success — True if the Source was used successfully, false otherwise.