Commit 5bd1e168 authored by Geoff Simmons's avatar Geoff Simmons

Add Admin.VCLLabel()

parent 0c812d02
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment