website

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 50 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWindow = Window{From: NewTimeOfDay(9, 0, 0), To: NewTimeOfDay(21, 0, 0)}

DefaultWindow is the window used for a time field whose model declares none: a working day of 09:00 through 21:00. Under it a bare "7" reads as 7:00 PM and a bare "10" as 10:00 AM. Assign to it to retune every such field at once; a field that declares a window in the model is unaffected.

View Source
var ErrInvalidWeekday = errors.New("not a valid Weekday")

Functions

func ChainTimeEntries

func ChainTimeEntries(entries ...*TimeEntry)

ChainTimeEntries biases a run of time entries to read in order, each one after every filled entry before it. It is what makes a start/end pair read naturally: with entries chained, typing "7" then "9" gives 7:00 PM and 9:00 PM rather than 9:00 AM.

The reference is the running maximum of the earlier readings, so an explicit earlier value ("9am" for the first end of a window) cannot drag a later entry back before the start. A blank or unparseable entry does not advance it.

Chaining only ever sets biases; it never revises an entry's value. Each edit re-runs the pass so the entries after it read the new state, but the entries themselves keep whatever they were already read as. Editing one field of a chained run therefore leaves the other fields' values exactly as they were.

Chaining wires each entry's OnResolved, so set OnResolved before calling this -- an existing callback is kept and still runs.

func I18n

func I18n(w fyne.Window) fyne.CanvasObject

I18n builds the i18n tab: a table of message keys with each locale's translation side-by-side, plus controls to choose the website folder, add and remove messages, reload from disk, and save all locale files.

func TransformBind

func TransformBind[S, T any](
	src binding.Item[S],
	forward func(S) (T, error),
	reverse func(T) (S, error),
) binding.Item[T]

TransformBind adapts an existing binding into one carrying a different representation of the same underlying value. Use it when a widget's text is not the model value verbatim -- for example a clock-time entry showing "7pm" backed by a "19:00" string field -- where the generated <Field>Item bindings cannot map one-to-one.

Pass the field's generated <Field>Item as src. forward converts the source value to the widget representation (S -> T); reverse converts it back (T -> S). A reverse error leaves the underlying value unchanged so a widget can hold an unparseable draft while its Validator surfaces the problem, matching the permissive behaviour of the generated <Field>Item setters.

Because binding.String, binding.Bool, binding.Int and binding.Float are aliases for binding.Item[string|bool|int|float64], the result binds directly to the matching widget: TransformBind[string, string](world.ClockItem(), ...) yields a binding.String for widget.Entry.Bind.

func Website

func Website(w fyne.Window) fyne.CanvasObject

Website builds the Website tab.

Types

type Bias

type Bias struct {
	After  *TimeOfDay
	Before *TimeOfDay
}

Bias steers how an ambiguous clock entry is read, from what the rest of a form already says. A field holding the end of a span sets After to the span's start, so typing "7" then "9" reads as 7:00 PM then 9:00 PM rather than 9:00 AM. Both bounds are exclusive, and a nil bound is no constraint.

type HelpButton

type HelpButton struct {
	widget.Button

	// Help is the text shown in the popup, compiled in from the field's desc
	// by the generated New<Field>Help constructors. An empty Help opens
	// nothing.
	Help string
	// contains filtered or unexported fields
}

HelpButton is a question-mark button that reveals a field's description in a popup. Tapping it toggles the popup open or closed; tapping anywhere else closes it.

ponytail: click only, no hover. The popup sits on the canvas overlay stack, and that overlay covers the whole canvas and takes hover over from the button, so a hover-opened popup would flicker as soon as the pointer moved: open, mouse-out, close, mouse-in, open. Opening on hover needs a tooltip layer inside the window content, the way fyne-tooltip does it; add that if hover matters.

func NewHelpButton

func NewHelpButton(help string) *HelpButton

NewHelpButton returns a help button showing help when tapped. The generated New<Field>Help constructors call it with the field's description.

func (*HelpButton) Close

func (b *HelpButton) Close()

Close hides the popup if it is open.

func (*HelpButton) Open

func (b *HelpButton) Open()

Open shows the description in a popup directly below the button. It does nothing for an empty Help, for an already-open popup, or for a button that is not on a canvas yet.

func (*HelpButton) Toggle

func (b *HelpButton) Toggle()

Toggle opens the popup if it is closed and closes it if it is open. It is the button's OnTapped.

type LocaleName

type LocaleName struct {
	Locale string
	Name   string
	// contains filtered or unexported fields
}

func (*LocaleName) AddListener

func (b *LocaleName) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*LocaleName) GetItem

func (self *LocaleName) GetItem(key string) (binding.DataItem, error)

func (*LocaleName) GetValue

func (self *LocaleName) GetValue(key string) (any, error)

func (*LocaleName) Keys

func (self *LocaleName) Keys() []string

func (*LocaleName) LocaleItem

func (self *LocaleName) LocaleItem() binding.String

LocaleItem returns a typed two-way binding for the locale field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire LocaleValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*LocaleName) LocaleValidator

func (self *LocaleName) LocaleValidator() func(string) error

