func NewEndpoints(endpoint string) (*Endpoints, error) {
	if endpoint == "" {
		return nil, fmt.Errorf("endpoint is required")
	}
	ep, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	roles, err := urlJoin(ep, "roles")
	if err != nil {
		return nil, err
	}
	users, err := urlJoin(ep, "users")
	if err != nil {
		return nil, err
	}
	inputs, err := urlJoin(ep, "system/inputs")
	if err != nil {
		return nil, err
	}
	indexSets, err := urlJoin(ep, "system/indices/index_sets")
	if err != nil {
		return nil, err
	}
	indexSetStats, err := urlJoin(indexSets, "stats")
	if err != nil {
		return nil, err
	}
	streams, err := urlJoin(ep, "streams")
	if err != nil {
		return nil, err
	}
	enabledStreams, err := urlJoin(streams, "enabled")
	if err != nil {
		return nil, err
	}
	alertConditions, err := urlJoin(ep, "alerts/conditions")
	return &Endpoints{
		roles:           roles,
		users:           users,
		inputs:          inputs,
		indexSets:       indexSets,
		indexSetStats:   indexSetStats,
		streams:         streams,
		enabledStreams:  enabledStreams,
		alertConditions: alertConditions,
	}, nil
}
// NewEndpoints returns a new Endpoints.
NewEndpoints returns a new Endpoints.
// NewEndpoints returns a new Endpoints .
func NewEndpoints(endpoint string) (*Endpoints, error) {
	if endpoint == "" {
		return nil, fmt.Errorf("endpoint is required")
	}
	ep, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	roles, err := urlJoin(ep, "roles")
	if err != nil {
		return nil, err
	}
	users, err := urlJoin(ep, "users")
	if err != nil {
		return nil, err
	}
	inputs, err := urlJoin(ep, "system/inputs")
	if err != nil {
		return nil, err
	}
	indexSets, err := urlJoin(ep, "system/indices/index_sets")
	if err != nil {
		return nil, err
	}
	indexSetStats, err := urlJoin(indexSets, "stats")
	if err != nil {
		return nil, err
	}
	streams, err := urlJoin(ep, "streams")
	if err != nil {
		return nil, err
	}
	enabledStreams, err := urlJoin(streams, "enabled")
	if err != nil {
		return nil, err
	}
	alertConditions, err := urlJoin(ep, "alerts/conditions")
	return &Endpoints{
		roles:           roles,
		users:           users,
		inputs:          inputs,
		indexSets:       indexSets,
		indexSetStats:   indexSetStats,
		streams:         streams,
		enabledStreams:  enabledStreams,
		alertConditions: alertConditions,
	}, nil
}
func NewEndpoints ( endpoint string ) ( * Endpoints , error ) { if endpoint == " " { return nil , fmt . Errorf ( " " ) } ep , err := url . Parse ( endpoint ) if err != nil { return nil , err } roles , err := urlJoin ( ep , " " ) if err != nil { return nil , err } users , err := urlJoin ( ep , " " ) if err != nil { return nil , err } inputs , err := urlJoin ( ep , " " ) if err != nil { return nil , err } indexSets , err := urlJoin ( ep , " " ) if err != nil { return nil , err } indexSetStats , err := urlJoin ( indexSets , " " ) if err != nil { return nil , err } streams , err := urlJoin ( ep , " " ) if err != nil { return nil , err } enabledStreams , err := urlJoin ( streams , " " ) if err != nil { return nil , err } alertConditions , err := urlJoin ( ep , " " ) return & Endpoints { roles : roles , users : users , inputs : inputs , indexSets : indexSets , indexSetStats : indexSetStats , streams : streams , enabledStreams : enabledStreams , alertConditions : alertConditions , } , nil }
NewEndpoints returns a new Endpoints.
NewEndpoints returns a new Endpoints .