You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: synchronized_before_suite_node.go
    path of file: ./repos/streamdal/apps/server/vendor/github.com/onsi/ginkgo/internal/leafnodes
    
    the code of the file until where you have to start completion: package leafnodes

import (
	"bytes"
	"encoding/json"
	"io/ioutil"
	"net/http"
	"reflect"
	"time"

	"github.com/onsi/ginkgo/internal/failer"
	"github.com/onsi/ginkgo/types"
)

type synchronizedBeforeSuiteNode struct {
	runnerA *runner
	runnerB *runner

	data []byte

	outcome types.SpecState
	failure types.SpecFailure
	runTime time.Duration
}

func NewSynchronizedBeforeSuiteNode(bodyA interface{}, bodyB interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode {
	node := &synchronizedBeforeSuiteNode{}

	node.runnerA = newRunner(node.wrapA(bodyA), codeLocation, timeout, failer, types.SpecCo
    
func (node *synchronizedBeforeSuiteNode) waitForA(syncHost string) (types.SpecState, types.SpecFailure) {
	failure := func(message string) types.SpecFailure {
		return types.SpecFailure{
			Message:               message,
			Location:              node.runnerA.codeLocation,
			ComponentType:         node.runnerA.nodeType,
			ComponentIndex:        node.runnerA.componentIndex,
			ComponentCodeLocation: node.runnerA.codeLocation,
		}
	}
	for {
		resp, err := http.Get(syncHost + "/BeforeSuiteState")
		if err != nil || resp.StatusCode != http.StatusOK {
			return types.SpecStateFailed, failure("Failed to fetch BeforeSuite state")
		}

		body, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			return types.SpecStateFailed, failure("Failed to read BeforeSuite state")
		}
		resp.Body.Close()

		beforeSuiteData := types.RemoteBeforeSuiteData{}
		err = json.Unmarshal(body, &beforeSuiteData)
		if err != nil {
			return types.SpecStateFailed, failure("Failed to decode BeforeSuite state")
		}

		switch beforeSuiteData.State {
		case types.RemoteBeforeSuiteStatePassed:
			node.data = beforeSuiteData.Data
			return types.SpecStatePassed, types.SpecFailure{}
		case types.RemoteBeforeSuiteStateFailed:
			return types.SpecStateFailed, failure("BeforeSuite on Node 1 failed")
		case types.RemoteBeforeSuiteStateDisappeared:
			return types.SpecStateFailed, failure("Node 1 disappeared before completing BeforeSuite")
		}

		time.Sleep(50 * time.Millisecond)
	}
}