Documentation
¶
Overview ¶
Package podlogs contains code to fetch logs from Kubernetes pods
Index ¶
Constants ¶
View Source
const DefaultFollowWaiting time.Duration = 1 * time.Second
DefaultFollowWaiting is the default time the cluster streaming should wait before searching again for new cluster pods
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterWriter ¶
type ClusterWriter struct {
Cluster *apiv1.Cluster
Options *corev1.PodLogOptions
Previous bool `json:"previous,omitempty"`
FollowWaiting time.Duration
// NOTE: the Client argument may be omitted, but it is good practice to pass it
// Importantly, it makes the logging functions testable
Client kubernetes.Interface
}
ClusterWriter represents a request to stream a cluster's pod logs.
If the Follow Option is set to true, streaming will sit in a loop looking for any new / regenerated pods and will only exit when there are no pods streaming
func (*ClusterWriter) SingleStream ¶
SingleStream streams the cluster's pod logs and shunts them to a single io.Writer
type Writer ¶
type Writer struct {
Pod corev1.Pod
Client kubernetes.Interface
}
Writer represents a request to stream a pod's logs and send them to an io.Writer
func NewPodLogsWriter ¶
func NewPodLogsWriter(pod corev1.Pod, cli kubernetes.Interface) *Writer
NewPodLogsWriter initializes the struct
Click to show internal directories.
Click to hide internal directories.