logstorage

package
v0.0.0-...-6a3170c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNotFound = util.StringError("not found")

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesystemOSS

type FilesystemOSS struct {
	// contains filtered or unexported fields
}

func NewFilesystemOSS

func NewFilesystemOSS(baseDir string) *FilesystemOSS

func (*FilesystemOSS) Open

func (o *FilesystemOSS) Open(ctx context.Context, filename string) (io.ReadCloser, error)

func (*FilesystemOSS) Save

func (o *FilesystemOSS) Save(ctx context.Context, filename string, r Reader) error

type OSS

type OSS interface {
	Open(ctx context.Context, filename string) (io.ReadCloser, error)
	Save(ctx context.Context, filename string, r Reader) error
}

type Reader

type Reader interface {
	io.Reader
	io.Seeker
}

type S3

type S3 struct {
	// contains filtered or unexported fields
}

func NewS3

func NewS3(bucket string, client s3iface.S3API) *S3

func (*S3) Open

func (s *S3) Open(ctx context.Context, filename string) (io.ReadCloser, error)

func (*S3) Save

func (s *S3) Save(ctx context.Context, filename string, r Reader) error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(redis *redis.Client, oss OSS) *Service

func (*Service) Append

func (s *Service) Append(ctx context.Context, jobExecutionID int64, logName string,
	lines []*api.LogLine,
) error

Append appends log lines to the log storage. logName is the name of the log. For step, it is the name of the step. But there are some special log names, and generated by the system. These special log names typically start with _ and mainly for system logs.

func (*Service) Archive

func (s *Service) Archive(ctx context.Context, jobExecutionID int64) error

Archive archives logs to S3. It should be invoked when there are no more logs to be appended. Typically, it is invoked after the job is finished.

func (*Service) GetLogLines

func (s *Service) GetLogLines(ctx context.Context, jobExecutionID int64, logName string, start int64,
	limit int64,
) ([]*api.LogLine, error)

GetLogLines returns the log lines for a job execution. start is the start index of the log lines. It is 0-based. limit is the maximum number of log lines to return.

Jump to

Keyboard shortcuts

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