client

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertWWTStrToMins

func ConvertWWTStrToMins(wwtStr string) (uint, error)

func InitConf

func InitConf() error

func IsConflictErr

func IsConflictErr(err error) bool

func IsNoActivityRunningErr

func IsNoActivityRunningErr(err error) bool

Types

type Client

type Client struct {
	APIHost string
	// contains filtered or unexported fields
}

func Init

func Init(host string, authHeader string) Client

func (*Client) AddActivity

func (c *Client) AddActivity(desc string, start *time.Time, end *time.Time) (*pkg.Activity, error)

func (*Client) AddEmployee

func (c *Client) AddEmployee(name string, surname string, login string, pw string, wwt uint, nwwd uint, adminToken string) error

func (*Client) AddHoliday

func (c *Client) AddHoliday(desc string, start time.Time, end time.Time, legalHoliday bool, sick bool) error

func (*Client) CalcCurrentOverview

func (c *Client) CalcCurrentOverview(t time.Time) error

func (*Client) ChangeAccount

func (c *Client) ChangeAccount(cn bool, cs bool, cl bool, cp bool, cwwt bool, cwwd bool, nhd bool, value string) error
func (c *Client) CreateActivitiesIcalShareLink(name string) (string, error)
func (c *Client) CreateHolidayIcalShareLink(name string) (string, error)

func (*Client) CreateToken

func (c *Client) CreateToken(name string, readonly bool) (*pkg.Token, error)

func (*Client) CreateTokenViaCli

func (c *Client) CreateTokenViaCli(name string, readonly bool) error

func (*Client) DeleteActivity

func (c *Client) DeleteActivity(id uint) error

func (*Client) DeleteEmployee

func (c *Client) DeleteEmployee(login string, adminToken string) error

func (*Client) DeleteHoliday

func (c *Client) DeleteHoliday(id uint) error

func (*Client) DeleteToken

func (c *Client) DeleteToken(id uint) error

func (*Client) Export

func (c *Client) Export(since *time.Time, output string) error

func (*Client) GetAccount

func (c *Client) GetAccount() error

func (*Client) GetActivities

func (c *Client) GetActivities(start time.Time, end time.Time) ([]pkg.Activity, error)

func (*Client) GetHolidays

func (c *Client) GetHolidays(start time.Time, end time.Time, asJSON bool) error

func (*Client) GetHolidaysByType

func (c *Client) GetHolidaysByType(start time.Time, end time.Time, asJSON bool, hType pkg.HolidayType) error

func (*Client) GetTokens

func (c *Client) GetTokens() error

func (*Client) Import

func (c *Client) Import(input string) error

func (*Client) ImportKimai

func (c *Client) ImportKimai(filePath string) error

func (*Client) LinkApp

func (c *Client) LinkApp() error

func (*Client) StartActivity

func (c *Client) StartActivity(desc string) (*pkg.Activity, error)

func (*Client) StopActivity

func (c *Client) StopActivity() (*pkg.Activity, error)

func (*Client) UpdateActivity

func (c *Client) UpdateActivity(desc string, start *time.Time, end *time.Time, id uint) (*pkg.Activity, error)

func (*Client) UpdateHoliday

func (c *Client) UpdateHoliday(desc string, start *time.Time, end *time.Time, id uint, legalHoliday bool, sick bool, free bool) error

type ExportData

type ExportData struct {
	Activities []pkg.Activity
	Holidays   []pkg.Holiday
	WorkDays   []pkg.WorkDay
}

Jump to

Keyboard shortcuts

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