func NewApplication()

in grpc-xds/control-plane-go/pkg/applications/application.go [37:54]


func NewApplication(namespace string, name string, servingPort uint32, servingProtocol string, healthCheckPort uint32, healthCheckProtocol string, endpoints []ApplicationEndpoints) Application {
	endpointsCopy := make([]ApplicationEndpoints, len(endpoints))
	copy(endpointsCopy, endpoints)
	slices.SortFunc(endpointsCopy, func(a ApplicationEndpoints, b ApplicationEndpoints) int {
		return a.Compare(b)
	})
	return Application{
		Namespace:           namespace,
		ServiceAccountName:  name,
		Name:                name,
		PathPrefix:          "",
		ServingPort:         servingPort,
		ServingProtocol:     servingProtocol,
		HealthCheckPort:     healthCheckPort,
		HealthCheckProtocol: healthCheckProtocol,
		Endpoints:           endpointsCopy,
	}
}