package sihl

  1. Overview
  2. Docs
The modular functional web framework

Install

Dune Dependency

Authors

Maintainers

Sources

sihl-queue-0.1.6.tbz
sha256=574c73c97ea0bc57144853b28df6125855a040ef0378f3bf180b4331dde93f9d
sha512=92c474ed3b6609395799f77259fc424af37dcad53095773ca2f2cdd4757a1607a5b53b6594cd7b6ddabeb40ebba67bb9544ff0f31dc228c87cfe015afa520aaa

doc/sihl.token/Token/Service/Make/index.html

Module Service.MakeSource

Parameters

Signature

Sourceval create : Core.Ctx.t -> kind:string -> ?data:string -> ?expires_in:Utils.Time.duration -> ?length:int -> unit -> Token__.Model.t Lwt.t

Create a token and store a token.

Provide expires_in to define a duration in which the token is valid, default is one day. Provide data to store optional data as string. Provide length to define the length of the token in bytes.

Sourceval find : Core.Ctx.t -> string -> Token__.Model.t Lwt.t

Returns an active and non-expired token. Raises Failure if no token is found.

Sourceval find_opt : Core.Ctx.t -> string -> Token__.Model.t option Lwt.t

Returns an active and non-expired token.

Sourceval find_by_id : Core.Ctx.t -> string -> Token__.Model.t Lwt.t

Returns an active and non-expired token by id. Raises Failure if no token is found.

Sourceval find_by_id_opt : Core.Ctx.t -> string -> Token__.Model.t option Lwt.t

Returns an active and non-expired token by id.

Sourceval invalidate : Core.Ctx.t -> Token__.Model.t -> unit Lwt.t

Invalidate a token by marking it as such in the database and therefore marking it "to be deleted"

OCaml

Innovation. Community. Security.