add router interface
This commit is contained in:
@ -2,15 +2,20 @@ package ingress
|
||||
|
||||
import "context"
|
||||
|
||||
type GetOptions struct{}
|
||||
type Options struct{}
|
||||
|
||||
type GetOption func(opts *GetOptions)
|
||||
type Option func(opts *Options)
|
||||
|
||||
type SetOptions struct{}
|
||||
|
||||
type SetOption func(opts *SetOptions)
|
||||
type Rule struct {
|
||||
// Hostname is the hostname match pattern, e.g. example.com, *.example.org or .example.com.
|
||||
Hostname string
|
||||
// Endpoint is the tunnel ID for the hostname.
|
||||
Endpoint string
|
||||
}
|
||||
|
||||
type Ingress interface {
|
||||
Get(ctx context.Context, host string, opts ...GetOption) string
|
||||
Set(ctx context.Context, host, endpoint string, opts ...SetOption) bool
|
||||
// SetRule adds or updates a rule for the ingress.
|
||||
SetRule(ctx context.Context, rule *Rule, opts ...Option) bool
|
||||
// GetRule queries a rule by host.
|
||||
GetRule(ctx context.Context, host string, opts ...Option) *Rule
|
||||
}
|
||||
|
Reference in New Issue
Block a user