Documentation ¶
Overview ¶
Package exchange is used as a CalendarService in BusyBee.
It is not recommended to use this package outside of BusyBee. To use with BusyBee make sure to import this package. You can do so by adding the following:
import _ "github.com/dixonwille/busybee/exchange"
But since you will need the Configuration Struct it may just be easier to use it like normal.
Index ¶
- Constants
- func New(conf interface{}, bb *busybee.BusyBee) (busybee.InEventer, error)
- func NewConf() interface{}
- type CalendarEvent
- type Conf
- type Exchange
- type FreeBusyResponse
- type FreeBusyViewOptions
- type GetUserAvailabilityRequest
- type MailboxData
- type MailboxDataArray
- type RequestEnvelope
- type ResponseEnvelope
- type TimeZone
- type TimeZoneTime
Constants ¶
const (
//DateTimeFormat is the format used for request and responses from the server.
DateTimeFormat = "2006-01-02T15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new Exchange Calendar service for BusyBee for consumption. conf holds information on how to create the new instance. Keys that must exist are as follows:
* host - holds the host for the exchange service * user - username to sign in to exchange with * pass - password for the username to sign in to exchange
Types ¶
type CalendarEvent ¶
type CalendarEvent struct { StartTime string `xml:"StartTime"` EndTime string `xml:"EndTime"` BusyType string `xml:"BusyType"` }
CalendarEvent is the start and end time in the requested time zone. Also returns whether they are busy or not at those times.
type Conf ¶ added in v0.1.2
type Conf struct { Host string `quest:"What is the exchange host?"` User string `quest:"What is your exchange username?"` Pass string `quest:"What is your exchange password?,encrypt,pass"` }
Conf holds all the needed information to create a new exchange service.
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
Exchange is of type CalendarService and is used to communicate with an Exchange server.
type FreeBusyResponse ¶
type FreeBusyResponse struct {
CalendarEvents []CalendarEvent `xml:"FreeBusyView>CalendarEventArray>CalendarEvent"`
}
FreeBusyResponse holds all the Calendar Events for a single user.
type FreeBusyViewOptions ¶
type FreeBusyViewOptions struct { StartTime string `xml:"t:TimeWindow>t:StartTime"` EndTime string `xml:"t:TimeWindow>t:EndTime"` MergedFreeBusyIntervalInMinutes int `xml:"t:MergedFreeBusyIntervalInMinutes"` RequestedView string `xml:"t:RequestedView"` }
FreeBusyViewOptions lets the server know how you want to view the data that will be returned. I only care if there is something going on now and if you are busy for it. So I return the minimum required.
type GetUserAvailabilityRequest ¶
type GetUserAvailabilityRequest struct { Xmlns string `xml:"xmlns,attr"` T string `xml:"xmlns:t,attr"` TimeZone TimeZone `xml:"t:TimeZone"` MailboxDataArray MailboxDataArray `xml:"MailboxDataArray"` FreeBusyViewOptions FreeBusyViewOptions `xml:"t:FreeBusyViewOptions"` }
GetUserAvailabilityRequest is the soap request we want to make.
type MailboxData ¶
type MailboxData struct { Address string `xml:"t:Email>t:Address"` AttendeeType string `xml:"t:AttendeeType"` ExcludeConflicts bool `xml:"t:ExcludeConflicts"` }
MailboxData is a single entry in MailboxDataArray. It holds information like which user you want to look up.
type MailboxDataArray ¶
type MailboxDataArray struct {
MailboxData []MailboxData `xml:"t:MailboxData"`
}
MailboxDataArray is the overall structure for each individual email address.
type RequestEnvelope ¶
type RequestEnvelope struct { XMLName xml.Name `xml:"soap:Envelope"` Xsi string `xml:"xmlns:xsi,attr"` Xsd string `xml:"xmlns:xsd,attr"` Soap string `xml:"xmlns:soap,attr"` T string `xml:"xmlns:t,attr"` GetUserAvailabilityRequest GetUserAvailabilityRequest `xml:"soap:Body>GetUserAvailabilityRequest"` }
RequestEnvelope is the main structure of our exchange soap request.
func NewRequestEnvelope ¶
func NewRequestEnvelope(startTime, endTime time.Time, addresses ...string) *RequestEnvelope
NewRequestEnvelope creates the entire request for us. It is highly recommended to use this method first then update values as needed. There are a lot of default values that this creates which is enough for what we need it to do.
type ResponseEnvelope ¶
type ResponseEnvelope struct { XMLName xml.Name `xml:"Envelope"` FreeBusyResponses []FreeBusyResponse `xml:"Body>GetUserAvailabilityResponse>FreeBusyResponseArray>FreeBusyResponse"` }
ResponseEnvelope is the highest level element. There is a single FreeBusyResponse for each user specified in the request.
type TimeZone ¶
type TimeZone struct { Xmlns string `xml:"xmlns,attr"` Bias int `xml:"Bias"` StandardTime TimeZoneTime `xml:"StandardTime"` DaylightTime TimeZoneTime `xml:"DaylightTime"` }
TimeZone is used to tell the server information about our timezone.