timeline

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTics

func CalculateTics(d time.Duration) (Tics, Tics)

func GenFrame

func GenFrame(start, now time.Time) time.Time

Types

type Entry

type Entry struct {
	Avatar   image.Image
	Color    color.Color
	Sections []Section
}

type EntryBuilder

type EntryBuilder struct {
	Entry
}

func NewEntryBuilder

func NewEntryBuilder(avatar image.Image, color color.Color) *EntryBuilder

func (*EntryBuilder) AddSection

func (b *EntryBuilder) AddSection(start, end time.Time) *EntryBuilder

func (*EntryBuilder) Build

func (b *EntryBuilder) Build() Entry

type Section

type Section struct {
	Start time.Time
	End   time.Time
}

Section represents a time Section in a timeline entry. It is defined by a start and end time.

type Tics

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

type Timeline

type Timeline struct {
	StartTime time.Time
	Indicator time.Time
	EndTime   time.Time
	Entries   []Entry
}

func (Timeline) Generate

func (t Timeline) Generate() io.Reader

type TimelineBuilder

type TimelineBuilder struct {
	Timeline
}

func NewTimelineBuilder

func NewTimelineBuilder(start, end time.Time) *TimelineBuilder

func (*TimelineBuilder) AddEntries

func (b *TimelineBuilder) AddEntries(entries ...Entry) *TimelineBuilder

func (*TimelineBuilder) Build

func (b *TimelineBuilder) Build() Timeline

func (*TimelineBuilder) SetIndicator

func (b *TimelineBuilder) SetIndicator(indicator time.Time) *TimelineBuilder

Jump to

Keyboard shortcuts

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