kubernetes indexer源碼解析
kubernetes indexer是實現了多索引的本地緩存
1.背景
以db中學校學生表做本地緩存為例
type Student struct {
ID uint32
Name string
Class uint32
}
// 本地緩存,id和學生的映射
var idCache = map[uint32]Student{}
先從makefile入手,我這裏是基於redis 7.2.3的源碼。
# Top level makefile, the real shit is at src/Makefile
default: all
.DEFAULT:
cd src $(MAKE) $@
install:
cd src $(MAKE) $@
.PHONY: install
先來看看makefil
react-router-config主要用來幫助我們進行集中式路由的配置,在不使用react-router-config之前,我們的路由使用react-router-dom庫來進行配置,類似如下代碼:
import React from 'react';
import {
BrowserRouter as Router,
Switch,
Route,
} from "react-ro