state

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteStateManager added in v1.9.5

type SQLiteStateManager struct {
	// contains filtered or unexported fields
}

func NewSQLiteStateManager added in v1.9.5

func NewSQLiteStateManager(dbPath string, logger *slog.Logger) (*SQLiteStateManager, error)

func (*SQLiteStateManager) Close added in v1.9.5

func (s *SQLiteStateManager) Close() error

func (*SQLiteStateManager) GetStats added in v1.9.5

func (s *SQLiteStateManager) GetStats() (map[string]int, error)

func (*SQLiteStateManager) LoadState added in v1.9.5

func (s *SQLiteStateManager) LoadState() (map[string]interface{}, map[string]interface{}, map[string]interface{}, error)

func (*SQLiteStateManager) SaveState added in v1.9.5

func (s *SQLiteStateManager) SaveState(rateCache, botCache, verifiedCache map[string]interface{}, expiration time.Duration) error

type State

type State struct {
	Rate        map[string]uint    `json:"rate"`
	Bots        map[string]bool    `json:"bots"`
	Verified    map[string]bool    `json:"verified"`
	Memory      map[string]uintptr `json:"memory"`
	SQLiteStats map[string]int     `json:"sqlite_stats,omitempty"`
}

func GetState

func GetState(rateCache, botCache, verifiedCache map[string]lru.Item) State

type StateEntry added in v1.9.5

type StateEntry struct {
	Key       string    `json:"key"`
	Value     string    `json:"value"`
	Type      string    `json:"type"`
	ExpiresAt time.Time `json:"expires_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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