src/prologue/core/types

Types

BadSecretKeyError = object of CatchableError
  Source Edit
EmptySecretKeyError = object of CatchableError
  Source Edit
BaseType = int | float | bool | string
  Source Edit
SecretKey = distinct string
  Source Edit
SecretUrl = distinct string
  Source Edit
Session = ref object
  data: StringTableRef
  newCreated*: bool
  modified*: bool
  accessed*: bool
  Source Edit
FormPart = object
  data*: OrderedTableRef[string, tuple[params: StringTableRef, body: string]]
  Source Edit

Procs

proc initFormPart(): FormPart {...}{.inline, raises: [], tags: [].}
  Source Edit
proc `[]`(formPart: FormPart; key: string): tuple[params: StringTableRef, body: string] {...}{.
    inline, raises: [KeyError], tags: [].}
  Source Edit
proc `[]=`(formPart: FormPart; key: string; body: string) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc parseValue[T: BaseType](value: string; default: T): T {...}{.inline.}
  Source Edit
proc len(secretKey: SecretKey): int {...}{.inline, raises: [], tags: [].}
  Source Edit
proc `$`(secretKey: SecretKey): string {...}{.inline, raises: [], tags: [].}
Hide secretKey's value   Source Edit
proc initSession(data: StringTableRef; newCreated = false; modified = false;
                accessed = false): Session {...}{.inline, raises: [], tags: [].}
  Source Edit
proc update(session: Session) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc `[]`(session: Session; key: string): string {...}{.inline, raises: [KeyError], tags: [].}
  Source Edit
proc `[]=`(session: Session; key, value: string) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc len(session: Session): int {...}{.inline, raises: [], tags: [].}
  Source Edit
proc getOrDefault(session: Session; key: string; default = ""): string {...}{.inline,
    raises: [KeyError], tags: [].}
  Source Edit
proc del(session: Session; key: string) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc clear(session: Session) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc `$`(session: Session): string {...}{.inline, raises: [], tags: [].}
  Source Edit
proc parseStringTable(tabs: StringTableRef; s: string) {...}{.inline, raises: [], tags: [].}
  Source Edit
proc parseStringTable(s: string): StringTableRef {...}{.inline, raises: [], tags: [].}
  Source Edit
proc loads(session: Session; s: string) {...}{.inline, raises: [], tags: [].}
Loads session from strings.   Source Edit
proc dumps(session: Session): string {...}{.inline, raises: [], tags: [].}
Dumps session to strings.   Source Edit