LocaleValidator returns a Fyne validator enforcing the same constraints as Validate for the locale field. Assign it to a widget's Validator (for example widget.Entry.Validator).

func (*LocaleName) MarshalJSON

func (self *LocaleName) MarshalJSON() ([]byte, error)

func (*LocaleName) MarshalYAML

func (self *LocaleName) MarshalYAML() (any, error)

func (*LocaleName) NameItem

func (self *LocaleName) NameItem() binding.String

NameItem returns a typed two-way binding for the name field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire NameValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*LocaleName) NameValidator

func (self *LocaleName) NameValidator() func(string) error

NameValidator returns a Fyne validator enforcing the same constraints as Validate for the name field. Assign it to a widget's Validator (for example widget.Entry.Validator).

func (*LocaleName) NewLocaleFormItem

func (self *LocaleName) NewLocaleFormItem(w fyne.CanvasObject) *widget.FormItem

NewLocaleFormItem labels w with the locale field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*LocaleName) NewLocaleHelp

func (self *LocaleName) NewLocaleHelp() *HelpButton

NewLocaleHelp returns a help button carrying the locale field's description from the model, to place beside the field's widget. Tapping it shows the description; NewLocaleFormItem places one for you.

func (*LocaleName) NewNameFormItem

func (self *LocaleName) NewNameFormItem(w fyne.CanvasObject) *widget.FormItem

NewNameFormItem labels w with the name field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*LocaleName) NewNameHelp

func (self *LocaleName) NewNameHelp() *HelpButton

NewNameHelp returns a help button carrying the name field's description from the model, to place beside the field's widget. Tapping it shows the description; NewNameFormItem places one for you.

func (*LocaleName) Reload

func (self *LocaleName) Reload() error

func (*LocaleName) RemoveListener

func (b *LocaleName) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*LocaleName) SetValue

func (self *LocaleName) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*LocaleName) SetValueChecked

func (self *LocaleName) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*LocaleName) UnmarshalJSON

func (self *LocaleName) UnmarshalJSON(data []byte) error

func (*LocaleName) UnmarshalYAML

func (self *LocaleName) UnmarshalYAML(node *yaml.Node) error

func (*LocaleName) Validate

func (self *LocaleName) Validate() error

type Optional

type Optional[T any] struct {
	// contains filtered or unexported fields
}

Optional wraps a value that may be absent, keeping "not set" distinct from the zero value of T.

func None

func None[T any]() Optional[T]

None builds an unset Optional.

func Some

func Some[T any](v T) Optional[T]

Some builds a set Optional holding v.

func (Optional[T]) Get

func (o Optional[T]) Get(def T) T

Get returns the value when present, otherwise def.

func (Optional[T]) GetOrZero

func (o Optional[T]) GetOrZero() T

GetOrZero returns the value when present, otherwise the zero value of T.

func (Optional[T]) IsNone

func (o Optional[T]) IsNone() bool

IsNone reports whether the value is absent.

func (Optional[T]) IsSome

func (o Optional[T]) IsSome() bool

IsSome reports whether a value is present.

type ScheduleDay

type ScheduleDay struct {
	Weekday Weekday
	Streams []Stream
	// contains filtered or unexported fields
}

func (*ScheduleDay) AddListener

func (b *ScheduleDay) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*ScheduleDay) GetItem

func (self *ScheduleDay) GetItem(key string) (binding.DataItem, error)

func (*ScheduleDay) GetValue

func (self *ScheduleDay) GetValue(key string) (any, error)

func (*ScheduleDay) Keys

func (self *ScheduleDay) Keys() []string

func (*ScheduleDay) MarshalJSON

func (self *ScheduleDay) MarshalJSON() ([]byte, error)

func (*ScheduleDay) MarshalYAML

func (self *ScheduleDay) MarshalYAML() (any, error)

func (*ScheduleDay) NewStreamsFormItem

func (self *ScheduleDay) NewStreamsFormItem(w fyne.CanvasObject) *widget.FormItem

NewStreamsFormItem labels w with the streams field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*ScheduleDay) NewStreamsHelp

func (self *ScheduleDay) NewStreamsHelp() *HelpButton

NewStreamsHelp returns a help button carrying the streams field's description from the model, to place beside the field's widget. Tapping it shows the description; NewStreamsFormItem places one for you.

func (*ScheduleDay) NewWeekdayFormItem

func (self *ScheduleDay) NewWeekdayFormItem(w fyne.CanvasObject) *widget.FormItem

NewWeekdayFormItem labels w with the weekday field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*ScheduleDay) NewWeekdayHelp

func (self *ScheduleDay) NewWeekdayHelp() *HelpButton

NewWeekdayHelp returns a help button carrying the weekday field's description from the model, to place beside the field's widget. Tapping it shows the description; NewWeekdayFormItem places one for you.

func (*ScheduleDay) Reload

func (self *ScheduleDay) Reload() error

func (*ScheduleDay) RemoveListener

func (b *ScheduleDay) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*ScheduleDay) SetValue

func (self *ScheduleDay) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*ScheduleDay) SetValueChecked

func (self *ScheduleDay) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*ScheduleDay) UnmarshalJSON

func (self *ScheduleDay) UnmarshalJSON(data []byte) error

func (*ScheduleDay) UnmarshalYAML

func (self *ScheduleDay) UnmarshalYAML(node *yaml.Node) error

func (*ScheduleDay) Validate

func (self *ScheduleDay) Validate() error

type ScheduleEnd

type ScheduleEnd struct {
	Earliest Optional[TimeOfDay]
	Latest   Optional[TimeOfDay]
	// contains filtered or unexported fields
}

func (*ScheduleEnd) AddListener

func (b *ScheduleEnd) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*ScheduleEnd) EarliestItem

func (self *ScheduleEnd) EarliestItem() binding.Item[TimeOfDay]

EarliestItem returns a typed two-way binding for the earliest field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire EarliestValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*ScheduleEnd) EarliestOptionalItem

func (self *ScheduleEnd) EarliestOptionalItem() binding.Item[Optional[TimeOfDay]]

EarliestOptionalItem returns a typed two-way binding for the earliest field that keeps the field's unset state, which EarliestItem does not -- that one reads an unset field as midnight. TimeEntry.BindOptional consumes this one, so a blank entry round-trips as unset, not as a time.

func (*ScheduleEnd) GetItem

func (self *ScheduleEnd) GetItem(key string) (binding.DataItem, error)

func (*ScheduleEnd) GetValue

func (self *ScheduleEnd) GetValue(key string) (any, error)

func (*ScheduleEnd) Keys

func (self *ScheduleEnd) Keys() []string

func (*ScheduleEnd) LatestItem

func (self *ScheduleEnd) LatestItem() binding.Item[TimeOfDay]

LatestItem returns a typed two-way binding for the latest field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire LatestValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*ScheduleEnd) LatestOptionalItem

func (self *ScheduleEnd) LatestOptionalItem() binding.Item[Optional[TimeOfDay]]

LatestOptionalItem returns a typed two-way binding for the latest field that keeps the field's unset state, which LatestItem does not -- that one reads an unset field as midnight. TimeEntry.BindOptional consumes this one, so a blank entry round-trips as unset, not as a time.

func (*ScheduleEnd) MarshalJSON

func (self *ScheduleEnd) MarshalJSON() ([]byte, error)

func (*ScheduleEnd) MarshalYAML

func (self *ScheduleEnd) MarshalYAML() (any, error)

func (*ScheduleEnd) NewEarliestEntry

func (self *ScheduleEnd) NewEarliestEntry() *TimeEntry

NewEarliestEntry returns a TimeEntry bound to the earliest field, with the field's preferred hours from the model compiled in. Set the entry's Bias (or pass it to ChainTimeEntries) to have it read in step with the rest of the form.

func (*ScheduleEnd) NewEarliestFormItem

func (self *ScheduleEnd) NewEarliestFormItem(w fyne.CanvasObject) *widget.FormItem

NewEarliestFormItem labels w with the earliest field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*ScheduleEnd) NewEarliestHelp

func (self *ScheduleEnd) NewEarliestHelp() *HelpButton

NewEarliestHelp returns a help button carrying the earliest field's description from the model, to place beside the field's widget. Tapping it shows the description; NewEarliestFormItem places one for you.

func (*ScheduleEnd) NewLatestEntry

func (self *ScheduleEnd) NewLatestEntry() *TimeEntry

NewLatestEntry returns a TimeEntry bound to the latest field, with the field's preferred hours from the model compiled in. Set the entry's Bias (or pass it to ChainTimeEntries) to have it read in step with the rest of the form.

func (*ScheduleEnd) NewLatestFormItem

func (self *ScheduleEnd) NewLatestFormItem(w fyne.CanvasObject) *widget.FormItem

NewLatestFormItem labels w with the latest field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*ScheduleEnd) NewLatestHelp

func (self *ScheduleEnd) NewLatestHelp() *HelpButton

NewLatestHelp returns a help button carrying the latest field's description from the model, to place beside the field's widget. Tapping it shows the description; NewLatestFormItem places one for you.

func (*ScheduleEnd) Reload

func (self *ScheduleEnd) Reload() error

func (*ScheduleEnd) RemoveListener

func (b *ScheduleEnd) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*ScheduleEnd) SetValue

func (self *ScheduleEnd) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*ScheduleEnd) SetValueChecked

func (self *ScheduleEnd) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*ScheduleEnd) UnmarshalJSON

func (self *ScheduleEnd) UnmarshalJSON(data []byte) error

func (*ScheduleEnd) UnmarshalYAML

func (self *ScheduleEnd) UnmarshalYAML(node *yaml.Node) error

func (*ScheduleEnd) Validate

func (self *ScheduleEnd) Validate() error

type Site

type Site struct {
	StreamName string
	Streamer   string
	TitleFont  Optional[string]
	TextFont   Optional[string]
	// contains filtered or unexported fields
}

func (*Site) AddListener

func (b *Site) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*Site) GetItem

func (self *Site) GetItem(key string) (binding.DataItem, error)

func (*Site) GetValue

func (self *Site) GetValue(key string) (any, error)

func (*Site) Keys

func (self *Site) Keys() []string

func (*Site) LogoItem

func (self *Site) LogoItem() binding.String

