utils

package
v0.0.0-...-2b54c60 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyAfter

func EmptyAfter(lines []string, idx int) int

EmptyAfter finds the fist empty line after the given index.

func EmptyBefore

func EmptyBefore(lines []string, idx int) int

EmptyBefore finds the fist empty line before the given index.

func FromRegex

func FromRegex(lines []string, pattern, content string) ([]string, string, int, error)

FromRegex finds the first line matching the regex, removes it from lines and returns its content.

func NewContext

func NewContext(parent ...context.Context) context.Context

NewContext creates a new context with a logger and sentry hub

func ParseLines

func ParseLines(abspath string) ([]string, error)

ParseLines parses a file into a slice of strings, one per line.

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel sets the log level

func SetName

func SetName(name string)

SetName sets the name of the application

func SetSentryDSN

func SetSentryDSN(dsn string)

SetSentryDSN sets the sentry DSN

func StartSpan

func StartSpan(ctx context.Context, operation string) *sentry.Span

StartSpan starts a new span, and if there is no transaction, it starts a new transaction

Types

This section is empty.

Jump to

Keyboard shortcuts

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