util

package
v0.0.0-...-c8ed9d9 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const XRequestIDKey = "x-request-id"

XRequestIDKey リクエストID key

View Source
const (
	YmdHis = "2006-01-02 15:04:05"
)

formats

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

errors

Functions

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID getter

func HandleRequestID

func HandleRequestID(ctx context.Context) string

HandleRequestID handler

func Logger

func Logger() *logrus.Logger

Logger ロガー

func SetRequestID

func SetRequestID(ctx context.Context, rid string) context.Context

SetRequestID setter

func Time

func Time(ctx context.Context) time.Time

Time return Time

func TimeToFormat

func TimeToFormat(t time.Time) string

TimeToFormat Y-m-d H:i:s 形式の文字列へ

func UnaryErrorInterceptor

func UnaryErrorInterceptor() grpc.UnaryServerInterceptor

UnaryErrorInterceptor エラーインターセプター

func UnaryRequestIDInterceptor

func UnaryRequestIDInterceptor() grpc.UnaryServerInterceptor

UnaryRequestIDInterceptor unary rpc 用のリクエストID interceptor

func UnaryTimerInterceptor

func UnaryTimerInterceptor() grpc.UnaryServerInterceptor

UnaryTimerInterceptor timer

Types

This section is empty.

Jump to

Keyboard shortcuts

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