storage

package
v0.0.54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AkkerisAppLabelKey = "akkeris.io/app-name"
View Source
const AkkerisDynoTypeLabelKey = "akkeris.io/dyno-type"
View Source
const DrainAnnotationKey = "logtrain.akkeris.io/drains"
View Source
const HostnameAnnotationKey = "logtrain.akkeris.io/hostname"
View Source
const TagAnnotationKey = "logtrain.akkeris.io/tag"

Variables

This section is empty.

Functions

func GetHostNameFromTLO

func GetHostNameFromTLO(kube kubernetes.Interface, obj meta.Object, useAkkerisHosts bool) string

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 CreatePostgresDataSource

func CreatePostgresDataSource(db *sql.DB, listener Listener, init bool) (*PostgresDataSource, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL