Versions in this module Expand all Collapse all v0 v0.0.3 Jun 27, 2024 Changes in this version + type ConnectClientParams struct + IpAddress string + PeerID pgtype.UUID type CreateClientParams + PeerRole NullPeerRoleType + type DownloadFilesRow struct + FileData []byte + FileHash *string + FileName string + ModificationDate pgtype.Timestamp + type FileLog struct + CurrentFileStatus NullFileStatusType + DeltaTime pgtype.Timestamptz + FileHash string + ID int32 + OldFileStatus NullFileStatusType + PeerID uuid.UUID type FileStatusType + const FileStatusTypeStored + type FileTrackerStatus string + const FileTrackerStatusDeleted + const FileTrackerStatusRequested + const FileTrackerStatusStored + const FileTrackerStatusUploaded + func (e *FileTrackerStatus) Scan(src interface{}) error + type GetFileDataRow struct + FileData []byte + FileState NullFileStatusType + PeerID uuid.UUID + type GetFilesRow struct + FileHash *string + FileName string + FilePath string + FileState NullFileStatusType + FileType string + ModificationDate pgtype.Timestamp + PrevFileHash *string + type InsertFileRow struct + FileHash *string + ID int32 + type MarkFileDeletedParams struct + FileHash *string + PeerID uuid.UUID + type NullFileTrackerStatus struct + FileTrackerStatus FileTrackerStatus + Valid bool + func (ns *NullFileTrackerStatus) Scan(value interface{}) error + func (ns NullFileTrackerStatus) Value() (driver.Value, error) + type NullPeerRoleType struct + PeerRoleType PeerRoleType + Valid bool + func (ns *NullPeerRoleType) Scan(value interface{}) error + func (ns NullPeerRoleType) Value() (driver.Value, error) + type PeerRoleType string + const PeerRoleTypeClient + const PeerRoleTypeServer + const PeerRoleTypeStorage + func (e *PeerRoleType) Scan(src interface{}) error type PeersTable + PeerName *string + PeerRole NullPeerRoleType type Queries + func (q *Queries) CountIfStored(ctx context.Context, db DBTX, fileHash *string) (int64, error) + func (q *Queries) DownloadFiles(ctx context.Context, db DBTX, peerID uuid.UUID) ([]*DownloadFilesRow, error) + func (q *Queries) GetCountOfStoragePeers(ctx context.Context, db DBTX) (int64, error) + func (q *Queries) MarkFileDeleted(ctx context.Context, db DBTX, arg *MarkFileDeletedParams) error + func (q *Queries) UpdateFileLog(ctx context.Context, db DBTX, arg *UpdateFileLogParams) error + func (q *Queries) UpdatePeerRole(ctx context.Context, db DBTX, arg *UpdatePeerRoleParams) error + type UpdateFileLogParams struct + CurrentFileStatus NullFileStatusType + FileHash string + OldFileStatus NullFileStatusType + PeerID uuid.UUID + type UpdatePeerRoleParams struct + PeerID pgtype.UUID + PeerRole NullPeerRoleType v0.0.2 Jun 25, 2024 Changes in this version + type CreateClientParams struct + IpAddress string + Pem []byte type Queries + func (q *Queries) ConnectClient(ctx context.Context, db DBTX, ipAddress string) ([]*PeersTable, error) + func (q *Queries) CreateClient(ctx context.Context, db DBTX, arg *CreateClientParams) ([]pgtype.UUID, error) + func (q *Queries) GetAllPem(ctx context.Context, db DBTX) ([][]byte, error) v0.0.1 Jun 23, 2024 Changes in this version + type DBTX interface + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + type FileStatusType string + const FileStatusTypeDeleted + const FileStatusTypeNew + const FileStatusTypeShared + const FileStatusTypeUpdated + func (e *FileStatusType) Scan(src interface{}) error + type FileStorage struct + Creation pgtype.Timestamptz + FileData []byte + FileHash *string + FileName string + FilePath string + FileState NullFileStatusType + FileType string + ID int32 + ModificationDate pgtype.Timestamp + PeerID uuid.UUID + PrevFileHash *string + type InsertFileParams struct + FileData []byte + FileName string + FilePath string + FileState NullFileStatusType + FileType string + ModificationDate pgtype.Timestamp + PeerID uuid.UUID + type NullFileStatusType struct + FileStatusType FileStatusType + Valid bool + func (ns *NullFileStatusType) Scan(value interface{}) error + func (ns NullFileStatusType) Value() (driver.Value, error) + type PeersTable struct + ID int32 + IpAddress string + PeerID pgtype.UUID + Pem []byte + type Queries struct + func New(db DBTX) *Queries + func (q *Queries) GetFileData(ctx context.Context, fileHash *string) (interface{}, error) + func (q *Queries) GetFiles(ctx context.Context, peerID uuid.UUID) ([]interface{}, error) + func (q *Queries) InsertFile(ctx context.Context, arg *InsertFileParams) (interface{}, error) + func (q *Queries) WithTx(tx pgx.Tx) *Queries