Skip to content
Snippets Groups Projects
Commit 38e9f0f9 authored by André Sterba's avatar André Sterba
Browse files

Fix lint errors

parent 4996042b
No related branches found
No related tags found
5 merge requests!376Add additional example application hostname-checker,!349Northbound refactoring to implement NIB concept for devices,!343Add basic application framework and example application to show interaction between events an NBI,!339Create basic venv-manager for use with arista,!324Provide prototype implementation for topology handling
Pipeline #106384 passed
This commit is part of merge request !343. Comments created here will be created in the context of that merge request.
......@@ -5,16 +5,18 @@ import (
"net"
)
// IPConfig represents an interface configuration for a cEOS instance
type IPConfig struct {
IP net.IP `json:"ip,omitempty"`
PrefixLength int `json:"prefix_length,omitempty"`
IP net.IP `bson:"ip,omitempty"`
PrefixLength int `bson:"prefix_length,omitempty"`
}
// New creates a new IPConfig
func New(ip string, prefixLength int) (IPConfig, error) {
newIPConfig := IPConfig{}
parsedIP := net.ParseIP(ip)
if parsedIP == nil {
return newIPConfig, fmt.Errorf("%s can not be parsed to an IP.", ip)
return newIPConfig, fmt.Errorf("%s can not be parsed to an IP", ip)
}
newIPConfig.IP = parsedIP
......
......@@ -7,9 +7,9 @@ import (
// Port is a representation of physical port on a network element
type Port struct {
ID uuid.UUID `bson:"_id"`
Name string `bson:"name,omitempty"`
Configuration configuration.IPConfig
ID uuid.UUID `bson:"_id"`
Name string `bson:"name,omitempty"`
Configuration configuration.IPConfig `bson:"configuration,omitempty"`
}
// GetID returns the id of a port
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment