hooks

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteConfig

type SQLiteConfig struct {
	DBPath string // Path to SQLite database file
}

SQLiteConfig holds configuration for SQLite hook

type SQLiteHook

type SQLiteHook struct {
	bridge.BridgeHookBase
	// contains filtered or unexported fields
}

SQLiteHook implements BridgeHook interface to provide session persistence

func NewSQLiteHook

func NewSQLiteHook(logger *zap.Logger) *SQLiteHook

NewSQLiteHook creates a new SQLiteHook instance

func (*SQLiteHook) GetStoredSessions

func (h *SQLiteHook) GetStoredSessions() (map[string]*bridge.SessionInfo, error)

GetStoredSessions implements the SessionStore interface to retrieve all stored sessions

func (*SQLiteHook) ID

func (h *SQLiteHook) ID() string

ID returns the unique identifier for this hook

func (*SQLiteHook) Init

func (h *SQLiteHook) Init(config any) error

Init initializes the hook with the provided configuration

func (*SQLiteHook) OnSessionCreated

func (h *SQLiteHook) OnSessionCreated(session *bridge.SessionInfo) error

OnSessionCreated handles new session creation

func (*SQLiteHook) OnSessionDisconnected

func (h *SQLiteHook) OnSessionDisconnected(session *bridge.SessionInfo) error

OnSessionDisconnected handles session disconnection

func (*SQLiteHook) OnSessionResumed

func (h *SQLiteHook) OnSessionResumed(session *bridge.SessionInfo) error

OnSessionResumed handles session resumption

func (*SQLiteHook) OnSessionSuspended

func (h *SQLiteHook) OnSessionSuspended(session *bridge.SessionInfo) error

OnSessionSuspended handles session suspension

func (*SQLiteHook) Provides

func (h *SQLiteHook) Provides(b byte) bool

Provides indicates whether this hook provides the specified functionality

func (*SQLiteHook) Stop

func (h *SQLiteHook) Stop() error

Stop gracefully stops the hook

Jump to

Keyboard shortcuts

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