zap

package
v0.0.0-...-d500d3c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationService

type AuthorizationService struct {
	Logger               *zap.Logger
	AuthorizationService platform.AuthorizationService
}

AuthorizationService manages authorizations.

func (*AuthorizationService) CreateAuthorization

func (s *AuthorizationService) CreateAuthorization(ctx context.Context, a *platform.Authorization) (err error)

CreateAuthorization creates an authorization, and logs any errors.

func (*AuthorizationService) DeleteAuthorization

func (s *AuthorizationService) DeleteAuthorization(ctx context.Context, id platform.ID) (err error)

DeleteAuthorization deletes an authorization, and logs any errors.

func (*AuthorizationService) FindAuthorizationByID

func (s *AuthorizationService) FindAuthorizationByID(ctx context.Context, id platform.ID) (a *platform.Authorization, err error)

FindAuthorizationByID returns an authorization given an id, and logs any errors.

func (*AuthorizationService) FindAuthorizationByToken

func (s *AuthorizationService) FindAuthorizationByToken(ctx context.Context, t string) (a *platform.Authorization, err error)

FindAuthorizationByToken returns an authorization given a token, and logs any errors.

func (*AuthorizationService) FindAuthorizations

func (s *AuthorizationService) FindAuthorizations(ctx context.Context, filter platform.AuthorizationFilter, opt ...platform.FindOptions) (as []*platform.Authorization, i int, err error)

FindAuthorizations returns authorizations given a filter, and logs any errors.

func (*AuthorizationService) SetAuthorizationStatus

func (s *AuthorizationService) SetAuthorizationStatus(ctx context.Context, id platform.ID, status platform.Status) (err error)

SetAuthorizationStatus updates an authorization's status and logs any errors.

type ProxyQueryService

type ProxyQueryService struct {
	Logger *zap.Logger
}

ProxyQueryService logs the request but does not write to the writer.

func NewProxyQueryService

func NewProxyQueryService(l *zap.Logger) *ProxyQueryService

NewProxyQueryService creates a new proxy query service with a logger. If the logger is nil, then it will use a noop logger.

func (*ProxyQueryService) Query

Query logs the query request.

type Span

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

Span implements opentracing.Span, all Spans must be created using the Tracer.

func (*Span) BaggageItem

func (s *Span) BaggageItem(restrictedKey string) string

func (*Span) Context

func (s *Span) Context() opentracing.SpanContext

func (*Span) Finish

func (s *Span) Finish()

func (*Span) FinishWithOptions

func (s *Span) FinishWithOptions(opts opentracing.FinishOptions)

func (*Span) Log

func (s *Span) Log(data opentracing.LogData)

Log is deprecated, as such it is not implemented.

func (*Span) LogEvent

func (s *Span) LogEvent(event string)

LogEvent is deprecated, as such it is not implemented.

func (*Span) LogEventWithPayload

func (s *Span) LogEventWithPayload(event string, payload interface{})

LogEventWithPayload is deprecated, as such it is not implemented.

func (*Span) LogFields

func (s *Span) LogFields(fields ...log.Field)

func (*Span) LogKV

func (s *Span) LogKV(keyValues ...interface{})

func (*Span) SetBaggageItem

func (s *Span) SetBaggageItem(restrictedKey string, value string) opentracing.Span

func (*Span) SetOperationName

func (s *Span) SetOperationName(operationName string) opentracing.Span

func (*Span) SetTag

func (s *Span) SetTag(key string, value interface{}) opentracing.Span

func (*Span) Tracer

func (s *Span) Tracer() opentracing.Tracer

type SpanContext

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

SpanContext implements opentracing.SpanContext, all span contexts must be created using the Tracer.

func (SpanContext) ForeachBaggageItem

func (c SpanContext) ForeachBaggageItem(handler func(k, v string) bool)

func (SpanContext) MarshalJSON

func (c SpanContext) MarshalJSON() ([]byte, error)

func (*SpanContext) UnmarshalJSON

func (c *SpanContext) UnmarshalJSON(data []byte) error

type Tracer

type Tracer struct {
	Logger      *zap.Logger
	IDGenerator platform.IDGenerator
}

Tracer implements opentracing.Tracer and logs each span as its own log.

func (*Tracer) Extract

func (t *Tracer) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error)

func (*Tracer) Inject

func (t *Tracer) Inject(sm opentracing.SpanContext, format interface{}, carrier interface{}) error

func (*Tracer) StartSpan

func (t *Tracer) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span

Jump to

Keyboard shortcuts

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