Documentation
¶
Overview ¶
Package example is a CoreDNS plugin that prints "example" to stdout on every packet received.
It serves as an example CoreDNS plugin with numerous code comments.
Index ¶
- Constants
- Variables
- type App
- type CombiningResponseWriter
- type CurrSyncPoint
- type DroveApp
- type DroveAppsResponse
- type DroveAuthConfig
- type DroveClient
- func (c *DroveClient) DefinedGateways() []net.IP
- func (c *DroveClient) FetchApps() (*DroveAppsResponse, error)
- func (c *DroveClient) FetchRecentEvents(syncPoint *CurrSyncPoint) (*DroveEventSummary, error)
- func (c *DroveClient) Init() error
- func (c *DroveClient) PollEvents(callback func(event *DroveEventSummary))
- type DroveConfig
- type DroveEndpoints
- type DroveEventSummary
- type DroveEventsApiResponse
- type DroveHandler
- type DroveServiceHost
- type EndpointStatus
- type Host
- type HostGroup
- type IDroveClient
- type LeaderController
Constants ¶
Variables ¶
View Source
var ( DroveQueryTotal = promauto.NewCounter(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "sync_total", Help: "Counter of Drove sync successful", }) DroveQueryFailure = promauto.NewCounter(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "sync_failure", Help: "Counter of Drove syncs failed", }) DroveApiRequests = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "api_total", Help: "Drove api requests total", }, []string{"code", "method", "host"}) DroveControllerHealth = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "controller_health", Help: "Drove controller health", }, []string{"host"}) )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
ID string
Vhost string
Hosts []Host
Tags map[string]string
Groups map[string]HostGroup
}
App struct
type CombiningResponseWriter ¶
type CombiningResponseWriter struct {
dns.ResponseWriter
// contains filtered or unexported fields
}
Name implements the Handler interface.
type CurrSyncPoint ¶
type DroveApp ¶
type DroveApp struct {
ID string `json:"appId"`
Vhost string `json:"vhost"`
Tags map[string]string `json:"tags"`
Hosts []DroveServiceHost `json:"hosts"`
}
type DroveAppsResponse ¶
type DroveAppsResponse struct {
Status string `json:"status"`
Apps []DroveApp `json:"data"`
Message string `json:"message"`
}
DroveAppsResponse struct for our apps nested with tasks.
type DroveAuthConfig ¶
func (DroveAuthConfig) Validate ¶
func (dc DroveAuthConfig) Validate() error
type DroveClient ¶
type DroveClient struct {
EndpointMutex sync.RWMutex
Endpoint []EndpointStatus
Leader *LeaderController
AuthConfig *DroveAuthConfig
Gateways []string
// contains filtered or unexported fields
}
func NewDroveClient ¶
func NewDroveClient(config DroveConfig) DroveClient
func (*DroveClient) DefinedGateways ¶
func (c *DroveClient) DefinedGateways() []net.IP
func (*DroveClient) FetchApps ¶
func (c *DroveClient) FetchApps() (*DroveAppsResponse, error)
func (*DroveClient) FetchRecentEvents ¶
func (c *DroveClient) FetchRecentEvents(syncPoint *CurrSyncPoint) (*DroveEventSummary, error)
func (*DroveClient) Init ¶
func (c *DroveClient) Init() error
func (*DroveClient) PollEvents ¶
func (c *DroveClient) PollEvents(callback func(event *DroveEventSummary))
type DroveConfig ¶
type DroveConfig struct {
Endpoint string
Gateway string
AuthConfig DroveAuthConfig
SkipSSL bool
}
func NewDroveConfig ¶
func NewDroveConfig() DroveConfig
func (DroveConfig) Validate ¶
func (dc DroveConfig) Validate() error
type DroveEndpoints ¶
type DroveEndpoints struct {
AppsDB *DroveAppsResponse
DroveClient IDroveClient
AppsByVhost map[string]DroveApp
// contains filtered or unexported fields
}
type DroveEventSummary ¶
type DroveEventsApiResponse ¶
type DroveEventsApiResponse struct {
Status string `json:"status"`
EventSummary DroveEventSummary `json:"data"`
Message string `json:"message"`
}
type DroveHandler ¶
type DroveHandler struct {
DroveEndpoints *DroveEndpoints
Gateways []net.IP
Next plugin.Handler
}
Example is an example plugin to show how to write a plugin.
func NewDroveHandler ¶
func NewDroveHandler(droveClient IDroveClient) *DroveHandler
func (*DroveHandler) Name ¶
func (e *DroveHandler) Name() string
func (*DroveHandler) Ready ¶
func (e *DroveHandler) Ready() bool
Checks if apps data could be synced from drove cluster
type DroveServiceHost ¶
type EndpointStatus ¶
type IDroveClient ¶
type IDroveClient interface {
FetchApps() (*DroveAppsResponse, error)
FetchRecentEvents(syncPoint *CurrSyncPoint) (*DroveEventSummary, error)
PollEvents(callback func(event *DroveEventSummary))
DefinedGateways() []net.IP
}
type LeaderController ¶
Click to show internal directories.
Click to hide internal directories.