func New(org, project string, envs, services, identities, instances []string) (*PathExp, error) {
	pe := PathExp{
		org:     literal(org),
		project: literal(project),
	}

	if !slug.MatchString(org) {
		return nil, errors.New("Invalid org name.")
	}

	if !slug.MatchString(project) {
		return nil, errors.New("Invalid project name.")
	}

	var err error

	pe.envs, err = parseMultiple("environment", envs)
	if err != nil {
		return nil, err
	}

	pe.services, err = parseMultiple("service", services)
	if err != nil {
		return nil, err
	}

	pe.identities, err = parseMultiple("identity", identities)
	if err != nil {
		return nil, err
	}

	pe.instances, err = parseMultiple("instance", instances)
	if err != nil {
		return nil, err
	}

	return &pe, nil
}
// New creates a new path expression from the given path segments
// It returns an error if any of the values fail to validate
New creates a new path expression from the given path segments
It returns an error if any of the values fail to validate
// New creates a new path expression from the given path segments // It returns an error if any of the values fail to validate
func New(org, project string, envs, services, identities, instances []string) (*PathExp, error) {
	pe := PathExp{
		org:     literal(org),
		project: literal(project),
	}
	if !slug.MatchString(org) {
		return nil, errors.New("Invalid org name.")
	}
	if !slug.MatchString(project) {
		return nil, errors.New("Invalid project name.")
	}
	var err error
	pe.envs, err = parseMultiple("environment", envs)
	if err != nil {
		return nil, err
	}
	pe.services, err = parseMultiple("service", services)
	if err != nil {
		return nil, err
	}
	pe.identities, err = parseMultiple("identity", identities)
	if err != nil {
		return nil, err
	}
	pe.instances, err = parseMultiple("instance", instances)
	if err != nil {
		return nil, err
	}
	return &pe, nil
}
func New ( org , project string , envs , services , identities , instances [ ] string ) ( * PathExp , error ) { pe := PathExp { org : literal ( org ) , project : literal ( project ) , } if ! slug . MatchString ( org ) { return nil , errors . New ( " " ) } if ! slug . MatchString ( project ) { return nil , errors . New ( " " ) } var err error pe . envs , err = parseMultiple ( " " , envs ) if err != nil { return nil , err } pe . services , err = parseMultiple ( " " , services ) if err != nil { return nil , err } pe . identities , err = parseMultiple ( " " , identities ) if err != nil { return nil , err } pe . instances , err = parseMultiple ( " " , instances ) if err != nil { return nil , err } return & pe , nil }
New creates a new path expression from the given path segments
It returns an error if any of the values fail to validate
New creates a new path expression from the given path segments It returns an error if any of the values fail to validate