Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig read YAML-formatted config from filename into cfg.
Types ¶
type API ¶
type API struct { Cfg *Config Logger *zap.Logger KafkaSvc *kafka.Service OwlSvc *owl.Service Hooks *Hooks // Hooks to add additional functionality from the outside at different places (used by Kafka Owl Business) // contains filtered or unexported fields }
API represents the server and all it's dependencies to serve incoming user requests
type Config ¶
type Config struct { ConfigFilepath string MetricsNamespace string `yaml:"metricsNamespace"` ServeFrontend bool `yaml:"serveFrontend"` REST rest.Config `yaml:"server"` Kafka kafka.Config `yaml:"kafka"` Logger logging.Config `yaml:"logger"` }
Config holds all (subdependency)Configs needed to run the API
func (*Config) RegisterFlags ¶
RegisterFlags for all (sub)configs
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type GetConsumerGroupsResponse ¶
type GetConsumerGroupsResponse struct {
ConsumerGroups []*owl.ConsumerGroupOverview `json:"consumerGroups"`
}
GetConsumerGroupsResponse represents the data which is returned for listing topics
type GetTopicMessagesResponse ¶
type GetTopicMessagesResponse struct {
KafkaMessages *kafka.ListMessageResponse `json:"kafkaMessages"`
}
GetTopicMessagesResponse is a wrapper for an array of TopicMessage
type Hooks ¶
type Hooks struct { Route RouteHooks Owl OwlHooks }
Hooks are a way to extend the Kafka Owl functionality from the outside. By default all hooks have no additional functionality. In order to run your own Hooks you must construct an Hooks instance and run attach them to your own instance of Api.
type KafkaHealthCheck ¶
type KafkaHealthCheck struct {
// contains filtered or unexported fields
}
KafkaHealthCheck implements the gosundheit HealthCheck interface
func (*KafkaHealthCheck) Execute ¶
func (k *KafkaHealthCheck) Execute() (interface{}, error)
Execute runs a single time check, and returns an error when the check fails, and an optional details object.
func (*KafkaHealthCheck) Name ¶
func (k *KafkaHealthCheck) Name() string
Name indicates the probe name
type OwlHooks ¶
type OwlHooks interface { CanSeeTopic(ctx context.Context, topicName string) (bool, *rest.Error) CanViewTopicPartitions(ctx context.Context, topicName string) (bool, *rest.Error) CanViewTopicConfig(ctx context.Context, topicName string) (bool, *rest.Error) CanViewTopicMessages(ctx context.Context, topicName string) (bool, *rest.Error) CanViewTopicConsumers(ctx context.Context, topicName string) (bool, *rest.Error) }
OwlHooks include all functions which allow you to modify
type RouteHooks ¶
type RouteHooks interface { // ConfigAPIRouter allows you to modify the router responsible for all /api routes ConfigAPIRouter(router chi.Router) // ConfigRouter allows you to modify the router responsible for all non /api and non /admin routes. // By default we serve the frontend on these routes. ConfigRouter(router chi.Router) }
RouteHooks allow you to modify the Router