pathmodel

package
v0.0.0-...-16d19c9 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountlessStat

type CountlessStat struct {
	Name           string        `json:"name"`
	StepEquivalent int32         `json:"stepEquivalent"`
	Quota          QuotaEditable `json:"quota"`
}

type FullPath

type FullPath struct {
	Path
	Stats   []Stat `json:"stats"`
	OwnerId string `json:"ownerId"`
}

type Path

type Path struct {
	Name   string `json:"name"`
	Public bool   `json:"public"`
	Id     string `json:"id"`
}

Path

type PathStore

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

func NewPathStore

func NewPathStore(postgresC *postgresclient.Client) *PathStore

func (*PathStore) CreatePath

func (ps *PathStore) CreatePath(ctx context.Context, userId, pathName string) (string, error)

func (*PathStore) CreateQuota

func (p *PathStore) CreateQuota(ctx context.Context, pathId, statName string) error

func (*PathStore) CreateStat

func (ps *PathStore) CreateStat(ctx context.Context, pathId string, name, askerId string) error

func (*PathStore) DeletePath

func (ps *PathStore) DeletePath(ctx context.Context, pathId string, askerId string) error

func (*PathStore) DeleteStat

func (ps *PathStore) DeleteStat(ctx context.Context, pathId string, name string, askerId string) error

func (*PathStore) GetFullPath

func (ps *PathStore) GetFullPath(ctx context.Context, askerId, pathId string) (FullPath, error)

func (*PathStore) GetPaths

func (ps *PathStore) GetPaths(ctx context.Context, userId, askerId string) ([]PathWithSteps, error)

func (*PathStore) GetStats

func (ps *PathStore) GetStats(ctx context.Context, pathId string) ([]Stat, error)

func (*PathStore) UpdatePath

func (ps *PathStore) UpdatePath(ctx context.Context, newPath Path, askerId string) error

func (*PathStore) UpdateQuota

func (p *PathStore) UpdateQuota(ctx context.Context, pathId, statName string, quota QuotaEditable) error

func (*PathStore) UpdateQuotaStreak

func (p *PathStore) UpdateQuotaStreak(ctx context.Context, pathId, statName string, count int32, quota *Quota) error

func (*PathStore) UpdateStat

func (ps *PathStore) UpdateStat(ctx context.Context, pathId, statName string, stat *CountlessStat, askerId string) error

func (*PathStore) UpdateStatsCounts

func (ps *PathStore) UpdateStatsCounts(ctx context.Context, pathId string, counts []StatCount, askerId string) error

type PathWithSteps

type PathWithSteps struct {
	Path
	Steps int `json:"steps"`
}

type Quota

type Quota struct {
	QuotaEditable

	CountProgress int32 `json:"countProgress"`
	HoursPassed   int32 `json:"hoursPassed"`
	Streak        int32 `json:"streak"`
}

type QuotaEditable

type QuotaEditable struct {
	Quota      int32 `json:"quota"`
	HoursLimit int32 `json:"hoursLimit"`
}

Quota

type Stat

type Stat struct {
	Name           string `json:"name"`
	Count          int32  `json:"count"`
	StepEquivalent int32  `json:"stepEquivalent"`
	Quota          Quota  `json:"quota"`
}

Stat

type StatCount

type StatCount struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Jump to

Keyboard shortcuts

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