storage

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package storage contains FileStorage interface and its mock.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound means that file is not found.

Functions

This section is empty.

Types

type FileStorage added in v1.2.0

type FileStorage interface {
	health.Pinger

	Read(ctx context.Context, path string) (io.ReadCloser, error)
	Write(ctx context.Context, data io.Reader, size int64, path string, contentType string, isPublicRead bool) (string, error)

	DeleteData(ctx context.Context, address string) error
}

FileStorage is interface which provides access to user's data.

type IndexStorage added in v1.2.0

type IndexStorage interface {
	InTx(ctx context.Context, f func(s IndexStorage) error) error
	SetHeight(ctx context.Context, height uint64) error
	GetHeight(ctx context.Context) (uint64, error)

	GetProfile(ctx context.Context, addr string) (*Profile, error)
	GetProfiles(ctx context.Context, addr []string) ([]*Profile, error)
	SetProfile(ctx context.Context, p *SetProfileParams) error
	DeleteProfile(ctx context.Context, addr string) error

	ListPDV(ctx context.Context, owner string, from uint64, limit uint16) ([]uint64, error)
	DeletePDV(ctx context.Context, owner string) error

	GetPDVMeta(ctx context.Context, address string, id uint64) (*entities.PDVMeta, error)
	SetPDVMeta(ctx context.Context, address string, id uint64, tx string, m *entities.PDVMeta) error
}

IndexStorage provides access to pdv index.

type Profile added in v1.2.0

type Profile struct {
	Address   string
	FirstName string
	LastName  string
	Emails    []string
	Bio       string
	Avatar    string
	Gender    string
	Birthday  time.Time
	UpdatedAt *time.Time
	CreatedAt time.Time
}

Profile ...

type SetProfileParams added in v1.2.0

type SetProfileParams struct {
	Address   string
	FirstName string
	LastName  string
	Emails    []string
	Bio       string
	Avatar    string
	Gender    string
	Birthday  time.Time
}

SetProfileParams ...

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package postgres is implementation of storage interface.
Package postgres is implementation of storage interface.
Package s3 contains implementation FileStorage interface with any s3-compatible storage.
Package s3 contains implementation FileStorage interface with any s3-compatible storage.

Jump to

Keyboard shortcuts

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