func CreateOpaClient(parentLogger logger.Logger, opaConfiguration *Config) Client {
	var newOpaClient Client
	switch opaConfiguration.ClientKind {
	case ClientKindHTTP:
		newOpaClient = NewHTTPClient(parentLogger,
			opaConfiguration.Address,
			opaConfiguration.PermissionQueryPath,
			opaConfiguration.PermissionFilterPath,
			time.Duration(opaConfiguration.RequestTimeout)*time.Second,
			opaConfiguration.LogLevel,
			opaConfiguration.OverrideHeaderValue)
	case ClientKindMock:
		newOpaClient = &MockClient{}
	case ClientKindNop:
		newOpaClient = NewNopClient(parentLogger, opaConfiguration.LogLevel)
	default:
		newOpaClient = NewNopClient(parentLogger, opaConfiguration.LogLevel)
	}
	return newOpaClient
}
CreateOpaClient creates an OPA client by a given configuration
package opa
import (
	"time"
	"github.com/nuclio/logger"
)