openproject

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

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"`
	Name string `json:"name"`
}

func NewActivityFromWorkType

func NewActivityFromWorkType(
	config config.Config, issueId int, workType string,
) (Activity, error)

type TimeEntry

type TimeEntry struct {
	Ongoing bool `json:"ongoing"`
	Comment struct {
		Raw string `json:"raw"`
	} `json:"comment"`
	SpentOn string `json:"spentOn"`
	Hours   string `json:"hours"`
	Links   struct {
		WorkPackage struct {
			Href  string `json:"href"`
			Title string `json:"title"`
		} `json:"workPackage"`
		Activity struct {
			Href  string `json:"href"`
			Title string `json:"title"`
		} `json:"activity"`
		Project struct {
			Href  string `json:"href,omitempty"`
			Title string `json:"title,omitempty"`
		} `json:"project,omitempty"`
		User struct {
			Href  string `json:"href,omitempty"`
			Title string `json:"title,omitempty"`
		} `json:"user,omitempty"`
	} `json:"_links"`
}

func GetAllTimeEntries

func GetAllTimeEntries(config *config.Config, user User, startDate string, endDate string, workpackages []any) ([]TimeEntry, error)

func (TimeEntry) GetDuration

func (timeEntry TimeEntry) GetDuration() (time.Duration, error)

func (TimeEntry) GetHumanReadableDuration

func (timeEntry TimeEntry) GetHumanReadableDuration() (string, error)

func (TimeEntry) Save

func (timeEntry TimeEntry) Save(config config.Config) error

type User

type User struct {
	Name string `json:"name"`
	Id   int    `json:"id"`
}

func FindUserByName

func FindUserByName(config *config.Config, search string) (User, error)

FindUserByName searches for users that match the given search and returns the first match.

type WorkPackage

type WorkPackage struct {
	Subject string `json:"subject"`
	Id      int    `json:"id"`
}

func GetWorkpackage

func GetWorkpackage(workPackageId string, config *config.Config) (WorkPackage, error)

func NewWorkPackage

func NewWorkPackage(id int, subject string) WorkPackage

Jump to

Keyboard shortcuts

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