func (e *Environment) mergeCustomerEnvironmentVariables(envVars map[string]string) {
	e.Customer = mapUnion(e.Customer, envVars)
}
mergeCustomerEnvironmentVariables appends to customer env vars, overwriting entries if they exist
package env
import (
	"os"
	"strconv"
	"strings"
	"syscall"
	log "github.com/sirupsen/logrus"
)
const runtimeAPIAddressKey = "AWS_LAMBDA_RUNTIME_API"
const handlerEnvKey = "_HANDLER"
const executionEnvKey = "AWS_EXECUTION_ENV"
type Environment struct {
	RAPID              map[string]string  
	Platform           map[string]string  
	Runtime            map[string]string  
	PlatformUnreserved map[string]string  
	Credentials        map[string]string  
	Customer           map[string]string  
	runtimeAPISet  bool
	initEnvVarsSet bool
}
type RapidConfig struct {
	SbID                   string
	LogFd                  int
	ShmFd                  int
	CtrlFd                 int
	CnslFd                 int
	DirectInvokeFd         int
	LambdaTaskRoot         string
	XrayDaemonAddress      string
	PreLoadTimeNs          int64
	FunctionName           string
	TelemetryAPIPassphrase string
}
func lookupEnv(keys map[string]bool) map[string]string {
	res := map[string]string{}
	for key := range keys {
		val, ok := os.LookupEnv(key)
		if ok {
			res[key] = val
		}
	}
	return res
}
func NewEnvironment() *Environment {
	return &Environment{
		RAPID:              lookupEnv(predefinedInternalEnvVarKeys()),
		Platform:           lookupEnv(predefinedPlatformEnvVarKeys()),
		Runtime:            lookupEnv(predefinedRuntimeEnvVarKeys()),
		PlatformUnreserved: lookupEnv(predefinedPlatformUnreservedEnvVarKeys()),
		Credentials: map[string]string{},
		Customer:    map[string]string{},
		runtimeAPISet:  false,
		initEnvVarsSet: false,
	}
}
func (e *Environment) StoreRuntimeAPIEnvironmentVariable(runtimeAPIAddress string) {
	e.Platform[runtimeAPIAddressKey] = runtimeAPIAddress
	e.runtimeAPISet = true
}
func (e *Environment) GetHandler() string {
	return e.Runtime[handlerEnvKey]
}
func (e *Environment) SetHandler(handler string) {
	e.Runtime[handlerEnvKey] = handler
}
func (e *Environment) GetExecutionEnv() string {
	return e.Runtime[executionEnvKey]
}
func (e *Environment) SetExecutionEnv(executionEnv string) {
	e.Runtime[executionEnvKey] = executionEnv
}
func (e *Environment) StoreEnvironmentVariablesFromInit(customerEnv map[string]string, handler, awsKey, awsSecret, awsSession, funcName, funcVer string) {
	e.Credentials["AWS_ACCESS_KEY_ID"] = awsKey
	e.Credentials["AWS_SECRET_ACCESS_KEY"] = awsSecret
	e.Credentials["AWS_SESSION_TOKEN"] = awsSession
	if handler != "" {
		e.SetHandler(handler)
	}
	if funcName != "" {
		e.Platform["AWS_LAMBDA_FUNCTION_NAME"] = funcName
	}
	if funcVer != "" {
		e.Platform["AWS_LAMBDA_FUNCTION_VERSION"] = funcVer
	}
	e.mergeCustomerEnvironmentVariables(customerEnv)  
	e.initEnvVarsSet = true
}
func (e *Environment) StoreEnvironmentVariablesFromCLIOptions(envVars map[string]string) {
	e.mergeCustomerEnvironmentVariables(envVars)
}