valueobjects

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidColors = []string{
	"slate", "gray", "zinc", "neutral", "stone",
	"red", "orange", "amber", "yellow", "lime", "green",
	"emerald", "teal", "cyan", "sky", "blue", "indigo",
	"violet", "purple", "fuchsia", "pink", "rose",
}

ValidColors contains all valid Tailwind CSS 4 colors (22 colors).

Functions

This section is empty.

Types

type Category

type Category string

Category represents the category of a log entry.

const (
	CategoryHTTP        Category = "http"
	CategoryDatabase    Category = "database"
	CategorySecurity    Category = "security"
	CategoryPerformance Category = "performance"
	CategoryBusiness    Category = "business"
	CategorySystem      Category = "system"
	CategoryGeneral     Category = "general"
)

func CategoryFromString

func CategoryFromString(s string) Category

CategoryFromString creates a Category from a string, returns default if invalid.

func DefaultCategory

func DefaultCategory() Category

DefaultCategory returns the default category when none is specified.

func (Category) IsValid

func (c Category) IsValid() bool

IsValid checks if the category is valid.

func (Category) String

func (c Category) String() string

String returns the string representation of the category.

type Color

type Color string

Color represents a Tailwind CSS color for visual categorization.

func AutoAssignColor

func AutoAssignColor(severity Severity) Color

AutoAssignColor automatically assigns a color based on severity.

func ColorFromString

func ColorFromString(s string) Color

ColorFromString creates a Color from a string, returns empty if invalid.

func DefaultColor

func DefaultColor() Color

DefaultColor returns the default color.

func (Color) IsValid

func (c Color) IsValid() bool

IsValid checks if the color is a valid Tailwind CSS color.

func (Color) String

func (c Color) String() string

String returns the string representation of the color.

type Severity

type Severity string

Severity represents the severity level of a log entry. Custom severities are allowed - the standard ones are provided for convenience.

const (
	SeverityCritical Severity = "critical"
	SeverityError    Severity = "error"
	SeverityWarning  Severity = "warning"
	SeveritySuccess  Severity = "success"
	SeverityInfo     Severity = "info"
	SeverityDebug    Severity = "debug"
)

func DefaultSeverity

func DefaultSeverity() Severity

DefaultSeverity returns the default severity when none is specified.

func SeverityFromString

func SeverityFromString(s string) Severity

SeverityFromString creates a Severity from a string. Returns the severity as-is (custom severities are allowed). Returns default only if empty.

func (Severity) IsStandard

func (s Severity) IsStandard() bool

IsStandard checks if the severity is one of the standard predefined severities.

func (Severity) IsValid

func (s Severity) IsValid() bool

IsValid checks if the severity is non-empty (all custom severities are valid).

func (Severity) String

func (s Severity) String() string

String returns the string representation of the severity.

Jump to

Keyboard shortcuts

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