mongo

package
v0.0.0-...-a0fcb3e Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPlayerStatisticProgressionAlreadyCreated = errors.New("player progression already created")
)

Functions

func New

func New(ctx context.Context, connStr, db string) (*connection, error)

Types

type PlayerStatisticProgression

type PlayerStatisticProgression struct {
	StartedAt                time.Time                            `bson:"startedAt,omitempty"`
	UpdatedAt                time.Time                            `bson:"updatedAt,omitempty"`
	PlayerID                 string                               `bson:"playerId"`
	StatisticID              string                               `bson:"statisticId"`
	StatisticAggregationMode string                               `bson:"statisticAggregationMode"`
	CurrentValue             *float64                             `bson:"currentValue"`
	GoalValue                *float64                             `bson:"goalValue,omitempty"`
	GoalCompleted            *bool                                `bson:"goalCompleted,omitempty"`
	GoalCompletedAt          time.Time                            `bson:"goalCompletedAt,omitempty"`
	Landmarks                []PlayerStatisticProgressionLandmark `bson:"landmarks,omitempty"`

	PreviousData *PlayerStatisticProgression `bson:"_previousData,omitempty"`
}

type PlayerStatisticProgressionLandmark

type PlayerStatisticProgressionLandmark struct {
	Value       float64   `bson:"value"`
	Completed   bool      `bson:"completed"`
	CompletedAt time.Time `bson:"completedAt,omitempty"`
}

type Statistic

type Statistic struct {
	CreatedAt       time.Time          `bson:"createdAt,omitempty"`
	UpdatedAt       time.Time          `bson:"updatedAt,omitempty"`
	DeletedAt       time.Time          `bson:"deletedAt,omitempty"`
	ID              primitive.ObjectID `bson:"_id,omitempty"`
	GameID          string             `bson:"gameId,omitempty"`
	Name            string             `bson:"name,omitempty"`
	Description     string             `bson:"description,omitempty"`
	AggregationMode string             `bson:"aggregationMode,omitempty"`
	InitialValue    *float64           `bson:"initialValue,omitempty"`
	Goal            *float64           `bson:"goal,omitempty"`
	Landmarks       []float64          `bson:"landmarks,omitempty"`
}

Jump to

Keyboard shortcuts

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