Persist

public struct Persist

Undocumented

  • Set value for key that will expire after a certain time.

    Doesn’t check to see if key already exists. Some drivers may fail it key already exists

    Declaration

    Swift

    public func create<Object>(key: String, value: Object, expires: TimeAmount? = nil) -> EventLoopFuture<Void> where Object : Decodable, Object : Encodable

    Parameters

    key

    key string

    value

    value

    expires

    time key/value pair will expire

    Return Value

    EventLoopFuture for when value has been set

  • Set value for key that will expire after a certain time

    Declaration

    Swift

    public func set<Object>(key: String, value: Object, expires: TimeAmount? = nil) -> EventLoopFuture<Void> where Object : Decodable, Object : Encodable

    Parameters

    key

    key string

    value

    value

    expires

    time key/value pair will expire

    Return Value

    EventLoopFuture for when value has been set

  • Get value for key

    Declaration

    Swift

    public func get<Object>(key: String, as type: Object.Type) -> EventLoopFuture<Object?> where Object : Decodable, Object : Encodable

    Parameters

    key

    key string

    type

    Type of value

    Return Value

    EventLoopFuture that will be filled with value

  • Remove value for key

    Declaration

    Swift

    public func remove(key: String) -> EventLoopFuture<Void>

    Parameters

    key

    key string