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
0de7803a
Commit
0de7803a
authored
Aug 20, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the Attacher interface (until and unless there's a use for it).
parent
9cdb136a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
32 deletions
+15
-32
vsm.go
internal/pkg/vsm/vsm.go
+15
-32
No files found.
internal/pkg/vsm/vsm.go
View file @
0de7803a
...
...
@@ -44,32 +44,6 @@ import (
"unsafe"
)
// An Attacher can attach to a running instance of Varnish. This means
// that it can obtain information from resources that are actively
// managed and updated by the live Varnish child process.
type
Attacher
interface
{
// Set the timeout for attaching to a Varnish instance. If the
// Duration, rounded to seconds toward 0s, is >= 0s, then wait
// that many seconds to attach. If the Duration < 0s, wait
// indefinitely. By default, the Varnish default timeout holds
// (5s in recent Varnish versions).
AttachTmo
(
time
.
Duration
)
error
// Attach to the default instance of Varnish -- the instance
// of varnishd invoked without the -n option.
//
// If the bool argument is true, a dot ('.') is printed to
// standard output for each second waiting for the attach to
// succeed. If the attach fails after timeout, a newline is
// printed. If the argument is false, there is no such output.
Attach
(
bool
)
error
// Attach to a named instance of Varnish, where the string
// corresponds to the -n argument in the invocation of
// varnishd.
AttachInstance
(
string
,
bool
)
error
}
// VSM provides methods for attaching to Varnish shared memory.
type
VSM
struct
{
vsm
*
C
.
struct_vsm
...
...
@@ -120,8 +94,11 @@ func (v *VSM) Error() string {
return
C
.
GoString
(
C
.
VSM_Error
(
v
.
vsm
))
}
// AttachTmo sets the timeout for attaching to a Varnish instance, as
// documented for the Attacher interface.
// AttachTmo sets the timeout for attaching to a Varnish instance. If
// the Duration, rounded to seconds toward 0s, is >= 0s, then wait
// that many seconds to attach. If the Duration < 0s, wait
// indefinitely. By default, the Varnish default timeout holds (5s in
// recent Varnish versions).
func
(
v
*
VSM
)
AttachTmo
(
tmo
time
.
Duration
)
error
{
if
err
:=
v
.
checkNil
();
err
!=
nil
{
return
err
...
...
@@ -150,8 +127,13 @@ func (v *VSM) attach(progress bool) error {
return
nil
}
// Attach attaches to the default instance of Varnish, as documented
// for the Attacher interface.
// Attach to the default instance of Varnish -- the instance of
// varnishd invoked without the -n option.
//
// If the bool argument is true, a dot ('.') is printed to standard
// output for each second waiting for the attach to succeed. If the
// attach fails after timeout, a newline is printed. If the argument
// is false, there is no such output.
func
(
v
*
VSM
)
Attach
(
progress
bool
)
error
{
if
err
:=
v
.
checkNil
();
err
!=
nil
{
return
err
...
...
@@ -159,8 +141,9 @@ func (v *VSM) Attach(progress bool) error {
return
v
.
attach
(
progress
)
}
// AttachInstance attaches to a named instance of Varnish, as
// documented for the Attacher interface.
// AttachInstance attaches to a named instance of Varnish, where the
// string corresponds to the -n argument in the invocation of
// varnishd.
func
(
v
*
VSM
)
AttachInstance
(
inst
string
,
progress
bool
)
error
{
if
err
:=
v
.
checkNil
();
err
!=
nil
{
return
err
...
...
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