client

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCalendarEntryFromGocalEvent

func NewCalendarEntryFromGocalEvent(calName string, e gocal.Event) *pb.CalendarEntry

Types

type Calendar

type Calendar struct {
	Name string `mapstructure:"name"`
	From string `mapstructure:"from"`
	Ical string `mapstructure:"ical"`
}

type ICalClient

type ICalClient struct {
	CustomStatus map[string]*pb.CustomStatus // custom status is a map from calendar-name to status
	// contains filtered or unexported fields
}

func NewICalClient

func NewICalClient(zapLog *otelzap.Logger) *ICalClient

func (*ICalClient) FetchEvents

func (e *ICalClient) FetchEvents(ctx context.Context)

func (*ICalClient) GetCurrentEvent

func (e *ICalClient) GetCurrentEvent(ctx context.Context, calendar string) *pb.CalendarEntry

func (*ICalClient) GetCustomStatus

func (e *ICalClient) GetCustomStatus(ctx context.Context, req *pb.GetCustomStatusRequest) *pb.CustomStatus

func (*ICalClient) GetEvents

func (e *ICalClient) GetEvents(ctx context.Context) *pb.CalendarResponse

func (*ICalClient) SetCustomStatus

func (e *ICalClient) SetCustomStatus(ctx context.Context, req *pb.SetCustomStatusRequest)

type Rule

type Rule struct {
	CalendarName string   `mapstructure:"calendar"`
	Name         string   `mapstructure:"name"`
	Key          string   `mapstructure:"key"`
	Contains     []string `mapstructure:"contains"`
	Skip         bool     `mapstructure:"skip"`
	Message      string   `mapstructure:"message"`
	Important    bool     `mapstructure:"important"`
}

func (*Rule) Evaluate

func (r *Rule) Evaluate(e *pb.CalendarEntry, zapLog *otelzap.Logger) (bool, bool)

Evaluate evaluates a rule against a pb.CalendarEntry and returns (bool, bool) where the first bool indicates if the rule was applied to this pb.CalendarEntry and the second bool indicates if this is a skip rule and the pb.CalendarEntry should be skipped

Jump to

Keyboard shortcuts

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