Documentation ¶
Index ¶
- Constants
- type APIRequest
- type AuthProvider
- type BasicAuth
- type SignRequest
- type SignSlotEvent
- type SignSlots
- type Signs
- type Token
- type TokenAuth
- type TokenResponse
- type User
- type WoffuAPI
- func (w WoffuAPI) CreateToken() (*TokenResponse, error)
- func (w WoffuAPI) GetCurrentUser() (*User, error)
- func (w WoffuAPI) GetSignSlots() (SignSlots, error)
- func (w WoffuAPI) GetSigns() (Signs, error)
- func (w WoffuAPI) GetUserWorkDay(userId int) (*WorkDay, error)
- func (w WoffuAPI) Sign(userId int) (err error)
- type WorkDay
Constants ¶
View Source
const (
BaseURL = "https://app.woffu.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRequest ¶
type APIRequest struct {
// contains filtered or unexported fields
}
type AuthProvider ¶
type SignRequest ¶
type SignSlotEvent ¶
type SignSlots ¶
type SignSlots []struct { ID string `json:"$id"` In SignSlotEvent `json:"In"` Out SignSlotEvent `json:"Out"` Motive struct { ID string `json:"$id"` Name string `json:"Name"` } `json:"Motive"` }
func (SignSlots) TimeWorked ¶ added in v0.2.0
type Signs ¶
type Signs []struct { SignIn bool `json:"SignIn"` IP string `json:"IP"` Date string `json:"Date"` // UTC TrueDate string `json:"TrueDate"` // Local Time }
func (Signs) HasAlreadyClockedIn ¶ added in v0.2.0
type TokenAuth ¶
type TokenAuth struct {
Token string
}
func (*TokenAuth) Authenticate ¶
func (*TokenAuth) Credentials ¶
type TokenResponse ¶
type TokenResponse struct {
AccessToken Token `json:"access_token"`
}
type User ¶
type User struct { UserId int `json:"UserId"` Email string `json:"Email"` FirstName string `json:"FirstName"` CompanyId string `json:"CompanyId"` CompanyName string `json:"CompanyName"` AllocatedDays float64 `json:"AllocatedDays"` ApprovedDays float64 `json:"ApprovedDays"` UsedDays float64 `json:"UsedDays"` }
type WoffuAPI ¶
type WoffuAPI struct {
// contains filtered or unexported fields
}
func NewWithBasicAuth ¶
func NewWithToken ¶
func (WoffuAPI) CreateToken ¶
func (w WoffuAPI) CreateToken() (*TokenResponse, error)
func (WoffuAPI) GetCurrentUser ¶
func (WoffuAPI) GetSignSlots ¶
type WorkDay ¶
type WorkDay struct { StartTime string `json:"StartTime"` TrueStartTime string `json:"TrueStartTime"` EndTime string `json:"EndTime"` TrueEndTime string `json:"TrueEndTime"` ScheduleHours float64 `json:"ScheduleHours"` TrueScheduleHours float64 `json:"TrueScheduleHours"` IsWeekend bool `json:"IsWeekend"` IsHoliday bool `json:"IsHoliday"` IsEvent bool `json:"IsEvent"` IsFlexible bool `json:"IsFlexible"` }
Click to show internal directories.
Click to hide internal directories.