func RegisterExtension(runtimeURL string, registrationRoute string, timeout time.Duration) (ID, error) {

	extesionRegistrationURL := BuildURL(runtimeURL, registrationRoute)
	payload := createRegistrationPayload()

	request, err := buildRegisterRequest(headerExtName, extensionName, extesionRegistrationURL, payload)
	if err != nil {
		return "", fmt.Errorf("registerExtension: can't create the POST register request: %v", err)
	}

	response, err := sendRequest(&http.Client{Timeout: timeout}, request)
	if err != nil {
		return "", fmt.Errorf("registerExtension: error while POST register route: %v", err)
	}

	if !isAValidResponse(response) {
		return "", fmt.Errorf("registerExtension: didn't receive an HTTP 200")
	}

	id := extractID(response)
	if len(id) == 0 {
		return "", fmt.Errorf("registerExtension: didn't receive an identifier")
	}

	return ID(id), nil
}
// RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages.
// Returns either (the serverless ID assigned by the serverless daemon + the api key as read from
// the environment) or an error.
RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages.
Returns either (the serverless ID assigned by the serverless daemon + the api key as read from
the environment) or an error.
// RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages . // Returns either ( the serverless ID assigned by the serverless daemon + the api key as read from // the environment ) or an error .
func RegisterExtension(runtimeURL string, registrationRoute string, timeout time.Duration) (ID, error) {
	extesionRegistrationURL := BuildURL(runtimeURL, registrationRoute)
	payload := createRegistrationPayload()
	request, err := buildRegisterRequest(headerExtName, extensionName, extesionRegistrationURL, payload)
	if err != nil {
		return "", fmt.Errorf("registerExtension: can't create the POST register request: %v", err)
	}
	response, err := sendRequest(&http.Client{Timeout: timeout}, request)
	if err != nil {
		return "", fmt.Errorf("registerExtension: error while POST register route: %v", err)
	}
	if !isAValidResponse(response) {
		return "", fmt.Errorf("registerExtension: didn't receive an HTTP 200")
	}
	id := extractID(response)
	if len(id) == 0 {
		return "", fmt.Errorf("registerExtension: didn't receive an identifier")
	}
	return ID(id), nil
}
func RegisterExtension ( runtimeURL string , registrationRoute string , timeout time . Duration ) ( ID , error ) { extesionRegistrationURL := BuildURL ( runtimeURL , registrationRoute ) payload := createRegistrationPayload ( ) request , err := buildRegisterRequest ( headerExtName , extensionName , extesionRegistrationURL , payload ) if err != nil { return " " , fmt . Errorf ( " " , err ) } response , err := sendRequest ( & http . Client { Timeout : timeout } , request ) if err != nil { return " " , fmt . Errorf ( " " , err ) } if ! isAValidResponse ( response ) { return " " , fmt . Errorf ( " " ) } id := extractID ( response ) if len ( id ) == 0 { return " " , fmt . Errorf ( " " ) } return ID ( id ) , nil }
RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages.
RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages .