From 1a8c1ccb1dc5cdc7b3e4b118252193cdd9016b2d Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Sat, 14 Jan 2023 13:09:24 +0800 Subject: [PATCH] add ingress interface --- handler/option.go | 7 +++++++ ingress/ingress.go | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 ingress/ingress.go diff --git a/handler/option.go b/handler/option.go index b75ca03..b1faf53 100644 --- a/handler/option.go +++ b/handler/option.go @@ -20,6 +20,7 @@ type Options struct { RateLimiter rate.RateLimiter TLSConfig *tls.Config Logger logger.Logger + Service string } type Option func(opts *Options) @@ -66,6 +67,12 @@ func LoggerOption(logger logger.Logger) Option { } } +func ServiceOption(service string) Option { + return func(opts *Options) { + opts.Service = service + } +} + type HandleOptions struct { Metadata metadata.Metadata } diff --git a/ingress/ingress.go b/ingress/ingress.go new file mode 100644 index 0000000..f0f6c0a --- /dev/null +++ b/ingress/ingress.go @@ -0,0 +1,5 @@ +package ingress + +type Ingress interface { + Get(host string) string +}