func newACLCache(conf *Config, logger *log.Logger, rpc rpcFn, local acl.FaultFunc) (*aclCache, error) {
	var err error
	cache := &aclCache{
		config: conf,
		logger: logger,
		rpc:    rpc,
		local:  local,
	}

	// Initialize the non-authoritative ACL cache
	cache.acls, err = lru.New2Q(aclCacheSize)
	if err != nil {
		return nil, fmt.Errorf("Failed to create ACL cache: %v", err)
	}

	// Initialize the ACL policy cache
	cache.policies, err = lru.New2Q(aclCacheSize)
	if err != nil {
		return nil, fmt.Errorf("Failed to create ACL policy cache: %v", err)
	}

	return cache, nil
}
// newACLCache returns a new non-authoritative cache for ACLs. This is used for
// performance, and is used inside the ACL datacenter on non-leader servers, and
// outside the ACL datacenter everywhere.
newACLCache returns a new non-authoritative cache for ACLs. This is used for
performance, and is used inside the ACL datacenter on non-leader servers, and
outside the ACL datacenter everywhere.
// newACLCache returns a new non - authoritative cache for ACLs . This is used for // performance and is used inside the ACL datacenter on non - leader servers and // outside the ACL datacenter everywhere .
func newACLCache(conf *Config, logger *log.Logger, rpc rpcFn, local acl.FaultFunc) (*aclCache, error) {
	var err error
	cache := &aclCache{
		config: conf,
		logger: logger,
		rpc:    rpc,
		local:  local,
	}
	cache.acls, err = lru.New2Q(aclCacheSize)
	if err != nil {
		return nil, fmt.Errorf("Failed to create ACL cache: %v", err)
	}
	cache.policies, err = lru.New2Q(aclCacheSize)
	if err != nil {
		return nil, fmt.Errorf("Failed to create ACL policy cache: %v", err)
	}
	return cache, nil
}
func newACLCache ( conf * Config , logger * log . Logger , rpc rpcFn , local acl . FaultFunc ) ( * aclCache , error ) { var err error cache := & aclCache { config : conf , logger : logger , rpc : rpc , local : local , } cache . acls , err = lru . New2Q ( aclCacheSize ) if err != nil { return nil , fmt . Errorf ( " " , err ) } cache . policies , err = lru . New2Q ( aclCacheSize ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return cache , nil }
newACLCache returns a new non-authoritative cache for ACLs.
newACLCache returns a new non - authoritative cache for ACLs .
// Initialize the non-authoritative ACL cache // Initialize the ACL policy cache