Documentation ¶
Index ¶
- func Close(v any) error
- func SaveLogContext(ctx context.Context, logContext LogContext) context.Context
- func Start(v any) error
- type APIHandler
- type APILogContext
- type Closer
- type Core
- type DNSContext
- func (c *DNSContext) ClientIP() netip.Addr
- func (c *DNSContext) Clone() *DNSContext
- func (c *DNSContext) Color() aurora.Color
- func (c *DNSContext) Context() context.Context
- func (c *DNSContext) Duration() time.Duration
- func (c *DNSContext) FlushColor()
- func (c *DNSContext) ID() uint32
- func (c *DNSContext) InitTime() time.Time
- func (c *DNSContext) Listener() string
- func (c *DNSContext) Mark() uint64
- func (c *DNSContext) Metadata() map[string]string
- func (c *DNSContext) ReqMsg() *dns.Msg
- func (c *DNSContext) RespMsg() *dns.Msg
- func (c *DNSContext) RespUpstreamTag() string
- func (c *DNSContext) SetID(id uint32)
- func (c *DNSContext) SetMark(mark uint64)
- func (c *DNSContext) SetRespMsg(resp *dns.Msg)
- func (c *DNSContext) SetRespUpstreamTag(tag string)
- type Listener
- type LogContext
- type PluginExecutor
- type PluginMatcher
- type ReturnMode
- type Starter
- type Upstream
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveLogContext ¶
func SaveLogContext(ctx context.Context, logContext LogContext) context.Context
Types ¶
type APIHandler ¶
type APIHandler interface {
APIHandler() chi.Router
}
type APILogContext ¶
type APILogContext struct {
// contains filtered or unexported fields
}
func NewAPILogContext ¶
func NewAPILogContext() *APILogContext
func (*APILogContext) Color ¶
func (c *APILogContext) Color() aurora.Color
func (*APILogContext) Duration ¶
func (c *APILogContext) Duration() time.Duration
func (*APILogContext) ID ¶
func (c *APILogContext) ID() uint32
type Core ¶
type Core interface { Closer Run() error GetListener(tag string) Listener GetListeners() []Listener GetUpstream(tag string) Upstream GetUpstreams() []Upstream GetWorkflow(tag string) Workflow GetWorkflows() []Workflow GetPluginMatcher(tag string) PluginMatcher GetPluginMatchers() []PluginMatcher GetPluginExecutor(tag string) PluginExecutor GetPluginExecutors() []PluginExecutor GetTimeFunc() func() time.Time }
type DNSContext ¶
type DNSContext struct {
// contains filtered or unexported fields
}
func NewDNSContext ¶
func (*DNSContext) ClientIP ¶
func (c *DNSContext) ClientIP() netip.Addr
func (*DNSContext) Clone ¶
func (c *DNSContext) Clone() *DNSContext
func (*DNSContext) Color ¶
func (c *DNSContext) Color() aurora.Color
func (*DNSContext) Context ¶
func (c *DNSContext) Context() context.Context
func (*DNSContext) Duration ¶
func (c *DNSContext) Duration() time.Duration
func (*DNSContext) FlushColor ¶
func (c *DNSContext) FlushColor()
func (*DNSContext) ID ¶
func (c *DNSContext) ID() uint32
func (*DNSContext) InitTime ¶
func (c *DNSContext) InitTime() time.Time
func (*DNSContext) Listener ¶
func (c *DNSContext) Listener() string
func (*DNSContext) Mark ¶
func (c *DNSContext) Mark() uint64
func (*DNSContext) Metadata ¶
func (c *DNSContext) Metadata() map[string]string
func (*DNSContext) ReqMsg ¶
func (c *DNSContext) ReqMsg() *dns.Msg
func (*DNSContext) RespMsg ¶
func (c *DNSContext) RespMsg() *dns.Msg
func (*DNSContext) RespUpstreamTag ¶
func (c *DNSContext) RespUpstreamTag() string
func (*DNSContext) SetID ¶
func (c *DNSContext) SetID(id uint32)
func (*DNSContext) SetMark ¶
func (c *DNSContext) SetMark(mark uint64)
func (*DNSContext) SetRespMsg ¶
func (c *DNSContext) SetRespMsg(resp *dns.Msg)
func (*DNSContext) SetRespUpstreamTag ¶
func (c *DNSContext) SetRespUpstreamTag(tag string)
type LogContext ¶
func LoadLogContext ¶
func LoadLogContext(ctx context.Context) LogContext
type PluginExecutor ¶
type PluginMatcher ¶
type ReturnMode ¶
type ReturnMode int
const ( ReturnModeUnknown ReturnMode = iota ReturnModeContinue ReturnModeReturnAll ReturnModeReturnOnce )
func (ReturnMode) String ¶
func (r ReturnMode) String() string
type Workflow ¶
type Workflow interface { Tag() string Check() error Exec(ctx context.Context, dnsCtx *DNSContext) (ReturnMode, error) }
Click to show internal directories.
Click to hide internal directories.