utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPrivateField

func FetchPrivateField[T any](s any, name string) T

FetchPrivateField fetches a private field.

func ShowAlert

func ShowAlert(canvas fyne.Canvas, label string, button string, closeFunc func())

func UpdatePrivateField

func UpdatePrivateField[T any](v any, name string, value T)

UpdatePrivateField sets a private field to the value passed.

Types

type FixedSizeLayout

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

func NewFixedSizeLayout

func NewFixedSizeLayout(size fyne.Size) *FixedSizeLayout

func NewFixedSizeLayoutExpand

func NewFixedSizeLayoutExpand(size fyne.Size) *FixedSizeLayout

func (FixedSizeLayout) Layout

func (m FixedSizeLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (FixedSizeLayout) MinSize

func (m FixedSizeLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

type FixedSizeLayoutExpand

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

func (FixedSizeLayoutExpand) Layout

func (m FixedSizeLayoutExpand) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (FixedSizeLayoutExpand) MinSize

func (m FixedSizeLayoutExpand) MinSize(objects []fyne.CanvasObject) fyne.Size

type NethernetConnWithHeader

type NethernetConnWithHeader struct {
	*nethernet.Conn
}

func (*NethernetConnWithHeader) ReadPacket

func (g *NethernetConnWithHeader) ReadPacket() ([]byte, error)

func (*NethernetConnWithHeader) Write

func (g *NethernetConnWithHeader) Write(b []byte) (n int, err error)

type Pinger

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

func NewPinger

func NewPinger(log *slog.Logger) (*Pinger, error)

func (*Pinger) AddServer

func (p *Pinger) AddServer(ipStr string, statusFunc func(s ServerStatus)) error

func (*Pinger) Close

func (p *Pinger) Close() error

func (*Pinger) RemoveServer

func (p *Pinger) RemoveServer(ipStr string) error

type ServerStatus

type ServerStatus struct {
	// ServerName is the name or MOTD of the server, as shown in the server list.
	ServerName string
	// ProtocolID is the main protocol id accepted by the server
	ProtocolID int
	// Version is the main version that the server supports
	Version string
	// PlayerCount is the current amount of players displayed in the list.
	PlayerCount int
	// MaxPlayers is the maximum amount of players in the server. If set to 0, MaxPlayers is set to
	// PlayerCount + 1.
	MaxPlayers int
	// RaknetID is the server's Raknet ID
	RaknetID int
	// WorldName is the world name of the server
	WorldName string
	// GameMode is the gamemode of the server
	GameMode string
}

type TextEntry

type TextEntry struct {
	Color color.RGBA
	Style TextStyle
	Text  string
}

func ParseText

func ParseText(s string) (t []TextEntry)

type TextStyle

type TextStyle uint8

func (TextStyle) Bold

func (t TextStyle) Bold() bool

func (TextStyle) Italic

func (t TextStyle) Italic() bool

func (TextStyle) Obfuscated

func (t TextStyle) Obfuscated() bool

func (TextStyle) SetBold

func (t TextStyle) SetBold() TextStyle

func (TextStyle) SetItalic

func (t TextStyle) SetItalic() TextStyle

func (TextStyle) SetObfuscated

func (t TextStyle) SetObfuscated() TextStyle

type WidgetWithLabel

type WidgetWithLabel[T fyne.CanvasObject] struct {
	// contains filtered or unexported fields
}

func NewObjectWithLabel

func NewObjectWithLabel[T fyne.CanvasObject](label string, obj T) *WidgetWithLabel[T]

func (*WidgetWithLabel[T]) Container

func (e *WidgetWithLabel[T]) Container() *fyne.Container

func (*WidgetWithLabel[T]) Obj

func (e *WidgetWithLabel[T]) Obj() T

Jump to

Keyboard shortcuts

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