add binder for connector
This commit is contained in:
23
pkg/handler/forward/remote/metadata.go
Normal file
23
pkg/handler/forward/remote/metadata.go
Normal file
@ -0,0 +1,23 @@
|
||||
package forward
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
md "github.com/go-gost/gost/pkg/metadata"
|
||||
)
|
||||
|
||||
type metadata struct {
|
||||
readTimeout time.Duration
|
||||
retryCount int
|
||||
}
|
||||
|
||||
func (h *forwardHandler) parseMetadata(md md.Metadata) (err error) {
|
||||
const (
|
||||
readTimeout = "readTimeout"
|
||||
retryCount = "retry"
|
||||
)
|
||||
|
||||
h.md.readTimeout = md.GetDuration(readTimeout)
|
||||
h.md.retryCount = md.GetInt(retryCount)
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user