LogoItem returns a typed two-way binding for the logo field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire LogoValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Site) MarshalJSON

func (self *Site) MarshalJSON() ([]byte, error)

func (*Site) MarshalYAML

func (self *Site) MarshalYAML() (any, error)

func (*Site) NewLogoFormItem

func (self *Site) NewLogoFormItem(w fyne.CanvasObject) *widget.FormItem

NewLogoFormItem labels w with the logo field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Site) NewLogoHelp

func (self *Site) NewLogoHelp() *HelpButton

NewLogoHelp returns a help button carrying the logo field's description from the model, to place beside the field's widget. Tapping it shows the description; NewLogoFormItem places one for you.

func (*Site) NewStreamNameFormItem

func (self *Site) NewStreamNameFormItem(w fyne.CanvasObject) *widget.FormItem

NewStreamNameFormItem labels w with the stream_name field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Site) NewStreamNameHelp

func (self *Site) NewStreamNameHelp() *HelpButton

NewStreamNameHelp returns a help button carrying the stream_name field's description from the model, to place beside the field's widget. Tapping it shows the description; NewStreamNameFormItem places one for you.

func (*Site) NewStreamerFormItem

func (self *Site) NewStreamerFormItem(w fyne.CanvasObject) *widget.FormItem

NewStreamerFormItem labels w with the streamer field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Site) NewStreamerHelp

func (self *Site) NewStreamerHelp() *HelpButton

NewStreamerHelp returns a help button carrying the streamer field's description from the model, to place beside the field's widget. Tapping it shows the description; NewStreamerFormItem places one for you.

func (*Site) NewTextFontFormItem

func (self *Site) NewTextFontFormItem(w fyne.CanvasObject) *widget.FormItem

NewTextFontFormItem labels w with the text_font field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Site) NewTextFontHelp

func (self *Site) NewTextFontHelp() *HelpButton

NewTextFontHelp returns a help button carrying the text_font field's description from the model, to place beside the field's widget. Tapping it shows the description; NewTextFontFormItem places one for you.

func (*Site) NewTitleFontFormItem

func (self *Site) NewTitleFontFormItem(w fyne.CanvasObject) *widget.FormItem

NewTitleFontFormItem labels w with the title_font field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Site) NewTitleFontHelp

func (self *Site) NewTitleFontHelp() *HelpButton

NewTitleFontHelp returns a help button carrying the title_font field's description from the model, to place beside the field's widget. Tapping it shows the description; NewTitleFontFormItem places one for you.

func (*Site) Reload

func (self *Site) Reload() error

func (*Site) RemoveListener

func (b *Site) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*Site) SetValue

func (self *Site) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*Site) SetValueChecked

func (self *Site) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*Site) StreamNameItem

func (self *Site) StreamNameItem() binding.String

StreamNameItem returns a typed two-way binding for the stream_name field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire StreamNameValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Site) StreamerItem

func (self *Site) StreamerItem() binding.String

StreamerItem returns a typed two-way binding for the streamer field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire StreamerValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Site) TextFontItem

func (self *Site) TextFontItem() binding.String

TextFontItem returns a typed two-way binding for the text_font field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire TextFontValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Site) TitleFontItem

func (self *Site) TitleFontItem() binding.String

TitleFontItem returns a typed two-way binding for the title_font field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire TitleFontValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Site) UnmarshalJSON

func (self *Site) UnmarshalJSON(data []byte) error

func (*Site) UnmarshalYAML

func (self *Site) UnmarshalYAML(node *yaml.Node) error

func (*Site) Validate

func (self *Site) Validate() error

type Stream

type Stream struct {
	Start    TimeOfDay
	End      ScheduleEnd
	Game     string
	Platform Optional[string]
	World    Optional[string]
	// contains filtered or unexported fields
}

func (*Stream) AddListener

func (b *Stream) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*Stream) GameItem

func (self *Stream) GameItem() binding.String

GameItem returns a typed two-way binding for the game field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire GameValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Stream) GetItem

func (self *Stream) GetItem(key string) (binding.DataItem, error)

func (*Stream) GetValue

func (self *Stream) GetValue(key string) (any, error)

func (*Stream) Keys

func (self *Stream) Keys() []string

func (*Stream) MarshalJSON

func (self *Stream) MarshalJSON() ([]byte, error)

func (*Stream) MarshalYAML

func (self *Stream) MarshalYAML() (any, error)

func (*Stream) NewEndFormItem

func (self *Stream) NewEndFormItem(w fyne.CanvasObject) *widget.FormItem

NewEndFormItem labels w with the end field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Stream) NewEndHelp

func (self *Stream) NewEndHelp() *HelpButton

NewEndHelp returns a help button carrying the end field's description from the model, to place beside the field's widget. Tapping it shows the description; NewEndFormItem places one for you.

func (*Stream) NewGameFormItem

func (self *Stream) NewGameFormItem(w fyne.CanvasObject) *widget.FormItem

NewGameFormItem labels w with the game field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Stream) NewGameHelp

func (self *Stream) NewGameHelp() *HelpButton

NewGameHelp returns a help button carrying the game field's description from the model, to place beside the field's widget. Tapping it shows the description; NewGameFormItem places one for you.

