storage

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 5 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

	List(ctx context.Context, prefix string, from uint64, limit uint16) ([]string, error)
	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
}

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