storage

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package storage manages storage of network artifacts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStoreClient added in v1.1.6

type LocalStoreClient struct{}

LocalStoreClient stores file on the local filesystem

func (*LocalStoreClient) WriteToBinFile added in v1.1.6

func (client *LocalStoreClient) WriteToBinFile(path, objectName string, object []byte) error

WriteToBinFile writes to binary file in given path

type Manager added in v1.1.6

type Manager struct {
	StorageConfig *config.StorageConfig

	LocalStore *LocalStoreClient
	IpfsStore  *ipfsStore
	// contains filtered or unexported fields
}

Manager composes of all the different storage types supported by the agent

func NewStorageManager added in v1.1.6

func NewStorageManager(conf *config.StorageConfig) (*Manager, error)

NewStorageManager creates and sets up a new storage manager with given config

func (*Manager) Close added in v1.1.6

func (manager *Manager) Close()

Close the stores which compose the manager

func (*Manager) GenerateLocation added in v1.1.6

func (manager *Manager) GenerateLocation(segmentName string, replicaSegmentAvro []byte) (string, cid.Cid)

GenerateLocation calculates the non-local location (ipfs) for the given segment and data, cid is returned in case of ipfs

func (*Manager) Store added in v1.1.6

func (manager *Manager) Store(ccid cid.Cid, filename string, data []byte) error

Store the given data in the stores supported by the agent. cid is needed for IFPS based stores, and cid.Undef can be passed in case IPFS is not needed.

Jump to

Keyboard shortcuts

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