local

package
v0.0.0-...-b4eff13 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	count.Count
	// contains filtered or unexported fields
}

Disk is a Local that stores data on disk.

func NewDisk

func NewDisk(verbose bool, dir string) *Disk

func (*Disk) Close

func (d *Disk) Close() error

func (*Disk) Get

func (d *Disk) Get(_ context.Context, actionID string) (outputID, diskPath string, err error)

func (*Disk) Kind

func (d *Disk) Kind() string

func (*Disk) Put

func (d *Disk) Put(_ context.Context, actionID, objectID string, size int64, body io.Reader) (diskPath string, _ error)

func (*Disk) Start

func (d *Disk) Start(context.Context) error

func (*Disk) Summary

func (d *Disk) Summary() string

type MergeRemote

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

MergeRemote is a storage that is backed by a local storage and a remote storage.

func NewMergeRemote

func NewMergeRemote(localStorage Storage, remoteStorage remote.Storage, verbose bool) *MergeRemote

func (*MergeRemote) Close

func (m *MergeRemote) Close() error

func (*MergeRemote) Get

func (m *MergeRemote) Get(ctx context.Context, actionID string) (string, string, error)

func (*MergeRemote) Kind

func (m *MergeRemote) Kind() string

func (*MergeRemote) Put

func (m *MergeRemote) Put(ctx context.Context, actionID, outputID string, size int64, body io.Reader) (diskPath string, err error)

Put writes the data to the remote cache and local cache.

func (*MergeRemote) Start

func (m *MergeRemote) Start(ctx context.Context) error

func (*MergeRemote) Summary

func (m *MergeRemote) Summary() string

type Storage

type Storage interface {
	Kind() string
	Start(ctx context.Context) error
	Get(ctx context.Context, actionID string) (outputID, diskPath string, err error)
	Put(ctx context.Context, actionID, outputID string, size int64, body io.Reader) (diskPath string, err error)
	Close() error
	Summary() string
}

Jump to

Keyboard shortcuts

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