Help us shape the future of Go! Take the 2026 Go Developer Survey

xchango

package module
v0.0.0-...-cc4f54c Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2015 License: MIT Imports: 11 Imported by: 0

README

Exchango

Read calendar information from an Exchange Server using Go.

Build Status Build Status

Install

go get github.com/sgoertzen/xchango

Usage

import "github.com/sgoertzen/xchango"

func main() {
	xchango.SetExchangeConfig(/* your class that implements ExchangeConfig interface */)
	
	user := ExchangeUser { Username: "sally", Password: "123" }
	cal, err := xchango.GetExchangeCalendar(user)
	if err != nil {
		// handle error
	}
	
	appointments, er := xchango.GetExchangeAppointments(user, cal)
	if er != nil {
		// handle error
	}
	
	for _, app := range appointments {
		// Do something with each appointment
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExchangeAppointments

func GetExchangeAppointments(user *ExchangeUser, cal *ExchangeCalendar) (*[]Appointment, error)

func SetExchangeConfig

func SetExchangeConfig(config ExchangeConfig)

Types

type Appointment

type Appointment struct {
	ItemId         string
	ChangeKey      string
	Subject        string
	Cc             string
	To             string
	Start          time.Time
	End            time.Time
	IsAllDayEvent  bool
	Location       string
	MyResponseType string
	Organizer      string
	Body           string
	BodyType       string
}

func (*Appointment) BuildDesc

func (a *Appointment) BuildDesc() string

func (Appointment) String

func (a Appointment) String() string

type Body

type Body struct {
	BodyType string `xml:"BodyType,attr"`
	Body     string `xml:",chardata"`
}

type CalendarItem

type CalendarItem struct {
	ItemId         ItemId
	Subject        string
	DisplayCc      string
	DisplayTo      string
	Start          string
	End            string
	IsAllDayEvent  bool
	Location       string
	MyResponseType string
	Organizer      Organizer
	Body           Body
}

func (CalendarItem) ToAppointment

func (c CalendarItem) ToAppointment() Appointment

type ExchangeCalendar

type ExchangeCalendar struct {
	Folderid  string
	Changekey string
}

func GetExchangeCalendar

func GetExchangeCalendar(user *ExchangeUser) (*ExchangeCalendar, error)

type ExchangeConfig

type ExchangeConfig interface {
	ExchangeURL() string
	MaxFetchSize() int
	UserDomain() string
	ExchangeVersion() string
	LookAheadDays() int
}

type ExchangeUser

type ExchangeUser struct {
	Username string
	Password string
}

type ItemId

type ItemId struct {
	Id        string `xml:"Id,attr"`
	ChangeKey string `xml:"ChangeKey,attr"`
}

type Mailbox

type Mailbox struct {
	Name string
}

type Organizer

type Organizer struct {
	Mailbox Mailbox
}

Jump to

Keyboard shortcuts

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