distance

package
v0.0.0-...-0cfb223 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Collection = "statistics.ammunition.distances"

Collection indicates the MongoDB feature collection

Variables

This section is empty.

Functions

func Create

func Create(stats *AmmoDistanceStatistics) error

Create creates a new entity

func GetAll

func GetAll(opts *Options) (*model.Result, error)

GetAll returns a result based on filters

func GetByRefsAndRange

func GetByRefsAndRange(ids []string, gte, lte *uint64, opts *Options) (*model.Result, error)

GetByRefsAndRange returns a result by given IDs and range

func Remove

func Remove(id string) error

Remove removes an entity

func Replace

func Replace(id string, stats *AmmoDistanceStatistics) error

Replace replaces the data of an existing entity

Types

type AmmoDistanceStatistics

type AmmoDistanceStatistics struct {
	ID               objectID  `json:"_id" bson:"_id"`
	Reference        objectID  `json:"ammo" bson:"ammo"`
	Distance         uint64    `json:"distance" bson:"distance"`
	Velocity         float64   `json:"velocity" bson:"velocity"`
	Damage           float64   `json:"damage" bson:"damage"`
	PenetrationPower float64   `json:"penetrationPower" bson:"penetrationPower"`
	TimeOfFlight     float64   `json:"timeOfFlight" bson:"timeOfFlight"`
	Drop             float64   `json:"drop" bson:"drop"`
	Modified         timestamp `json:"_modified" bson:"_modified"`
}

AmmoDistanceStatistics describes the entity of a ammo distance statistics

func GetByID

func GetByID(id string) (*AmmoDistanceStatistics, error)

GetByID returns the entity of the given ID

func (AmmoDistanceStatistics) Validate

func (d AmmoDistanceStatistics) Validate() error

Validate validates the fields of a DistanceStatistics

type Options

type Options struct {
	Sort   bson.D
	Limit  int64
	Offset int64
}

Options represents the options for a database operation

Jump to

Keyboard shortcuts

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