Config class
Class that defines the main parameters of the database, such as
name - the database name
db - receives an IDatabase object (has methods like init, save...)
port - the port for database access
statics - receives a String, default is Public
auth - receives an AuthService object
Storage - receives a Storage object
host - receives the ip address of the host
Constructors
- Config({String name = 'Dartion Server', required IDatabase db, required int port, String statics = 'public', AuthService? auth, Storage? storage, String? host})
- Class constructor to create the server. Has some default configurations but it is advised to create a new instance using the factory so you can implement the configuration set up in your config.yaml file
- Config.fromYaml(Map doc)
-
Factory constructor to build your database configuration using a provided
config.yaml file
The config.yaml must have a layout like this one:
factory
Properties
- auth → AuthService?
-
AuthService object
final
- db → IDatabase
-
IDatabase object
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String?
-
Host's IP address
final
- name → String
-
Database name
final
- port → int
-
The hosts port for database access
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statics → String
-
Database statics, default to Public
final
- storage → Storage?
-
Storage object
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited