Beispiel #1
0
// Lookup or initialize ipvsService from a kernel ipvs.Service
func (services Services) get(ipvsService ipvs.Service) Service {
	if service, exists := services[ipvsService.String()]; exists {
		return service
	} else {
		service := Service{
			Service: ipvsService,
			dests:   make(ServiceDests),
		}

		services[service.String()] = service

		return service
	}
}
Beispiel #2
0
func (services Services) config(ipvsService ipvs.Service, dests ServiceDests) {
	services[ipvsService.String()] = Service{
		Service: ipvsService,
		dests:   dests,
	}
}