utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w http.ResponseWriter, value interface{}, optional ...any) error

JSON marshals the value as JSON and writes it to the response writer. with status code (compat with .JSON)

JSON(w, value) JSON(w, value, statusCode)

func ReadYAMLIntoStruct

func ReadYAMLIntoStruct[T any](filepath string) (T, error)

Reads YAML-File into specified struct

Types

type H

type H map[string]interface{}

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Wrapper around go-redis, with provided context

func (*Redis) Get

func (r *Redis) Get(key string) (string, error)

func (*Redis) Init

func (r *Redis) Init(redisUrl string)

func (*Redis) Set

func (r *Redis) Set(key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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