var bytes = await cache.GetAsync(key, token); // Try to get from cache. 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.Serial...
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....