add router component
This commit is contained in:
@ -30,19 +30,19 @@ type ingressWrapper struct {
|
||||
r *ingressRegistry
|
||||
}
|
||||
|
||||
func (w *ingressWrapper) Get(ctx context.Context, host string, opts ...ingress.GetOption) string {
|
||||
func (w *ingressWrapper) GetRule(ctx context.Context, host string, opts ...ingress.Option) *ingress.Rule {
|
||||
v := w.r.get(w.name)
|
||||
if v == nil {
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
return v.Get(ctx, host, opts...)
|
||||
return v.GetRule(ctx, host, opts...)
|
||||
}
|
||||
|
||||
func (w *ingressWrapper) Set(ctx context.Context, host, endpoint string, opts ...ingress.SetOption) bool {
|
||||
func (w *ingressWrapper) SetRule(ctx context.Context, rule *ingress.Rule, opts ...ingress.Option) bool {
|
||||
v := w.r.get(w.name)
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return v.Set(ctx, host, endpoint, opts...)
|
||||
return v.SetRule(ctx, rule, opts...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user