Documentation ¶
Index ¶
- Constants
- Variables
- func Ingest(addr string, records RecordSink, logs log.Sink, metrics IngestMetrics, ...)
- func IsUnauthenticatedError(err error) bool
- func Listen(addr string, tlsConfig *tls.Config, reg ListenerRegistry, logs log.Sink, ...)
- type Authenticator
- type FlowKind
- type FlowReference
- type Handleable
- type HandleableLatch
- type IngestMetrics
- type ListenMetrics
- type Listener
- type ListenerEvent
- type ListenerEventChannel
- type ListenerRegistry
- type Metrics
- func (ms *Metrics) CurrentListeners(cnt int)
- func (ms *Metrics) Error()
- func (ms *Metrics) HealthCheck()
- func (ms *Metrics) ListenerAccepted(flow FlowReference, user authv1.UserInfo)
- func (ms *Metrics) ListenerRejected(flow FlowReference, user authv1.UserInfo)
- func (ms *Metrics) ListenerRemoved(l Listener)
- func (ms *Metrics) LogRecordReceived(r Record)
- func (ms *Metrics) LogRecordRedacted(l Listener, r Record)
- func (ms *Metrics) LogRecordTransmitted(l Listener, r Record)
- type Pipeline
- type ReconcileEvent
- type ReconcileEventChannel
- type Record
- type RecordSink
- type RecordsChannel
- type Stage
- type TokenReviewAuthenticator
- type UnauthenticatedError
- type WaitableLatch
Constants ¶
View Source
const ( FKClusterFlow FlowKind = "clusterflow" FKFlow FlowKind = "flow" RegisterListener listenerEventType = iota UnregisterListener AuthHeaderKey = "X-Authorization" AuthQueryKey = "token" )
View Source
const HealthCheckEndpoint = "/healthz"
View Source
const MetricsEndpoint = "/metrics"
Variables ¶
View Source
var ( DefLabel = map[string]string{"app.kubernetes.io/created-by": "log-socket"} FlowAnnotationKey = "flowRef" )
Functions ¶
func Ingest ¶
func Ingest(addr string, records RecordSink, logs log.Sink, metrics IngestMetrics, stopSignal Handleable, terminateSignal Handleable)
func IsUnauthenticatedError ¶
func Listen ¶
func Listen(addr string, tlsConfig *tls.Config, reg ListenerRegistry, logs log.Sink, metrics ListenMetrics, stopSignal Handleable, terminationSignal Handleable, authenticator Authenticator)
Types ¶
type Authenticator ¶
type FlowReference ¶
type FlowReference struct { types.NamespacedName Kind FlowKind }
func ExtractFlow ¶
func ExtractFlow(req *http.Request) (res FlowReference, err error)
func (FlowReference) URL ¶
func (f FlowReference) URL() string
type Handleable ¶
type Handleable interface {
HandleWith(func())
}
type HandleableLatch ¶
type HandleableLatch struct {
// contains filtered or unexported fields
}
func NewHandleableLatch ¶
func NewHandleableLatch(ch <-chan struct{}) *HandleableLatch
func (*HandleableLatch) HandleWith ¶
func (l *HandleableLatch) HandleWith(handler func())
type IngestMetrics ¶
type IngestMetrics interface { HealthCheck() LogRecordReceived(r Record) }
type ListenMetrics ¶
type ListenMetrics interface { ListenerAccepted(flow FlowReference, user authv1.UserInfo) ListenerRejected(flow FlowReference, user authv1.UserInfo) // contains filtered or unexported methods }
type Listener ¶
type Listener interface { Send(Record) Flow() FlowReference User() authv1.UserInfo }
type ListenerEvent ¶
type ListenerEvent struct { Listener Listener EventType listenerEventType }
type ListenerEventChannel ¶
type ListenerEventChannel chan ListenerEvent
func (ListenerEventChannel) Register ¶
func (r ListenerEventChannel) Register(l Listener)
func (ListenerEventChannel) Unregister ¶
func (r ListenerEventChannel) Unregister(l Listener)
type ListenerRegistry ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func (*Metrics) CurrentListeners ¶
func (*Metrics) HealthCheck ¶
func (ms *Metrics) HealthCheck()
func (*Metrics) ListenerAccepted ¶
func (ms *Metrics) ListenerAccepted(flow FlowReference, user authv1.UserInfo)
func (*Metrics) ListenerRejected ¶
func (ms *Metrics) ListenerRejected(flow FlowReference, user authv1.UserInfo)
func (*Metrics) ListenerRemoved ¶
func (*Metrics) LogRecordReceived ¶
func (*Metrics) LogRecordRedacted ¶
func (*Metrics) LogRecordTransmitted ¶
type ReconcileEvent ¶
type ReconcileEvent struct {
Requests []FlowReference
}
type ReconcileEventChannel ¶
type ReconcileEventChannel chan ReconcileEvent
type Record ¶
type Record struct { RawData []byte Data struct { Kubernetes struct { Labels map[string]string `json:"labels"` PodName string `json:"pod_name"` } `json:"kubernetes"` } Flow FlowReference }
type RecordSink ¶
type RecordSink interface {
Push(Record)
}
type RecordsChannel ¶
type RecordsChannel chan Record
func (RecordsChannel) Push ¶
func (rs RecordsChannel) Push(r Record)
type Stage ¶
type Stage struct { Instance *wasmer.Instance Memory *wasmer.Memory Module *wasmer.Module Origin string // contains filtered or unexported fields }
func LoadStageFromFile ¶
type TokenReviewAuthenticator ¶
type TokenReviewAuthenticator struct {
Client client.Client `json:"client" yaml:"client"` //this is a client
}
func (TokenReviewAuthenticator) Authenticate ¶
func (t TokenReviewAuthenticator) Authenticate(token string) (res authv1.UserInfo, err error)
type UnauthenticatedError ¶
type UnauthenticatedError interface {
IsUnauthenticatedError() bool
}
type WaitableLatch ¶
type WaitableLatch struct {
// contains filtered or unexported fields
}
func NewWaitableLatch ¶
func NewWaitableLatch() *WaitableLatch
func (*WaitableLatch) Chan ¶
func (l *WaitableLatch) Chan() <-chan struct{}
func (*WaitableLatch) Close ¶
func (l *WaitableLatch) Close()
func (*WaitableLatch) Wait ¶
func (l *WaitableLatch) Wait()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.