server library

Classes

AuthenticationInfo
Holds the id for an authenticated user and which scopes it can access. Allowed scopes are defined for each Endpoint.
Endpoint
The Endpoint is an entrypoint to the Server. To add a custom Endpoint to a Server, create a subclass and place it in the endpoints directory. Code will generated that builds the corresponding client library. To add methods that can be accessed from the client, make sure that the first argument of the method is a Session parameter.
EndpointConnector
The EndpointConnector associates a name with and endpoint and its MethodConnectors.
EndpointDispatch
The EndpointDispatch is responsible for directing requests to the Server to the correct Endpoint and method. Typically, this class is overridden by an Endpoints class that is generated.
FutureCall<T extends SerializableEntity>
Superclass of a FutureCall, override the invoke method to create a custom FutureCall. The call also needs to be registered with the top ServerPod object before starting the Server.
FutureCallSession
Created when a FutureCall is being made. It contains all data associated with the current call and provides easy access to the database.
InternalSession
A Session used internally in the ServerPod. Typically used to access the database and do logging for events that are not triggered from a call, or a stream.
MessageCentral
The MessageCentral handles communication within the server, and between servers in a cluster. It is especially useful when working with streaming endpoints. The message central can pass on any serializable to a channel. The channel can be listened to by from any place in the server.
MessageCentralAccess
Provides access to the Serverpod's MessageCentral.
MethodCallSession
When a call is made to the Server a MethodCallSession object is created. It contains all data associated with the current connection and provides easy access to the database.
MethodConnector
The MethodConnector hooks up a method with its name and the actual call to the method.
ParameterDescription
Defines a parameter in a MethodConnector.
Result
The Result of an Endpoint method call.
ResultAuthenticationFailed
The result of a failed Endpoint method call where authentication failed.
ResultInternalServerError
The result of a failed Endpoint method call where an Exception was thrown during execution of the method.
ResultInvalidParams
The result of a failed Endpoint method call where the parameters where not valid.
ResultStatusCode
The result of a failed Endpoint method call, with a custom status code.
ResultSuccess
A successful result from an Endpoint method call containing the return value of the call.
Scope
Used to define who can access an Endpoint. Authenticated users can be associated with a Scope, if the same scope is defined in the Endpoint the user is granted access. The scope is defined by its name.
SerializationManagerServer
The SerializationManager is responsible for creating objects from a serialization, but also for serializing objects. This class is typically overriden by generated code. SerializationManagerServer is an extension to also handle Tables.
Server
Handling incoming calls and routing them to the correct Endpoint methods.
ServerHealthMetric
Represents a snapshot of a specific health metric. An entry is written every minute for each server. All health data can be accessed through Serverpod Insights.
ServerHealthMetricTable
Serverpod
The Serverpod handles all setup and manages the main Server. In addition to the user managed server, it also runs a server for handling the DistributedCache and other connections through the InsightsEndpoint.
ServerpodRunMode
Defines valid run modes for the Serverpod.
Session
When a call is made to the Server a Session object is created. It contains all data associated with the current connection and provides easy access to the database.
StorageAccess
Collects methods for accessing cloud storage.
StreamingSession
When a web socket connection is opened to the Server a StreamingSession object is created. It contains all data associated with the current connection and provides easy access to the database.
UserAuthetication
Collects methods for authenticating users.

Extensions

AuthKeyScopes on AuthKey
Adds methods for scopes on AuthKey.

Properties

tServerHealthMetric ServerHealthMetricTable
getter/setter pair

Typedefs

AuthenticationHandler = Future<AuthenticationInfo?> Function(Session session, String key)
Returns authentication information for a given Session and key or null if the key is invalid.
HealthCheckHandler = Future<List<ServerHealthMetric>> Function(Serverpod pod, DateTime timestamp)
Performs a set of custom health checks on a Serverpod.
MessageCentralListenerCallback = void Function(SerializableEntity message)
The callback used by listeners of the MessageCentral.
MethodCall = Future Function(Session session, Map<String, dynamic> params)
Calls a named method referenced in a MethodConnector.
ServerHealthMetricExpressionBuilder = Expression Function(ServerHealthMetricTable)