utils

package
v0.0.0-...-97f09c1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanEnvID

func CleanEnvID(envID string) (string, error)

func ErrorHandler

func ErrorHandler(c *gin.Context, message string, statusCode int)

func GenerateID

func GenerateID() string

func ParseBody

func ParseBody[B any](ctx context.Context, c *gin.Context) (body B, err error)

func ParseJSONBody

func ParseJSONBody[B any](ctx context.Context, body io.ReadCloser) (*B, error)

func ShortID

func ShortID(id string) string

func UnwrapGRPCError

func UnwrapGRPCError(err error) error

Types

type Map

type Map[V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[V any]() *Map[V]

func (*Map[V]) Get

func (m *Map[V]) Get(key string) (V, bool)

func (*Map[V]) Insert

func (m *Map[V]) Insert(key string, value V)

func (*Map[V]) Items

func (m *Map[V]) Items() map[string]V

func (*Map[V]) Remove

func (m *Map[V]) Remove(key string)

type NoOpWriter

type NoOpWriter struct{}

NoOpWriter is an io.Writer implementation that discards anything written to it.

func (*NoOpWriter) Write

func (nw *NoOpWriter) Write(p []byte) (n int, err error)

type Result

type Result struct {
	Error error
}

Jump to

Keyboard shortcuts

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