konfurbot

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

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

Go to latest
Published: Dec 2, 2016 License: MIT Imports: 1 Imported by: 0

README

Build Status Coverage Status Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type    string
	Speaker string
	Venue   string
	Short   string
	Long    string
	Start   *time.Time
	Finish  *time.Time
}

Event is a single event in conference

type Logger

type Logger interface {
	Log(...interface{}) error
}

Logger is a simple logging wrapper interface

type Schedule

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

Schedule is an implementation of ScheduleStorage

func (*Schedule) AddEvent

func (s *Schedule) AddEvent(event Event)

AddEvent adds event to storage, preserving order of events

func (*Schedule) GetCurrentEventsByType

func (s *Schedule) GetCurrentEventsByType(kind string, now time.Time) []Event

GetCurrentEventsByType returns list of events by type, and only events that have started and not have finished yet

func (*Schedule) GetDayEventsByType

func (s *Schedule) GetDayEventsByType(kind string) []Event

GetDayEventsByType returns list of events by type, and only events that will start before the night time

func (*Schedule) GetEventsByType

func (s *Schedule) GetEventsByType(kind string) []Event

GetEventsByType returns unfiltered list of events by type

func (*Schedule) GetNextEventsByType

func (s *Schedule) GetNextEventsByType(kind string, now time.Time, interval time.Duration) []Event

GetNextEventsByType returns list of events by type, and only events that will start in the next interval

func (*Schedule) GetNightEventsByType

func (s *Schedule) GetNightEventsByType(kind string) []Event

GetNightEventsByType returns list of events by type, and only events that will end after the night time

func (*Schedule) SetNightCutoff

func (s *Schedule) SetNightCutoff(cutoff time.Time)

SetNightCutoff sets time that separates night events from day events

type ScheduleStorage

type ScheduleStorage interface {
	SetNightCutoff(time.Time)
	AddEvent(Event)
	GetEventsByType(string) []Event
	GetCurrentEventsByType(string, time.Time) []Event
	GetNextEventsByType(string, time.Time, time.Duration) []Event
	GetDayEventsByType(string) []Event
	GetNightEventsByType(string) []Event
}

ScheduleStorage provides searching and filtering capabilities over schedule

type Service

type Service interface {
	Start() error
	Stop() error
}

Service is started and stopped in main function, which assembles services into a working application

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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