Instance Methodvapor 4.114.1Vapor
createSession(_:for:)
MemorySessions.swift:35func createSession(_ data: SessionData, for request: Request) -> EventLoopFuture<SessionID>
func createSession(_ data: SessionData, for request: Request) -> EventLoopFuture<SessionID>
s5Vapor14MemorySessionsV13createSession_3for7NIOCore15EventLoopFutureCyAA0E2IDVGAA0E4DataV_AA7RequestCtF
What are these?3XC9T
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct MemorySessions
Simple in-memory sessions implementation.
struct SessionData
A container for storing data associated with a given SessionID
.
final class Request
Represents an HTTP request in an application.
final class EventLoopFuture<Value>
Holder for a result that will be provided later.
struct SessionID
init(storage: Storage)
let storage: Storage
func deleteSession(_ sessionID: SessionID, for request: Request) -> EventLoopFuture<Void>
func readSession(_ sessionID: SessionID, for request: Request) -> EventLoopFuture<SessionData?>
func updateSession(_ sessionID: SessionID, to data: SessionData, for request: Request) -> EventLoopFuture<SessionID>
final class Storage