// New method of Adapter:
New method of Adapter.
// New method of Adapter :
func New(config Configuration) *Adapter {
	backoff := heimdall.NewConstantBackoff(config.BackoffInterval, config.JitterInterval)
	retrier := heimdall.NewRetrier(backoff)
	httpClient := httpclient.NewClient(
		httpclient.WithHTTPTimeout(config.HTTPTimeout),
		httpclient.WithRetrier(retrier),
		httpclient.WithRetryCount(int(config.RequestRetryCount)),
	)
	adapterVersion := os.Getenv("BUILD_VERSION")
	adapter := &Adapter{
		Config:        config,
		HTTPClient:    httpClient,
		Logger:        log.New(os.Stdout, config.Hostname+" ", log.LstdFlags),
		Queue:         make(chan Line),
		instrumenting: newInstrumentingAdapter(),
		version:       adapterVersion,
	}
	go adapter.instrumenting.fireBuildInfo(adapterVersion)
	go adapter.readQueue()
	return adapter
}
func New ( config Configuration ) * Adapter { backoff := heimdall . NewConstantBackoff ( config . BackoffInterval , config . JitterInterval ) retrier := heimdall . NewRetrier ( backoff ) httpClient := httpclient . NewClient ( httpclient . WithHTTPTimeout ( config . HTTPTimeout ) , httpclient . WithRetrier ( retrier ) , httpclient . WithRetryCount ( int ( config . RequestRetryCount ) ) , ) adapterVersion := os . Getenv ( " " ) adapter := & Adapter { Config : config , HTTPClient : httpClient , Logger : log . New ( os . Stdout , config . Hostname + " " , log . LstdFlags ) , Queue : make ( chan Line ) , instrumenting : newInstrumentingAdapter ( ) , version : adapterVersion , } go adapter . instrumenting . fireBuildInfo ( adapterVersion ) go adapter . readQueue ( ) return adapter }
New method of Adapter.
New method of Adapter .