lru
This commit is contained in:
@@ -56,7 +56,8 @@ func LogComponent(startTime int64, r *http.Request) {
|
|||||||
endTime := fmt.Sprintf(color, ms)
|
endTime := fmt.Sprintf(color, ms)
|
||||||
method := fmt.Sprintf("\033[1;32m%s\033[0m", r.Method) // 綠色加重
|
method := fmt.Sprintf("\033[1;32m%s\033[0m", r.Method) // 綠色加重
|
||||||
url := fmt.Sprintf("\033[1;34m%s\033[0m", r.URL) // 藍色加重
|
url := fmt.Sprintf("\033[1;34m%s\033[0m", r.URL) // 藍色加重
|
||||||
log.Println(method, url, endTime)
|
|
||||||
|
log.Println(method, url, endTime, r.Header.Get("X-Forwarded-For"))
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
|
2
go.mod
2
go.mod
@@ -10,6 +10,7 @@ require (
|
|||||||
github.com/elastic/go-elasticsearch/v8 v8.11.0
|
github.com/elastic/go-elasticsearch/v8 v8.11.0
|
||||||
github.com/graphql-go/graphql v0.8.1
|
github.com/graphql-go/graphql v0.8.1
|
||||||
github.com/graphql-go/handler v0.2.3
|
github.com/graphql-go/handler v0.2.3
|
||||||
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||||
github.com/jmoiron/sqlx v1.3.5
|
github.com/jmoiron/sqlx v1.3.5
|
||||||
github.com/milvus-io/milvus-sdk-go/v2 v2.2.1
|
github.com/milvus-io/milvus-sdk-go/v2 v2.2.1
|
||||||
github.com/mitchellh/mapstructure v1.5.0
|
github.com/mitchellh/mapstructure v1.5.0
|
||||||
@@ -31,7 +32,6 @@ require (
|
|||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/magiconair/properties v1.8.7 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
|
Reference in New Issue
Block a user