Documentation
¶
Index ¶
- func BlendImage(dst *image.RGBA, src image.Image, x, y int, opacity float64)
- func DrawRectangle(dst *image.RGBA, x, y, width, height int, color image.Image, opacity float64)
- type BaseWidget
- type GitHubWidget
- type GitHubWorkflowRun
- type GitHubWorkflowRunsResponse
- type Manager
- func (m *Manager) AddWidget(widget Widget) error
- func (m *Manager) Clear()
- func (m *Manager) CreateWidget(widgetType string, id string, config map[string]interface{}) (Widget, error)
- func (m *Manager) ExportConfig() []map[string]interface{}
- func (m *Manager) GetAllWidgets() []Widget
- func (m *Manager) GetAvailableWidgetTypes() []map[string]interface{}
- func (m *Manager) GetWidget(id string) (Widget, bool)
- func (m *Manager) IsEnabled() bool
- func (m *Manager) LoadFromConfig(configs []map[string]interface{}) error
- func (m *Manager) RemoveWidget(id string) error
- func (m *Manager) Render(img *image.RGBA) error
- func (m *Manager) SetEnabled(enabled bool)
- func (m *Manager) UpdateWidget(id string, config map[string]interface{}) error
- type TextWidget
- func (w *TextWidget) GetConfig() map[string]interface{}
- func (w *TextWidget) GetText() string
- func (w *TextWidget) Render(img *image.RGBA) error
- func (w *TextWidget) SetBackground(c *color.RGBA)
- func (w *TextWidget) SetColor(c color.RGBA)
- func (w *TextWidget) SetText(text string)
- func (w *TextWidget) Type() string
- func (w *TextWidget) UpdateConfig(config map[string]interface{}) error
- func (w *TextWidget) Validate() error
- type Widget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlendImage ¶
BlendImage blends a source image onto a destination image at the given position with the specified opacity
Types ¶
type BaseWidget ¶
type BaseWidget struct {
// contains filtered or unexported fields
}
BaseWidget provides common functionality for all widgets
func NewBaseWidget ¶
func NewBaseWidget(id string, x, y int, opacity float64) *BaseWidget
NewBaseWidget creates a new base widget
func (*BaseWidget) GetOpacity ¶
func (w *BaseWidget) GetOpacity() float64
GetOpacity returns the widget's opacity
func (*BaseWidget) GetPosition ¶
func (w *BaseWidget) GetPosition() (int, int)
GetPosition returns the widget's position
func (*BaseWidget) IsEnabled ¶
func (w *BaseWidget) IsEnabled() bool
IsEnabled returns whether the widget should be rendered
func (*BaseWidget) SetEnabled ¶
func (w *BaseWidget) SetEnabled(enabled bool)
SetEnabled sets whether the widget should be rendered
func (*BaseWidget) SetOpacity ¶
func (w *BaseWidget) SetOpacity(opacity float64)
SetOpacity sets the widget's opacity (0.0 to 1.0)
func (*BaseWidget) SetPosition ¶
func (w *BaseWidget) SetPosition(x, y int)
SetPosition sets the widget's position
type GitHubWidget ¶
type GitHubWidget struct {
*BaseWidget
// contains filtered or unexported fields
}
GitHubWidget displays GitHub Actions workflow status
func NewGitHubWidget ¶
func NewGitHubWidget(id string, config map[string]interface{}) (*GitHubWidget, error)
NewGitHubWidget creates a new GitHub Actions status widget
func (*GitHubWidget) GetConfig ¶
func (w *GitHubWidget) GetConfig() map[string]interface{}
GetConfig returns the widget configuration
func (*GitHubWidget) Render ¶
func (w *GitHubWidget) Render(img *image.RGBA) error
Render draws the GitHub Actions status widget
func (*GitHubWidget) UpdateConfig ¶
func (w *GitHubWidget) UpdateConfig(config map[string]interface{}) error
UpdateConfig updates the widget configuration
type GitHubWorkflowRun ¶
type GitHubWorkflowRun struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status string `json:"status"` // queued, in_progress, completed
Conclusion string `json:"conclusion"` // success, failure, cancelled, skipped, etc.
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
GitHubWorkflowRun represents a simplified GitHub Actions workflow run
type GitHubWorkflowRunsResponse ¶
type GitHubWorkflowRunsResponse struct {
TotalCount int `json:"total_count"`
WorkflowRuns []GitHubWorkflowRun `json:"workflow_runs"`
}
GitHubWorkflowRunsResponse represents the GitHub API response
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles overlay widgets and rendering
func (*Manager) CreateWidget ¶
func (m *Manager) CreateWidget(widgetType string, id string, config map[string]interface{}) (Widget, error)
CreateWidget creates a new widget instance from configuration
func (*Manager) ExportConfig ¶
ExportConfig exports all widget configurations
func (*Manager) GetAllWidgets ¶
GetAllWidgets returns all widgets
func (*Manager) GetAvailableWidgetTypes ¶
GetAvailableWidgetTypes returns a list of available widget types
func (*Manager) LoadFromConfig ¶
LoadFromConfig loads widget configurations and creates widget instances
func (*Manager) RemoveWidget ¶
RemoveWidget removes a widget from the overlay
func (*Manager) SetEnabled ¶
SetEnabled enables or disables the entire overlay
type TextWidget ¶
type TextWidget struct {
*BaseWidget
// contains filtered or unexported fields
}
TextWidget displays text on the overlay
func NewTextWidget ¶
func NewTextWidget(id string, config map[string]interface{}) (*TextWidget, error)
NewTextWidget creates a new text widget
func (*TextWidget) GetConfig ¶
func (w *TextWidget) GetConfig() map[string]interface{}
GetConfig returns the widget configuration
func (*TextWidget) Render ¶
func (w *TextWidget) Render(img *image.RGBA) error
Render draws the text widget
func (*TextWidget) SetBackground ¶
func (w *TextWidget) SetBackground(c *color.RGBA)
SetBackground sets the background color (nil for transparent)
func (*TextWidget) SetColor ¶
func (w *TextWidget) SetColor(c color.RGBA)
SetColor sets the text color
func (*TextWidget) SetText ¶
func (w *TextWidget) SetText(text string)
SetText updates the text content
func (*TextWidget) UpdateConfig ¶
func (w *TextWidget) UpdateConfig(config map[string]interface{}) error
UpdateConfig updates the widget configuration
func (*TextWidget) Validate ¶
func (w *TextWidget) Validate() error
Validate ensures the widget configuration is valid
type Widget ¶
type Widget interface {
// ID returns the unique identifier for this widget instance
ID() string
// Type returns the widget type name
Type() string
// Render draws the widget onto the provided image at the configured position
Render(img *image.RGBA) error
// GetConfig returns the widget's configuration as a map
GetConfig() map[string]interface{}
// UpdateConfig updates the widget's configuration
UpdateConfig(config map[string]interface{}) error
// IsEnabled returns whether the widget should be rendered
IsEnabled() bool
// SetEnabled sets whether the widget should be rendered
SetEnabled(enabled bool)
}
Widget represents a renderable overlay widget