Documentation
¶
Index ¶
- func Access(format string, args ...any)
- func Debug(format string, args ...any)
- func Error(format string, args ...any)
- func ExtractLogLabels(meta *model.LogMeta) map[string]string
- func ExtractStandardLabels(meta *model.Meta) map[string]string
- func Fatal(format string, args ...any)
- func GenerateEndpointID(meta *model.Meta) string
- func GetClientIP(r *http.Request) string
- func GetLocalIP() string
- func GetNamespace(meta *model.Meta) string
- func GetWorkingDir() string
- func Info(format string, args ...any)
- func InitLogger(appLogFile, errorLogFile, accessLogFile, debugLogFile, logLevel string) error
- func JSON(w http.ResponseWriter, status int, data interface{})
- func MatchAllLabels(required map[string]string, actual map[string]string) bool
- func MergeMaps(base, override map[string]string) map[string]string
- func Must(label string, err error)
- func NewUUID() string
- func ParseIntOrDefault(input string, def int) int
- func ParseTagString(input string) map[string]string
- func SafeCopyLabels(meta *model.Meta) map[string]string
- func Truncate(s string, max int) string
- func Warn(format string, args ...any)
- func WriteJSON(filename string, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLogLabels ¶
ExtractLogLabels builds labels from model.LogMeta.
func ExtractStandardLabels ¶
ExtractStandardLabels builds a consistent map of labels from model.Meta.
func GenerateEndpointID ¶
GenerateEndpointID creates a unique identifier for an endpoint based on its metadata.
func GetClientIP ¶
func GetLocalIP ¶
func GetLocalIP() string
GetLocalIP retrieves the local IP address of the machine running the gosight agent.
func GetNamespace ¶
GetNamespace returns the namespace for the endpoint based on its metadata.
func GetWorkingDir ¶
func GetWorkingDir() string
GetWorkingDir returns the current working directory
func InitLogger ¶
InitLogger initializes the logging system with specified log files and log level.
func JSON ¶
func JSON(w http.ResponseWriter, status int, data interface{})
func MatchAllLabels ¶
MatchAllLabels returns true if all required Labels exist in actualLabels and match.
func ParseIntOrDefault ¶
func ParseTagString ¶
func SafeCopyLabels ¶
SafeCopyLabels ensures that meta.Labels is never nil. It returns a non-nil map[string]string for Labels, even if it was nil originally.
Types ¶
This section is empty.