Documentation
¶
Overview ¶
Package utils provides utility functions for the application
Index ¶
- func AllContains[T comparable](slices1 []T, slices2 []T) bool
- func AnyContains[T comparable](slices1 []T, slices2 []T) bool
- func Contains[T comparable](slice []T, elem T) bool
- func GenerateUniqueID() string
- func GetTerminalSize() (int, int, error)
- func SetFocus(app *tview.Application, primitive tview.Primitive)
- func UnmarshalJSON(data []byte, v any) error
- type Broadcaster
- type DelayedTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllContains ¶
func AllContains[T comparable](slices1 []T, slices2 []T) bool
AllContains checks if all of the slices contain a specific element
func AnyContains ¶
func AnyContains[T comparable](slices1 []T, slices2 []T) bool
AnyContains checks if any of the slices contains a specific element
func Contains ¶
func Contains[T comparable](slice []T, elem T) bool
Contains checks if a slice contains a specific element
func GetTerminalSize ¶
GetTerminalSize returns the width and height of the terminal.
func SetFocus ¶
func SetFocus(app *tview.Application, primitive tview.Primitive)
SetFocus sets the focus to the specified primitive
func UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON data into a struct
Types ¶
type Broadcaster ¶
type Broadcaster[T any] struct { // contains filtered or unexported fields }
func NewBroadcaster ¶
func NewBroadcaster[T any]() *Broadcaster[T]
func (*Broadcaster[T]) Broadcast ¶
func (b *Broadcaster[T]) Broadcast(value T) <-chan struct{}
func (*Broadcaster[T]) Close ¶
func (b *Broadcaster[T]) Close()
func (*Broadcaster[T]) Subscribe ¶
func (b *Broadcaster[T]) Subscribe() <-chan T
func (*Broadcaster[T]) Unsubscribe ¶
func (b *Broadcaster[T]) Unsubscribe(ch chan T)
type DelayedTransport ¶
type DelayedTransport struct { Transport http.RoundTripper Delay time.Duration }
Click to show internal directories.
Click to hide internal directories.