util

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMessageSize = 150 * 1024 // 150 KB

Variables

View Source
var (
	ErrUnknown = errors.New("unknown argument passed")

	ErrInvalidArgument = errors.New("invalid argument passed")
)

Functions

func FilterEmptyStrings

func FilterEmptyStrings(s []string) []string

func GenerateID

func GenerateID() (string, error)

func ValidateMessageSize

func ValidateMessageSize(msg *message_pb.Message) error

Types

type ChronoError

type ChronoError struct {
	Level   ErrorLevel
	Code    codes.Code // gRPC status code
	Message string
	Err     error
}

func NewChronoError

func NewChronoError(level ErrorLevel, code codes.Code, err error, msg string) *ChronoError

func (*ChronoError) Error

func (ce *ChronoError) Error() string

func (*ChronoError) GRPCStatus

func (e *ChronoError) GRPCStatus() error

Convert the ChronoError to a gRPC status error

type ErrorLevel

type ErrorLevel int
const (
	ERROR_LEVEL_INFO ErrorLevel = iota
	ERROR_LEVEL_ERROR
	ERROR_LEVEL_DEBUG
)

Jump to

Keyboard shortcuts

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