mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
feat: add openim make lint
This commit is contained in:
parent
853ac47e42
commit
c9d773d82d
@ -128,9 +128,11 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
|
||||
if err != nil {
|
||||
Fail = Fail + messageCount
|
||||
// log.Info(operationID, "some token push err", err.Error(), messageCount)
|
||||
log.Info("Failed to send messages:", Fail)
|
||||
} else {
|
||||
Success = Success + response.SuccessCount
|
||||
Fail = Fail + response.FailureCount
|
||||
log.Info("Message sending summary: Success:", Success, "Fail:", Fail)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@ -18,7 +18,6 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/sdkws"
|
||||
sdk "github.com/OpenIMSDK/protocol/sdkws"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
|
||||
)
|
||||
|
||||
@ -194,5 +194,5 @@ func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn {
|
||||
return nil
|
||||
}
|
||||
func (cli *K8sDR) Close() {
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ func configureProducerAck(p *Producer, ackConfig string) {
|
||||
|
||||
// configureCompression configures the message compression type for the producer.
|
||||
func configureCompression(p *Producer, compressType string) {
|
||||
var compress sarama.CompressionCodec = sarama.CompressionNone
|
||||
var compress = sarama.CompressionNone
|
||||
err := compress.UnmarshalText(bytes.ToLower([]byte(compressType)))
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to configure compression: %v\n", err)
|
||||
|
||||
@ -57,6 +57,20 @@ type UserRegisterRequest struct {
|
||||
Users []User `json:"users"`
|
||||
}
|
||||
|
||||
/* func main() {
|
||||
// Example usage of functions
|
||||
token, err := GetUserToken("openIM123456")
|
||||
if err != nil {
|
||||
log.Fatalf("Error getting user token: %v", err)
|
||||
}
|
||||
fmt.Println("Token:", token)
|
||||
|
||||
err = RegisterUser(token, "testUserID", "TestNickname", "https://example.com/image.jpg")
|
||||
if err != nil {
|
||||
log.Fatalf("Error registering user: %v", err)
|
||||
}
|
||||
} */
|
||||
|
||||
// GetUserToken requests a user token from the API.
|
||||
func GetUserToken(userID string) (string, error) {
|
||||
reqBody := UserTokenRequest{
|
||||
|
||||
@ -101,23 +101,23 @@ func main() {
|
||||
select {}
|
||||
}
|
||||
|
||||
// // getLatestVersion fetches the latest version number from a given URL.
|
||||
// func getLatestVersion(url string) (string, error) {
|
||||
// resp, err := http.Get(url)
|
||||
// if err != nil {
|
||||
// return "", err
|
||||
// }
|
||||
// defer resp.Body.Close()
|
||||
// getLatestVersion fetches the latest version number from a given URL.
|
||||
/* func getLatestVersion(url string) (string, error) {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// location := resp.Header.Get("Location")
|
||||
// if location == "" {
|
||||
// return defaultTemplateVersion, nil
|
||||
// }
|
||||
|
||||
// // Extract the version number from the URL
|
||||
// latestVersion := filepath.Base(location)
|
||||
// return latestVersion, nil
|
||||
// }
|
||||
// Extract the version number from the URL
|
||||
latestVersion := filepath.Base(location)
|
||||
return latestVersion, nil
|
||||
} */
|
||||
|
||||
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
|
||||
func downloadAndExtract(url, destDir string) error {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user