From f54b05a5218134ce5d24c2d1299d5ccc68761d59 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 20 May 2024 22:15:51 +0800 Subject: [PATCH] chore: tweak comments --- docs/apidocs.swagger.yaml | 8 ++++---- proto/api/v1/memo_service.proto | 6 +++--- proto/api/v1/user_service.proto | 2 +- proto/gen/api/v1/activity_service.pb.gw.go | 6 +++--- proto/gen/api/v1/auth_service.pb.gw.go | 6 +++--- proto/gen/api/v1/idp_service.pb.gw.go | 6 +++--- proto/gen/api/v1/inbox_service.pb.gw.go | 6 +++--- proto/gen/api/v1/markdown_service.pb.gw.go | 6 +++--- proto/gen/api/v1/memo_service.pb.go | 6 +++--- proto/gen/api/v1/memo_service.pb.gw.go | 6 +++--- proto/gen/api/v1/resource_service.pb.gw.go | 6 +++--- proto/gen/api/v1/user_service.pb.go | 2 +- proto/gen/api/v1/user_service.pb.gw.go | 6 +++--- proto/gen/api/v1/webhook_service.pb.gw.go | 6 +++--- proto/gen/api/v1/workspace_service.pb.gw.go | 6 +++--- proto/gen/api/v1/workspace_setting_service.pb.gw.go | 6 +++--- 16 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/apidocs.swagger.yaml b/docs/apidocs.swagger.yaml index 8907e0f6..cda21f8a 100644 --- a/docs/apidocs.swagger.yaml +++ b/docs/apidocs.swagger.yaml @@ -310,7 +310,7 @@ paths: - name: filter description: |- Filter is used to filter memos returned in the list. - Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" in: query required: false type: string @@ -410,7 +410,7 @@ paths: - name: filter description: |- Filter is used to filter memos returned. - Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" in: query required: false type: string @@ -545,7 +545,7 @@ paths: - name: filter description: |- Filter is used to filter users returned in the list. - Format: "username == frank" + Format: "username == 'frank'" in: query required: false type: string @@ -1517,7 +1517,7 @@ paths: - name: filter description: |- Filter is used to filter memos. - Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" in: query required: false type: string diff --git a/proto/api/v1/memo_service.proto b/proto/api/v1/memo_service.proto index 9b7bd8b5..52e862c4 100644 --- a/proto/api/v1/memo_service.proto +++ b/proto/api/v1/memo_service.proto @@ -205,7 +205,7 @@ message ListMemosRequest { string page_token = 2; // Filter is used to filter memos returned in the list. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" string filter = 3; } @@ -219,7 +219,7 @@ message ListMemosResponse { message SearchMemosRequest { // Filter is used to filter memos returned. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" string filter = 1; } @@ -266,7 +266,7 @@ message ListMemoTagsRequest { string parent = 1; // Filter is used to filter memos. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" string filter = 2; } diff --git a/proto/api/v1/user_service.proto b/proto/api/v1/user_service.proto index b9762311..80fdf98a 100644 --- a/proto/api/v1/user_service.proto +++ b/proto/api/v1/user_service.proto @@ -129,7 +129,7 @@ message ListUsersResponse { message SearchUsersRequest { // Filter is used to filter users returned in the list. - // Format: "username == frank" + // Format: "username == 'frank'" string filter = 1; } diff --git a/proto/gen/api/v1/activity_service.pb.gw.go b/proto/gen/api/v1/activity_service.pb.gw.go index 4596fa9d..df2d3b81 100644 --- a/proto/gen/api/v1/activity_service.pb.gw.go +++ b/proto/gen/api/v1/activity_service.pb.gw.go @@ -120,21 +120,21 @@ func RegisterActivityServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterActivityServiceHandlerFromEndpoint is same as RegisterActivityServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterActivityServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/auth_service.pb.gw.go b/proto/gen/api/v1/auth_service.pb.gw.go index 417c52c9..5690b32f 100644 --- a/proto/gen/api/v1/auth_service.pb.gw.go +++ b/proto/gen/api/v1/auth_service.pb.gw.go @@ -312,21 +312,21 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/idp_service.pb.gw.go b/proto/gen/api/v1/idp_service.pb.gw.go index 2fdd8b91..973dd0de 100644 --- a/proto/gen/api/v1/idp_service.pb.gw.go +++ b/proto/gen/api/v1/idp_service.pb.gw.go @@ -416,21 +416,21 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt // RegisterIdentityProviderServiceHandlerFromEndpoint is same as RegisterIdentityProviderServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterIdentityProviderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/inbox_service.pb.gw.go b/proto/gen/api/v1/inbox_service.pb.gw.go index b0ab788f..51e0b314 100644 --- a/proto/gen/api/v1/inbox_service.pb.gw.go +++ b/proto/gen/api/v1/inbox_service.pb.gw.go @@ -306,21 +306,21 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu // RegisterInboxServiceHandlerFromEndpoint is same as RegisterInboxServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterInboxServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/markdown_service.pb.gw.go b/proto/gen/api/v1/markdown_service.pb.gw.go index ee5f04e2..52e66b87 100644 --- a/proto/gen/api/v1/markdown_service.pb.gw.go +++ b/proto/gen/api/v1/markdown_service.pb.gw.go @@ -206,21 +206,21 @@ func RegisterMarkdownServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterMarkdownServiceHandlerFromEndpoint is same as RegisterMarkdownServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterMarkdownServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/memo_service.pb.go b/proto/gen/api/v1/memo_service.pb.go index 7c4d650f..c41f8489 100644 --- a/proto/gen/api/v1/memo_service.pb.go +++ b/proto/gen/api/v1/memo_service.pb.go @@ -315,7 +315,7 @@ type ListMemosRequest struct { // Provide this to retrieve the subsequent page. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // Filter is used to filter memos returned in the list. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` } @@ -435,7 +435,7 @@ type SearchMemosRequest struct { unknownFields protoimpl.UnknownFields // Filter is used to filter memos returned. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } @@ -831,7 +831,7 @@ type ListMemoTagsRequest struct { // Format: memos/{id}. Use "memos/-" to list all tags. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Filter is used to filter memos. - // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']" Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` } diff --git a/proto/gen/api/v1/memo_service.pb.gw.go b/proto/gen/api/v1/memo_service.pb.gw.go index 4a3b4ee8..0385766b 100644 --- a/proto/gen/api/v1/memo_service.pb.gw.go +++ b/proto/gen/api/v1/memo_service.pb.gw.go @@ -1712,21 +1712,21 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterMemoServiceHandlerFromEndpoint is same as RegisterMemoServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterMemoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/resource_service.pb.gw.go b/proto/gen/api/v1/resource_service.pb.gw.go index 4e0182f1..e6873ef1 100644 --- a/proto/gen/api/v1/resource_service.pb.gw.go +++ b/proto/gen/api/v1/resource_service.pb.gw.go @@ -554,21 +554,21 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterResourceServiceHandlerFromEndpoint is same as RegisterResourceServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterResourceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/user_service.pb.go b/proto/gen/api/v1/user_service.pb.go index 8cebfcb8..c1fa7ff0 100644 --- a/proto/gen/api/v1/user_service.pb.go +++ b/proto/gen/api/v1/user_service.pb.go @@ -306,7 +306,7 @@ type SearchUsersRequest struct { unknownFields protoimpl.UnknownFields // Filter is used to filter users returned in the list. - // Format: "username == frank" + // Format: "username == 'frank'" Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } diff --git a/proto/gen/api/v1/user_service.pb.gw.go b/proto/gen/api/v1/user_service.pb.gw.go index 9088bb29..89e6d6d3 100644 --- a/proto/gen/api/v1/user_service.pb.gw.go +++ b/proto/gen/api/v1/user_service.pb.gw.go @@ -1033,21 +1033,21 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/webhook_service.pb.gw.go b/proto/gen/api/v1/webhook_service.pb.gw.go index b1728d35..bd8b960f 100644 --- a/proto/gen/api/v1/webhook_service.pb.gw.go +++ b/proto/gen/api/v1/webhook_service.pb.gw.go @@ -434,21 +434,21 @@ func RegisterWebhookServiceHandlerServer(ctx context.Context, mux *runtime.Serve // RegisterWebhookServiceHandlerFromEndpoint is same as RegisterWebhookServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterWebhookServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/workspace_service.pb.gw.go b/proto/gen/api/v1/workspace_service.pb.gw.go index 5df16678..96a80d29 100644 --- a/proto/gen/api/v1/workspace_service.pb.gw.go +++ b/proto/gen/api/v1/workspace_service.pb.gw.go @@ -86,21 +86,21 @@ func RegisterWorkspaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser // RegisterWorkspaceServiceHandlerFromEndpoint is same as RegisterWorkspaceServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterWorkspaceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/proto/gen/api/v1/workspace_setting_service.pb.gw.go b/proto/gen/api/v1/workspace_setting_service.pb.gw.go index fea94724..9df10d8f 100644 --- a/proto/gen/api/v1/workspace_setting_service.pb.gw.go +++ b/proto/gen/api/v1/workspace_setting_service.pb.gw.go @@ -205,21 +205,21 @@ func RegisterWorkspaceSettingServiceHandlerServer(ctx context.Context, mux *runt // RegisterWorkspaceSettingServiceHandlerFromEndpoint is same as RegisterWorkspaceSettingServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterWorkspaceSettingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }()