rkgrpclog

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package rkgrpclog is an interface of logging for grpc framework

Index

Constants

View Source
const (
	// ENCODING_CONSOLE encoding type as console for EventLoggerEntry
	ENCODING_CONSOLE int = 0
	// ENCODING_JSON encoding type as json for EventLoggerEntry
	ENCODING_JSON int = 1
)

Variables

This section is empty.

Functions

func StreamClientInterceptor

func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor

StreamClientInterceptor Create new stream client interceptor.

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor Create new stream server interceptor.

func UnaryClientInterceptor

func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor

UnaryClientInterceptor Create new unary client interceptor.

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor Create new unary server interceptor.

Types

type Option

type Option func(*optionSet)

Option is params for creating interceptor

func WithEntryNameAndType added in v1.2.0

func WithEntryNameAndType(entryName, entryType string) Option

WithEntryNameAndType Provide entry name and entry type.

func WithEventLoggerEncoding added in v1.2.0

func WithEventLoggerEncoding(ec int) Option

WithEventLoggerEncoding Provide ZapLoggerEncodingType. ENCODING_CONSOLE or ENCODING_JSON is supported.

func WithEventLoggerEntry added in v1.2.0

func WithEventLoggerEntry(eventLoggerEntry *rkentry.EventLoggerEntry) Option

WithEventLoggerEntry Provide rkentry.EventLoggerEntry.

func WithEventLoggerOutputPaths added in v1.2.0

func WithEventLoggerOutputPaths(path ...string) Option

WithEventLoggerOutputPaths Provide EventLogger Output Path. Multiple output path could be supported including stdout.

func WithZapLoggerEncoding added in v1.2.0

func WithZapLoggerEncoding(ec int) Option

WithZapLoggerEncoding Provide ZapLoggerEncodingType. json or console is supported.

func WithZapLoggerEntry added in v1.2.0

func WithZapLoggerEntry(zapLoggerEntry *rkentry.ZapLoggerEntry) Option

WithZapLoggerEntry Provide rkentry.ZapLoggerEntry.

func WithZapLoggerOutputPaths added in v1.2.0

func WithZapLoggerOutputPaths(path ...string) Option

WithZapLoggerOutputPaths Provide ZapLogger Output Path. Multiple output path could be supported including stdout.

Jump to

Keyboard shortcuts

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