activity

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Id             int           `json:"id"`             // Unique identifier of the activity
	Description    string        `json:"description"`    // description of the activity
	Duration       time.Duration `json:"duration"`       // duration of the activity
	Start          time.Time     `json:"start"`          // Start time of the activity
	Finish         time.Time     `json:"finish"`         // Finish time of he activity
	PredecessorsId []int         `json:"predecessorsId"` // ID of the activities that precede
	SuccessorsId   []int         `json:"successorsId"`   // ID of the activities that come after
	Progress       float32       `json:"progress"`       // How complete is the activity (between 0 and 1)
	Cost           float64       `json:"cost"`           // Cost of the activity
}

Activity is a struct representing an activity with various attributes.

func (*Activity) AddPredecessor added in v0.0.4

func (a *Activity) AddPredecessor(id int) (err error)

AddPredecessor adds a predecessor with the given 'id' to the activity's predecessors list. It returns an error if the predecessor already exists in the list.

func (*Activity) AddSuccessor added in v0.0.4

func (a *Activity) AddSuccessor(id int) (err error)

AddSuccessor adds a successor with the given 'id' to the activity's successors list. It returns an error if the successor already exists in the list.

func (*Activity) RemovePredecessor added in v0.0.4

func (a *Activity) RemovePredecessor(id int) (err error)

RemovePredecessor removes the predecessor with the given 'id' from the activity's predecessors list. It returns an error if the predecessor is not found in the list.

func (*Activity) RemoveSuccessor added in v0.0.4

func (a *Activity) RemoveSuccessor(id int) (err error)

RemoveSuccessor removes the successor with the given 'id' from the activity's successors list. It returns an error if the successor is not found in the list.

func (*Activity) UpdatePredecessorId added in v0.0.4

func (a *Activity) UpdatePredecessorId(oldId, newId int) (err error)

UpdatePredecessorId updates the predecessor ID from 'oldId' to 'newId' in the activity's predecessors list. It returns an error if the predecessor with 'oldId' is not found.

func (*Activity) UpdateSuccessorId added in v0.0.4

func (a *Activity) UpdateSuccessorId(oldId, newId int) (err error)

UpdateSuccessorId updates the successor ID from 'oldId' to 'newId' in the activity's successors list. It returns an error if the successor with 'oldId' is not found.

Jump to

Keyboard shortcuts

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