adapter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SinkClientFactory

func SinkClientFactory(typ Type) (sync.Sink, error)

SinkClientFactory is a convenience factory. It is needed to retrieve new - default - client implementations.

func SourceClientFactory

func SourceClientFactory(typ Type) (sync.Source, error)

SourceClientFactory is a convenience factory. It is needed to retrieve new - default - client implementations.

Types

type ConfigReader

type ConfigReader interface {
	Adapter() config.Adapter
}

ConfigReader provides an interface for adapters to load their own configuration map. It's the adapter's responsibility to validate that the map is valid.

type Configurable

type Configurable interface {
	Initialize(ctx context.Context, config map[string]interface{}) error
}

Configurable is an interface which defines how arbitrary configuration data can be passed to a struct which implements this interface. Clients should be configurable.

type LogSetter

type LogSetter interface {
	SetLogger(logger *log.Logger)
}

LogSetter can be implemented by a struct to allows injection of a logger instance

type OAuth2Adapter

type OAuth2Adapter interface {
	SetupOauth2(credentials auth.Credentials, storage auth.Storage, bindPort uint) error
}

type SinkAdapter

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

func NewSinkAdapterFromConfig

func NewSinkAdapterFromConfig(ctx context.Context, bindPort uint, config ConfigReader, storage auth.Storage, logger *log.Logger) (*SinkAdapter, error)

func (SinkAdapter) CalendarID

func (a SinkAdapter) CalendarID() string

func (SinkAdapter) CreateEvent

func (a SinkAdapter) CreateEvent(ctx context.Context, e models.Event) error

func (SinkAdapter) DeleteEvent

func (a SinkAdapter) DeleteEvent(ctx context.Context, e models.Event) error

func (SinkAdapter) EventsInTimeframe

func (a SinkAdapter) EventsInTimeframe(ctx context.Context, start time.Time, end time.Time) ([]models.Event, error)

func (SinkAdapter) GetCalendarID added in v0.8.0

func (a SinkAdapter) GetCalendarID() string

func (SinkAdapter) Name

func (a SinkAdapter) Name() string

func (SinkAdapter) UpdateEvent

func (a SinkAdapter) UpdateEvent(ctx context.Context, e models.Event) error

type SourceAdapter

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

func NewSourceAdapterFromConfig

func NewSourceAdapterFromConfig(ctx context.Context, bindPort uint, config ConfigReader, storage auth.Storage, logger *log.Logger) (*SourceAdapter, error)

func (SourceAdapter) CalendarID

func (a SourceAdapter) CalendarID() string

func (SourceAdapter) EventsInTimeframe

func (a SourceAdapter) EventsInTimeframe(ctx context.Context, start time.Time, end time.Time) ([]models.Event, error)

func (SourceAdapter) GetCalendarID added in v0.8.0

func (a SourceAdapter) GetCalendarID() string

func (SourceAdapter) Name

func (a SourceAdapter) Name() string

type Type

type Type string
const (
	GoogleCalendarType      Type = "google"
	ZepCalendarType         Type = "zep"
	OutlookCalendarType     Type = "outlook"
	OutlookHttpCalendarType Type = "outlook_http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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