Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEphemeralOrFileClosed ¶ added in v1.2.0
IsEphemeralOrFileClosed checks if the error is an ephemeral error or if the file is already closed. This is useful on certain file systems (e.g. on Windows) where in practice reading a file can result in ephemeral errors (e.g. due to antivirus scans) or if the file appears as closed when being removed or rotated.
func NewRemoteWriteServer ¶
func NewRemoteWriteServer(receivedChan chan RemoteWriteRequest, status int) *httptest.Server
NewRemoteWriteServer creates and starts a new httpserver.Server that can handle remote write request. When a request is handled, the received entries are written to receivedChan, and status is responded.
Types ¶
type RemoteWriteRequest ¶
type RemoteWriteRequest struct { TenantID string Request logproto.PushRequest }
RemoteWriteRequest wraps the received logs remote write request that is received.
type SyncSlice ¶
type SyncSlice[T any] struct { // contains filtered or unexported fields }
SyncSlice is a concurrent slice implementation.
func NewSyncSlice ¶
func (*SyncSlice[T]) DoneIterate ¶
func (ss *SyncSlice[T]) DoneIterate()
DoneIterate releases the internal read-lock.
func (*SyncSlice[T]) Reset ¶
func (ss *SyncSlice[T]) Reset()
Reset resets the slice to have zero elements. If used during benchmarks, this will probably make new appends more efficient since the underlying array has more room.
func (*SyncSlice[T]) StartIterate ¶
func (ss *SyncSlice[T]) StartIterate() []T
StartIterate returns the internal slice, after read-locking the internal lock. Once the iteration is finished, DoneIterate should be called to release the lock.