func (*Stream) NewPlatformFormItem

func (self *Stream) NewPlatformFormItem(w fyne.CanvasObject) *widget.FormItem

NewPlatformFormItem labels w with the platform field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Stream) NewPlatformHelp

func (self *Stream) NewPlatformHelp() *HelpButton

NewPlatformHelp returns a help button carrying the platform field's description from the model, to place beside the field's widget. Tapping it shows the description; NewPlatformFormItem places one for you.

func (*Stream) NewStartEntry

func (self *Stream) NewStartEntry() *TimeEntry

NewStartEntry returns a TimeEntry bound to the start field, with the field's preferred hours from the model compiled in. Set the entry's Bias (or pass it to ChainTimeEntries) to have it read in step with the rest of the form.

func (*Stream) NewStartFormItem

func (self *Stream) NewStartFormItem(w fyne.CanvasObject) *widget.FormItem

NewStartFormItem labels w with the start field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Stream) NewStartHelp

func (self *Stream) NewStartHelp() *HelpButton

NewStartHelp returns a help button carrying the start field's description from the model, to place beside the field's widget. Tapping it shows the description; NewStartFormItem places one for you.

func (*Stream) NewWorldFormItem

func (self *Stream) NewWorldFormItem(w fyne.CanvasObject) *widget.FormItem

NewWorldFormItem labels w with the world field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Stream) NewWorldHelp

func (self *Stream) NewWorldHelp() *HelpButton

NewWorldHelp returns a help button carrying the world field's description from the model, to place beside the field's widget. Tapping it shows the description; NewWorldFormItem places one for you.

func (*Stream) PlatformItem

func (self *Stream) PlatformItem() binding.String

PlatformItem returns a typed two-way binding for the platform field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire PlatformValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Stream) Reload

func (self *Stream) Reload() error

func (*Stream) RemoveListener

func (b *Stream) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*Stream) SetValue

func (self *Stream) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*Stream) SetValueChecked

func (self *Stream) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*Stream) StartItem

func (self *Stream) StartItem() binding.Item[TimeOfDay]

StartItem returns a typed two-way binding for the start field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire StartValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*Stream) UnmarshalJSON

func (self *Stream) UnmarshalJSON(data []byte) error

func (*Stream) UnmarshalYAML

func (self *Stream) UnmarshalYAML(node *yaml.Node) error

func (*Stream) Validate

func (self *Stream) Validate() error

func (*Stream) WorldItem

func (self *Stream) WorldItem() binding.String

WorldItem returns a typed two-way binding for the world field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire WorldValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

type StreamerConfig

type StreamerConfig struct {
	Worlds   []World
	Schedule []ScheduleDay
	Theme    Theme
	Site     Site
	// contains filtered or unexported fields
}

func (*StreamerConfig) AddListener

func (b *StreamerConfig) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*StreamerConfig) GetItem

func (self *StreamerConfig) GetItem(key string) (binding.DataItem, error)

func (*StreamerConfig) GetValue

func (self *StreamerConfig) GetValue(key string) (any, error)

func (*StreamerConfig) Keys

func (self *StreamerConfig) Keys() []string

func (*StreamerConfig) MarshalJSON

func (self *StreamerConfig) MarshalJSON() ([]byte, error)

func (*StreamerConfig) MarshalYAML

func (self *StreamerConfig) MarshalYAML() (any, error)

func (*StreamerConfig) NewScheduleFormItem

func (self *StreamerConfig) NewScheduleFormItem(w fyne.CanvasObject) *widget.FormItem

NewScheduleFormItem labels w with the schedule field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*StreamerConfig) NewScheduleHelp

func (self *StreamerConfig) NewScheduleHelp() *HelpButton

NewScheduleHelp returns a help button carrying the schedule field's description from the model, to place beside the field's widget. Tapping it shows the description; NewScheduleFormItem places one for you.

func (*StreamerConfig) NewSiteFormItem

func (self *StreamerConfig) NewSiteFormItem(w fyne.CanvasObject) *widget.FormItem

NewSiteFormItem labels w with the site field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*StreamerConfig) NewSiteHelp

func (self *StreamerConfig) NewSiteHelp() *HelpButton

NewSiteHelp returns a help button carrying the site field's description from the model, to place beside the field's widget. Tapping it shows the description; NewSiteFormItem places one for you.

func (*StreamerConfig) NewThemeFormItem

func (self *StreamerConfig) NewThemeFormItem(w fyne.CanvasObject) *widget.FormItem

NewThemeFormItem labels w with the theme field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*StreamerConfig) NewThemeHelp

func (self *StreamerConfig) NewThemeHelp() *HelpButton

NewThemeHelp returns a help button carrying the theme field's description from the model, to place beside the field's widget. Tapping it shows the description; NewThemeFormItem places one for you.

func (*StreamerConfig) NewWorldsFormItem

func (self *StreamerConfig) NewWorldsFormItem(w fyne.CanvasObject) *widget.FormItem

NewWorldsFormItem labels w with the worlds field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*StreamerConfig) NewWorldsHelp

func (self *StreamerConfig) NewWorldsHelp() *HelpButton

