我之前使用statik将文件嵌入到 Go 应用程序中。
使用 Go 1.16 我可以删除该依赖项
例如:
//go:embed static
var static embed.FS
fs := http.FileServer(http.FS(static))
http.Handle("/", fs)
Run Code Online (Sandbox Code Playgroud)
这将为./static/目录提供服务http://.../static/
有没有一种方法可以从/根路径提供该目录,而不需要/static?
我正在使用此模块https://github.com/turnerlabs/terraform-s3-user创建一些 s3 存储桶和相关的 iam 用户。
这工作正常:
module "my_bucket" {
  source = "github.com/turnerlabs/terraform-s3-user?ref=v2.1"
  bucket_name = "my-bucket"
  tag_team          = "developers"
  tag_contact-email = "xxxxx"
  tag_application   = "xxxxx"
  tag_environment   = "prod"
  tag_customer      = "xxxxx"
}
Run Code Online (Sandbox Code Playgroud)
现在我想修复此模块创建的 s3 存储桶的默认策略。
terrafom show给我看看这个:
module.my_bucket.aws_s3_bucket_policy.bucket_policy:
  id = my-bucket
  bucket = my-bucket
  policy = {
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::____________:user/srv_my-bucket"
      },
      "Action": [ "s3:*" ],
      "Resource": [
        "arn:aws:s3:::my-bucket",
        "arn:aws:s3:::my-bucket/*"
      ]
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)
我应该如何修改我的 .tf 以获得另一个策略?
按照本指南https://clickhouse.com/docs/knowledgebase/mysql-to-parquet-csv-json我已从 MySQL 服务器将一些表导出到镶木地板。
但我无法使用 DuckDB 读取这些镶木地板文件。
我可以检查结构:
DESCRIBE SELECT * FROM 'mytable.parquet';
Run Code Online (Sandbox Code Playgroud)
但如果我尝试阅读:
select ID from mytable.parquet;
Error: Invalid Error: Unsupported compression codec "7". Supported options are uncompressed, gzip, snappy or zstd
Run Code Online (Sandbox Code Playgroud)
我猜想 clickhouse 正在编写 LZ4 压缩的 parquet 文件,而 duckdb 不支持它们。我可以更改 clickhouse-local 中的压缩格式吗?