Documentation ¶
Overview ¶
Package stanzareceiver implements a receiver that can be used by the Opentelemetry collector to receive logs using the stanza log agent
Index ¶
- func CreatorID(ctx context.Context, client storage.Client) (component.ID, error)
- func NewNonStorageID(name string) component.ID
- func NewStorageID(name string) component.ID
- type NonStorage
- type StorageHost
- func (h *StorageHost) GetExtensions() map[component.ID]component.Component
- func (h *StorageHost) WithExtension(id component.ID, ext extension.Extension) *StorageHost
- func (h *StorageHost) WithFileBackedStorageExtension(name, storageDir string) *StorageHost
- func (h *StorageHost) WithInMemoryStorageExtension(name string) *StorageHost
- func (h *StorageHost) WithNonStorageExtension(name string) *StorageHost
- type TestClient
- func (p *TestClient) Batch(_ context.Context, ops ...storage.Operation) error
- func (p *TestClient) Close(_ context.Context) error
- func (p *TestClient) Delete(_ context.Context, key string) error
- func (p *TestClient) Get(_ context.Context, key string) ([]byte, error)
- func (p *TestClient) Set(_ context.Context, key string, value []byte) error
- type TestStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatorID ¶ added in v0.59.0
CreatorID is the component.ID of the extension that created the component
func NewNonStorageID ¶ added in v0.59.0
func NewStorageID ¶ added in v0.59.0
Types ¶
type NonStorage ¶ added in v0.59.0
NonStorage is useful for testing expected behaviors that involve non-storage extensions
func NewNonStorageExtension ¶ added in v0.59.0
func NewNonStorageExtension(name string) *NonStorage
NewNonStorageExtension creates a NonStorage extension
type StorageHost ¶
func NewStorageHost ¶
func NewStorageHost() *StorageHost
func (*StorageHost) GetExtensions ¶
func (h *StorageHost) GetExtensions() map[component.ID]component.Component
func (*StorageHost) WithExtension ¶ added in v0.59.0
func (h *StorageHost) WithExtension(id component.ID, ext extension.Extension) *StorageHost
func (*StorageHost) WithFileBackedStorageExtension ¶ added in v0.59.0
func (h *StorageHost) WithFileBackedStorageExtension(name, storageDir string) *StorageHost
func (*StorageHost) WithInMemoryStorageExtension ¶ added in v0.59.0
func (h *StorageHost) WithInMemoryStorageExtension(name string) *StorageHost
func (*StorageHost) WithNonStorageExtension ¶ added in v0.59.0
func (h *StorageHost) WithNonStorageExtension(name string) *StorageHost
type TestClient ¶ added in v0.59.0
type TestClient struct {
// contains filtered or unexported fields
}
func NewFileBackedClient ¶ added in v0.59.0
func NewFileBackedClient(kind component.Kind, id component.ID, name string, storageDir string) *TestClient
NewFileBackedClient creates a storage.Client that will load previous storage contents upon creation and save storage contents when closed. It also has metadata which may be used to validate test expectations.
func NewInMemoryClient ¶ added in v0.59.0
NewInMemoryClient creates a storage.Client that functions as a map[string][]byte This is useful for tests that do not involve collector restart behavior.
func (*TestClient) Delete ¶ added in v0.59.0
func (p *TestClient) Delete(_ context.Context, key string) error
type TestStorage ¶ added in v0.59.0
type TestStorage struct { component.StartFunc component.ShutdownFunc ID component.ID // contains filtered or unexported fields }
TestStorage is an in memory storage extension designed for testing
func NewFileBackedStorageExtension ¶ added in v0.59.0
func NewFileBackedStorageExtension(name string, storageDir string) *TestStorage
NewFileBackedStorageExtension creates a TestStorage extension
func NewInMemoryStorageExtension ¶ added in v0.59.0
func NewInMemoryStorageExtension(name string) *TestStorage
NewInMemoryStorageExtension creates a TestStorage extension