예제 #1
0
파일: registry.go 프로젝트: jonboulle/fleet
func (rc *RegistryClient) UnitState(name string) (*schema.UnitState, error) {
	rUnitState, err := rc.Registry.UnitState(name)
	if err != nil {
		return nil, err
	}

	return schema.MapUnitStateToSchemaUnitState(rUnitState), nil
}
예제 #2
0
func (rc *RegistryClient) UnitStates() ([]*schema.UnitState, error) {
	rUnitStates, err := rc.Registry.UnitStates()
	if err != nil {
		return nil, err
	}

	states := make([]*schema.UnitState, len(rUnitStates))
	for i, rus := range rUnitStates {
		states[i] = schema.MapUnitStateToSchemaUnitState(rus)
	}

	return states, nil
}