calendarboard

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	CalendarIcon(ctx context.Context, bounds image.Rectangle) (*logo.Logo, error)
	HTTPPathPrefix() string
	DailyEvents(ctx context.Context, date time.Time) ([]*Event, error)
}

API ...

type CalendarBoard

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

CalendarBoard implements board.Board

func New

func New(api API, logger *zap.Logger, config *Config) (*CalendarBoard, error)

New ...

func (*CalendarBoard) Enabler

func (s *CalendarBoard) Enabler() board.Enabler

func (*CalendarBoard) GetHTTPHandlers

func (s *CalendarBoard) GetHTTPHandlers() ([]*board.HTTPHandler, error)

GetHTTPHandlers ...

func (*CalendarBoard) GetRPCHandler

func (s *CalendarBoard) GetRPCHandler() (string, http.Handler)

GetRPCHandler ...

func (*CalendarBoard) HasPriority

func (s *CalendarBoard) HasPriority() bool

HasPriority ...

func (*CalendarBoard) InBetween

func (s *CalendarBoard) InBetween() bool

InBetween ...

func (*CalendarBoard) Name

func (s *CalendarBoard) Name() string

Name ...

func (*CalendarBoard) Render

func (s *CalendarBoard) Render(ctx context.Context, canvas board.Canvas) error

Render ...

func (*CalendarBoard) ScrollMode

func (s *CalendarBoard) ScrollMode() bool

ScrollMode ...

type Config

type Config struct {
	TodayFunc Todayer

	StartEnabled       *atomic.Bool `json:"enabled"`
	BoardDelay         string       `json:"boardDelay"`
	OnTimes            []string     `json:"onTimes"`
	OffTimes           []string     `json:"offTimes"`
	TightScrollPadding int          `json:"tightScrollPadding"`
	CalendarIDs        []string     `json:"calendarIDs"`
	// contains filtered or unexported fields
}

Config ...

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults sets config defaults

type Event

type Event struct {
	Time  time.Time
	Title string
}

Event is a calendar event

type Server

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

Server ...

func (*Server) GetStatus

func (s *Server) GetStatus(ctx context.Context, req *emptypb.Empty) (*pb.StatusResp, error)

GetStatus ...

func (*Server) SetStatus

func (s *Server) SetStatus(ctx context.Context, req *pb.SetStatusReq) (*emptypb.Empty, error)

SetStatus ...

type Todayer

type Todayer func() []time.Time

Todayer is a func that returns a string representing a date that will be used for determining "Today's" games. This is useful in testing what past days looked like

Jump to

Keyboard shortcuts

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