比如想实现这样一个配置
users []user
type user struct {
username string
password string
}
这个 toml 应该是长啥样呢?
就是什么格式和解析或什么格式的 struct 才能实现像 php 那样的:
$arr = [
'users' => [
['username'=>'1', 'password' => '1']
]
];
// foreach ($arr['users'] as $item) if $req['user'] == $item['username'] .....
场景是一个特别小的内部使用的用户配置文件。在这个配置里面的才能访问这个服务不值顾搞套数据库。