Documentation ¶
Index ¶
- type Activity
- func (a *Activity) AddPredecessor(id int) (err error)
- func (a *Activity) AddSuccessor(id int) (err error)
- func (a *Activity) RemovePredecessor(id int) (err error)
- func (a *Activity) RemoveSuccessor(id int) (err error)
- func (a *Activity) UpdatePredecessorId(oldId, newId int) (err error)
- func (a *Activity) UpdateSuccessorId(oldId, newId int) (err error)
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
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
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
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
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
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
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.