Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishapi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishapi
Commits
ad02b98b
Commit
ad02b98b
authored
Aug 12, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RecordType.String.
parent
9f1ee042
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
log.go
pkg/log/log.go
+7
-0
log_test.go
pkg/log/log_test.go
+15
-0
No files found.
pkg/log/log.go
View file @
ad02b98b
...
@@ -189,6 +189,8 @@ const (
...
@@ -189,6 +189,8 @@ const (
// it is part of the log for a client request/response, a backend
// it is part of the log for a client request/response, a backend
// request/repsonse, or neither. Corresponds to the indicator 'b',
// request/repsonse, or neither. Corresponds to the indicator 'b',
// 'c' or '-' in the fourth column of verbose varnishlog output.
// 'c' or '-' in the fourth column of verbose varnishlog output.
//
// Use rune(rt) for a RecordType rt to get 'b', 'c' or '-'
type
RecordType
uint8
type
RecordType
uint8
const
(
const
(
...
@@ -205,6 +207,11 @@ const (
...
@@ -205,6 +207,11 @@ const (
None
=
RecordType
(
'-'
)
None
=
RecordType
(
'-'
)
)
)
// String returns "b", "c" or "-".
func
(
rt
RecordType
)
String
()
string
{
return
string
(
rt
)
}
func
initTags
()
[]
string
{
func
initTags
()
[]
string
{
var
tags
[]
string
var
tags
[]
string
if
uint8
(
C
.
slt_max
())
>
^
uint8
(
0
)
{
if
uint8
(
C
.
slt_max
())
>
^
uint8
(
0
)
{
...
...
pkg/log/log_test.go
View file @
ad02b98b
...
@@ -91,6 +91,21 @@ func TestReasonString(t *testing.T) {
...
@@ -91,6 +91,21 @@ func TestReasonString(t *testing.T) {
}
}
}
}
var
expRecordTypeStr
=
map
[
RecordType
]
string
{
Client
:
"c"
,
Backend
:
"b"
,
None
:
"-"
,
}
func
TestRecordTypeString
(
t
*
testing
.
T
)
{
for
k
,
v
:=
range
expRecordTypeStr
{
if
k
.
String
()
!=
v
{
t
.
Errorf
(
"%c.String() expected=%v got=%v"
,
k
,
v
,
k
.
String
())
}
}
}
func
TestNewRelease
(
t
*
testing
.
T
)
{
func
TestNewRelease
(
t
*
testing
.
T
)
{
l
:=
New
()
l
:=
New
()
defer
l
.
Release
()
defer
l
.
Release
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment