@@ -22,12 +22,12 @@ import (
2222)
2323
2424var (
25- errMissingDataPathName = errors .New ("datapath name argument is mandatory" )
26- errUninitializedClient = errors .New ("client unitialized" )
27- errMissingMandatoryZone = errors .New ("at least 1 zone is mandatory" )
28- errWrongArgumentNumber = errors .New ("missing or too much arguments to setup ct limits" )
29- errWrongDefaultArgument = errors .New ("wrong argument while setting default ct limits" )
30- errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
25+ errMissingMandatoryDataPathName = errors .New ("datapath name argument is mandatory" )
26+ errUninitializedClient = errors .New ("client unitialized" )
27+ errMissingMandatoryZone = errors .New ("at least 1 zone is mandatory" )
28+ errWrongArgumentNumber = errors .New ("missing or too many arguments to setup ct limits" )
29+ errWrongDefaultArgument = errors .New ("wrong argument while setting default ct limits" )
30+ errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
3131)
3232
3333// Zone defines the type used to store a zone as it is returned
@@ -44,7 +44,7 @@ type Zone map[string]uint64
4444type ConnTrackOutput struct {
4545 // defaulCT is used to store the global setting: default
4646 defaultLimit Zone
47- //zones stores all remaning zone's settings
47+ // zones stores all remaning zone's settings
4848 zones []Zone
4949}
5050
@@ -78,10 +78,10 @@ type ConnTrackReader interface {
7878// ConnTrackWriter is the interface defining the write operations
7979// of ovs conntrack
8080type ConnTrackWriter interface {
81- // SetCTLimits is the method used to setup a limit for an ofport ( zone)
81+ // SetCTLimits is the method used to setup a limit for a zone
8282 // belonging to a datapath of a switch
8383 SetCTLimits (string ) (string , error )
84- // DelCTLimits is the method used to remove a limit to an ofport ( zone)
84+ // DelCTLimits is the method used to remove a limit to a zone
8585 // belonging to a datapath of a switch
8686 DelCTLimits (string , []uint64 ) (string , error )
8787}
@@ -152,7 +152,7 @@ func (dp *DataPathService) DelDataPath(dpName string) error {
152152func (dp * DataPathService ) GetCTLimits (dpName string , zones []uint64 ) (* ConnTrackOutput , error ) {
153153 // Start by building the args
154154 if dpName == "" {
155- return nil , errMissingDataPathName
155+ return nil , errMissingMandatoryDataPathName
156156 }
157157
158158 args := []string {"ct-get-limits" , dpName }
@@ -215,7 +215,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
215215func (dp * DataPathService ) SetCTLimits (dpName string , zone map [string ]uint64 ) (string , error ) {
216216 // Sanitize the input
217217 if dpName == "" {
218- return "" , errMissingDataPathName
218+ return "" , errMissingMandatoryDataPathName
219219 }
220220 argsStr , err := ctSetLimitsArgsToString (zone )
221221 if err != nil {
@@ -233,7 +233,7 @@ func (dp *DataPathService) SetCTLimits(dpName string, zone map[string]uint64) (s
233233// sudo ovs-dpctl ct-del-limits system@ovs-system zone=40,4
234234func (dp * DataPathService ) DelCTLimits (dpName string , zones []uint64 ) (string , error ) {
235235 if dpName == "" {
236- return "" , errMissingDataPathName
236+ return "" , errMissingMandatoryDataPathName
237237 }
238238 if len (zones ) < 1 {
239239 return "" , errMissingMandatoryZone
@@ -253,7 +253,7 @@ func (dp *DataPathService) DelCTLimits(dpName string, zones []uint64) (string, e
253253 return string (results ), err
254254}
255255
256- // ctSetLimitsArgsToString is function to help formating and sanatizing an input
256+ // ctSetLimitsArgsToString helps formating and sanatizing an input
257257// It takes a map and output a string like this:
258258// - "zone=2,limit=10000" or "limit=10000,zone=2"
259259// - "default=10000"
0 commit comments