Exemplo n.º 1
0
Arquivo: unit.go Projeto: jkary/core
// Service returns the service.
func (u *Unit) Service() (*Service, error) {
	serviceTag := names.ServiceTag(u.ServiceName())
	service := &Service{
		st:  u.st,
		tag: serviceTag,
	}
	// Call Refresh() immediately to get the up-to-date
	// life and other needed locally cached fields.
	err := service.Refresh()
	if err != nil {
		return nil, err
	}
	return service, nil
}
Exemplo n.º 2
0
// Tag returns a name identifying the service that is safe to use
// as a file name.  The returned name will be different from other
// Tag values returned by any other entities from the same state.
func (s *Service) Tag() string {
	return names.ServiceTag(s.Name())
}
Exemplo n.º 3
0
Arquivo: unit.go Projeto: jkary/core
// ServiceTag returns the service tag.
func (u *Unit) ServiceTag() string {
	return names.ServiceTag(u.ServiceName())
}