demo

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service handles demo mode functionality

func NewService

func NewService(db *sql.DB, snippetService *services.SnippetService, logger *slog.Logger, resetInterval time.Duration, enabled bool) *Service

NewService creates a new demo service

func (*Service) IsEnabled

func (s *Service) IsEnabled() bool

IsEnabled returns whether demo mode is enabled

func (*Service) ResetDatabase

func (s *Service) ResetDatabase(ctx context.Context) error

ResetDatabase clears all data and creates fake snippets

func (*Service) StartPeriodicReset

func (s *Service) StartPeriodicReset(ctx context.Context)

StartPeriodicReset starts the periodic database reset goroutine

Jump to

Keyboard shortcuts

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