SomeInformation info; if (bytes is null) { // Cache miss; get the data from the real source. info = await SomeExpensiveOperationAsync(name, id, token); // Serialize and cache it. bytes = SomeSerializer.Serialize(info); await cache.SetAsync(key, bytes, token); } else { // Cache hi...
RedisHost string `env:"REDIS_HOST" envDefault:"cache"` RedisPort int `env:"REDIS_PORT" envDefault:"6379"` FrontEndpoint string `env:"FRONT_ENDPOINT" envDefault:"http://localhost:3000"` } // 環境変数の構造体を返却 func New() (*Config, error) { cfg := &Config{} if err := env....