storage

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogRoot = "/data/logs"

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Start()
	Write(string, string) error
	Read(string, int) ([]string, error)
	Chan(context.Context, string, int) (chan string, error)
	Destroy(string) error
	Reopen() error
	Stop()
}

Adapter is an interface for pluggable components that store log messages.

func NewAdapter

func NewAdapter(adapterType string, numLines int) (Adapter, error)

NewAdapter returns a pointer to an appropriate implementation of the Adapter interface, as determined by the adapterType string it is passed.

func NewFileAdapter

func NewFileAdapter() (Adapter, error)

NewFileAdapter returns an Adapter that uses a file.

func NewRedisStorageAdapter

func NewRedisStorageAdapter(bufferSize int) (Adapter, error)

NewRedisStorageAdapter returns a pointer to a new instance of a redis-based storage.Adapter.

Jump to

Keyboard shortcuts

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