NewWorldsHelp returns a help button carrying the worlds field's description from the model, to place beside the field's widget. Tapping it shows the description; NewWorldsFormItem places one for you.

func (*StreamerConfig) Reload

func (self *StreamerConfig) Reload() error

func (*StreamerConfig) RemoveListener

func (b *StreamerConfig) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*StreamerConfig) SetValue

func (self *StreamerConfig) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*StreamerConfig) SetValueChecked

func (self *StreamerConfig) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*StreamerConfig) UnmarshalJSON

func (self *StreamerConfig) UnmarshalJSON(data []byte) error

func (*StreamerConfig) UnmarshalYAML

func (self *StreamerConfig) UnmarshalYAML(node *yaml.Node) error

func (*StreamerConfig) Validate

func (self *StreamerConfig) Validate() error

type Theme

type Theme struct {
	Light map[string]string
	Dark  map[string]string
	// contains filtered or unexported fields
}

func (*Theme) AddListener

func (b *Theme) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*Theme) GetItem

func (self *Theme) GetItem(key string) (binding.DataItem, error)

func (*Theme) GetValue

func (self *Theme) GetValue(key string) (any, error)

func (*Theme) Keys

func (self *Theme) Keys() []string

func (*Theme) MarshalJSON

func (self *Theme) MarshalJSON() ([]byte, error)

func (*Theme) MarshalYAML

func (self *Theme) MarshalYAML() (any, error)

func (*Theme) NewDarkFormItem

func (self *Theme) NewDarkFormItem(w fyne.CanvasObject) *widget.FormItem

NewDarkFormItem labels w with the dark field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Theme) NewDarkHelp

func (self *Theme) NewDarkHelp() *HelpButton

NewDarkHelp returns a help button carrying the dark field's description from the model, to place beside the field's widget. Tapping it shows the description; NewDarkFormItem places one for you.

func (*Theme) NewLightFormItem

func (self *Theme) NewLightFormItem(w fyne.CanvasObject) *widget.FormItem

NewLightFormItem labels w with the light field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*Theme) NewLightHelp

func (self *Theme) NewLightHelp() *HelpButton

NewLightHelp returns a help button carrying the light field's description from the model, to place beside the field's widget. Tapping it shows the description; NewLightFormItem places one for you.

func (*Theme) Reload

func (self *Theme) Reload() error

func (*Theme) RemoveListener

func (b *Theme) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*Theme) SetValue

func (self *Theme) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*Theme) SetValueChecked

func (self *Theme) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*Theme) UnmarshalJSON

func (self *Theme) UnmarshalJSON(data []byte) error

func (*Theme) UnmarshalYAML

func (self *Theme) UnmarshalYAML(node *yaml.Node) error

func (*Theme) Validate

func (self *Theme) Validate() error

type TimeEntry

type TimeEntry struct {
	widget.Entry

	// AllowEmpty makes a blank entry valid, meaning "unset". Set automatically
	// by the generated constructor for an optional field.
	AllowEmpty bool

	// OnResolved is called whenever the entry's reading changes, with the
	// resolved value, whether the entry was non-blank, and any parse error.
	OnResolved func(value TimeOfDay, filled bool, err error)
	// contains filtered or unexported fields
}

TimeEntry is a text entry for a time-of-day field. It accepts the loose clock forms ParseClock does ("7", "7:30", "7pm", "7.30p") and resolves an ambiguous bare hour against two layers of preference: the field's Window, compiled in from the model by the generated New<Field>Entry constructors, and a Bias set at runtime from whatever else the form already says.

Both layers decide how an edit is read as it is made. Neither reaches back: a bias arriving after the fact does not re-read text already resolved, so the entry's value only ever moves in response to its own field being typed in.

Every keystroke is accepted, including text that is not a time at all. While the entry has focus its text is exactly what the user typed, and the reading is shown beside it: whenever the two differ the entry states its reading at its trailing edge, so typing "9" into an evening field shows "9:00 PM" there before anything is saved. The Validator reports anything that does not parse. Only when focus leaves does the entry rewrite its text, in the canonical form of whatever it read -- at which point the text says it and the hint clears; text that does not parse is left as typed and stays flagged.

The same reading is available through Resolved, Display, Hint, and the OnResolved callback, for a caller that wants to echo it somewhere else too.

TimeEntry owns the embedded Entry's OnChanged. Use OnResolved instead; assigning OnChanged replaces the widget's own handler and stops it working.

func NewTimeEntry

func NewTimeEntry() *TimeEntry

NewTimeEntry returns a time entry using DefaultWindow, for a caller wiring a time input by hand. Prefer the generated New<Field>Entry constructors, which compile in the field's own window and bind it to the model.

func (*TimeEntry) Bind

func (e *TimeEntry) Bind(item binding.Item[TimeOfDay])

Bind two-way binds the entry to a required time field's item, seeding the text from the item's current value.

func (*TimeEntry) BindOptional

func (e *TimeEntry) BindOptional(item binding.Item[Optional[TimeOfDay]])

BindOptional two-way binds the entry to an optional time field's item. A blank entry is the unset value and vice versa, so AllowEmpty is implied.

