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
5bd1e168
Commit
5bd1e168
authored
Nov 29, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Admin.VCLLabel()
parent
0c812d02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
cli.go
pkg/admin/cli.go
+22
-0
No files found.
pkg/admin/cli.go
View file @
5bd1e168
...
...
@@ -208,6 +208,28 @@ func (adm *Admin) VCLUse(config string) error {
return
nil
}
// VCLLabel encapsulates the "vcl.label" command. error is non-nil
// when the response was not OK. In that case, the error is an
// UnexpectedResponse, which wraps the response from Varnish.
//
// label is the VCL label name, which may have previously defined by
// VCLLabel() or an invocation of "vcl.label", or which becomes
// defined through the use of this function. config is the
// configuration name previousy set with VCLLoad(), or a previous
// invocation of "vcl.load". On success, the label is used to refer to
// the config.
func
(
adm
*
Admin
)
VCLLabel
(
label
string
,
config
string
)
error
{
resp
,
err
:=
adm
.
Command
(
"vcl.label"
,
label
,
config
)
if
err
!=
nil
{
return
err
}
if
resp
.
Code
!=
OK
{
badResp
:=
UnexpectedResponse
{
Response
:
resp
}
return
badResp
}
return
nil
}
// VCLDiscard encapsulates the "vcl.discard" command. error is non-nil
// when the response was not OK. In that case, the error is an
// UnexpectedResponse, which wraps the response from Varnish.
...
...
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