app

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCookiesNotFound  = errors.New("session cookies not found")
	ErrNotAuthenticated = errors.New("not authenticated")
	ErrInvalidSession   = errors.New("session is not valid")
	ErrDuplicateProblem = errors.New("question has already been downloaded")
	ErrNoQuestions      = errors.New("no questions found in the database")
	ErrQuestionNotFound = errors.New("question not found")
	ErrSolutionFailed   = errors.New("solution failed")
)
View Source
var MapIDtoSlug = map[int]string{}/* 3292 elements not displayed */

Functions

func ConvertToSlug

func ConvertToSlug(name string) string

Types

type App

type App struct {
	Config   *config.Config
	Question *QuestionService
	Setting  *config.ConfigService
	Session  *SessionService
}

func New

func New() (*App, error)

type AppOptions

type AppOptions struct {
	Problem   string
	Language  string
	Tracks    []string
	Workspace string
	Open      bool
	Force     bool
}

type Extractor

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

func NewExtractor

func NewExtractor() *Extractor

func (Extractor) ExtractSnippet

func (e Extractor) ExtractSnippet(path string) (string, error)

type QuestionService

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

func NewQuestionService

func NewQuestionService(repo *repository.Queries, client leetcode.Client, renderer render.Renderer) *QuestionService

func (*QuestionService) GetAllQuestionsWithStatus

func (s *QuestionService) GetAllQuestionsWithStatus(ctx context.Context, opts AppOptions) ([]domain.QuestionStat, error)

func (*QuestionService) GetBySlug

func (s *QuestionService) GetBySlug(ctx context.Context, opts AppOptions) (*domain.Problem, error)

func (*QuestionService) GetQuestion

func (s *QuestionService) GetQuestion(ctx context.Context, opts AppOptions) (*domain.Problem, error)

func (*QuestionService) GetRandomQuestion

func (s *QuestionService) GetRandomQuestion(ctx context.Context, opts AppOptions) (*domain.Problem, error)

func (*QuestionService) GetStats

func (*QuestionService) Stub

func (s *QuestionService) Stub(ctx context.Context, problem *domain.Problem, opts AppOptions) (*render.RenderResult, error)

func (*QuestionService) SubmitSolution

func (s *QuestionService) SubmitSolution(ctx context.Context, problem *domain.Problem, opts AppOptions) (string, error)

func (*QuestionService) SubmitTest

func (s *QuestionService) SubmitTest(ctx context.Context, problem *domain.Problem, opts AppOptions) (string, error)

func (*QuestionService) WaitForResult

func (s *QuestionService) WaitForResult(ctx context.Context, problem *domain.Problem, submissionId string, maxWaitTime time.Duration) (*leetcode.SubmissionResult, error)

type SessionService

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

func NewSessionService

func NewSessionService(cfg *config.Config, client leetcode.Client, config *config.ConfigService) *SessionService

func (*SessionService) CheckSession

func (s *SessionService) CheckSession(ctx context.Context) error

func (*SessionService) RefreshFromBrowser

func (s *SessionService) RefreshFromBrowser() error

func (*SessionService) ValidateSession

func (s *SessionService) ValidateSession(ctx context.Context) (string, error)

Jump to

Keyboard shortcuts

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