Documentation
¶
Index ¶
Constants ¶
View Source
const ( KindHttp = "http" KindFile = "file" KindStdOut = "stdout" KindChannel = "channel" )
Variables ¶
View Source
var (
ErrMissingChannel = errors.New("destination cfg is missing channel")
)
View Source
var (
ErrMissingEndpoint = errors.New("missing endpoint information")
)
View Source
var (
ErrMissingPath = errors.New("missing path for file destination")
)
View Source
var (
ErrNoProcessor = errors.New("no internal processor")
)
Functions ¶
This section is empty.
Types ¶
type ChannelDestination ¶
func (*ChannelDestination) Close ¶
func (cd *ChannelDestination) Close() error
func (*ChannelDestination) Setup ¶
func (cd *ChannelDestination) Setup() error
type Destination ¶
type Destination struct {
ID string
Kind string
BufferSize int
Subscriptions []string
Subscriber pubsub.Subscriber
// contains filtered or unexported fields
}
func New ¶
func New(id, kind string, bufferSize int, subscriptions []string, impl DestinationProcessor) (*Destination, error)
func (*Destination) Init ¶
func (d *Destination) Init(id string) error
func (*Destination) Process ¶
func (d *Destination) Process(ctx context.Context)
type DestinationProcessor ¶
type DestinationProcessor interface {
Setup() error
Deliver(context.Context, *optimusv1.LogEvent) error
Close() error
}
func HclImpl ¶
func HclImpl(kind string, body hcl.Body) (DestinationProcessor, hcl.Diagnostics)
type FileDestination ¶
type FileDestination struct {
Path string `hcl:"path"`
// contains filtered or unexported fields
}
func (*FileDestination) Close ¶
func (f *FileDestination) Close() error
func (*FileDestination) Setup ¶
func (f *FileDestination) Setup() error
type HttpDestination ¶
type HttpDestination struct {
Timeout time.Duration `hcl:"timeout,optional"`
Retries int `hcl:"retries,optional"`
Endpoint string `hcl:"endpoint"`
Method string `hcl:"http_method,optional"`
Headers []Header `hcl:"headers,optional"`
BatchSize int `hcl:"batch_size,optional"`
BatchTimeout time.Duration `hcl:"batch_timeout,optional"`
// contains filtered or unexported fields
}
func (*HttpDestination) AddHeaders ¶
func (h *HttpDestination) AddHeaders(req *retryablehttp.Request, event *optimusv1.LogEvent)
func (*HttpDestination) Close ¶
func (h *HttpDestination) Close() error
func (*HttpDestination) Setup ¶
func (h *HttpDestination) Setup() error
type Initializer ¶
type Initializer = func() error
type StdOutDestination ¶
func (*StdOutDestination) Close ¶
func (sd *StdOutDestination) Close() error
func (*StdOutDestination) Setup ¶
func (sd *StdOutDestination) Setup() error
Click to show internal directories.
Click to hide internal directories.