scheduler

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DailyRecursiveTaskSeer

type DailyRecursiveTaskSeer struct {
	*DefaultRecursiveTaskSeer
}

func (*DailyRecursiveTaskSeer) GetNextDay

func (r *DailyRecursiveTaskSeer) GetNextDay(date string) (string, error)

type DefaultRecursiveTaskSeer

type DefaultRecursiveTaskSeer struct {
	Scheduler TimeMasterScheduler
	Task      *specs.TaskScheduled
	// contains filtered or unexported fields
}

func (*DefaultRecursiveTaskSeer) DoPrevision

func (r *DefaultRecursiveTaskSeer) DoPrevision(now string) error

type DefaultScheduler

type DefaultScheduler struct {
	Logger     *log.TmLogger
	Config     *specs.TimeMasterConfig
	Clients    []specs.Client
	Resources  []specs.Resource
	Timesheets []specs.AgendaTimesheets
	Scenario   *specs.ScenarioSchedule

	ResourcesMap map[string]*ResourceDailyMap
	// contains filtered or unexported fields
}

func (*DefaultScheduler) CreateTaskScheduled

func (s *DefaultScheduler) CreateTaskScheduled()

func (*DefaultScheduler) FilterPostElaboration

func (s *DefaultScheduler) FilterPostElaboration(opts SchedulerOpts) error

func (*DefaultScheduler) FilterPreElaboration

func (s *DefaultScheduler) FilterPreElaboration(opts SchedulerOpts) error

func (*DefaultScheduler) FilterPreElaborationFlags

func (s *DefaultScheduler) FilterPreElaborationFlags(opts SchedulerOpts) error

func (*DefaultScheduler) GetConfig

func (s *DefaultScheduler) GetConfig() *specs.TimeMasterConfig

func (*DefaultScheduler) GetLogger

func (s *DefaultScheduler) GetLogger() *log.TmLogger

func (*DefaultScheduler) GetResourcesMap

func (s *DefaultScheduler) GetResourcesMap() *map[string]*ResourceDailyMap

func (*DefaultScheduler) GetTaskMap

func (s *DefaultScheduler) GetTaskMap() *map[string]*specs.TaskScheduled

func (*DefaultScheduler) Init

func (s *DefaultScheduler) Init() error

func (*DefaultScheduler) SetClients

func (s *DefaultScheduler) SetClients(clients *[]specs.Client)

func (*DefaultScheduler) SetResources

func (s *DefaultScheduler) SetResources(r *[]specs.Resource)

func (*DefaultScheduler) SetTimesheets

func (s *DefaultScheduler) SetTimesheets(t *[]specs.AgendaTimesheets)

type MonthlyRecursiveTaskSeer

type MonthlyRecursiveTaskSeer struct {
	*DefaultRecursiveTaskSeer
}

func (*MonthlyRecursiveTaskSeer) GetNextDay

func (r *MonthlyRecursiveTaskSeer) GetNextDay(date string) (string, error)

type RecursiveTaskSeer

type RecursiveTaskSeer interface {
	DoPrevision(now string) error
	GetNextDay(date string) (string, error)
}

type ResourceDailyMap

type ResourceDailyMap struct {
	User     string
	Resource *specs.Resource
	// Map with the time left for a specific day
	Days map[string]int64
}

type SchedulerOpts

type SchedulerOpts struct {
	SkipPlan          bool
	OnlyClosed        bool
	SkipEmptyTasks    bool
	IgnoreMissingDeps bool

	PreClients              []string
	PreActivities           []string
	PreExcludeActivities    []string
	PreExcludeTaskFlags     []string
	PreExcludeActivityFlags []string

	// Post elaboration filter
	PostClients              []string
	PostActivities           []string
	PostExcludeActivities    []string
	PostExcludeTaskFlags     []string
	PostExcludeActivityFlags []string
}

type SimpleScheduler

type SimpleScheduler struct {
	*DefaultScheduler
}

func NewSimpleScheduler

func NewSimpleScheduler(config *specs.TimeMasterConfig, scenario *specs.Scenario) *SimpleScheduler

func (*SimpleScheduler) BuildPrevision

func (s *SimpleScheduler) BuildPrevision(opts SchedulerOpts) (*specs.ScenarioSchedule, error)

type TimeMasterScheduler

type TimeMasterScheduler interface {
	BuildPrevision(SchedulerOpts) (*specs.ScenarioSchedule, error)
	SetClients(*[]specs.Client)
	SetResources(*[]specs.Resource)
	SetTimesheets(*[]specs.AgendaTimesheets)

	// Internal methods
	GetResourcesMap() *map[string]*ResourceDailyMap
	GetTaskMap() *map[string]*specs.TaskScheduled
	GetConfig() *specs.TimeMasterConfig
	GetLogger() *log.TmLogger
	Init() error
}

type WeeklyRecursiveTaskSeer

type WeeklyRecursiveTaskSeer struct {
	*DefaultRecursiveTaskSeer
}

func (*WeeklyRecursiveTaskSeer) GetNextDay

func (r *WeeklyRecursiveTaskSeer) GetNextDay(date string) (string, error)

Jump to

Keyboard shortcuts

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