memory

package
v0.0.0-...-1bb7c6f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package memory implements the storage interface for the memory storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is the memory storage implementation

func New

func New(log *zerolog.Logger, tracer trace.Tracer) *Storage

New creates a new memory storage

func (*Storage) ChunkExists

func (s *Storage) ChunkExists(ctx context.Context, chunk models.Chunk) (bool, error)

ChunkExists checks if a chunk exists

func (*Storage) FileExists

func (s *Storage) FileExists(ctx context.Context, filename string) (bool, error)

FileExists checks if a file exists

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, id uuid.UUID) (*models.Signature, error)

Get returns the signature for the given id

func (*Storage) GetSignatureForChunk

func (s *Storage) GetSignatureForChunk(ctx context.Context, chunk models.Chunk) (*models.Signature, error)

GetSignatureForChunk returns the signature that contains the given chunk

func (*Storage) GetSignatureForFilename

func (s *Storage) GetSignatureForFilename(ctx context.Context, filename string) (*models.Signature, error)

GetSignatureForFilename returns the signature for the given file

func (*Storage) Save

func (s *Storage) Save(ctx context.Context, signature *models.Signature) (*models.Signature, error)

Save saves the file signature

func (*Storage) Update

func (s *Storage) Update(ctx context.Context, signature *models.Signature) (*models.Signature, error)

Update updates the given signature

Jump to

Keyboard shortcuts

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