mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
25 lines
425 B
Go
25 lines
425 B
Go
package goStrongswanVici
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type UnloadConnRequest struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (c *ClientConn) UnloadConn(r *UnloadConnRequest) error {
|
|
reqMap := &map[string]interface{}{}
|
|
ConvertToGeneral(r, reqMap)
|
|
msg, err := c.Request("unload-conn", *reqMap)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if msg["success"] != "yes" {
|
|
return fmt.Errorf("[Unload-Connection] %s", msg["errmsg"])
|
|
}
|
|
|
|
return nil
|
|
}
|