// Turn "service/method{h;m}" into "service", "method", "{h;m}".
437590
func parseMethodConfigAndSuffix(c string) (service, method, suffix string, _ error) {
	// Regexp result:
	//
	// in:  "p.s/m{h:123,m:123}",
	// out: []string{"p.s/m{h:123,m:123}", "p.s", "m", "{h:123,m:123}"},
	match := longMethodConfigRegexp.FindStringSubmatch(c)
	if match == nil {
		return "", "", "", fmt.Errorf("%q contains invalid substring", c)
	}
	service = match[1]
	method = match[2]
	suffix = match[3]
	return
}
795924
func (service *BaseService) AddMethods(names []string, obj interface{}, aliases []string, option ...Options) Service {
	service.methodManager.AddMethods(names, obj, aliases, option...)
	return service
}
928894
func (ctx *SimpleContext) service(unitName string, renderer shell.Renderer) (deployerService, error) {
	// Service name can be at most 64 characters long, we limit it to 56 just to be safe.
	tag, err := names.NewUnitTag(unitName).ShortenedString(56)
	if err != nil {
		return nil, errors.Trace(err)
	}

	svcName := "jujud-" + tag

	info := service.NewAgentInfo(
		service.AgentKindUnit,
		unitName,
		ctx.agentConfig.DataDir(),
		ctx.agentConfig.LogDir(),
	)

	// TODO(thumper): 2013-09-02 bug 1219630
	// As much as I'd like to remove JujuContainerType now, it is still
	// needed as MAAS still needs it at this stage, and we can't fix
	// everything at once.
	containerType := ctx.agentConfig.Value(agent.ContainerType)

	conf := service.ContainerAgentConf(info, renderer, containerType)
	return ctx.discoverService(svcName, conf)
}
230806
func (o *Operation) Methods() []string {
	methods := []string{
		o.ExportedName,
		o.ExportedName + "Request",
		o.ExportedName + "WithContext",
	}

	if o.Paginator != nil {
		methods = append(methods, []string{
			o.ExportedName + "Pages",
			o.ExportedName + "PagesWithContext",
		}...)
	}

	return methods
}
953533
func (_m *FacadeInterface) RemoveServiceTemplate(ctx datastore.Context, templateID string) error {
	ret := _m.Called(ctx, templateID)

	var r0 error
	if rf, ok := ret.Get(0).(func(datastore.Context, string) error); ok {
		r0 = rf(ctx, templateID)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1254291
func (rd *Resource) generateMethods(r *raml.Resource) {
	rd.addMethod(r, r.Get, "Get")
	rd.addMethod(r, r.Post, "Post")
	rd.addMethod(r, r.Put, "Put")
	rd.addMethod(r, r.Patch, "Patch")
	rd.addMethod(r, r.Delete, "Delete")
	rd.addMethod(r, r.Options, "Options")

	for _, v := range r.Nested {
		rd.generateMethods(v)
	}
}
313120
func (mm *methodManager) AddMethod(
	name string, obj interface{}, alias string, option ...Options) {
	if obj == nil {
		panic("obj can't be nil")
	}
	f := reflect.ValueOf(obj).MethodByName(name)
	if alias != "" {
		name = alias
	}
	if f.CanInterface() {
		mm.AddFunction(name, f, option...)
	}
}
470340
func (self *DefaultRequest) GetMethod() string {
	self.once.Do(self.prepare)
	return self.Method
}
1165686
func (cs Set) Service() string {
	domain, target, _ := cs.Split()
	if domain == "services" {
		return target
	}
	return ""
}
1282497
func (c *MarathonConverter) convertToService(app *gomarathon.Application) *api.Service {
	service := new(api.Service)

	service.Id = (strings.Replace(app.ID, "/", ".", -1))[1:]
	service.Name = app.ID
	service.ActualState = "Deploying"
	if app.TasksRunning > 0 {
		service.ActualState = "Running"
	}

	return service
}
1282163
func getServiceName(service *v1.Service) string {
	return fmt.Sprintf("%s/%s", service.Namespace, service.Name)
}
74789
func (client *Client) Call(serviceMethod string, args interface{}, reply interface{}) error {
	call := <-client.Go(serviceMethod, args, reply, make(chan *Call, 1)).Done
	return call.Error
}
791717
func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
	return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params)
}
192413
func methodFamily(m string) string {
	m = strings.TrimPrefix(m, "/") // remove leading slash
	if i := strings.Index(m, "/"); i >= 0 {
		m = m[:i] // remove everything from second slash
	}
	if i := strings.LastIndex(m, "."); i >= 0 {
		m = m[i+1:] // cut down to last dotted component
	}
	return m
}
788095
func (c *MarathonConverter) convertToServices(apps []*gomarathon.Application) []*api.Service {
	services := make([]*api.Service, len(apps))

	for i := range apps {
		services[i] = c.convertToService(apps[i])
	}

	return services
}
42439
func (v *Service) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	fields[i] = fmt.Sprintf("Name: %v", v.Name)
	i++
	fields[i] = fmt.Sprintf("ThriftName: %v", v.ThriftName)
	i++
	if v.ParentID != nil {
		fields[i] = fmt.Sprintf("ParentID: %v", *(v.ParentID))
		i++
	}
	fields[i] = fmt.Sprintf("Functions: %v", v.Functions)
	i++
	fields[i] = fmt.Sprintf("ModuleID: %v", v.ModuleID)
	i++
	if v.Annotations != nil {
		fields[i] = fmt.Sprintf("Annotations: %v", v.Annotations)
		i++
	}

	return fmt.Sprintf("Service{%v}", strings.Join(fields[:i], ", "))
}
1023244
func GetMethods(m string) []string {
	var methods []string

	if m != "" {
		cln := multispaces.ReplaceAllString(m, " ")
		methods = multispaces.Split(cln, -1)
	}

	return methods
}