func (*TimeEntry) Display

func (e *TimeEntry) Display() string

Display renders the entry's reading on a 12-hour clock ("7:00 PM"), or "" if the entry is blank or does not parse.

func (*TimeEntry) FocusGained

func (e *TimeEntry) FocusGained()

FocusGained starts an edit: from here until focus is lost the text is the user's, and neither the model nor the entry's own reading rewrites it.

func (*TimeEntry) FocusLost

func (e *TimeEntry) FocusLost()

FocusLost ends the edit and settles the entry: a reading that parses is rewritten in canonical form ("7pm" becomes "7:00 PM"), and text that does not parse is kept as typed with the Validator's error still showing.

func (*TimeEntry) Hint

func (e *TimeEntry) Hint() string

Hint returns the reading shown at the trailing edge of the entry: the entry's Display, or "" when the text is blank, does not parse, or already says the reading itself.

func (*TimeEntry) Refresh

func (e *TimeEntry) Refresh()

Refresh restates the hint before redrawing, so every path that repaints the entry -- a keystroke, a settle, a theme change -- shows the current reading.

func (*TimeEntry) Resolved

func (e *TimeEntry) Resolved() (TimeOfDay, bool, error)

Resolved returns the entry's current reading: the parsed value, whether the entry was non-blank, and any parse error. A blank entry yields the zero TimeOfDay with filled false. The reading is the one the text was given when it was last edited, so it always agrees with what was written to the bound value, whatever the bias has since become.

func (*TimeEntry) SetBias

func (e *TimeEntry) SetBias(b Bias)

SetBias steers how an ambiguous entry is read, from what the rest of the form says: a field holding the end of a span passes Bias{After: &start}, which is what makes a bare "9" typed there land in the evening when the span starts at 7:00 PM.

It applies to the next edit only. Text already read keeps the reading it was given -- the entry's value is not revised, and its text is not rewritten -- because a field the user is not typing in should not change under them. So a start time moved to the evening after the end was already filled in leaves that end time alone; only what is typed from then on is read the new way.

func (*TimeEntry) Unbind

func (e *TimeEntry) Unbind()

Unbind detaches the entry from whatever it is bound to, leaving the text as it stands.

type TimeOfDay

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

TimeOfDay holds a time of day with whole-second precision, stored as the number of nanoseconds since midnight. It serializes to and from "HH:MM:SS" (e.g. "12:34:56") in both JSON and YAML via MarshalText/UnmarshalText. Both "HH:MM" and "HH:MM:SS" are accepted on input; output is always the whole-second "HH:MM:SS" form.

func NewTimeOfDay

func NewTimeOfDay(hour, min, sec int) TimeOfDay

NewTimeOfDay builds a TimeOfDay from a wall-clock hour, minute, and second. Out-of-range components wrap the way time.Duration arithmetic does, so NewTimeOfDay(25, 0, 0) is an hour past midnight; callers taking user input should use ParseClock instead.

func ParseClock

func ParseClock(s string, bias Bias, window Window) (TimeOfDay, error)

ParseClock parses a loosely-typed clock entry into a TimeOfDay.

Accepted input is a bare hour ("7"), an hour:minute ("7:30"), or an hour:minute:second ("7:30:15"), with "." accepted in place of ":", optionally suffixed with a meridiem marker (a, am, p, pm -- case-insensitive, spacing optional). A marker is definitive, as is an explicit 24-hour value (hour 0 or 13-23); combining the two is an error.

A zero-padded two-digit hour ("07", "08") is a definitive 24-hour value and skips the meridiem inference below. That is the form String() emits, so a stored value round-trips through an editor unchanged instead of being re-read as PM.

Otherwise a bare 1-12 hour is ambiguous, and its AM and PM readings are resolved against two layers of preference:

  1. Readings ruled out by bias are dropped.
  2. Of what remains, a reading inside window wins; if both or neither are inside it, the earlier one wins.
  3. If bias ruled out everything, the best-effort reading is used: the later one when After is set, the earlier one when only Before is, so a typed entry still lands somewhere sensible rather than failing.

func TimeOfDayFromString

func TimeOfDayFromString(s string) (TimeOfDay, error)

TimeOfDayFromString parses an "HH:MM" or "HH:MM:SS" string into a TimeOfDay.

func (TimeOfDay) Display

func (t TimeOfDay) Display() string

Display renders the time of day on a 12-hour clock, e.g. "7:30 PM". The seconds are shown only when they are set ("7:30:15 PM"). The result parses back to the same value through ParseClock.

func (TimeOfDay) Duration

func (t TimeOfDay) Duration() time.Duration

Duration returns the time of day as the number of nanoseconds since midnight.

func (TimeOfDay) MarshalText

func (t TimeOfDay) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler, rendering "HH:MM:SS".

func (TimeOfDay) String

func (t TimeOfDay) String() string

String renders the time of day as "HH:MM:SS".

func (*TimeOfDay) UnmarshalText

func (t *TimeOfDay) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler, parsing "HH:MM" or "HH:MM:SS".

type ValidationError

type ValidationError struct {
	Kind     string
	Message  string
	DataPath string
	FilePath string
}

