kamk

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Injuries

type Injuries interface {
	AddInjury(ctx context.Context, userID int32, in InjuryInput) error
	MarkInjuryRecovered(ctx context.Context, userID int32, injuryID int32) (int64, error)
	GetActiveInjuries(ctx context.Context, userID int32) ([]Injury, error)
	GetMaxInjuryID(ctx context.Context, userID int32) (int32, error)
	DeleteInjury(ctx context.Context, userID int32, injuryID int32) (int64, error)
}

type InjuriesStore

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

func (*InjuriesStore) AddInjury

func (s *InjuriesStore) AddInjury(ctx context.Context, userID int32, in InjuryInput) error

func (*InjuriesStore) DeleteInjury

func (s *InjuriesStore) DeleteInjury(ctx context.Context, userID int32, injuryID int32) (int64, error)

func (*InjuriesStore) GetActiveInjuries

func (s *InjuriesStore) GetActiveInjuries(ctx context.Context, userID int32) ([]Injury, error)

func (*InjuriesStore) GetMaxInjuryID

func (s *InjuriesStore) GetMaxInjuryID(ctx context.Context, userID int32) (int32, error)

func (*InjuriesStore) MarkInjuryRecovered

func (s *InjuriesStore) MarkInjuryRecovered(ctx context.Context, userID int32, injuryID int32) (int64, error)

type Injury

type Injury struct {
	UserID      int32      `json:"user_id"`
	InjuryType  int32      `json:"injury_type"`
	Severity    int32      `json:"severity"`
	PainLevel   int32      `json:"pain_level"`
	Description string     `json:"description"`
	DateStart   time.Time  `json:"date_start"`
	Status      int32      `json:"status"`
	DateEnd     *time.Time `json:"date_end,omitempty"`
	InjuryID    int32      `json:"injury_id"`
	Meta        string     `json:"meta"`
}

type InjuryInput

type InjuryInput struct {
	InjuryType  int32
	Severity    int32
	PainLevel   int32
	Description string
	InjuryID    int32
	Meta        string
}

type KAMKStorage

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

KAMKStorage

func NewKAMKStorage

func NewKAMKStorage(db *sql.DB) *KAMKStorage

NewKAMKStorage creates a new KAMKStorage instance

func (*KAMKStorage) Injuries

func (s *KAMKStorage) Injuries() Injuries

func (*KAMKStorage) Ping

func (s *KAMKStorage) Ping(ctx context.Context) error

Methods

func (*KAMKStorage) Queries

func (s *KAMKStorage) Queries() Queries

type Queries

type Queries interface {
	AddQuestionnaire(ctx context.Context, userID int32, in QuestionnaireInput) (int64, error)
	GetQuestionnaires(ctx context.Context, userID int32) ([]Questionnaire, error)
	IsQuizDoneToday(ctx context.Context, userID int32, queryType int32) ([]Questionnaire, error)
	UpdateQuestionnaireByID(ctx context.Context, userID int32, id int64, answers string, comment string) (int64, error)
	DeleteQuestionnaireByID(ctx context.Context, userID int32, id int64) (int64, error)
}

type QueriesStore

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

func (*QueriesStore) AddQuestionnaire

func (s *QueriesStore) AddQuestionnaire(ctx context.Context, userID int32, in QuestionnaireInput) (int64, error)

func (*QueriesStore) DeleteQuestionnaireByID

func (s *QueriesStore) DeleteQuestionnaireByID(ctx context.Context, userID int32, id int64) (int64, error)

func (*QueriesStore) GetQuestionnaires

func (s *QueriesStore) GetQuestionnaires(ctx context.Context, userID int32) ([]Questionnaire, error)

func (*QueriesStore) IsQuizDoneToday

func (s *QueriesStore) IsQuizDoneToday(ctx context.Context, userID int32, queryType int32) ([]Questionnaire, error)

func (*QueriesStore) UpdateQuestionnaireByID

func (s *QueriesStore) UpdateQuestionnaireByID(ctx context.Context, userID int32, id int64, answers string, comment string) (int64, error)

type Questionnaire

type Questionnaire struct {
	ID        int64     `json:"id"`
	UserID    int32     `json:"user_id"`
	QueryType int32     `json:"query_type"`
	Answers   string    `json:"answers"`
	Comment   string    `json:"comment"`
	Timestamp time.Time `json:"timestamp"`
	Meta      string    `json:"meta"`
}

type QuestionnaireInput

type QuestionnaireInput struct {
	QueryType int32
	Answers   string
	Comment   string
	Meta      string
}

Jump to

Keyboard shortcuts

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