Skip to content
Snippets Groups Projects

Add basic application framework and example application to show interaction between events an NBI

Merged Ghost User requested to merge istaester/init-application-framework into develop
1 file
+ 24
0
Compare changes
  • Side-by-side
  • Inline
package configuration
import (
"fmt"
"net"
)
type IPConfig struct {
IP net.IP `json:"ip,omitempty"`
PrefixLength int `json:"prefix_length,omitempty"`
}
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)
}
newIPConfig.IP = parsedIP
newIPConfig.PrefixLength = prefixLength
return newIPConfig, nil
}
Loading