// NewIssueService returns a new IssueService.
197835
func NewIssueService(httpClient *http.Client) *IssueService {
	return &IssueService{
		sling: sling.New().Client(httpClient).Base(baseURL),
	}
}
1357297
func NewIndicesGetService(client *Client) *IndicesGetService {
	return &IndicesGetService{
		client:  client,
		index:   make([]string, 0),
		feature: make([]string, 0),
	}
}
910609
func NewCheService(context servicecontext.ServiceContext, config Configuration) service.CheService {
	return &cheServiceImpl{
		BaseService: base.NewBaseService(context),
		config:      config,
	}
}
1031888
func (m *Module) LookupService(name string) (*ServiceSpec, error) {
	if s, ok := m.Services[name]; ok {
		return s, nil
	}

	return nil, lookupError{Name: name}
}
259520
func SendIssueMentionMail(issue Issue, repo Repository, doer User, tos []string) {
	if len(tos) == 0 {
		return
	}
	Send(composeIssueMessage(issue, repo, doer, MAIL_ISSUE_MENTION, tos, "issue mention"))
}
1118139
func createService(c context.Context, opts auth.Options) (*compute.Service, error) {
	http, err := auth.NewAuthenticator(c, auth.OptionalLogin, opts).Client()
	if err != nil {
		return nil, err
	}
	service, err := compute.New(http)
	if err != nil {
		return nil, err
	}
	return service, nil
}
9542
func NewService(events *exchange.Exchange) api.EventsServer {
	return &service{
		ttService: &ttrpcService{
			events: events,
		},
		events: events,
	}
}
369475
func NewService(config ServiceConfig) (Service, error) {
	// Dependencies.
	if config.RandomService == nil {
		return nil, maskAnyf(invalidConfigError, "random service must not be empty")
	}

	// Settings.
	if config.HashChars == "" {
		return nil, maskAnyf(invalidConfigError, "hash characters must not be empty")
	}
	if config.Length == 0 {
		return nil, maskAnyf(invalidConfigError, "length must not be empty")
	}

	newService := &service{
		// Dependencies.
		random: config.RandomService,

		// Settings.
		hashChars: config.HashChars,
		length:    config.Length,
	}

	return newService, nil
}
1007168
func NewUserService() *UserService {
	return &UserService{
		FindUserByIDFn: func(context.Context, platform.ID) (*platform.User, error) { return nil, nil },
		FindUserFn:     func(context.Context, platform.UserFilter) (*platform.User, error) { return nil, nil },
		CreateUserFn:   func(context.Context, *platform.User) error { return nil },
		UpdateUserFn:   func(context.Context, platform.ID, platform.UserUpdate) (*platform.User, error) { return nil, nil },
		DeleteUserFn:   func(context.Context, platform.ID) error { return nil },
		FindUsersFn: func(context.Context, platform.UserFilter, ...platform.FindOptions) ([]*platform.User, int, error) {
			return nil, 0, nil
		},
	}
}
951653
func NewService(c *http.Client) *Service {
	if c == nil {
		c = http.DefaultClient
	}
	return &Service{
		client: c,
		URL:    DefaultURL,
	}
}
11879
func (tracker *issueTracker) updateIssues(
	issues []*github.Issue,
	updateFunc issueUpdateFunc,
	rollbackFunc issueUpdateFunc,
) ([]*github.Issue, action.Action, error) {

	var (
		client = tracker.newClient()
		owner  = tracker.config.GitHubOwner
		repo   = tracker.config.GitHubRepository
	)
	return updateIssues(client, owner, repo, issues, updateFunc, rollbackFunc)
}
648880
func NewService(comp Component, opts []Option) *Service {
	s := &Service{
		Type:     reflect.TypeOf(comp),
		Receiver: reflect.ValueOf(comp),
	}

	// apply options
	for i := range opts {
		opt := opts[i]
		opt(&s.Options)
	}
	if name := s.Options.name; name != "" {
		s.Name = name
	} else {
		s.Name = reflect.Indirect(s.Receiver).Type().Name()
	}

	return s
}
1248501
func initService(service *goa.Service) {
	// Setup encoders and decoders
	service.Encoder.Register(goa.NewJSONEncoder, "application/json")
	service.Encoder.Register(goa.NewGobEncoder, "application/gob", "application/x-gob")
	service.Encoder.Register(goa.NewXMLEncoder, "application/xml")
	service.Decoder.Register(goa.NewJSONDecoder, "application/json")
	service.Decoder.Register(goa.NewGobDecoder, "application/gob", "application/x-gob")
	service.Decoder.Register(goa.NewXMLDecoder, "application/xml")

	// Setup default encoder and decoder
	service.Encoder.Register(goa.NewJSONEncoder, "*/*")
	service.Decoder.Register(goa.NewJSONDecoder, "*/*")
}
801178
func NewResourceService(context servicecontext.ServiceContext) service.ResourceService {
	return &resourceServiceImpl{base.NewBaseService(context)}
}
1299574
func NewService() *Service {
	return &Service{
		TokenGenerator: rand.NewTokenGenerator(64),
		IDGenerator:    snowflake.NewIDGenerator(),
		time:           time.Now,
	}
}
255263
func (i *Handle) NewService(s *Service) error {
	return i.doCmd(s, nil, ipvsCmdNewService)
}
859886
func newService(name, binary string) *Service {
	return &Service{
		name:         name,
		binary:       binary,
		args:         make([]string, 0),
		dependencies: make(map[string]*Service),
		dependents:   make(map[string]*Service),

		done:     make(chan bool),
		shutdown: make(chan bool, 1),
		started:  make(chan bool, 1),
		stopped:  make(chan bool, 1),

		termTimeout: 5 * time.Second,
	}
}