ews

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 13 Imported by: 0

README

Go Bindings for Exchange Web Service (EWS)

SOAP-based XML client implementation for Exchange Web Service (EWS)

Usage

package main

import (
	"github.com/konimarti/ews"
)

func main() {

.. TODO ..

}

Supported EWS operations

  • FindFolder (with pagination)
  • FindItem (with pagination)
  • SyncFolderHierarchy
  • SyncFolderItems
  • GetFolder
  • GetItem
  • UpdateItem
  • CreateItem (message)
Credits

Inspired from github.com/andlabs/ews

Reference

https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/ews-operations-in-exchange

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFolder

func FindFolder(
	ctx context.Context,
	c Client,
	request *req.FindFolderRequest,
	chunks chan<- FolderChunk,
)

func FindItem

func FindItem(
	ctx context.Context,
	c Client,
	request *req.FindItemRequest,
	chunks chan<- ItemsChunk,
)

func GetFolder

func GetFolder(ctx context.Context, c Client, r *req.GetFolderRequest) (*resp.Folder, error)

func GetItem

func GetItem(ctx context.Context, c Client, r *req.GetItemRequest) (*resp.Item, error)

func NewClient

func NewClient(config Config) *client

func NewError

func NewError(resp *http.Response) error

func SetReadFlagRequest

func SetReadFlagRequest(id common.ItemId, flag bool) interface{}

func SyncFolderHierarchy

func SyncFolderHierarchy(
	ctx context.Context,
	c Client,
	request *req.SyncFolderHierarchyRequest,
	chunks chan<- SyncHierarchy,
)

func SyncFolderItems

func SyncFolderItems(
	ctx context.Context,
	c Client,
	request *req.SyncFolderItemsRequest,
	chunks chan<- SyncChunk,
)

func UpdateItem

func UpdateItem(ctx context.Context, c Client, request interface{}) error

Types

type Client

type Client interface {
	Do(ctx context.Context, request interface{}) (*resp.Envelope, error)
	Endpoint() string
	Username() string
	Status() error
}

type Config

type Config struct {
	Endpoint string
	Username string
	Token    string
	Debug    bool
}

type FolderChunk

type FolderChunk struct {
	Folders []resp.Folder
	Err     error
}

type HTTPError

type HTTPError struct {
	Status     string
	StatusCode int
}

func (HTTPError) Error

func (s HTTPError) Error() string

type ItemsChunk

type ItemsChunk struct {
	Items resp.Items
	Err   error
}

type SoapError

type SoapError struct {
	Fault *resp.Fault
}

func (SoapError) Error

func (s SoapError) Error() string

type SyncChunk

type SyncChunk struct {
	State *common.SyncState
	Chunk *resp.ItemChanges
	Err   error
}

type SyncHierarchy

type SyncHierarchy struct {
	State *common.SyncState
	Chunk *resp.FolderChanges
	Err   error
}

Directories

Path Synopsis
cmds
ews

Jump to

Keyboard shortcuts

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