datetime

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int

Alignment is a datetime alignment

const (
	// AlignmentLeft aligns datetime left
	AlignmentLeft Alignment = iota
	// AlignmentRight aligns datetime right
	AlignmentRight
	// AlignmentCentre aligns datetime centrally
	AlignmentCentre
)

type Component

type Component struct {
	NamedPropertiesMap map[string][]string
	Time               *time.Time
	TimeFormat         string
	Start              image.Point
	Size               float64
	MaxWidth           int
	Alignment          Alignment
	Font               *truetype.Font
	Colour             color.NRGBA
	// contains filtered or unexported fields
}

Component implements the Component interface for datetime

func (Component) GetJSONFormat

func (component Component) GetJSONFormat() interface{}

GetJSONFormat returns the JSON structure of a datetime component

func (Component) SetNamedProperties

func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error)

SetNamedProperties proceses the named properties and sets them into the datetime properties

func (Component) VerifyAndSetJSONData

func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error)

VerifyAndSetJSONData processes the data parsed from JSON and uses it to set datetime properties and fill the named properties map

func (Component) Write

func (component Component) Write(canvas render.Canvas) (c render.Canvas, err error)

Write draws datetime on the canvas

Jump to

Keyboard shortcuts

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