Documentation
¶
Index ¶
Constants ¶
const AkkerisAppLabelKey = "akkeris.io/app-name"
const AkkerisDynoTypeLabelKey = "akkeris.io/dyno-type"
const DrainAnnotationKey = "logtrain.akkeris.io/drains"
const HostnameAnnotationKey = "logtrain.akkeris.io/hostname"
const TagAnnotationKey = "logtrain.akkeris.io/tag"
Variables ¶
This section is empty.
Functions ¶
func GetHostNameFromTLO ¶
GetHostNameFromTLO derives a hostname from an object in kubernetes
Types ¶
type DataSource ¶
type DataSource interface {
AddRoute() chan LogRoute
RemoveRoute() chan LogRoute
GetAllRoutes() ([]LogRoute, error)
}
Datasource describes an interface for querying and listening for routes
type KubernetesDataSource ¶
type KubernetesDataSource struct {
// contains filtered or unexported fields
}
KubernetesDataSource uses kubernetes as a datasource for routes by listening to annotations
func CreateKubernetesDataSource ¶
func CreateKubernetesDataSource(kube kubernetes.Interface) (*KubernetesDataSource, error)
CreateKubernetesDataSource creates a new kubernetes data source from a kube client
func (*KubernetesDataSource) AddRoute ¶
func (kds *KubernetesDataSource) AddRoute() chan LogRoute
AddRoute returns a channel where new routes are published to
func (*KubernetesDataSource) Close ¶
func (kds *KubernetesDataSource) Close() error
Close closes the data sources
func (*KubernetesDataSource) GetAllRoutes ¶
func (kds *KubernetesDataSource) GetAllRoutes() ([]LogRoute, error)
GetAllRoutes returns all routes the datasource is aware of
func (*KubernetesDataSource) RemoveRoute ¶
func (kds *KubernetesDataSource) RemoveRoute() chan LogRoute
RemoveRoute returns a channel where route removals are published
type Listener ¶
type Listener interface {
Close() error
Listen(string) error
NotificationChannel() <-chan *pq.Notification
Ping() error
}
This normally isnt needed but in order to pass in a fake listener for testing we need this.
type LogRoute ¶
type LogRoute struct {
Endpoint string
Hostname string
Tag string
// contains filtered or unexported fields
}
LogRoute describes a structure for routes from Hostname -> Endpoint
type PostgresDataSource ¶
type PostgresDataSource struct {
// contains filtered or unexported fields
}
func (*PostgresDataSource) AddRoute ¶
func (pds *PostgresDataSource) AddRoute() chan LogRoute
func (*PostgresDataSource) GetAllRoutes ¶
func (pds *PostgresDataSource) GetAllRoutes() ([]LogRoute, error)
func (*PostgresDataSource) RemoveRoute ¶
func (pds *PostgresDataSource) RemoveRoute() chan LogRoute