Movatterモバイル変換


[0]ホーム

URL:


ringlog

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:1Imported by:0

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package ringlog contains a limited-size concurrency-safe generic ring log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeRingLog

type RingLog[Tany] struct {// contains filtered or unexported fields}

RingLog is a concurrency-safe fixed size log window containing entries of [T].

funcNew

func New[Tany](maxint) *RingLog[T]

New creates a newRingLog containing at most max items.

func (*RingLog[T])Add

func (rb *RingLog[T]) Add(t T)

Add appends a new item to theRingLog, possibly overwriting the oldestitem in the log if it is already full.

It does nothing if rb is nil.

func (*RingLog[T])Clear

func (rb *RingLog[T]) Clear()

Clear will empty the ring log.

func (*RingLog[T])GetAll

func (rb *RingLog[T]) GetAll() []T

GetAll returns a copy of all the entries in the ring log in the order theywere added.

It returns nil if rb is nil.

func (*RingLog[T])Len

func (rb *RingLog[T]) Len()int

Len returns the number of elements in the ring log. Note that this valuecould change immediately after being returned if a concurrent callermodifies the log.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp