{"modulePath":"github.com/bfallik/kubernetes","version":"v1.0.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package algorithm\n\nPackage scheduler contains a generic Scheduler interface and several implementations.\n\n## Types\n\n```go\ntype FakeMinionLister api.NodeList\n```\nFakeMinionLister implements MinionLister on a \\[]string for test purposes.\n\n```go\nfunc (f FakeMinionLister) List() (api.NodeList, error)\n```\nList returns minions as a \\[]string.\n\n```go\ntype FakePodLister []*api.Pod\n```\nFakePodLister implements PodLister on an \\[]api.Pods for test purposes.\n\n```go\nfunc (f FakePodLister) List(s labels.Selector) (selected []*api.Pod, err error)\n```\nList returns \\[]\\*api.Pod matching a query.\n\n```go\ntype FakeServiceLister []api.Service\n```\nFakeServiceLister implements ServiceLister on \\[]api.Service for test purposes.\n\n```go\nfunc (f FakeServiceLister) GetPodServices(pod *api.Pod) (services []api.Service, err error)\n```\nGetPodServices gets the services that have the selector that match the labels on the given pod\n\n```go\nfunc (f FakeServiceLister) List() (api.ServiceList, error)\n```\nFakeServiceLister returns api.ServiceList, the list of all services.\n\n```go\ntype FitPredicate func(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\nFitPredicate is a function that indicates if a pod fits into an existing node.\n\n```go\ntype HostPriority struct {\n\tHost  string\n\tScore int\n}\n```\nHostPriority represents the priority of scheduling to a particular host, lower priority is better.\n\n```go\ntype HostPriorityList []HostPriority\n```\n\n```go\nfunc (h HostPriorityList) Len() int\n```\n\n```go\nfunc (h HostPriorityList) Less(i, j int) bool\n```\n\n```go\nfunc (h HostPriorityList) Swap(i, j int)\n```\n\n```go\ntype MinionLister interface {\n\tList() (list api.NodeList, err error)\n}\n```\nMinionLister interface represents anything that can list minions for a scheduler.\n\n```go\ntype PodLister interface {\n\t// TODO: make this exactly the same as client's Pods(ns).List() method, by returning a api.PodList\n\tList(labels.Selector) ([]*api.Pod, error)\n}\n```\nPodLister interface represents anything that can list pods for a scheduler.\n\n```go\ntype PriorityConfig struct {\n\tFunction PriorityFunction\n\tWeight   int\n}\n```\n\n```go\ntype PriorityFunction func(pod *api.Pod, podLister PodLister, minionLister MinionLister) (HostPriorityList, error)\n```\n\n```go\ntype ScheduleAlgorithm interface {\n\tSchedule(*api.Pod, MinionLister) (selectedMachine string, err error)\n}\n```\nScheduler is an interface implemented by things that know how to schedule pods onto machines.\n\n```go\ntype ServiceLister interface {\n\t// Lists all the services\n\tList() (api.ServiceList, error)\n\t// Gets the services for the given pod\n\tGetPodServices(*api.Pod) ([]api.Service, error)\n}\n```\nServiceLister interface represents anything that can produce a list of services; the list is consumed by a scheduler.\n\n","path":"github.com/bfallik/kubernetes/plugin/pkg/scheduler/algorithm","name":"algorithm","synopsis":"Package scheduler contains a generic Scheduler interface and several implementations.","isRedistributable":true}
