kfgokit

package
v0.0.0-...-5889168 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

kfgokit package contains some utilities for working with https://github.com/go-kit/kit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeResponse

func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

EncodeResponse endodes responses. This is a generic json encoder. It takes arbitrary go structurs and encodes them as json.

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

ErrorEncoder is a custom error used to encode errors into the http response. If the error is of type httpError then is used to obtain the statuscode. TODO(jlewi): Should we follow the model

Types

This section is empty.

Jump to

Keyboard shortcuts

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