databasePG

package
v2.0.0-...-6b45633 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const SQL_COLLECTIONS_LOADALL = "" +
	"SELECT " +
	"collectionid, " +
	"estateid, " +
	"name, " +
	"description, " +
	"signature_prefix, " +
	"storageid, " +
	"jwtkey, " +
	"secret, " +
	"public " +
	"FROM %s.collection"
View Source
const SQL_COLLECTION_NEWITEM = "" +
	"INSERT INTO %s.item (collectionid, signature, urn) " +
	"VALUES($1, $2, $3) returning itemid"
View Source
const SQL_LOADITEM = "" +
	"SELECT i.itemid, i.collectionid, i.signature, i.urn, i.type, i.subtype, i.objecttype, " +
	"i.parentid, i.mimetype, i.error, i.sha512, i.metadata, i.creation_date, i.last_modified, i.disabled, i.public, " +
	"i.public_actions, i.status " +
	"FROM %s.item i, %s.collection c " +
	"WHERE i.collectionid=c.collectionid AND c.name=$1 AND i.signature=$2"
View Source
const SQL_STORAGES_LOADALL = "" +
	"SELECT " +
	"storageid, " +
	"name, " +
	"filebase, " +
	"datadir, " +
	"subitemdir, " +
	"tempdir " +
	"FROM %s.storage"

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(db *sql.DB, schema string) (*driver, error)

func Startup

func Startup(conf *config.DatabasePG, wg *sync.WaitGroup, log *logging.Logger) (grpcutil.ShutdownService, error)

Types

type Client

type Client struct {
	pb.DatabaseClient
	// contains filtered or unexported fields
}

func NewClientPlain

func NewClientPlain(addr string, bearer string) (*Client, error)

func (*Client) Close

func (dbClient *Client) Close() error

type Service

type Service struct {
	pb.UnimplementedDatabaseServer
	// contains filtered or unexported fields
}

func NewService

func NewService(db *sql.DB, schema string) (*Service, error)

func (*Service) GetCache

func (srv *Service) GetCache(ctx context.Context, req *pb.CacheRequest) (*pb.CacheResult, error)

func (*Service) LoadAll

func (srv *Service) LoadAll(colls *models.Collections) error

func (*Service) Ping

func (srv *Service) Ping(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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