Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/component/loki/source/journal/journal_stub.go
4096 views
1
//go:build !linux || !cgo || !promtail_journal_enabled
2
3
package journal
4
5
import (
6
"context"
7
8
"github.com/go-kit/log/level"
9
"github.com/grafana/agent/component"
10
)
11
12
func init() {
13
component.Register(component.Registration{
14
Name: "loki.source.journal",
15
Args: Arguments{},
16
17
Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
18
return New(opts, args.(Arguments))
19
},
20
})
21
}
22
23
var _ component.Component = (*Component)(nil)
24
25
// Component represents reading from a journal
26
type Component struct {
27
}
28
29
// New creates a new component.
30
func New(o component.Options, args Arguments) (component.Component, error) {
31
level.Info(o.Logger).Log("msg", "loki.source.journal is not enabled, and must be ran on linux with journal support")
32
c := &Component{}
33
return c, nil
34
}
35
36
// Run starts the component.
37
func (c *Component) Run(ctx context.Context) error {
38
<-ctx.Done()
39
return nil
40
}
41
42
// Update updates the fields of the component.
43
func (c *Component) Update(args component.Arguments) error {
44
return nil
45
}
46
47