func New(configCache apisettings.Cache, repo mydomain.Repository) (*Service, error) {
	var c *cache.Cache

	if configCache.Enabled {
		// Create a cache with a default expiration time of 5 minutes, and which
		// purges expired items every 10 minutes
		cacheTime := time.Minute * configCache.ExpirationMinutes
		purgeTime := time.Minute * configCache.PurgeMinutes

		c = cache.New(cacheTime, purgeTime)
	}

	s := &Service{
		repo:  repo,
		cache: c,
	}
	return s, nil
}
// New constructs and returns a Service struct
New constructs and returns a Service struct
// New constructs and returns a Service struct
func New(configCache apisettings.Cache, repo mydomain.Repository) (*Service, error) {
	var c *cache.Cache
	if configCache.Enabled {
		cacheTime := time.Minute * configCache.ExpirationMinutes
		purgeTime := time.Minute * configCache.PurgeMinutes
		c = cache.New(cacheTime, purgeTime)
	}
	s := &Service{
		repo:  repo,
		cache: c,
	}
	return s, nil
}
func New ( configCache apisettings . Cache , repo mydomain . Repository ) ( * Service , error ) { var c * cache . Cache if configCache . Enabled { cacheTime := time . Minute * configCache . ExpirationMinutes purgeTime := time . Minute * configCache . PurgeMinutes c = cache . New ( cacheTime , purgeTime ) } s := & Service { repo : repo , cache : c , } return s , nil }
New constructs and returns a Service struct
New constructs and returns a Service struct
// Create a cache with a default expiration time of 5 minutes, and which // purges expired items every 10 minutes