blob: a457acf1b8e9e59a53ef40ca738a2bcdbfe53abf [file] [log] [blame]
// Code generated by svcmux; DO NOT EDIT
package buildbot
import (
"go.chromium.org/luci/grpc/svcmux"
context "golang.org/x/net/context"
)
type VersionedBuildbot struct {
// Default is the version used if X-Luci-Service-Version metadata
// is not present.
Default string
// Impls maps versions to service implementations.
Impls map[string]BuildbotServer
}
func (s *VersionedBuildbot) Search(c context.Context, req *SearchRequest) (*SearchResponse, error) {
ver := svcmux.GetServiceVersion(c, s.Default)
impl := s.Impls[ver]
if impl == nil {
return nil, svcmux.NoImplementation(ver)
}
return impl.Search(c, req)
}
func (s *VersionedBuildbot) Schedule(c context.Context, req *ScheduleRequest) (*ScheduleResponse, error) {
ver := svcmux.GetServiceVersion(c, s.Default)
impl := s.Impls[ver]
if impl == nil {
return nil, svcmux.NoImplementation(ver)
}
return impl.Schedule(c, req)
}