states

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package states provides tracking of login success and failure events as well as the state of ongoing session loops (token expiration, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(ctx context.Context, dbRW *sql.DB) error

CreateTable creates the table for session state tracking.

func HasAnyFailures

func HasAnyFailures(ctx context.Context, dbRO *sql.DB) (bool, error)

HasAnyFailures checks if there are any failure entries in the table.

func Insert

func Insert(ctx context.Context, dbRW *sql.DB, timestamp int64, success bool, message string) error

Insert inserts a new login status entry.

Types

type State

type State struct {
	Timestamp int64
	Success   bool
	Message   string
}

State represents a single login/session status entry.

func ReadLast

func ReadLast(ctx context.Context, dbRO *sql.DB) (*State, error)

ReadLast returns the most recent login status entry. Returns nil if no entries exist.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL