Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.components.paths.ServerPaths Class Reference
Collaboration diagram for src.lib.components.paths.ServerPaths:
Collaboration graph

Public Member Functions

None __init__ (self, RuntimeData runtime_data, int success=0, int error=84, bool debug=False)
 
int add_path (self, str path, object endpoint, Union[str, List[str]] method)
 
None load_default_paths_initialised (self)
 
None inject_routes (self)
 

Data Fields

RuntimeData runtime_data_initialised = runtime_data
 
 success = success
 
 error = error
 
list routes = []
 
bool debug = debug
 
Disp disp
 

Detailed Description

_summary_

Definition at line 10 of file paths.py.

Constructor & Destructor Documentation

◆ __init__()

None src.lib.components.paths.ServerPaths.__init__ ( self,
RuntimeData runtime_data,
int success = 0,
int error = 84,
bool debug = False )
_summary_

Args:
    success (int, optional): _description_. Defaults to 0.
    error (int, optional): _description_. Defaults to 84.

Definition at line 14 of file paths.py.

Member Function Documentation

◆ add_path()

int src.lib.components.paths.ServerPaths.add_path ( self,
str path,
object endpoint,
Union[str, List[str]] method )
_summary_
    This function is in charge of adding a path to the list of paths_initialised.

Args:
    path (str): _description_: The path to call for the endpoint to be triggered
    endpoint (str): _description_: The function that represents the endpoint
    method (str, list): _description_: The method used for the provided path (GET, PUT, POST, etc)

Returns:
    int: _description_: success if it succeeded, error if there was an error in the data.

Definition at line 36 of file paths.py.

◆ inject_routes()

None src.lib.components.paths.ServerPaths.inject_routes ( self)
_summary_
    Function in charge of loading the routes into the api.
Args:
    app (FastAPI): _description_

Definition at line 82 of file paths.py.

◆ load_default_paths_initialised()

None src.lib.components.paths.ServerPaths.load_default_paths_initialised ( self)
_summary_
    This function is in charge of adding the default paths_initialised to the list of paths_initialised.

Definition at line 72 of file paths.py.

Field Documentation

◆ debug

bool src.lib.components.paths.ServerPaths.debug = debug

Definition at line 25 of file paths.py.

◆ disp

Disp src.lib.components.paths.ServerPaths.disp
Initial value:
= Disp(
TOML_CONF,
FILE_DESCRIPTOR,
SAVE_TO_FILE,
FILE_NAME,
debug=self.debug,
logger=self.__class__.__name__
)

Definition at line 27 of file paths.py.

◆ error

src.lib.components.paths.ServerPaths.error = error

Definition at line 23 of file paths.py.

◆ routes

src.lib.components.paths.ServerPaths.routes = []

Definition at line 24 of file paths.py.

◆ runtime_data_initialised

RuntimeData src.lib.components.paths.ServerPaths.runtime_data_initialised = runtime_data

Definition at line 21 of file paths.py.

◆ success

src.lib.components.paths.ServerPaths.success = success

Definition at line 22 of file paths.py.


The documentation for this class was generated from the following file: