git.zd.zone/hrpc/hrpc@v0.0.12/database/redis/README.md (about)

     1  # Introduction
     2  
     3  
     4  ## Usages
     5  
     6  Customized use case.
     7  ```go
     8  func main() {
     9      s, err := hrpc.NewServer(
    10  		option.WithServerName("orderservice"),
    11  		option.WithDatabases(redis.New(
    12              redis.WithCustomized(), // Very important, if you forget to provide this option, the HRPC will read configuration got from the configuration center to load.
    13              redis.WithAddress("xxxx"),
    14              redis.WithDB(0),
    15              redis.WithAuth("user", "pass"),
    16              redis.WithPort(6378), // Default 6379
    17          )),
    18  		option.WithEnvironment(option.Development),
    19  		option.WithHealthCheck(),
    20  	)
    21      // xxx
    22  }
    23  ```