Documentation
¶
Index ¶
- Variables
- func DiffIds(remoteIds, cachedIds []string) (toFetch, toDelete []string)
- type SpanCache
- type SpanType
- type TraceCache
- func (c *TraceCache) DeleteTraces(ids []string) error
- func (c *TraceCache) GetCachedIds() ([]string, error)
- func (c *TraceCache) LoadAllTraces() ([]*backend.TraceTest, error)
- func (c *TraceCache) LoadTrace(id string) (*backend.TraceTest, error)
- func (c *TraceCache) SaveTraces(traces []*backend.TraceTest) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidID = errors.New("invalid ID: contains path traversal characters")
ErrInvalidID is returned when an ID contains path traversal characters.
Functions ¶
Types ¶
type SpanCache ¶
type SpanCache struct {
// contains filtered or unexported fields
}
SpanCache manages local caching of spans (pre-app-start or global). Cache files are stored as protobuf-serialized .bin files named by span ID.
func NewSpanCache ¶
NewSpanCache creates a new SpanCache for the given service ID and span type. The cache directory is: <os.UserCacheDir()>/tusk/<serviceID>/spans/<spanType>/
func (*SpanCache) DeleteSpans ¶
DeleteSpans removes the specified span IDs from cache.
func (*SpanCache) GetCachedIds ¶
GetCachedIds returns the IDs of all cached spans by listing .bin files.
func (*SpanCache) LoadAllSpans ¶
LoadAllSpans loads all cached spans.
type TraceCache ¶
type TraceCache struct {
// contains filtered or unexported fields
}
TraceCache manages local caching of cloud trace tests. Cache files are stored as protobuf-serialized .bin files named by trace test ID.
func NewTraceCache ¶
func NewTraceCache(serviceID string) (*TraceCache, error)
NewTraceCache creates a new TraceCache for the given service ID. The cache directory is: <os.UserCacheDir()>/tusk/<serviceID>/traces/
func (*TraceCache) DeleteTraces ¶
func (c *TraceCache) DeleteTraces(ids []string) error
DeleteTraces removes the specified trace test IDs from cache.
func (*TraceCache) GetCachedIds ¶
func (c *TraceCache) GetCachedIds() ([]string, error)
GetCachedIds returns the IDs of all cached trace tests by listing .bin files.
func (*TraceCache) LoadAllTraces ¶
func (c *TraceCache) LoadAllTraces() ([]*backend.TraceTest, error)
LoadAllTraces loads all cached trace tests.
func (*TraceCache) LoadTrace ¶
func (c *TraceCache) LoadTrace(id string) (*backend.TraceTest, error)
LoadTrace loads a single trace test from cache by ID.
func (*TraceCache) SaveTraces ¶
func (c *TraceCache) SaveTraces(traces []*backend.TraceTest) error
SaveTraces saves multiple trace tests to cache.