activity

package
v0.0.0-...-b5f797f Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Collection store.CollectionName = "activities"

Functions

func CreateAll

func CreateAll(ctx context.Context, userId string, weeks int, dailyOvertime int, unit time.Duration, tags []string, nowFn func() time.Time, processFn func(ctx context.Context, userId string, act Activity) error) error

func Delete

func Delete(store store.Store) http.HandlerFunc

func Get

func Get(store store.Store) http.HandlerFunc

func InRange

func InRange(store store.Store) http.HandlerFunc

func Repeat

func Repeat(store store.Store) http.HandlerFunc

func Running

func Running(store store.Store) http.HandlerFunc

func Start

func Start(store store.Store) http.HandlerFunc

func Stop

func Stop(store store.Store) http.HandlerFunc

func Tags

func Tags(store store.Store) http.HandlerFunc

func Update

func Update(store store.Store) http.HandlerFunc

Types

type Activity

type Activity struct {
	Id     primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	UserId string             `json:"userId,omitempty" bson:"userId,omitempty"`
	Name   string             `json:"name,omitempty" bson:"name,omitempty"`
	Start  time.Time          `json:"start,omitempty" bson:"start,omitempty"`
	End    *time.Time         `json:"end,omitempty" bson:"end,omitempty"`
	Tags   []string           `json:"tags,omitempty" bson:"tags,omitempty"`
}

func New

func New(userId, name string, tags []string) *Activity

func NewWithStart

func NewWithStart(userId, name string, start time.Time, tags []string) *Activity

func NewWithStartAndEnd

func NewWithStartAndEnd(userId, name string, start, end time.Time, tags []string) *Activity

func (*Activity) Duration

func (me *Activity) Duration() time.Duration

func (*Activity) ObjectId

func (me *Activity) ObjectId() primitive.ObjectID

func (*Activity) SetObjectId

func (me *Activity) SetObjectId(id primitive.ObjectID)

func (*Activity) Stop

func (a *Activity) Stop()

Jump to

Keyboard shortcuts

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