add options for components

This commit is contained in:
ginuerzh
2023-10-26 22:20:46 +08:00
parent 6431cd8bb9
commit 9e767d6745
6 changed files with 37 additions and 11 deletions

View File

@ -2,7 +2,15 @@ package ingress
import "context"
type GetOptions struct{}
type GetOption func(opts *GetOptions)
type SetOptions struct{}
type SetOption func(opts *SetOptions)
type Ingress interface {
Get(ctx context.Context, host string) string
Set(ctx context.Context, host, endpoint string)
Get(ctx context.Context, host string, opts ...GetOption) string
Set(ctx context.Context, host, endpoint string, opts ...SetOption)
}