zap

package
v2.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationService

type AuthorizationService struct {
	AuthorizationService platform.AuthorizationService
	// contains filtered or unexported fields
}

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 platform2.ID) (err error)

DeleteAuthorization deletes an authorization, and logs any errors.

func (*AuthorizationService) FindAuthorizationByID

func (s *AuthorizationService) FindAuthorizationByID(ctx context.Context, id platform2.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) UpdateAuthorization

func (s *AuthorizationService) UpdateAuthorization(ctx context.Context, id platform2.ID, upd *platform.AuthorizationUpdate) (a *platform.Authorization, err error)

UpdateAuthorization updates an authorization's status, description and logs any errors.

type ProxyQueryService

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

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

func NewProxyQueryService

func NewProxyQueryService(log *zap.Logger) *ProxyQueryService

NewProxyQueryService creates a new proxy query service with a log. 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 {
	// contains filtered or unexported fields
}

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

func NewTracer

func NewTracer(log *zap.Logger, idGenerator platform2.IDGenerator) *Tracer

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