bamboohr

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBody

func ParseBody(resp *http.Response) ([]byte, error)

func Request

func Request(apiKey string, apiURL string) ([]byte, error)

Types

type Calendar

type Calendar struct {
	Items []Item `xml:"item"`
}

func (*Calendar) Holidays

func (calendar *Calendar) Holidays() []Item

func (*Calendar) ItemsByType

func (calendar *Calendar) ItemsByType(itemType string) []Item

func (*Calendar) TimeOffs

func (calendar *Calendar) TimeOffs() []Item

type Client

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

A Client represents the data required to connect to the BambooHR API

func NewClient

func NewClient(url string) *Client

NewClient creates and returns a new BambooHR client

func (*Client) Away

func (client *Client) Away(itemType, startDate, endDate string) []Item

Away returns a string representation of the people who are out of the office during the defined period

type Employee

type Employee struct {
	ID   int    `xml:"id,attr"`
	Name string `xml:",chardata"`
}

* Note: this currently implements the minimum number of fields to fulfill the Away functionality. * Undoubtedly there are more fields than this to an employee

type Item

type Item struct {
	Employee Employee `xml:"employee"`
	End      string   `xml:"end"`
	Holiday  string   `xml:"holiday"`
	Start    string   `xml:"start"`
	Type     string   `xml:"type,attr"`
}

func (*Item) IsOneDay

func (item *Item) IsOneDay() bool

func (*Item) Name

func (item *Item) Name() string

func (*Item) PrettyEnd

func (item *Item) PrettyEnd() string

func (*Item) PrettyStart

func (item *Item) PrettyStart() string

func (*Item) String

func (item *Item) String() string

type Widget

type Widget struct {
	wtf.TextWidget
}

func NewWidget

func NewWidget() *Widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

Jump to

Keyboard shortcuts

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