fix lint error (#2266)

pull/2268/head
Kagaya 2 years ago committed by GitHub
parent 0aa9719e3a
commit e4d73db523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      contrib/log/fluent/fluent.go
  2. 62
      contrib/registry/kubernetes/registry.go
  3. 1
      transport/grpc/resolver/direct/builder.go
  4. 1
      transport/grpc/server.go
  5. 1
      transport/http/server.go

@ -99,6 +99,7 @@ type Logger struct {
// NewLogger new a std logger with options.
// target:
//
// tcp://127.0.0.1:24224
// unix://var/run/fluent/fluent.sock
func NewLogger(addr string, opts ...Option) (*Logger, error) {

@ -32,37 +32,37 @@ import (
// kratos-service-protocols: define the protocols of the service
//
// Example Deployment:
//
// apiVersion: apps/v1
// kind: Deployment
// metadata:
// name: nginx
// labels:
// app: nginx
// spec:
// replicas: 5
// selector:
// matchLabels:
// app: nginx
// template:
// metadata:
// labels:
// app: nginx
// kratos-service-id: "56991810-c77f-4a95-8190-393efa9c1a61"
// kratos-service-app: "nginx"
// kratos-service-version: "v3.5.0"
// annotations:
// kratos-service-protocols: |
// {"80": "http"}
// kratos-service-metadata: |
// {"region": "sh", "zone": "sh001", "cluster": "pd"}
// spec:
// containers:
// - name: nginx
// image: nginx:1.7.9
// ports:
// - containerPort: 80
//
/*
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 5
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
kratos-service-id: "56991810-c77f-4a95-8190-393efa9c1a61"
kratos-service-app: "nginx"
kratos-service-version: "v3.5.0"
annotations:
kratos-service-protocols: |
{"80": "http"}
kratos-service-metadata: |
{"region": "sh", "zone": "sh001", "cluster": "pd"}
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
*/
const (
// LabelsKeyServiceID is used to define the ID of the service
LabelsKeyServiceID = "kratos-service-id"

@ -14,6 +14,7 @@ type directBuilder struct{}
// NewBuilder creates a directBuilder which is used to factory direct resolvers.
// example:
//
// direct://<authority>/127.0.0.1:9000,127.0.0.2:9000
func NewBuilder() resolver.Builder {
return &directBuilder{}

@ -176,6 +176,7 @@ func (s *Server) Use(selector string, m ...middleware.Middleware) {
// Endpoint return a real address to registry endpoint.
// examples:
//
// grpc://127.0.0.1:9000?isSecure=false
func (s *Server) Endpoint() (*url.URL, error) {
if err := s.listenAndEndpoint(); err != nil {

@ -256,6 +256,7 @@ func (s *Server) filter() mux.MiddlewareFunc {
// Endpoint return a real address to registry endpoint.
// examples:
//
// https://127.0.0.1:8000
// Legacy: http://127.0.0.1:8000?isSecure=false
func (s *Server) Endpoint() (*url.URL, error) {

Loading…
Cancel
Save