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) (config.ComponentID, error)
- func NewNonStorageID(name string) config.ComponentID
- func NewStorageID(name string) config.ComponentID
- type NonStorage
- type StorageHost
- func (h *StorageHost) GetExtensions() map[config.ComponentID]component.Extension
- func (h *StorageHost) WithExtension(id config.ComponentID, ext component.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 config.ComponentID of the extension that created the component
func NewNonStorageID ¶ added in v0.59.0
func NewNonStorageID(name string) config.ComponentID
func NewStorageID ¶ added in v0.59.0
func NewStorageID(name string) config.ComponentID
Types ¶
type NonStorage ¶ added in v0.59.0
type NonStorage struct {
config.ExtensionSettings
}
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[config.ComponentID]component.Extension
func (*StorageHost) WithExtension ¶ added in v0.59.0
func (h *StorageHost) WithExtension(id config.ComponentID, ext component.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 config.ComponentID, 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
func NewInMemoryClient(kind component.Kind, id config.ComponentID, name string) *TestClient
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 { config.ExtensionSettings // 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
func (*TestStorage) GetClient ¶ added in v0.59.0
func (s *TestStorage) GetClient(ctx context.Context, kind component.Kind, ent config.ComponentID, name string) (storage.Client, error)
GetClient returns a storage client for an individual component