postgres

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 16 Imported by: 0

README

/pkg/rsstorage/servers/postgres

Description

The Postgres implementation is alpha/experimental. It needs more testing (and probably more work) to prepare it for actual use.

A storage server implementation that uses PostgreSQL large object storage. Requires a connection pool from the pgx library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorageServer

func NewStorageServer(args StorageServerArgs) rsstorage.StorageServer

Types

type StorageServer

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

func (*StorageServer) Base

func (*StorageServer) CalculateUsage

func (s *StorageServer) CalculateUsage() (types.Usage, error)

func (*StorageServer) Check

func (s *StorageServer) Check(dir, address string) (found bool, chunked *types.ChunksInfo, sz int64, ts time.Time, err error)

func (*StorageServer) Copy

func (s *StorageServer) Copy(dir, address string, server rsstorage.StorageServer) error

func (*StorageServer) Dir

func (s *StorageServer) Dir() string

func (*StorageServer) Enumerate

func (s *StorageServer) Enumerate() (items []types.StoredItem, err error)

func (*StorageServer) Flush

func (s *StorageServer) Flush(dir, address string)

func (*StorageServer) Get

func (s *StorageServer) Get(dir, address string) (f io.ReadCloser, chunks *types.ChunksInfo, sz int64, lastMod time.Time, found bool, err error)

func (*StorageServer) Locate

func (s *StorageServer) Locate(dir, address string) string

func (*StorageServer) Move

func (s *StorageServer) Move(dir, address string, server rsstorage.StorageServer) error

func (*StorageServer) Put

func (s *StorageServer) Put(resolve types.Resolver, dir, address string) (dirOut, addrOut string, err error)

func (*StorageServer) PutChunked

func (s *StorageServer) PutChunked(resolve types.Resolver, dir, address string, sz uint64) (string, string, error)

func (*StorageServer) Remove

func (s *StorageServer) Remove(dir, address string) (err error)

func (*StorageServer) Type

func (s *StorageServer) Type() types.StorageType

type StorageServerArgs

type StorageServerArgs struct {
	ChunkSize uint64
	Waiter    rsstorage.ChunkWaiter
	Notifier  rsstorage.ChunkNotifier
	Class     string
	Pool      *pgxpool.Pool
}

Jump to

Keyboard shortcuts

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