1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

feat(transport): add endpoint option for server (#2904)

This commit is contained in:
LinXiaoWei 2023-07-06 19:59:02 +08:00 committed by GitHub
parent 32b1d13f90
commit bffc1a0989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,13 @@ func Address(addr string) ServerOption {
}
}
// Endpoint with server address.
func Endpoint(endpoint *url.URL) ServerOption {
return func(s *Server) {
s.endpoint = endpoint
}
}
// Timeout with server timeout.
func Timeout(timeout time.Duration) ServerOption {
return func(s *Server) {

View File

@ -42,6 +42,13 @@ func Address(addr string) ServerOption {
}
}
// Endpoint with server address.
func Endpoint(endpoint *url.URL) ServerOption {
return func(s *Server) {
s.endpoint = endpoint
}
}
// Timeout with server timeout.
func Timeout(timeout time.Duration) ServerOption {
return func(s *Server) {