Ejemplo n.º 1
0
func resetVerbosityEndpoint(lc spec.LogControl) endpoint.Endpoint {
	return func(ctx context.Context, request interface{}) (interface{}, error) {
		err := lc.ResetVerbosity(ctx)
		if err != nil {
			return api.WithError(maskAny(err)), nil
		}

		return api.WithSuccess(), nil
	}
}
Ejemplo n.º 2
0
func setVerbosityEndpoint(lc spec.LogControl) endpoint.Endpoint {
	return func(ctx context.Context, request interface{}) (interface{}, error) {
		req := request.(api.SetVerbosityRequest)

		err := lc.SetVerbosity(ctx, req.Verbosity)
		if err != nil {
			return api.WithError(maskAny(err)), nil
		}

		return api.WithSuccess(), nil
	}
}