event

package
v0.0.0-...-bc49666 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	EventName      string
	Location       string
	TimeRangesList []TimeRange
	EventTime      EventTime
}

func BuildEventByParameters

func BuildEventByParameters(
	name string,
	location string,
	timeRangesStrings []TimeRange,
	duration time.Duration,
	precautionDuration time.Duration,
	actualStartingTime time.Time) (eventResult Event)

func BuildEventFronYAML

func BuildEventFronYAML(yamlPath string) (Event, error)

func (Event) CreateEventsList

func (event Event) CreateEventsList() []Event

Get all possible events with updated ActualStartingTime.

func (Event) GetEventData

func (e Event) GetEventData() string

func (*Event) RegisterTimeRange

func (event *Event) RegisterTimeRange(newTimeRange TimeRange)

type EventTime

type EventTime struct {
	Duration           time.Duration
	PrecautionDuration time.Duration
	// contains filtered or unexported fields
}

func (EventTime) ActualStartingTime

func (et EventTime) ActualStartingTime() time.Time

func (EventTime) AreCoincide

func (currentEventTime EventTime) AreCoincide(eventTime EventTime) bool

func (EventTime) EndingTime

func (et EventTime) EndingTime() time.Time

The ActualStartingTime plus the Duration of event

func (EventTime) StartingTime

func (et EventTime) StartingTime() time.Time

The ActualStartingTime minus the PrecautionTime

type TimeRange

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

func CreateRange

func CreateRange(start time.Time, end time.Time) (timeRange TimeRange)

func CreateRangeByDuration

func CreateRangeByDuration(start time.Time, duration time.Duration) (timeRange TimeRange)

func (TimeRange) AreCoincide

func (currentTimeRange TimeRange) AreCoincide(timeRange TimeRange) bool

The ActualStartingTime minus the PrecautionTime

func (TimeRange) EndingTime

func (timeRange TimeRange) EndingTime() time.Time

func (TimeRange) StartingTime

func (timeRange TimeRange) StartingTime() time.Time

Jump to

Keyboard shortcuts

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