ValidationError describes a single constraint violation found by a generated Validate method. Kind is "length" or "range"; DataPath locates the offending field within the value, and FilePath is set when the value came from a known file.

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Weekday

type Weekday string

A day of the week a stream may be scheduled on. The member names are the keys used in the schedule, so a typo fails validation instead of silently producing an empty day.

const (
	// Monday.
	Monday Weekday = "monday"
	// Tuesday.
	Tuesday Weekday = "tuesday"
	// Wednesday.
	Wednesday Weekday = "wednesday"
	// Thursday.
	Thursday Weekday = "thursday"
	// Friday.
	Friday Weekday = "friday"
	// Saturday.
	Saturday Weekday = "saturday"
	// Sunday.
	Sunday Weekday = "sunday"
)

func ParseWeekday

func ParseWeekday(name string) (Weekday, error)

func (Weekday) IsValid

func (self Weekday) IsValid() bool

func (Weekday) MarshalText

func (self Weekday) MarshalText() ([]byte, error)

func (Weekday) String

func (self Weekday) String() string

func (*Weekday) UnmarshalText

func (self *Weekday) UnmarshalText(text []byte) error

type Window

type Window struct{ From, To TimeOfDay }

Window is the span of hours a time field's values typically fall in, used to pick between the AM and PM readings of an ambiguous clock entry. To is exclusive, and a window whose To is at or before its From wraps midnight (an evening shift, say 18:00 to 02:00).

type World

type World struct {
	Key   string
	Names []LocaleName
	// contains filtered or unexported fields
}

func (*World) AddListener

func (b *World) AddListener(l binding.DataListener)

AddListener registers l to be notified whenever any bound field changes. Per Fyne convention the listener also fires immediately so it can pull the current value.

func (*World) GetItem

func (self *World) GetItem(key string) (binding.DataItem, error)

func (*World) GetValue

func (self *World) GetValue(key string) (any, error)

func (*World) KeyItem

func (self *World) KeyItem() binding.String

KeyItem returns a typed two-way binding for the key field, ready to hand to a Fyne widget (for example widget.Entry.Bind). Set is permissive -- it commits and notifies without running the field's constraints -- so wire KeyValidator to the widget's Validator (and rely on Validate at save time) to enforce them.

func (*World) KeyValidator

func (self *World) KeyValidator() func(string) error

KeyValidator returns a Fyne validator enforcing the same constraints as Validate for the key field. Assign it to a widget's Validator (for example widget.Entry.Validator).

func (*World) Keys

func (self *World) Keys() []string

func (*World) MarshalJSON

func (self *World) MarshalJSON() ([]byte, error)

func (*World) MarshalYAML

func (self *World) MarshalYAML() (any, error)

func (*World) NewKeyFormItem

func (self *World) NewKeyFormItem(w fyne.CanvasObject) *widget.FormItem

NewKeyFormItem labels w with the key field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*World) NewKeyHelp

func (self *World) NewKeyHelp() *HelpButton

NewKeyHelp returns a help button carrying the key field's description from the model, to place beside the field's widget. Tapping it shows the description; NewKeyFormItem places one for you.

func (*World) NewNamesFormItem

func (self *World) NewNamesFormItem(w fyne.CanvasObject) *widget.FormItem

NewNamesFormItem labels w with the names field's display name from the model and puts the field's help button at w's trailing edge, ready to hand to widget.NewForm. The widget stays the caller's: which one a field wants is not something the model says.

func (*World) NewNamesHelp

func (self *World) NewNamesHelp() *HelpButton

NewNamesHelp returns a help button carrying the names field's description from the model, to place beside the field's widget. Tapping it shows the description; NewNamesFormItem places one for you.

func (*World) Reload

func (self *World) Reload() error

func (*World) RemoveListener

func (b *World) RemoveListener(l binding.DataListener)

RemoveListener stops l from receiving change notifications.

func (*World) SetValue

func (self *World) SetValue(key string, value any) error

SetValue commits value to the field named key and notifies listeners. It does NOT run the field's constraints: under two-way binding a widget must be free to hold a transient invalid value. Enforce constraints through the per-field Validator (on the widget) and Validate at save time, or call SetValueChecked to reject invalid values before committing.

func (*World) SetValueChecked

func (self *World) SetValueChecked(key string, value any) error

SetValueChecked is SetValue that runs the field's constraints first and returns an error (leaving the field unchanged) if they fail. Prefer plain SetValue on the binding path; use this when a caller wants to gate the write itself rather than surface the error through a widget Validator.

func (*World) UnmarshalJSON

func (self *World) UnmarshalJSON(data []byte) error

func (*World) UnmarshalYAML

func (self *World) UnmarshalYAML(node *yaml.Node) error

func (*World) Validate

func (self *World) Validate() error

Directories

Path Synopsis
Package legacyconfig converts a pre-merge config directory — the four files site.yaml, worlds.yaml, schedule.yaml and theme.json — into the single streamer-config.json the GUI and the website build now use.
Package legacyconfig converts a pre-merge config directory — the four files site.yaml, worlds.yaml, schedule.yaml and theme.json — into the single streamer-config.json the GUI and the website build now use.

Jump to

Keyboard shortcuts

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