storagetest

package
v0.84.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package stanzareceiver implements a receiver that can be used by the Opentelemetry collector to receive logs using the stanza log agent

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatorID added in v0.59.0

func CreatorID(ctx context.Context, client storage.Client) (component.ID, error)

CreatorID is the component.ID of the extension that created the component

func NewNonStorageID added in v0.59.0

func NewNonStorageID(name string) component.ID

func NewStorageID added in v0.59.0

func NewStorageID(name string) component.ID

Types

type NonStorage added in v0.59.0

type NonStorage struct {
	component.StartFunc
	component.ShutdownFunc
	ID component.ID
}

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

type StorageHost struct {
	component.Host
	// contains filtered or unexported fields
}

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

func NewInMemoryClient(kind component.Kind, id component.ID, 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) Batch added in v0.59.0

func (p *TestClient) Batch(_ context.Context, ops ...storage.Operation) error

func (*TestClient) Close added in v0.59.0

func (p *TestClient) Close(_ context.Context) error

func (*TestClient) Delete added in v0.59.0

func (p *TestClient) Delete(_ context.Context, key string) error

func (*TestClient) Get added in v0.59.0

func (p *TestClient) Get(_ context.Context, key string) ([]byte, error)

func (*TestClient) Set added in v0.59.0

func (p *TestClient) Set(_ context.Context, key string, value []byte) 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

func (*TestStorage) GetClient added in v0.59.0

func (s *TestStorage) GetClient(ctx context.Context, kind component.Kind, ent component.ID, name string) (storage.Client, error)

GetClient returns a storage client for an individual component

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL