add router component

This commit is contained in:
ginuerzh
2023-11-19 14:23:21 +08:00
parent 88cc6ff4d5
commit 74639e9c4e
25 changed files with 788 additions and 123 deletions

View File

@ -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...)
}